Program: 5594
Project: 5594
Buggy source:
public void receivedByte(byte data){
  log("String_Node_Str" + Utils.hex8(data) + "String_Node_Str"+ stateMachine+ "String_Node_Str"+ zeroSymbols+ ((stateMachine == RadioState.RX_SFD_SEARCH || stateMachine == RadioState.RX_FRAME) ? "String_Node_Str" : "String_Node_Str"));
  if (stateMachine == RadioState.RX_SFD_SEARCH) {
    if (data == 0) {
      zeroSymbols++;
    }
 else     if (zeroSymbols >= 4 && data == 0x7A) {
      setSFD(true);
      if (DEBUG)       log("String_Node_Str");
      rxread=0;
      setState(RadioState.RX_FRAME);
    }
 else {
      zeroSymbols=0;
    }
  }
 else   if (stateMachine == RadioState.RX_FRAME) {
    if (rxfifoLen == 128) {
      setRxOverflow();
    }
 else {
      memory[RAM_RXFIFO + rxfifoWritePos]=data & 0xFF;
      rxfifoWritePos=(rxfifoWritePos + 1) & 127;
      rxfifoLen++;
      if (rxread == 0) {
        rxCrc.setCRC(0);
        rxlen=data & 0xff;
        rxPacketStart=rxfifoWritePos;
        decodeAddress=false;
        if (DEBUG)         log("String_Node_Str" + rxlen);
        setFIFO(true);
      }
 else       if (rxread < rxlen - 2) {
        rxCrc.add(data & 0xff);
        if (rxread == 2) {
          if (TYPE_DATA_FRAME == (memory[RAM_RXFIFO + rxPacketStart] & FRAME_TYPE)) {
            decodeAddress=addressDecode & (memory[RAM_RXFIFO + rxPacketStart] & ACK_REQUEST) > 0;
            destinationAddressMode=(memory[RAM_RXFIFO + (rxPacketStart + 1)] >> 2) & 3;
          }
        }
        if (decodeAddress) {
          boolean flushPacket=false;
          if (destinationAddressMode == LONG_ADDRESS && rxread == 8 + 5) {
            int addrPos=rxPacketStart + 5;
            for (int i=0; i < 8; i++) {
              if (memory[RAM_IEEEADDR + i] != memory[RAM_RXFIFO + ((addrPos + i) & 127)]) {
                flushPacket=true;
              }
            }
            System.out.print("String_Node_Str" + !flushPacket + "String_Node_Str");
            for (int i=0; i < 8; i++) {
              System.out.print(Utils.hex8(memory[RAM_RXFIFO + ((addrPos + i) & 127)]) + "String_Node_Str");
            }
            System.out.println("String_Node_Str" + memory[RAM_IEEEADDR]);
            decodeAddress=false;
          }
 else           if (destinationAddressMode == SHORT_ADDRESS && rxread == 2 + 5) {
            int addrPos=rxPacketStart + 5;
            boolean bc=true;
            for (int i=0; i < 2; i++) {
              int addrData=memory[RAM_RXFIFO + ((addrPos + i) & 127)];
              if (bc && addrData != 0xff) {
                bc=false;
              }
              if (memory[RAM_SHORTADDR + i] != addrData) {
                flushPacket=true;
              }
            }
            if (bc)             flushPacket=false;
            System.out.print("String_Node_Str" + !flushPacket + "String_Node_Str");
            for (int i=0; i < 2; i++) {
              System.out.print(Utils.hex8(memory[RAM_RXFIFO + ((addrPos + i) & 127)]) + "String_Node_Str");
            }
            System.out.println("String_Node_Str" + memory[RAM_IEEEADDR]);
            decodeAddress=false;
          }
          if (flushPacket) {
            System.out.println("String_Node_Str");
            rxfifoLen=rxfifoLen - rxread;
            rxfifoWritePos=(rxPacketStart - 1 + 128) & 127;
            System.out.println("String_Node_Str" + rxfifoWritePos + "String_Node_Str"+ rxfifoReadPos);
            setSFD(false);
            setFIFOP(false);
            setFIFO(false);
            setState(RadioState.RX_SFD_SEARCH);
          }
        }
      }
      if (rxread++ == rxlen) {
        int crc=memory[RAM_RXFIFO + ((rxfifoWritePos + 128 - 2) & 127)] << 8;
        crc+=memory[RAM_RXFIFO + ((rxfifoWritePos + 128 - 1) & 127)];
        if (DEBUG && crc != rxCrc.getCRC()) {
          log("String_Node_Str" + crc + "String_Node_Str"+ rxCrc.getCRC());
        }
        memory[RAM_RXFIFO + ((rxfifoWritePos + 128 - 2) & 127)]=(registers[REG_RSSI]) & 0xff;
        memory[RAM_RXFIFO + ((rxfifoWritePos + 128 - 1) & 127)]=37 | (crc == rxCrc.getCRC() ? 0x80 : 0);
        setFIFOP(true);
        setSFD(false);
        lastPacketStart=(rxfifoWritePos + 128 - rxlen) & 127;
        if (true || DEBUG)         log("String_Node_Str" + lastPacketStart);
        if ((autoAck && checkAutoack()) || shouldAck) {
          ackBuf[ACK_SEQPOS]=memory[RAM_RXFIFO + lastPacketStart + 2];
          setState(RadioState.TX_ACK_CALIBRATE);
        }
 else {
          setState(RadioState.RX_WAIT);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void receivedByte(byte data){
  log("String_Node_Str" + Utils.hex8(data) + "String_Node_Str"+ stateMachine+ "String_Node_Str"+ zeroSymbols+ ((stateMachine == RadioState.RX_SFD_SEARCH || stateMachine == RadioState.RX_FRAME) ? "String_Node_Str" : "String_Node_Str"));
  if (stateMachine == RadioState.RX_SFD_SEARCH) {
    if (data == 0) {
      zeroSymbols++;
    }
 else     if (zeroSymbols >= 4 && data == 0x7A) {
      setSFD(true);
      if (DEBUG)       log("String_Node_Str");
      rxread=0;
      setState(RadioState.RX_FRAME);
    }
 else {
      zeroSymbols=0;
    }
  }
 else   if (stateMachine == RadioState.RX_FRAME) {
    if (rxfifoLen == 128) {
      setRxOverflow();
    }
 else {
      memory[RAM_RXFIFO + rxfifoWritePos]=data & 0xFF;
      rxfifoWritePos=(rxfifoWritePos + 1) & 127;
      rxfifoLen++;
      if (rxread == 0) {
        rxCrc.setCRC(0);
        rxlen=data & 0xff;
        rxPacketStart=rxfifoWritePos;
        decodeAddress=false;
        if (DEBUG)         log("String_Node_Str" + rxlen);
        setFIFO(true);
      }
 else       if (rxread < rxlen - 2) {
        rxCrc.add(data & 0xff);
        if (rxread == 2) {
          if (TYPE_DATA_FRAME == (memory[RAM_RXFIFO + rxPacketStart] & FRAME_TYPE)) {
            decodeAddress=addressDecode & (memory[RAM_RXFIFO + rxPacketStart] & ACK_REQUEST) > 0;
            destinationAddressMode=(memory[RAM_RXFIFO + ((rxPacketStart + 1) & 127)] >> 2) & 3;
          }
        }
        if (decodeAddress) {
          boolean flushPacket=false;
          if (destinationAddressMode == LONG_ADDRESS && rxread == 8 + 5) {
            int addrPos=rxPacketStart + 5;
            for (int i=0; i < 8; i++) {
              if (memory[RAM_IEEEADDR + i] != memory[RAM_RXFIFO + ((addrPos + i) & 127)]) {
                flushPacket=true;
              }
            }
            decodeAddress=false;
          }
 else           if (destinationAddressMode == SHORT_ADDRESS && rxread == 2 + 5) {
            int addrPos=rxPacketStart + 5;
            boolean bc=true;
            for (int i=0; i < 2; i++) {
              int addrData=memory[RAM_RXFIFO + ((addrPos + i) & 127)];
              if (bc && addrData != 0xff) {
                bc=false;
              }
              if (memory[RAM_SHORTADDR + i] != addrData) {
                flushPacket=true;
              }
            }
            if (bc)             flushPacket=false;
            decodeAddress=false;
          }
          if (flushPacket) {
            rxfifoLen=rxfifoLen - rxread;
            rxfifoWritePos=(rxPacketStart - 1 + 128) & 127;
            setSFD(false);
            setFIFOP(false);
            setFIFO(false);
            setState(RadioState.RX_SFD_SEARCH);
          }
        }
      }
      if (rxread++ == rxlen) {
        int crc=memory[RAM_RXFIFO + ((rxfifoWritePos + 128 - 2) & 127)] << 8;
        crc+=memory[RAM_RXFIFO + ((rxfifoWritePos + 128 - 1) & 127)];
        if (DEBUG && crc != rxCrc.getCRC()) {
          log("String_Node_Str" + crc + "String_Node_Str"+ rxCrc.getCRC());
        }
        memory[RAM_RXFIFO + ((rxfifoWritePos + 128 - 2) & 127)]=(registers[REG_RSSI]) & 0xff;
        memory[RAM_RXFIFO + ((rxfifoWritePos + 128 - 1) & 127)]=37 | (crc == rxCrc.getCRC() ? 0x80 : 0);
        setFIFOP(true);
        setSFD(false);
        lastPacketStart=(rxfifoWritePos + 128 - rxlen) & 127;
        if (DEBUG)         log("String_Node_Str" + lastPacketStart + "String_Node_Str"+ rxPacketStart);
        if ((autoAck && checkAutoack()) || shouldAck) {
          ackBuf[ACK_SEQPOS]=memory[RAM_RXFIFO + lastPacketStart + 2];
          setState(RadioState.TX_ACK_CALIBRATE);
        }
 else {
          setState(RadioState.RX_WAIT);
        }
      }
    }
  }
}