Program: 142401
Project: 142401
Buggy source:
public int processEvent(int msg){
  int evConsumed=0;
  if (m_initialized == false)   return 0;
  this.continueProcessing=true;
  do {
    evConsumed=0;
switch (stateVar) {
case COMMAND_PROCESSOR:
switch (stateVarCOMMAND_PROCESSOR) {
case END_OF_STACK_OR_EMPTY:
        if (true) {
          if (apduHasBeenProcessed()) {
            evConsumed=16;
            returnResult();
            stateVarCOMMAND_PROCESSOR=WAITING_FOR_COMMAND;
          }
 else {
            evConsumed=16;
            setProtocolPointerToFirstElementOfProtocolList();
            stateVarCOMMAND_PROCESSOR=WAITING_FOR_PROTOCOL_TO_PROCESS_APDU;
          }
        }
 else {
        }
      break;
case PROTOCOL_FROM_LIST_ACTIVE:
    if (true) {
      if (apduHasBeenProcessed() || protocolAtPointerWantsToGetOnStack()) {
        evConsumed=16;
        addProtocolAtProtocolPointerToStack();
        stateVarCOMMAND_PROCESSOR=PROTOCOL_PROCESSED;
      }
 else {
        evConsumed=16;
        stateVarCOMMAND_PROCESSOR=PROTOCOL_UNABLE_TO_PROCESS_APDU;
      }
    }
 else {
    }
  break;
case PROTOCOL_FROM_STACK_ACTIVE:
if (true) {
  evConsumed=16;
  currentProtocolProcess();
  stateVarCOMMAND_PROCESSOR=PROTOCOL_PROCESSED;
}
 else {
}
break;
case PROTOCOL_INACTIVE:
if (true) {
evConsumed=16;
stateVarCOMMAND_PROCESSOR=START_OF_STACK;
}
 else {
}
break;
case PROTOCOL_PROCESSED:
if (true) {
if (isProtocolFinished()) {
evConsumed=16;
removeCurrentProtocolAndAboveFromStack();
stateVarCOMMAND_PROCESSOR=PROTOCOL_INACTIVE;
}
 else {
evConsumed=16;
incrementStackPointer();
stateVarCOMMAND_PROCESSOR=PROTOCOL_INACTIVE;
}
}
 else {
}
break;
case PROTOCOL_UNABLE_TO_PROCESS_APDU:
if (true) {
if (protocolAtProtocolPointerIsLastElementOfProtocolList()) {
evConsumed=16;
setStatusWordForUnsupportedCommand();
returnResult();
stateVarCOMMAND_PROCESSOR=WAITING_FOR_COMMAND;
}
 else {
evConsumed=16;
setProtocolPointerToNextElementOfProtocolList();
stateVarCOMMAND_PROCESSOR=WAITING_FOR_PROTOCOL_TO_PROCESS_APDU;
}
}
 else {
}
break;
case START_OF_STACK:
if (true) {
if (stackPointerIsNull()) {
evConsumed=16;
stateVarCOMMAND_PROCESSOR=END_OF_STACK_OR_EMPTY;
}
 else {
evConsumed=16;
makeStackPointerCurrentlyActiveProtocol();
stateVarCOMMAND_PROCESSOR=PROTOCOL_FROM_STACK_ACTIVE;
}
}
 else {
}
break;
case WAITING_FOR_COMMAND:
if (true) {
evConsumed=16;
setStackPointerToBottom();
stateVarCOMMAND_PROCESSOR=START_OF_STACK;
}
 else {
}
break;
case WAITING_FOR_PROTOCOL_TO_PROCESS_APDU:
if (true) {
evConsumed=16;
resetProtocolAtProtocolPointer();
makeProtocolAtProtocolPointerCurrentlyActiveProtocol();
currentProtocolProcess();
stateVarCOMMAND_PROCESSOR=PROTOCOL_FROM_LIST_ACTIVE;
}
 else {
}
break;
default :
break;
}
break;
case INITIALIZATION:
if (true) {
evConsumed=16;
returnResult();
stateVar=COMMAND_PROCESSOR;
stateVarCOMMAND_PROCESSOR=WAITING_FOR_COMMAND;
}
 else {
}
break;
default :
break;
}
}
 while (this.continueProcessing);
return evConsumed;
}

