statements.addStatement(GenerateCCode.makeForLoop(innerLoops,
statements.addStatement(GenerateCCode.makeDoLoop(innerLoops,
    public JStatement[] getWork(JBlock enclosingBlock, boolean isInit)     {	JBlock statements = new JBlock(null, new JStatement[0], null);	JBlock innerLoops = new JBlock(null, new JStatement[0], null);	int mult = StrToRStream.getMult(getNode(), isInit);	if (mult == 0)	    return statements.getStatementArray();		assert node.edges[0] != null;	FusionState downstream = FusionState.getFusionState(node.edges[0]);	JVariableDefinition outgoingBuffer = downstream.getBufferVar(node, isInit);	JVariableDefinition induction = 	    GenerateCCode.newIntLocal(JOINERCOUNTER, myUniqueID, 0);		//add the decl of the induction variable	enclosingBlock.addStatementFirst(new JVariableDeclarationStatement					(null, induction, null));		for (int i = 0; i < node.inputs; i++) {	    JVariableDefinition innerVar = 		GenerateCCode.newIntLocal(JOINERINNERVAR + myUniqueID + "_", i, + 0);	    //add the decl of the induction variable	    enclosingBlock.addStatementFirst(new JVariableDeclarationStatement					     (null, innerVar, null));	    	    //add the decls for the buffers	    JVariableDefinition incomingBuffer = getBufferVar(node.incoming[i], isInit);	    enclosingBlock.addStatementFirst		(new JVariableDeclarationStatement(null, 						   incomingBuffer,						   null));	    //add the code to perform the joining	    	    //outgoing[induction * totalWeights + partialSum + innerVar] if init	    //outgoing[induction * totalWeights + partialSum + innerVar + peekBufferSize_of_outgoing] 	    //if steady	    JAddExpression outgoingIndex = 		new JAddExpression(null,				   new JMultExpression(null,						       new JLocalVariableExpression(null,										    induction),						       new JIntLiteral(node.getTotalIncomingWeights())),				   new JAddExpression(null,						      new JIntLiteral(node.getPartialIncomingSum(i)),						      new JLocalVariableExpression(null,										   innerVar)));	    if (!isInit && downstream.getPeekBufferSize() > 0)		outgoingIndex = new JAddExpression(null,						   outgoingIndex,						   new JIntLiteral(downstream.getPeekBufferSize()));	    	    //incoming[weight * induction + innerVar]	    JAddExpression incomingIndex = 		new JAddExpression(null,				   new JMultExpression(null, 						       new JIntLiteral(node.incomingWeights[i]),						       new JLocalVariableExpression(null,										    induction)),				   new JLocalVariableExpression(null,								innerVar));	    	    JArrayAccessExpression outgoingAccess = 		new JArrayAccessExpression(null,					   new JLocalVariableExpression(null, outgoingBuffer),					   outgoingIndex);	    	    JArrayAccessExpression incomingAccess = 		new JArrayAccessExpression(null,					   new JLocalVariableExpression(null, incomingBuffer),					   incomingIndex);	    JExpressionStatement assignment = 		new JExpressionStatement(null,					 new JAssignmentExpression(null,								   outgoingAccess,								   incomingAccess),					 null);	    innerLoops.addStatement(GenerateCCode.makeForLoop(assignment,							      innerVar,							      new JIntLiteral(node.incomingWeights[i])));	    	}		statements.addStatement(GenerateCCode.makeForLoop(innerLoops,							   induction,							   new JIntLiteral(mult)));		return statements.getStatementArray();    }