Program: 79482
Project: 79482
Buggy source:
void tryEliminate(IRFunction func){
  List<BasicBlock> reversePreOrder=func.getReversePreOrder();
  for (  BasicBlock bb : reversePreOrder) {
    for (IRInstruction inst=bb.getLastInst(), prevInst; inst != null; inst=prevInst) {
      prevInst=inst.getPrevInst();
      if (inst instanceof IRBinaryOperation || inst instanceof IRComparison || inst instanceof IRLoad|| inst instanceof IRMove|| inst instanceof IRUnaryOperation|| inst instanceof IRHeapAlloc) {
        IRRegister dest=inst.getDefinedRegister();
        if (dest == null || !inst.liveOut.contains(dest)) {
          eliminationChanged=true;
          inst.remove();
        }
      }
    }
  }
  for (  IRRoot.ForRecord forRec : ir.forRecMap.values()) {
    if (forRec.processed)     continue;
    boolean lieOutsideInst=false;
    if (forRec.condBB == null || forRec.stepBB == null || forRec.bodyBB == null || forRec.afterBB == null)     continue;
    List<BasicBlock> bbList=new ArrayList<>();
    bbList.add(forRec.condBB);
    bbList.add(forRec.stepBB);
    bbList.add(forRec.bodyBB);
    bbList.add(forRec.afterBB);
    IRInstruction afterFirstInst=forRec.afterBB.getFirstInst();
    for (int i=0; i < 3; ++i) {
      for (IRInstruction inst=forRec.condBB.getFirstInst(); inst != null; inst=inst.getNextInst()) {
        if (inst instanceof IRFunctionCall) {
          lieOutsideInst=true;
          continue;
        }
        if (inst.getDefinedRegister() != null) {
          if (afterFirstInst.liveIn.contains(inst.getDefinedRegister())) {
            lieOutsideInst=true;
          }
          continue;
        }
        if (inst instanceof IRStore) {
          lieOutsideInst=true;
          continue;
        }
        if (inst instanceof IRJump) {
          if (!bbList.contains(((IRJump)inst).getTargetBB()))           lieOutsideInst=true;
          continue;
        }
        if (inst instanceof IRBranch) {
          if (!bbList.contains(((IRBranch)inst).getThenBB()) || !bbList.contains(((IRBranch)inst).getElseBB()))           lieOutsideInst=true;
          continue;
        }
        if (inst instanceof IRReturn || inst instanceof IRPush || inst instanceof IRStore) {
          lieOutsideInst=true;
          continue;
        }
      }
    }
    if (!lieOutsideInst) {
      System.err.println("String_Node_Str");
      forRec.condBB.reInit();
      forRec.condBB.setJumpInst(new IRJump(forRec.condBB,forRec.afterBB));
      forRec.processed=true;
    }
  }
}

Fixed version (ground truth):
void tryEliminate(IRFunction func){
  List<BasicBlock> reversePreOrder=func.getReversePreOrder();
  for (  BasicBlock bb : reversePreOrder) {
    for (IRInstruction inst=bb.getLastInst(), prevInst; inst != null; inst=prevInst) {
      prevInst=inst.getPrevInst();
      if (inst instanceof IRBinaryOperation || inst instanceof IRComparison || inst instanceof IRLoad|| inst instanceof IRMove|| inst instanceof IRUnaryOperation|| inst instanceof IRHeapAlloc) {
        IRRegister dest=inst.getDefinedRegister();
        if (dest == null || !inst.liveOut.contains(dest)) {
          eliminationChanged=true;
          inst.remove();
        }
      }
    }
  }
  for (  IRRoot.ForRecord forRec : ir.forRecMap.values()) {
    if (forRec.processed)     continue;
    boolean lieOutsideInst=false;
    if (forRec.condBB == null || forRec.stepBB == null || forRec.bodyBB == null || forRec.afterBB == null)     continue;
    List<BasicBlock> bbList=new ArrayList<>();
    bbList.add(forRec.condBB);
    bbList.add(forRec.stepBB);
    bbList.add(forRec.bodyBB);
    bbList.add(forRec.afterBB);
    IRInstruction afterFirstInst=forRec.afterBB.getFirstInst();
    for (int i=0; i < 3; ++i) {
      for (IRInstruction inst=bbList.get(i).getFirstInst(); inst != null; inst=inst.getNextInst()) {
        if (inst instanceof IRFunctionCall) {
          lieOutsideInst=true;
          continue;
        }
        if (inst.getDefinedRegister() != null) {
          if (afterFirstInst.liveIn.contains(inst.getDefinedRegister())) {
            lieOutsideInst=true;
          }
          continue;
        }
        if (inst instanceof IRStore) {
          lieOutsideInst=true;
          continue;
        }
        if (inst instanceof IRJump) {
          if (!bbList.contains(((IRJump)inst).getTargetBB()))           lieOutsideInst=true;
          continue;
        }
        if (inst instanceof IRBranch) {
          if (!bbList.contains(((IRBranch)inst).getThenBB()) || !bbList.contains(((IRBranch)inst).getElseBB()))           lieOutsideInst=true;
          continue;
        }
        if (inst instanceof IRReturn || inst instanceof IRPush || inst instanceof IRStore) {
          lieOutsideInst=true;
          continue;
        }
      }
    }
    if (!lieOutsideInst) {
      forRec.condBB.reInit();
      forRec.condBB.setJumpInst(new IRJump(forRec.condBB,forRec.afterBB));
      forRec.processed=true;
    }
  }
}