MatchResult matchResult = null;
	private void work(State state) throws DataflowAnalysisException {		// Have we reached the end of the pattern?		if (state.isComplete()) {			// This is a complete match.			if (DEBUG) System.out.println("FINISHED A MATCH!");			resultList.add(state.getResult());			return;		}		// If we've reached the minimum number of occurrences for this		// pattern element, we can advance to the next pattern element without trying		// to match this instruction again.  We make sure that we only advance to		// the next element once for this matchCount.		State advance = state.advanceToNextElement();		if (advance != null) {			work(advance);		}		// If we've reached the maximum number of occurrences for this		// pattern element, then we can't continue.		if (!state.currentElementCanContinue())			return;		// Is there another instruction in this basic block?		MatchResult matchResult = null;		if (state.moreInstructionsInBasicBlock()) {			// Try to match it.			matchResult = state.matchNextInBasicBlock();			if (matchResult == null)				return;		}		// Continue the match at each successor instruction,		// using the same PatternElement.		if (state.moreInstructionsInBasicBlock()) {			// Easy case; continue matching in the same basic block.			work(state);		} else if (state.canAdvanceToNextBasicBlock()) {			// We've reached the end of the basic block.			// Try to advance to the successors of this basic block,			// ignoring loop backedges.			Iterator<Edge> i = cfg.outgoingEdgeIterator(state.getBasicBlock());			BitSet visitedSuccessorSet = new BitSet();			while (i.hasNext()) {				Edge edge = i.next();				if (dfs.getDFSEdgeType(edge) == BACK_EDGE)					continue;				BasicBlock destBlock = edge.getTarget();				int destId = destBlock.getId();				// CFGs can have duplicate edges				if (visitedSuccessorSet.get(destId))					continue;				visitedSuccessorSet.set(destId, true);				// If we have just matched an instruction, then we allow the				// matching PatternElement to choose which edges are acceptable.				// This allows PatternElements to select particular control edges;				// for example, only continue the pattern on the true branch				// of an "if" comparison.				State succState = state.advanceToSuccessor(edge, matchResult);				if (succState != null) {					work(succState);				}			}		}	}