Program: 149852
Project: 149852
Buggy source:
private static DefUseEffect call(boolean HIR,AbstractRegisterPool regpool,Instruction s){
  if (CF_FIELDS) {
    MethodOperand methOp=Call.getMethod(s);
    if (methOp == null) {
      return DefUseEffect.UNCHANGED;
    }
    if (methOp.isVirtual() && !methOp.hasPreciseTarget()) {
      Operand calleeThis=Call.getParam(s,0);
      if (calleeThis.isNullConstant()) {
        Trap.mutate(s,TRAP,NullCheck.getClearGuardResult(s),TrapCodeOperand.NullPtr());
        return DefUseEffect.TRAP_REDUCED;
      }
 else       if (calleeThis.isConstant() || calleeThis.asRegister().isPreciseType()) {
        VM_TypeReference calleeClass=calleeThis.getType();
        if (calleeClass.isResolved()) {
          methOp.refine(calleeClass.peekType());
          return DefUseEffect.UNCHANGED;
        }
      }
    }
 else     if (methOp.isStatic() && methOp.hasPreciseTarget() && HIR) {
      VM_Method containingMethod=s.position.getMethod();
      VM_Method method=methOp.getTarget();
      if (method == VM_Entrypoints.java_lang_Class_forName) {
        methOp=MethodOperand.STATIC(VM_Entrypoints.java_lang_Class_forName_withLoader.getMemberRef().asMethodReference(),VM_Entrypoints.java_lang_Class_forName_withLoader);
        Call.mutate3(s,CALL,Call.getResult(s),new AddressConstantOperand(VM_Entrypoints.java_lang_Class_forName_withLoader.getOffset()),methOp,Call.getGuard(s),Call.getParam(s,0),new IntConstantOperand(1),new ObjectConstantOperand(containingMethod.getDeclaringClass().getClassLoader(),Offset.zero()));
        return DefUseEffect.REDUCED;
      }
    }
    if (methOp.hasPreciseTarget() && methOp.getTarget().isPure()) {
      VM_Method method=methOp.getTarget();
      int n=Call.getNumberOfParams(s);
      for (int i=0; i < n; i++) {
        if (!Call.getParam(s,i).isConstant()) {
          return DefUseEffect.UNCHANGED;
        }
      }
      Object thisArg=null;
      VM_TypeReference[] paramTypes=method.getParameterTypes();
      Object[] otherArgs;
      Object result=null;
      if (methOp.isVirtual()) {
        thisArg=boxConstantOperand((ConstantOperand)Call.getParam(s,0),method.getDeclaringClass().getTypeRef());
        n--;
        otherArgs=new Object[n];
        for (int i=0; i < n; i++) {
          otherArgs[i]=boxConstantOperand((ConstantOperand)Call.getParam(s,i + 1),paramTypes[i]);
        }
      }
 else {
        otherArgs=new Object[n];
        for (int i=0; i < n; i++) {
          otherArgs[i]=boxConstantOperand((ConstantOperand)Call.getParam(s,i),paramTypes[i]);
        }
      }
      Throwable t=null;
      Method m=null;
      try {
        if (VM.runningVM) {
          result=VM_Reflection.invoke(method,thisArg,otherArgs,!methOp.isVirtual());
        }
 else {
          Class<?>[] argTypes=new Class<?>[n];
          for (int i=0; i < n; i++) {
            argTypes[i]=Call.getParam(s,i).getType().resolve().getClassForType();
          }
          m=method.getDeclaringClass().getClassForType().getDeclaredMethod(method.getName().toString(),argTypes);
          result=m.invoke(thisArg,otherArgs);
        }
      }
 catch (      Throwable e) {
        t=e;
      }
      if (t != null) {
        return DefUseEffect.UNCHANGED;
      }
      if (result == null)       throw new OptimizingCompilerException("String_Node_Str" + m + "String_Node_Str"+ method+ "String_Node_Str");
      if (method.getReturnType().isVoidType()) {
        Empty.mutate(s,NOP);
        return DefUseEffect.REDUCED;
      }
 else {
        Operator moveOp=IRTools.getMoveOp(method.getReturnType());
        Move.mutate(s,moveOp,Call.getClearResult(s),boxConstantObjectAsOperand(result,method.getReturnType()));
        return DefUseEffect.MOVE_FOLDED;
      }
    }
  }
  return DefUseEffect.UNCHANGED;
}

