Program: 132723
Project: 132723
Buggy source:
private void replaceVals(GlobalConstants consts,Block block,Map<Block,Congruences> congruences,InitState init){
  Congruences state=congruences.get(block);
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str");
    logger.trace("String_Node_Str" + System.identityHashCode(block) + "String_Node_Str"+ block.getType());
    state.printTraceInfo(logger,consts);
  }
  ListIterator<Statement> stmtIt=block.statementIterator();
  while (stmtIt.hasNext()) {
    Statement stmt=stmtIt.next();
    if (stmt.type() == StatementType.INSTRUCTION) {
      Instruction inst=stmt.instruction();
      replaceCongruent(inst,state,init);
      if (!inst.hasSideEffects() && inst.getOutputs().size() == 1) {
        Var output=inst.getOutput(0);
        if (!InitVariables.varMustBeInitialized(output,true) || init.isInitialized(output,true)) {
          if (Types.isScalarFuture(output)) {
            Arg val=state.findRetrieveResult(output,false);
            if (val != null && init.isInitialized(val,false)) {
              Instruction futureSet=TurbineOp.storePrim(output,val);
              stmtIt.set(futureSet);
              logger.trace("String_Node_Str" + futureSet);
            }
          }
 else           if (Types.isScalarValue(output)) {
            Arg val=state.findValue(output);
            if (val != null && val.isConstant()) {
              Instruction valueSet=ICInstructions.valueSet(output,val);
              stmtIt.set(valueSet);
              logger.trace("String_Node_Str" + valueSet);
            }
          }
        }
      }
      InitVariables.updateInitVars(logger,stmt,init,false);
    }
 else {
      assert(stmt.type() == StatementType.CONDITIONAL);
      replaceCongruentNonRec(stmt.conditional(),state,init);
      replaceValsRec(consts,stmt.conditional(),congruences,init);
    }
  }
  replaceCleanupCongruent(block,state,init);
  for (  Continuation cont : block.getContinuations()) {
    replaceCongruentNonRec(cont,state,init);
    replaceValsRec(consts,cont,congruences,init);
  }
}

Fixed version (ground truth):
private void replaceVals(GlobalConstants consts,String function,Block block,Map<Block,Congruences> congruences,InitState init){
  Congruences state=congruences.get(block);
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str");
    logger.trace("String_Node_Str" + System.identityHashCode(block) + "String_Node_Str"+ block.getType());
    state.printTraceInfo(logger,consts);
  }
  ListIterator<Statement> stmtIt=block.statementIterator();
  while (stmtIt.hasNext()) {
    Statement stmt=stmtIt.next();
    if (stmt.type() == StatementType.INSTRUCTION) {
      Instruction inst=stmt.instruction();
      replaceCongruent(function,inst,state,init);
      if (!inst.hasSideEffects() && inst.getOutputs().size() == 1) {
        Var output=inst.getOutput(0);
        if (!InitVariables.varMustBeInitialized(output,true) || init.isInitialized(output,true)) {
          if (Types.isScalarFuture(output)) {
            Arg val=state.findRetrieveResult(output,false);
            if (val != null && init.isInitialized(val,false)) {
              Instruction futureSet=TurbineOp.storePrim(output,val);
              stmtIt.set(futureSet);
              logger.trace("String_Node_Str" + futureSet);
            }
          }
 else           if (Types.isScalarValue(output)) {
            Arg val=state.findValue(output);
            if (val != null && val.isConstant()) {
              Instruction valueSet=ICInstructions.valueSet(output,val);
              stmtIt.set(valueSet);
              logger.trace("String_Node_Str" + valueSet);
            }
          }
        }
      }
      InitVariables.updateInitVars(logger,stmt,init,false);
    }
 else {
      assert(stmt.type() == StatementType.CONDITIONAL);
      replaceCongruentNonRec(function,stmt.conditional(),state,init);
      replaceValsRec(consts,function,stmt.conditional(),congruences,init);
    }
  }
  replaceCleanupCongruent(function,block,state,init);
  for (  Continuation cont : block.getContinuations()) {
    replaceCongruentNonRec(function,cont,state,init);
    replaceValsRec(consts,function,cont,congruences,init);
  }
}