Fixed version (ground truth):
public int processEvent(int msg){
  int evConsumed=0;
  if (m_initialized == false)   return 0;
  this.continueProcessing=true;
  do {
    evConsumed=0;
switch (stateVar) {
case COMMAND_PROCESSOR:
switch (stateVarCOMMAND_PROCESSOR) {
case END_OF_STACK_OR_EMPTY:
        if (true) {
          if (apduHasBeenProcessed()) {
            evConsumed=16;
            returnResult();
            stateVarCOMMAND_PROCESSOR=WAITING_FOR_COMMAND;
          }
 else {
            evConsumed=16;
            setProtocolPointerToFirstElementOfProtocolList();
            stateVarCOMMAND_PROCESSOR=START_PROTOCOL_ITERATION;
          }
        }
 else {
        }
      break;
case PROTOCOL_FROM_LIST_ACTIVE:
    if (true) {
      if (apduHasBeenProcessed() || protocolAtPointerWantsToGetOnStack()) {
        evConsumed=16;
        addProtocolAtProtocolPointerToStack();
        stateVarCOMMAND_PROCESSOR=PROTOCOL_PROCESSED;
      }
 else {
        evConsumed=16;
        setProtocolPointerToNextElementOfProtocolList();
        stateVarCOMMAND_PROCESSOR=PROTOCOL_UNABLE_TO_PROCESS_APDU;
      }
    }
 else {
    }
  break;
case PROTOCOL_FROM_STACK_ACTIVE:
if (true) {
  evConsumed=16;
  currentProtocolProcess();
  stateVarCOMMAND_PROCESSOR=PROTOCOL_PROCESSED;
}
 else {
}
break;
case PROTOCOL_INACTIVE:
if (true) {
evConsumed=16;
stateVarCOMMAND_PROCESSOR=START_OF_STACK;
}
 else {
}
break;
case PROTOCOL_PROCESSED:
if (true) {
if (isProtocolFinished()) {
evConsumed=16;
removeCurrentProtocolAndAboveFromStack();
stateVarCOMMAND_PROCESSOR=PROTOCOL_INACTIVE;
}
 else {
evConsumed=16;
incrementStackPointer();
stateVarCOMMAND_PROCESSOR=PROTOCOL_INACTIVE;
}
}
 else {
}
break;
case PROTOCOL_UNABLE_TO_PROCESS_APDU:
if (true) {
if (allProtocolsOfProtocolListProcessed()) {
evConsumed=16;
setStatusWordForUnsupportedCommand();
returnResult();
stateVarCOMMAND_PROCESSOR=WAITING_FOR_COMMAND;
}
 else {
evConsumed=16;
stateVarCOMMAND_PROCESSOR=WAITING_FOR_PROTOCOL_TO_PROCESS_APDU;
}
}
 else {
}
break;
case START_OF_STACK:
if (true) {
if (stackPointerIsNull()) {
evConsumed=16;
stateVarCOMMAND_PROCESSOR=END_OF_STACK_OR_EMPTY;
}
 else {
evConsumed=16;
makeStackPointerCurrentlyActiveProtocol();
stateVarCOMMAND_PROCESSOR=PROTOCOL_FROM_STACK_ACTIVE;
}
}
 else {
}
break;
case START_PROTOCOL_ITERATION:
if (true) {
if (allProtocolsOfProtocolListProcessed()) {
evConsumed=16;
setStatusWordForUnsupportedCommand();
returnResult();
stateVarCOMMAND_PROCESSOR=WAITING_FOR_COMMAND;
}
 else {
evConsumed=16;
stateVarCOMMAND_PROCESSOR=WAITING_FOR_PROTOCOL_TO_PROCESS_APDU;
}
}
 else {
}
break;
case WAITING_FOR_COMMAND:
if (true) {
evConsumed=16;
setStackPointerToBottom();
stateVarCOMMAND_PROCESSOR=START_OF_STACK;
}
 else {
}
break;
case WAITING_FOR_PROTOCOL_TO_PROCESS_APDU:
if (true) {
evConsumed=16;
resetProtocolAtProtocolPointer();
makeProtocolAtProtocolPointerCurrentlyActiveProtocol();
currentProtocolProcess();
stateVarCOMMAND_PROCESSOR=PROTOCOL_FROM_LIST_ACTIVE;
}
 else {
}
break;
default :
break;
}
break;
case INITIALIZATION:
if (true) {
evConsumed=16;
returnResult();
stateVar=COMMAND_PROCESSOR;
stateVarCOMMAND_PROCESSOR=WAITING_FOR_COMMAND;
}
 else {
}
break;
default :
break;
}
}
 while (this.continueProcessing);
return evConsumed;
}