for(int i=0;i<=topPopNum;i++) for(int j=0;j<popCount;j++) for(int k=topPopNum;k>=i;k--) {
for(int i=0;i<topPopNum;i++) for(int j=0;j<popCount;j++) for(int k=topPopNum;k>i;k--) {
    public JBlock getSteadyBlock() {	JStatement[] body;	if(begin)	    body=new JStatement[array.length+7];	else	    body=new JStatement[array.length+6];	//Filling register with Constants	InlineAssembly inline=new InlineAssembly();	inline.add(".set noat");	int turns=pos*num; //Default number of turns	int extra=0; //Extra turns needed	int excess=bufferSize-popCount*(int)Math.ceil(((double)peek)/popCount);//popCount*(num+turns);	if(excess>0) { //Handle excess items on peekbuffer	    System.err.println("WARNING: EXCESS ITEMS ON PEEKBUFFER DETECTED!");	    extra=(int)Math.ceil(((double)excess)/popCount);	    turns+=extra;	}	final int mult=getMult(array.length);	final int target=filterInfo.steadyMult-2-extra; //2 iterations start before innerloop	final int newSteadyMult=target/mult;	//final int newSteadyMult=1;	final int remainingExec=target-newSteadyMult*mult;	//final int remainingExec=1;	assert newSteadyMult>0:"SteadyMult on linear filter not high enough!";	inline.add("addiu! "+zeroReg+",\\t"+zeroReg+",\\t"+newSteadyMult); //Send steadyMult to switch	//TODO: Save registers here	body[0]=inline;	for(int i=0;i<array.length;i++) {	    inline=new InlineAssembly();	    inline.add("lw "+regs[i]+", %0");	    inline.addInput("\"m\"("+getWeight(i)+")");	    body[1+i]=inline;	}	if(begin) {	    inline=new InlineAssembly();	    inline.add("lw "+regs[regs.length-1]+", %0");	    inline.addInput("\"m\"("+getConstant()+")");	    body[body.length-6]=inline;	}	//Start Template	inline=new InlineAssembly();	body[body.length-5]=inline;	//Preloop	if(begin) {	    System.out.println("EXTRA: "+bufferSize);	    inline.addInput("\"i\"("+generatedVariables.recvBuffer.getIdent()+")");	    inline.add("la "+tempReg+", %0");	    int index=0;	    int bufferRemaining=bufferSize; //Use peek buffer while bufferRemaining>0 else use net	    for(int i=0;i<=topPopNum;i++)		for(int j=0;j<popCount;j++)		    if(bufferRemaining>0) {			inline.add("lw    "+tempRegs[0]+",\\t"+index+"("+tempReg+")");			index+=4;			for(int k=i;k>=0;k--) {			    inline.add("mul.s "+tempRegs[1]+",\\t"+tempRegs[0]+",\\t"+regs[idx[k]+j]);			    inline.add("add.s "+getInterReg(false,k,j)+",\\t"+getInterReg(true,k,j)+",\\t"+tempRegs[1]);			}			bufferRemaining--;		    } else			for(int k=i;k>=0;k--) {			    inline.add("mul.s "+tempRegs[0]+",\\t$csti,\\t"+regs[idx[k]+j]);			    inline.add("add.s "+getInterReg(false,k,j)+",\\t"+getInterReg(true,k,j)+",\\t"+tempRegs[0]);			}	    for(int turn=0;turn<turns;turn++) //Last iteration may not be from buffer		for(int j=0;j<popCount;j++)		    if(bufferRemaining>0) {			//Load value and send to switch			inline.add("lw!   "+tempRegs[0]+",\\t"+index+"("+tempReg+")");			index+=4;			for(int k=topPopNum;k>=0;k--) {			    inline.add("mul.s "+tempRegs[1]+",\\t"+tempRegs[0]+",\\t"+regs[idx[k]+j]);			    inline.add("add.s "+getInterReg(false,k,j)+",\\t"+getInterReg(true,k,j)+",\\t"+tempRegs[1]);			}			bufferRemaining--;		    } else			for(int k=topPopNum;k>=0;k--) {			    inline.add("mul.s "+tempRegs[0]+",\\t$csti,\\t"+regs[idx[k]+j]);			    inline.add("add.s "+getInterReg(false,k,j)+",\\t"+getInterReg(true,k,j)+",\\t"+tempRegs[0]);			}	} else {	    for(int i=0;i<=topPopNum;i++)		for(int j=0;j<popCount;j++)		    for(int k=i;k>=0;k--) {			inline.add("mul.s "+tempRegs[0]+",\\t$csti,\\t"+regs[idx[k]+j]);			inline.add("add.s "+getInterReg(false,k,j)+",\\t"+getInterReg(true,k,j)+",\\t"+tempRegs[0]);		    }	    for(int turn=0;turn<turns;turn++)		for(int j=0;j<popCount;j++)		    for(int k=topPopNum;k>=0;k--) {			inline.add("mul.s "+tempRegs[0]+",\\t$csti,\\t"+regs[idx[k]+j]);			inline.add("add.s "+getInterReg(false,k,j)+",\\t"+getInterReg(true,k,j)+",\\t"+tempRegs[0]);		    }	}	//Loop Counter	inline=new InlineAssembly();	body[body.length-4]=inline;	inline.add("addiu "+tempReg+",\\t"+zeroReg+",\\t-"+newSteadyMult);	//Innerloop	inline=new InlineAssembly();	body[body.length-3]=inline;	for(int repeat=0;repeat<2+remainingExec;repeat++) {	    if(repeat==1)		inline.add(getLabel()+": #LOOP");	    int times=0;	    int[] oldPopNum=new int[4];	    int[] oldElem=new int[4];	    for(int i=0;i<mult;i++)		for(int j=0;j<popCount;j++)		    for(int k=topPopNum;k>=0;k--) {			int offset=idx[k]+j;			inline.add("mul.s "+tempRegs[times]+",\\t$csti,\\t"+regs[offset]);			oldPopNum[times]=k;			oldElem[times]=j;			times++;			if(times==4) {			    times=0;			    for(int l=0;l<4;l++) {				int popNum=oldPopNum[l];				int elem=oldElem[l];				inline.add("add.s "+getInterReg(false,popNum,elem)+",\\t"+getInterReg(true,popNum,elem)+",\\t"+tempRegs[l]);			    }			}		    }	    if(repeat==1)		inline.add("bnea "+tempReg+",\\t"+zeroReg+",\\t"+getLabel());	}	//Remainder InnerLoop	inline=new InlineAssembly("#BLAH");	body[body.length-2]=inline;	//Postloop	inline=new InlineAssembly();	body[body.length-1]=inline;	turns=index*num+extra;	System.out.println("TILE TURNS: "+turns);	/*if(begin) {	  inline.addInput("\"i\"("+generatedVariables.recvBuffer.getIdent()+")");	  inline.add("la "+tempReg+", %0");	  }*/	if(begin) {	    //System.out.println("EXTRA: "+bufferSize);	    inline.addInput("\"i\"("+generatedVariables.recvBuffer.getIdent()+")");	    inline.add("la "+tempReg+", %0");	    int index=0;	    int emptySpots=popCount*(turns+topPopNum)-bufferSize;	    //Order reversed	    for(int turn=0;turn<turns;turn++) //Last iteration may not be from buffer		for(int j=0;j<popCount;j++)		    if(emptySpots>0) {			for(int k=topPopNum;k>=0;k--) {			    inline.add("mul.s "+tempRegs[0]+",\\t$csti,\\t"+regs[idx[k]+j]);			    inline.add("add.s "+getInterReg(false,k,j)+",\\t"+getInterReg(true,k,j)+",\\t"+tempRegs[0]);			}			emptySpots--;		    } else {			//Read value from switch			//inline.add("lw!   "+tempRegs[0]+",\\t"+index+"("+tempReg+")");			inline.add("move  "+tempRegs[0]+",\\t$csti");			inline.add("sw    "+tempRegs[0]+",\\t"+index+"("+tempReg+")");			index+=4;			for(int k=topPopNum;k>=0;k--) {			    inline.add("mul.s "+tempRegs[1]+",\\t"+tempRegs[0]+",\\t"+regs[idx[k]+j]);			    inline.add("add.s "+getInterReg(false,k,j)+",\\t"+getInterReg(true,k,j)+",\\t"+tempRegs[1]);			}		    }	    for(int i=0;i<=topPopNum;i++)		for(int j=0;j<popCount;j++)		    if(emptySpots>0) {			for(int k=topPopNum;k>=i;k--) {			    inline.add("mul.s "+tempRegs[0]+",\\t$csti,\\t"+regs[idx[k]+j]);			    inline.add("add.s "+getInterReg(false,k,j)+",\\t"+getInterReg(true,k,j)+",\\t"+tempRegs[0]);			}			emptySpots--;		    } else {			//Read value from switch			//inline.add("lw    "+tempRegs[0]+",\\t"+index+"("+tempReg+")");			inline.add("move  "+tempRegs[0]+",\\t$csti");			inline.add("sw    "+tempRegs[0]+",\\t"+index+"("+tempReg+")");			index+=4;			for(int k=topPopNum;k>=i;k--) {			    inline.add("mul.s "+tempRegs[1]+",\\t"+tempRegs[0]+",\\t"+regs[idx[k]+j]);			    inline.add("add.s "+getInterReg(false,k,j)+",\\t"+getInterReg(true,k,j)+",\\t"+tempRegs[1]);			}		    }	} else {	    //Order reversed	    for(int turn=0;turn<turns;turn++)		for(int j=0;j<popCount;j++)		    for(int k=topPopNum;k>=0;k--) {			inline.add("mul.s "+tempRegs[0]+",\\t$csti,\\t"+regs[idx[k]+j]);			inline.add("add.s "+getInterReg(false,k,j)+",\\t"+getInterReg(true,k,j)+",\\t"+tempRegs[0]);		    }	    for(int i=0;i<=topPopNum;i++)		for(int j=0;j<popCount;j++)		    for(int k=topPopNum;k>=i;k--) {			inline.add("mul.s "+tempRegs[0]+",\\t$csti,\\t"+regs[idx[k]+j]);			inline.add("add.s "+getInterReg(false,k,j)+",\\t"+getInterReg(true,k,j)+",\\t"+tempRegs[0]);		    }	}	//TODO: Restore regs 	inline.add(".set at");	return new JBlock(null,body,null);    }