Fixed version (ground truth):
private static DefUseEffect call(boolean HIR,AbstractRegisterPool regpool,Instruction s){
  if (CF_FIELDS) {
    MethodOperand methOp=Call.getMethod(s);
    if (methOp == null) {
      return DefUseEffect.UNCHANGED;
    }
    if (methOp.isVirtual() && !methOp.hasPreciseTarget()) {
      Operand calleeThis=Call.getParam(s,0);
      if (calleeThis.isNullConstant()) {
        Trap.mutate(s,TRAP,NullCheck.getClearGuardResult(s),TrapCodeOperand.NullPtr());
        return DefUseEffect.TRAP_REDUCED;
      }
 else       if (calleeThis.isConstant() || calleeThis.asRegister().isPreciseType()) {
        VM_TypeReference calleeClass=calleeThis.getType();
        if (calleeClass.isResolved()) {
          methOp.refine(calleeClass.peekType());
          return DefUseEffect.UNCHANGED;
        }
      }
    }
 else     if (methOp.isStatic() && methOp.hasPreciseTarget() && HIR) {
      VM_Method containingMethod=s.position.getMethod();
      VM_Method method=methOp.getTarget();
      if (method == VM_Entrypoints.java_lang_Class_forName) {
        methOp=MethodOperand.STATIC(VM_Entrypoints.java_lang_Class_forName_withLoader.getMemberRef().asMethodReference(),VM_Entrypoints.java_lang_Class_forName_withLoader);
        Call.mutate3(s,CALL,Call.getResult(s),new AddressConstantOperand(VM_Entrypoints.java_lang_Class_forName_withLoader.getOffset()),methOp,Call.getGuard(s),Call.getParam(s,0),new IntConstantOperand(1),new ObjectConstantOperand(containingMethod.getDeclaringClass().getClassLoader(),Offset.zero()));
        return DefUseEffect.REDUCED;
      }
    }
    if (methOp.hasPreciseTarget() && methOp.getTarget().isPure()) {
      VM_Method method=methOp.getTarget();
      int n=Call.getNumberOfParams(s);
      for (int i=0; i < n; i++) {
        if (!Call.getParam(s,i).isConstant()) {
          return DefUseEffect.UNCHANGED;
        }
      }
      Object thisArg=null;
      VM_TypeReference[] paramTypes=method.getParameterTypes();
      Object[] otherArgs;
      Object result=null;
      if (!methOp.isStatic()) {
        thisArg=boxConstantOperand((ConstantOperand)Call.getParam(s,0),method.getDeclaringClass().getTypeRef());
        n--;
        otherArgs=new Object[n];
        for (int i=0; i < n; i++) {
          otherArgs[i]=boxConstantOperand((ConstantOperand)Call.getParam(s,i + 1),paramTypes[i]);
        }
      }
 else {
        otherArgs=new Object[n];
        for (int i=0; i < n; i++) {
          otherArgs[i]=boxConstantOperand((ConstantOperand)Call.getParam(s,i),paramTypes[i]);
        }
      }
      Throwable t=null;
      Method m=null;
      try {
        if (VM.runningVM) {
          result=VM_Reflection.invoke(method,thisArg,otherArgs,!methOp.isVirtual());
        }
 else {
          Class<?>[] argTypes=new Class<?>[n];
          for (int i=0; i < n; i++) {
            argTypes[i]=Call.getParam(s,i).getType().resolve().getClassForType();
          }
          m=method.getDeclaringClass().getClassForType().getDeclaredMethod(method.getName().toString(),argTypes);
          result=m.invoke(thisArg,otherArgs);
        }
      }
 catch (      Throwable e) {
        t=e;
      }
      if (t != null) {
        return DefUseEffect.UNCHANGED;
      }
      if (result == null)       throw new OptimizingCompilerException("String_Node_Str" + m + "String_Node_Str"+ method+ "String_Node_Str");
      if (method.getReturnType().isVoidType()) {
        Empty.mutate(s,NOP);
        return DefUseEffect.REDUCED;
      }
 else {
        Operator moveOp=IRTools.getMoveOp(method.getReturnType());
        Move.mutate(s,moveOp,Call.getClearResult(s),boxConstantObjectAsOperand(result,method.getReturnType()));
        return DefUseEffect.MOVE_FOLDED;
      }
    }
  }
  return DefUseEffect.UNCHANGED;
}