Program: 79499
Project: 79499
Buggy source:
public void run(){
  for (  IRFunction irFunction : ir.getFuncs().values()) {
    irFunction.setRecursiveCall(irFunction.calleeSet.contains(irFunction));
    FuncInfo funcInfo=new FuncInfo();
    funcInfo.recursiveCall=irFunction.isRecursiveCall();
    funcInfoMap.put(irFunction,funcInfo);
  }
  for (  IRFunction irFunction : ir.getFuncs().values()) {
    FuncInfo funcInfo=funcInfoMap.get(irFunction);
    for (    BasicBlock bb : irFunction.getReversePostOrder()) {
      for (IRInstruction inst=bb.getFirstInst(); inst != null; inst=inst.getNextInst()) {
        ++funcInfo.numInst;
        if (inst instanceof IRFunctionCall) {
          FuncInfo calleeInfo=funcInfoMap.get(((IRFunctionCall)inst).getFunc());
          if (calleeInfo != null) {
            ++calleeInfo.numCalled;
          }
        }
      }
    }
  }
  List<BasicBlock> reversePostOrder=new ArrayList<>();
  List<String> unCalledFuncs=new ArrayList<>();
  boolean changed=true, thisFuncChanged;
  while (changed) {
    changed=false;
    unCalledFuncs.clear();
    for (    IRFunction irFunction : ir.getFuncs().values()) {
      FuncInfo funcInfo=funcInfoMap.get(irFunction);
      reversePostOrder.clear();
      reversePostOrder.addAll(irFunction.getReversePostOrder());
      thisFuncChanged=false;
      for (      BasicBlock bb : reversePostOrder) {
        for (IRInstruction inst=bb.getFirstInst(), nextInst; inst != null; inst=nextInst) {
          nextInst=inst.getNextInst();
          if (!(inst instanceof IRFunctionCall))           continue;
          FuncInfo calleeInfo=funcInfoMap.get(((IRFunctionCall)inst).getFunc());
          if (calleeInfo == null)           continue;
          if (calleeInfo.recursiveCall)           continue;
          if (calleeInfo.numInst > MAX_INLINE_INST || calleeInfo.numInst + funcInfo.numInst > MAX_FUNC_INST)           continue;
          nextInst=inlineFunctionCall((IRFunctionCall)inst);
          funcInfo.numInst+=calleeInfo.numInst;
          changed=true;
          thisFuncChanged=true;
          --calleeInfo.numCalled;
          if (calleeInfo.numCalled == 0) {
            unCalledFuncs.add(((IRFunctionCall)inst).getFunc().getName());
          }
        }
      }
      if (thisFuncChanged) {
        irFunction.calcReversePostOrder();
      }
    }
    for (    String funcName : unCalledFuncs) {
      ir.removeFunc(funcName);
    }
  }
  for (  IRFunction irFunction : ir.getFuncs().values()) {
    irFunction.updateCalleeSet();
  }
  ir.updateCalleeSet();
}

Fixed version (ground truth):
public void run(){
  for (  IRFunction irFunction : ir.getFuncs().values()) {
    irFunction.setRecursiveCall(irFunction.recursiveCalleeSet.contains(irFunction));
    FuncInfo funcInfo=new FuncInfo();
    funcInfo.recursiveCall=irFunction.isRecursiveCall();
    funcInfoMap.put(irFunction,funcInfo);
  }
  for (  IRFunction irFunction : ir.getFuncs().values()) {
    FuncInfo funcInfo=funcInfoMap.get(irFunction);
    for (    BasicBlock bb : irFunction.getReversePostOrder()) {
      for (IRInstruction inst=bb.getFirstInst(); inst != null; inst=inst.getNextInst()) {
        ++funcInfo.numInst;
        if (inst instanceof IRFunctionCall) {
          FuncInfo calleeInfo=funcInfoMap.get(((IRFunctionCall)inst).getFunc());
          if (calleeInfo != null) {
            ++calleeInfo.numCalled;
          }
        }
      }
    }
  }
  List<BasicBlock> reversePostOrder=new ArrayList<>();
  List<String> unCalledFuncs=new ArrayList<>();
  boolean changed=true, thisFuncChanged;
  while (changed) {
    changed=false;
    unCalledFuncs.clear();
    for (    IRFunction irFunction : ir.getFuncs().values()) {
      FuncInfo funcInfo=funcInfoMap.get(irFunction);
      reversePostOrder.clear();
      reversePostOrder.addAll(irFunction.getReversePostOrder());
      thisFuncChanged=false;
      for (      BasicBlock bb : reversePostOrder) {
        for (IRInstruction inst=bb.getFirstInst(), nextInst; inst != null; inst=nextInst) {
          nextInst=inst.getNextInst();
          if (!(inst instanceof IRFunctionCall))           continue;
          FuncInfo calleeInfo=funcInfoMap.get(((IRFunctionCall)inst).getFunc());
          if (calleeInfo == null)           continue;
          if (calleeInfo.recursiveCall)           continue;
          if (calleeInfo.numInst > MAX_INLINE_INST || calleeInfo.numInst + funcInfo.numInst > MAX_FUNC_INST)           continue;
          nextInst=inlineFunctionCall((IRFunctionCall)inst);
          funcInfo.numInst+=calleeInfo.numInst;
          changed=true;
          thisFuncChanged=true;
          --calleeInfo.numCalled;
          if (calleeInfo.numCalled == 0) {
            unCalledFuncs.add(((IRFunctionCall)inst).getFunc().getName());
          }
        }
      }
      if (thisFuncChanged) {
        irFunction.calcReversePostOrder();
      }
    }
    for (    String funcName : unCalledFuncs) {
      ir.removeFunc(funcName);
    }
  }
  for (  IRFunction irFunction : ir.getFuncs().values()) {
    irFunction.updateCalleeSet();
  }
  ir.updateCalleeSet();
}