Program: 133275
Project: 133275
Buggy source:
@Override public boolean tryUnroll(Logger logger,Block outerBlock){
  logger.trace("String_Node_Str" + loopName + "String_Node_Str"+ desiredUnroll);
  if (this.desiredUnroll > 1) {
    logger.debug("String_Node_Str" + desiredUnroll + "String_Node_Str");
    Oparg oldStep=this.increment;
    long checkIter;
    if (increment.getType() == OpargType.INTVAL && start.getType() == OpargType.INTVAL && end.getType() == OpargType.INTVAL) {
      long startV=start.getIntLit();
      long endV=end.getIntLit();
      long incV=increment.getIntLit();
      long diff=(endV - startV + 1);
      long iters=((diff - 1) / incV) + 1;
      long extra=iters % desiredUnroll;
      if (extra == 0) {
        checkIter=desiredUnroll;
      }
 else {
        checkIter=extra;
      }
    }
 else {
      checkIter=-1;
    }
    if (oldStep.getType() == OpargType.INTVAL) {
      this.increment=Oparg.createIntLit(oldStep.getIntLit() * desiredUnroll);
    }
 else {
      Variable old=oldStep.getVariable();
      Variable newIncrement=new Variable(old.getType(),old.getName() + "String_Node_Str" + desiredUnroll,VariableStorage.LOCAL,DefType.LOCAL_COMPILER,null);
      outerBlock.declareVariable(newIncrement);
      outerBlock.addInstruction(new LocalBuiltin(LocalOpcode.MULT_INT,newIncrement,Arrays.asList(oldStep,Oparg.createIntLit(desiredUnroll))));
      this.increment=Oparg.createVar(newIncrement);
    }
    Block orig=loopBody;
    this.loopBody=new Block(BlockType.LOOP_BODY);
    Block curr=loopBody;
    Variable nextIter=loopVar;
    for (int i=0; i < desiredUnroll; i++) {
      NestedBlock nb=new NestedBlock(orig.clone(BlockType.NESTED_BLOCK));
      curr.addContinuation(nb);
      if (i != 0) {
        nb.replaceVars(Collections.singletonMap(this.loopVar.getName(),Oparg.createVar(nextIter)));
      }
      if (i < desiredUnroll - 1) {
        Variable lastIter=nextIter;
        nextIter=new Variable(Types.VALUE_INTEGER,this.loopVar.getName() + "String_Node_Str" + (i + 1),VariableStorage.LOCAL,DefType.LOCAL_COMPILER,null);
        curr.addVariable(nextIter);
        curr.addInstruction(new LocalBuiltin(LocalOpcode.PLUS_INT,nextIter,Arrays.asList(Oparg.createVar(lastIter),oldStep)));
        boolean mustCheck=checkIter < 0 || i + 1 == checkIter;
        if (mustCheck) {
          Variable nextIterCheck=new Variable(Types.VALUE_BOOLEAN,this.loopVar.getName() + "String_Node_Str" + (i + 1)+ "String_Node_Str",VariableStorage.LOCAL,DefType.LOCAL_COMPILER,null);
          curr.addVariable(nextIterCheck);
          curr.addInstruction(new LocalBuiltin(LocalOpcode.LTE_INT,nextIterCheck,Arrays.asList(Oparg.createVar(nextIter),this.end)));
          IfStatement ifSt=new IfStatement(nextIterCheck);
          curr.addContinuation(ifSt);
          curr=ifSt.getThenBlock();
        }
      }
 else {
        curr=null;
      }
    }
    this.desiredUnroll=1;
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean tryUnroll(Logger logger,Block outerBlock){
  logger.trace("String_Node_Str" + loopName + "String_Node_Str"+ desiredUnroll);
  if (this.desiredUnroll > 1) {
    logger.debug("String_Node_Str" + desiredUnroll + "String_Node_Str");
    Oparg oldStep=this.increment;
    long checkIter;
    if (increment.getType() == OpargType.INTVAL && start.getType() == OpargType.INTVAL && end.getType() == OpargType.INTVAL) {
      long startV=start.getIntLit();
      long endV=end.getIntLit();
      long incV=increment.getIntLit();
      long diff=(endV - startV + 1);
      long iters=((diff - 1) / incV) + 1;
      long extra=iters % desiredUnroll;
      if (extra == 0) {
        checkIter=desiredUnroll;
      }
 else {
        checkIter=extra;
      }
    }
 else {
      checkIter=-1;
    }
    if (oldStep.getType() == OpargType.INTVAL) {
      this.increment=Oparg.createIntLit(oldStep.getIntLit() * desiredUnroll);
    }
 else {
      Variable old=oldStep.getVar();
      Variable newIncrement=new Variable(old.getType(),old.getName() + "String_Node_Str" + desiredUnroll,VariableStorage.LOCAL,DefType.LOCAL_COMPILER,null);
      outerBlock.declareVariable(newIncrement);
      outerBlock.addInstruction(new LocalBuiltin(LocalOpcode.MULT_INT,newIncrement,Arrays.asList(oldStep,Oparg.createIntLit(desiredUnroll))));
      this.increment=Oparg.createVar(newIncrement);
    }
    Block orig=loopBody;
    this.loopBody=new Block(BlockType.LOOP_BODY);
    Block curr=loopBody;
    Variable nextIter=loopVar;
    for (int i=0; i < desiredUnroll; i++) {
      NestedBlock nb=new NestedBlock(orig.clone(BlockType.NESTED_BLOCK));
      curr.addContinuation(nb);
      if (i != 0) {
        nb.replaceVars(Collections.singletonMap(this.loopVar.getName(),Oparg.createVar(nextIter)));
      }
      if (i < desiredUnroll - 1) {
        Variable lastIter=nextIter;
        nextIter=new Variable(Types.VALUE_INTEGER,this.loopVar.getName() + "String_Node_Str" + (i + 1),VariableStorage.LOCAL,DefType.LOCAL_COMPILER,null);
        curr.addVariable(nextIter);
        curr.addInstruction(new LocalBuiltin(LocalOpcode.PLUS_INT,nextIter,Arrays.asList(Oparg.createVar(lastIter),oldStep)));
        boolean mustCheck=checkIter < 0 || i + 1 == checkIter;
        if (mustCheck) {
          Variable nextIterCheck=new Variable(Types.VALUE_BOOLEAN,this.loopVar.getName() + "String_Node_Str" + (i + 1)+ "String_Node_Str",VariableStorage.LOCAL,DefType.LOCAL_COMPILER,null);
          curr.addVariable(nextIterCheck);
          curr.addInstruction(new LocalBuiltin(LocalOpcode.LTE_INT,nextIterCheck,Arrays.asList(Oparg.createVar(nextIter),this.end)));
          IfStatement ifSt=new IfStatement(nextIterCheck);
          curr.addContinuation(ifSt);
          curr=ifSt.getThenBlock();
        }
      }
 else {
        curr=null;
      }
    }
    this.desiredUnroll=1;
    return true;
  }
  return false;
}