result.copyState(new SIRTwoStageFilter(first.filter.getParent(), getFusedName(filterInfo), getFields(filterInfo), getMethods(filterInfo, init, initWork, steadyWork), new JIntLiteral(steadyPeek), new JIntLiteral(steadyPop), new JIntLiteral(steadyPush), steadyWork, initPeek, initPop, initPush, initWork, voidToInt(first.filter. getInputType()), voidToInt(last.filter. getOutputType())));
SIRFilter result;   if (initWork==null) { result = new SIRFilter(first.filter.getParent(), getFusedName(filterInfo), getFields(filterInfo), getMethods(filterInfo, init, initWork, steadyWork), new JIntLiteral(steadyPeek), new JIntLiteral(steadyPop), new JIntLiteral(steadyPush), steadyWork, voidToInt(first.filter. getInputType()), voidToInt(last.filter. getOutputType())); } else {   int initPop = first.init.num * first.filter.getPopInt(); int initPeek = (first.filter.getPeekInt() - first.filter.getPopInt()) + initPop; int initPush = last.init.num * last.filter.getPushInt();   result = new SIRTwoStageFilter(first.filter.getParent(), getFusedName(filterInfo), getFields(filterInfo), getMethods(filterInfo, init, initWork, steadyWork), new JIntLiteral(steadyPeek), new JIntLiteral(steadyPop), new JIntLiteral(steadyPush), steadyWork, initPeek, initPop, initPush, initWork, voidToInt(first.filter. getInputType()), voidToInt(last.filter. getOutputType())); }
    private static void makeFused(List filterInfo, 				  JMethodDeclaration init, 				  JMethodDeclaration initWork, 				  JMethodDeclaration steadyWork,				  SIRFilter result) {	// get the first and last filters' info	FilterInfo first = (FilterInfo)filterInfo.get(0);	FilterInfo last = (FilterInfo)filterInfo.get(filterInfo.size()-1);	// calculate the peek, pop, and push count for the fused	// filter in the INITIAL state	int initPop = first.init.num * first.filter.getPopInt();	int initPeek =	    (first.filter.getPeekInt() - first.filter.getPopInt()) + initPop;	int initPush = last.init.num * last.filter.getPushInt();	// calculate the peek, pop, and push count for the fused	// filter in the STEADY state	int steadyPop = first.steady.num * first.filter.getPopInt();	int steadyPeek = 	    (first.filter.getPeekInt() - first.filter.getPopInt()) + steadyPop;	int steadyPush = last.steady.num * last.filter.getPushInt();	/*	System.out.println(" Fused filter init peek   = " + initPeek);	System.out.println("              init pop    = " + initPop);	System.out.println("              init push   = " + initPush);	System.out.println("              steady peek = " + steadyPeek);	System.out.println("              steady pop  = " + steadyPop);	System.out.println("              steady push = " + steadyPush);	*/	// make a new filter to represent the fused combo	result.copyState(new SIRTwoStageFilter(first.filter.getParent(),					       getFusedName(filterInfo),					       getFields(filterInfo),					       getMethods(filterInfo, 							  init, 							  initWork, 							  steadyWork),					       new JIntLiteral(steadyPeek), 					       new JIntLiteral(steadyPop),					       new JIntLiteral(steadyPush),					       steadyWork,					       initPeek,					       initPop,					       initPush,					       initWork,					       voidToInt(first.filter.					       getInputType()),					       voidToInt(last.filter.					       getOutputType())));		// set init functions and work functions of fused filter	result.setInit(init);    }