Program: 171607
Project: 171607
Buggy source:
/** 
 * @param ROM
 * @param call
 */
public static void compileCall(ArrayList<Command> ROM,CallStatement call){
  ArrayList<Subroutine> oldsubs=new ArrayList<Subroutine>();
  oldsubs.addAll(subs);
  subs.clear();
  subs.addAll(call.cursubs);
  ArrayList<Command> tempROM=new ArrayList<Command>();
  tokens.addAll(0,call.statement);
  tokens.remove(0);
  Arg pointer=compileRef(tempROM,true);
  tokens.remove(0);
  String subName=tokens.remove(0);
  Subroutine sub=subroutine.get(subName);
  if (sub == null) {
    System.err.print("String_Node_Str" + subName + rmStatement());
    return;
  }
  Arg temp=mallocS();
  int ID=OpenLoop.nextLoopID++;
  tempROM.add(new Command("String_Node_Str",new Arg(1,CallStackPointer,0),new Arg(1),temp));
  tempROM.add(new Command("String_Node_Str",new Arg(-1),new Arg(1,subName,0),new Arg(1,temp.val)));
  freeS(temp);
  tempROM.add(new Command("String_Node_Str",new Arg(-1),new Arg(1,CallStackPointer,0),pointer));
  tokens.remove(0);
  if (tokens.get(0).equals("String_Node_Str")) {
    tokens.remove(0);
  }
  int argnum=2;
  ArrayList<Command> defArgROM=new ArrayList<Command>();
  for (; !tokens.get(0).equals("String_Node_Str"); argnum++) {
    if (tokens.get(0).equals("String_Node_Str")) {
      tokens.remove(0);
      defArgROM.addAll(sub.inits.get(argnum));
    }
 else {
      String argName=sub.args.get(argnum);
      String varName=tokens.get(0);
      if (tokens.get(1).equals("String_Node_Str")) {
      }
 else       if (arrayType.equals(varName)) {
      }
 else {
        Arg source=compileRef(tempROM,false);
        tokens.remove(0);
        temp=mallocS();
        tempROM.add(new Command("String_Node_Str",new Arg(pointer.mode + 1,pointer.val),new Arg(argName,0,subName),temp));
        tempROM.add(new Command("String_Node_Str",new Arg(-1),source,new Arg(1,temp.val)));
        freeS(temp);
      }
    }
  }
  tempROM.add(new Command("String_Node_Str",new Arg(-1),new Arg(pointer.mode + 1,pointer.val),new Arg(subName,0)));
  tempROM.add(new Command("String_Node_Str",new Arg(-1),new Arg("String_Node_Str" + ID + "String_Node_Str"+ subName,1),new Arg(1,subName,0)));
  tempROM.addAll(defArgROM);
  for (; argnum < sub.args.size(); argnum++) {
    tempROM.addAll(sub.inits.get(argnum));
  }
  tokens.remove(0);
  tempROM.add(new Command("String_Node_Str",new Arg(-1),new Arg("String_Node_Str" + sub.loop,0),new Arg(ProgramCounter,0)));
  compileDelaySlots(tempROM);
  tempROM.get(tempROM.size() - 1).tag="String_Node_Str" + ID + "String_Node_Str"+ subName;
  ROM.addAll(call.loc,tempROM);
  subs.clear();
  subs.addAll(oldsubs);
}

Fixed version (ground truth):
/** 
 * @param ROM
 * @param call
 */
public static void compileCall(ArrayList<Command> ROM,CallStatement call){
  ArrayList<Subroutine> oldsubs=new ArrayList<Subroutine>();
  oldsubs.addAll(subs);
  subs.clear();
  subs.addAll(call.cursubs);
  ArrayList<Command> tempROM=new ArrayList<Command>();
  tokens.addAll(0,call.statement);
  tokens.remove(0);
  Arg pointer=compileRef(tempROM,true);
  tokens.remove(0);
  String subName=tokens.remove(0);
  Subroutine sub=subroutine.get(subName);
  if (sub == null) {
    System.err.print("String_Node_Str" + subName + rmStatement());
    return;
  }
  Arg temp=mallocS();
  int ID=OpenLoop.nextLoopID++;
  tempROM.add(new Command("String_Node_Str",new Arg(1,CallStackPointer,0),new Arg(1),temp));
  tempROM.add(new Command("String_Node_Str",new Arg(-1),new Arg(1,subName,0),new Arg(1,temp.val)));
  freeS(temp);
  tempROM.add(new Command("String_Node_Str",new Arg(-1),new Arg(1,CallStackPointer,0),pointer));
  tokens.remove(0);
  if (tokens.get(0).equals("String_Node_Str")) {
    tokens.remove(0);
  }
  int argnum=2;
  ArrayList<Command> defArgROM=new ArrayList<Command>();
  for (; !tokens.get(0).equals("String_Node_Str"); argnum++) {
    if (tokens.get(0).equals("String_Node_Str")) {
      tokens.remove(0);
      defArgROM.addAll(sub.inits.get(argnum));
    }
 else {
      String argName=sub.args.get(argnum);
      String varName=tokens.get(0);
      if (tokens.get(1).equals("String_Node_Str")) {
      }
 else       if (arrayType.equals(varName)) {
      }
 else {
        Arg source=compileRef(tempROM,false);
        tokens.remove(0);
        temp=mallocS();
        tempROM.add(new Command("String_Node_Str",new Arg(pointer.mode + 1,pointer.val),new Arg(argName,0,subName),temp));
        tempROM.add(new Command("String_Node_Str",new Arg(-1),source,new Arg(1,temp.val)));
        freeS(temp);
      }
    }
  }
  tempROM.add(new Command("String_Node_Str",new Arg(-1),new Arg(pointer.mode + 1,pointer.val),new Arg(subName,0)));
  tempROM.add(new Command("String_Node_Str",new Arg(-1),new Arg("String_Node_Str" + ID + "String_Node_Str"+ subName,1),new Arg(1,subName,0)));
  tempROM.addAll(defArgROM);
  for (; argnum < sub.args.size(); argnum++) {
    tempROM.addAll(sub.inits.get(argnum));
  }
  tokens.remove(0);
  tempROM.add(new Command("String_Node_Str",new Arg(-1),new Arg("String_Node_Str" + sub.loop,0),new Arg(ProgramCounter,0)));
  compileDelaySlots(tempROM);
  tempROM.get(tempROM.size() - 1).tags.add("String_Node_Str" + ID + "String_Node_Str"+ subName);
  tempROM.get(tempROM.size() - 1).tags.addAll(call.tags);
  ROM.addAll(call.loc,tempROM);
  subs.clear();
  subs.addAll(oldsubs);
}