Program: 5745
Project: 5745
Buggy source:
public void write(int address,int data,boolean word,long cycles){
  if (DEBUG) {
    System.out.println("String_Node_Str" + Utils.hex16(address) + "String_Node_Str"+ data+ "String_Node_Str"+ word);
  }
  if (MSP430Constants.DEBUGGING_LEVEL > 0) {
    System.out.println("String_Node_Str" + Integer.toString(address,16) + "String_Node_Str"+ data);
  }
switch (address) {
case MPY:
    mpy=data;
  if (DEBUG)   System.out.println(getName() + "String_Node_Str" + data);
lastWriteOP=address;
break;
case MPYS:
mpys=data;
if (DEBUG) System.out.println(getName() + "String_Node_Str" + data);
lastWriteOP=address;
break;
case MAC:
mac=data;
if (DEBUG) System.out.println(getName() + "String_Node_Str" + data);
lastWriteOP=address;
break;
case MACS:
macs=data;
if (DEBUG) System.out.println(getName() + "String_Node_Str" + data);
lastWriteOP=address;
break;
case RESLO:
resLo=data;
break;
case RESHI:
resHi=data;
break;
case OP2:
if (DEBUG) System.out.println(getName() + "String_Node_Str" + data);
sumext=0;
op2=data;
int o1=mpy;
boolean signMode=false;
boolean sum=false;
if (lastWriteOP == MPYS) {
o1=mpys;
signMode=true;
}
 else if (lastWriteOP == MAC) {
o1=mac;
sum=true;
}
 else if (lastWriteOP == MACS) {
o1=macs;
signMode=true;
sum=true;
}
if (signMode) {
if (((o1 ^ op2) & 0x8000) > 0) {
sumext=0xffff;
}
}
long res=o1 * op2;
System.out.println("String_Node_Str" + o1 + "String_Node_Str"+ op2+ "String_Node_Str"+ res);
if (sum) {
currentSum=(resHi << 16) + resLo;
currentSum+=res;
res=currentSum;
}
resHi=(int)((res >> 16) & 0xffff);
resLo=(int)(res & 0xffff);
if (DEBUG) System.out.println("String_Node_Str" + res);
break;
}
}

Fixed version (ground truth):
public void write(int address,int data,boolean word,long cycles){
  if (DEBUG) {
    System.out.println("String_Node_Str" + Utils.hex16(address) + "String_Node_Str"+ data+ "String_Node_Str"+ word);
  }
  if (MSP430Constants.DEBUGGING_LEVEL > 0) {
    System.out.println("String_Node_Str" + Integer.toString(address,16) + "String_Node_Str"+ data);
  }
switch (address) {
case MPY:
    op1=mpy=data;
  if (DEBUG)   System.out.println(getName() + "String_Node_Str" + data);
lastWriteOP=address;
signed=false;
accumulating=false;
break;
case MPYS:
op1=mpys=data;
if (DEBUG) System.out.println(getName() + "String_Node_Str" + data);
lastWriteOP=address;
signed=true;
accumulating=false;
break;
case MAC:
op1=mac=data;
if (DEBUG) System.out.println(getName() + "String_Node_Str" + data);
lastWriteOP=address;
signed=false;
accumulating=true;
break;
case MACS:
op1=macs=data;
if (DEBUG) System.out.println(getName() + "String_Node_Str" + data);
lastWriteOP=address;
signed=true;
accumulating=true;
break;
case RESLO:
resLo=data;
break;
case RESHI:
resHi=data;
break;
case OP2:
if (DEBUG) System.out.println(getName() + "String_Node_Str" + data);
sumext=0;
op2=data;
if (signed) {
if (!word) {
if (op1 > 0x80) op1=op1 | 0xff00;
if (op2 > 0x80) op2=op2 | 0xff00;
}
op1=op1 > 0x8000 ? op1 - 0x10000 : op1;
op2=op2 > 0x8000 ? op2 - 0x10000 : op2;
}
long res=op1 * op2;
if (DEBUG) System.out.println("String_Node_Str" + op1 + "String_Node_Str"+ op2+ "String_Node_Str"+ res);
if (signed) {
sumext=res < 0 ? 0xffff : 0;
}
if (accumulating) {
res+=(resHi << 16) + resLo;
if (!signed && res > 0xffffffff) {
sumext=1;
}
}
resHi=(int)((res >> 16) & 0xffff);
resLo=(int)(res & 0xffff);
if (DEBUG) System.out.println("String_Node_Str" + res);
break;
}
}