if (remainingItemsToReceive > 0) {
if (remainingItemsToReceive > 0 && !((filter instanceof SIRTwoStageFilter) && initCount < 0)) {
    private void printCircularWorkHeader( int pop, int peek, int push, JBlock workBlock)     {		print("{\n");	Integer init = (Integer)RawBackend.initExecutionCounts.	    get(Layout.getNode(Layout.getTile(filter)));	//	Integer steady = (Integer)RawBackend.steadyExecutionCounts.	//    get(Layout.getNode(Layout.getTile(filter)));		int initCount = 0;		if (init != null) 	    initCount = init.intValue();	//if this is a two stage filter, count one of the initial executions 	//as the initWork execution and decrement the number of times the 	//work function is called in the init Schedule	if (filter instanceof SIRTwoStageFilter) {	    SIRTwoStageFilter two = (SIRTwoStageFilter)filter;	    if (!(two.getInitPeek() == 0 && two.getInitPush() == 0 &&		  two.getInitPop() == 0))		initCount--;	}	int prevInitCount = 0;	int prevPush = 0;		FlatNode node = Layout.getNode(Layout.getTile(filter));	FlatNode previous = null;		if (node.inputs > 0) {	    previous = node.incoming[0];	    prevInitCount = Util.getCountPrev(RawBackend.initExecutionCounts, 					 previous, node);	    if (prevInitCount > 0) {		if (previous.contents instanceof SIRSplitter || 		    previous.contents instanceof SIRJoiner) {		    prevPush = 1;		}		else		    prevPush = ((SIRFilter)previous.contents).getPushInt();	    }	}		int remainingItemsToReceive = (prevInitCount * prevPush);		//if the previous node is a two stage filter then count its initWork	//in the initialItemsTo Receive	if (previous != null && previous.contents instanceof SIRTwoStageFilter) {	    remainingItemsToReceive -= ((SIRTwoStageFilter)previous.contents).getPushInt();	    remainingItemsToReceive += ((SIRTwoStageFilter)previous.contents).getInitPush();	}		//subtract the number of items the initWork took from the previous 	//stream for the initialization code.	if (filter instanceof SIRTwoStageFilter) {	    SIRTwoStageFilter two = (SIRTwoStageFilter)filter;	    if (!(two.getInitPeek() == 0 && two.getInitPush() == 0 &&		  two.getInitPop() == 0)) {		remainingItemsToReceive -= two.getInitPeek();	    }	}	else  //if we are not a twostage we receive peek items on the first execution 	    remainingItemsToReceive -= (peek -pop);		remainingItemsToReceive -= (initCount * pop);		// keep in mind that a two-stage filter might already have	// peeked some items from the network.  in this case, only	// peek the extra that haven't been peeked yet.	int bottomPeek;	if (filter instanceof SIRTwoStageFilter) {	    bottomPeek = ((SIRTwoStageFilter)filter).getInitPeek();	} else {	    bottomPeek = 0;	}	if (bottomPeek < peek) {	    //print("int i, " + TAPE_INDEX + " = -1;\n");	    print("/* work header */\n");	    //	print(filter.getInputType() + 	    //       " buffer[" + filter.getPeekInt() + "];\n");	    print(" for (" + exeIndex + " = " + bottomPeek + "; " + exeIndex + " < " + 		  peek + "; " + exeIndex + "++) \n");	    printReceive();	}	//execute the work function	if (initCount > 0) {	    print("for (" + exeIndex + " = 0; " + exeIndex + " < " + initCount + "; " +		  exeIndex + "++)\n");	    print("{\n");	    //do not receive on the first invocation	    if (peek > 0) {		print("if (" + exeIndex + " != 0) {\n");		print(" for (" + exeIndex1 + " = " + 0 + "; " + exeIndex1 + " < " + 		      pop + "; " + exeIndex1 + "++) \n");		printReceive();		print("}\n");	    }	    	    workBlock.accept(this);	    print("}\n");	    	}		//receive the rest of the items	if (remainingItemsToReceive > 0) {	     print("for (" + exeIndex + " = 0; " + exeIndex + " < " + remainingItemsToReceive +		  "; " + exeIndex + "++)\n");	    printReceive();	}   		print(" while (1) {\n");	//receive	if (pop > 0) {	    print("for (" + exeIndex + " = 0; " + exeIndex + " < " + pop +		  "; " + exeIndex + "++)\n");	    printReceive();	}		    	//work	if (debug) print("   print_int("+   Layout.getTileNumber(filter) + ");\n");    }