successful = false;
    public static boolean doit(FlatNode top)     {	successful = false;	//find the sinks and make sure they are synchronized	HashSet sinks = Sink.getSinks(top);	//there could be multiple sinks, find one that works	Iterator sinksIt = sinks.iterator();		//get the totalNumber of prints	while (sinksIt.hasNext()) {	    sink = (FlatNode)sinksIt.next();	    int prints = CheckPrint.check((SIRFilter)sink.contents);	    Integer steadyInteger = (Integer)RawBackend.steadyExecutionCounts.get(sink);	    int steady = 0;	    	    if (steadyInteger != null) 		steady = steadyInteger.intValue();	    if (prints > 0)		totalPrintsPerSteady += (prints * steady);	}		System.out.println(" ****** Total Prints = " + totalPrintsPerSteady);		sinksIt = sinks.iterator();	while (sinksIt.hasNext()) {	    sink = (FlatNode)sinksIt.next();	    if (sink == null) {		continue;	    }	    //the prints at the sink:	    //no control flow	    //in the work function	    int prints = CheckPrint.check((SIRFilter)sink.contents);	    //if this sink does not print, keep looking for one that does	    if (prints == 0) {		continue;	    }	    // if we failed, unroll the filter on the loops that we	    // indicated	    if (prints == -1) {		SinkUnroller.doit(sink);		prints = CheckPrint.check((SIRFilter)sink.contents);	    }	    //if there still prints in control flow after unrolling, keep searching	    if (prints == -1) {		Utils.fail("Print(s) in control flow");		continue;	    }	    	    Integer initInteger = (Integer)RawBackend.initExecutionCounts.get(sink);	    Integer steadyInteger = (Integer)RawBackend.steadyExecutionCounts.get(sink);	    int init = 0, steady = 0;	    	    if (initInteger != null)		init = initInteger.intValue();	    if (steadyInteger != null) 		steady = steadyInteger.intValue();	    	    if (steady < 1) {		System.out.println		    ("Sink not called in Steady State");		continue;	    }	    //we are successsful	    System.out.println("Generating Number Gathering Code...");	    //set the globals that are read by makefilegenerator		    successful = true;	    skipPrints = init * prints;	    printsPerSteady = prints * steady;	    //remove the prints from all other tiles	    //change the prints in the sink to be a magic print	    //RemovePrintln.doit(top, sink);	    System.out.println("The Sink: " + sink.contents.getName());	    return true;	}	System.out.println("Cannot Generate Number Gathering Code.  Could not find a suitable sink...");	return false;    }