Program: 5606
Project: 5606
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:
    op1=mpy=data;
  if (DEBUG)   System.out.println(getName() + "String_Node_Str" + data);
signed=false;
accumulating=false;
break;
case MPYS:
op1=mpys=data;
if (DEBUG) System.out.println(getName() + "String_Node_Str" + data);
signed=true;
accumulating=false;
break;
case MAC:
op1=mac=data;
if (DEBUG) System.out.println(getName() + "String_Node_Str" + data);
signed=false;
accumulating=true;
break;
case MACS:
op1=macs=data;
if (DEBUG) System.out.println(getName() + "String_Node_Str" + data);
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=(long)op1 * (long)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+=((long)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;
}
}

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);
signed=false;
accumulating=false;
break;
case MPYS:
op1=mpys=data;
if (DEBUG) System.out.println(getName() + "String_Node_Str" + data);
signed=true;
accumulating=false;
break;
case MAC:
op1=mac=data;
if (DEBUG) System.out.println(getName() + "String_Node_Str" + data);
signed=false;
accumulating=true;
break;
case MACS:
op1=macs=data;
if (DEBUG) System.out.println(getName() + "String_Node_Str" + data);
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=(long)op1 * (long)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+=((long)resHi << 16) + resLo;
if (!signed) {
sumext=res > 0xffffffffL ? 1 : 0;
}
}
 else if (!signed) {
sumext=0;
}
resHi=(int)((res >> 16) & 0xffff);
resLo=(int)(res & 0xffff);
if (DEBUG) System.out.println("String_Node_Str" + res);
break;
}
}