public static void subOverflow(final long offset,final ITranslationEnvironment environment,final IInstruction instruction,final List<ReilInstruction> instructions,final OperandSize firstOperandSize,final String firstOperand,final OperandSize secondOperandSize,final String secondOperand,final OperandSize resultOperandSize,final String resultOperand,final String overflow,final long size){
  final OperandSize bt=OperandSize.BYTE;
  final OperandSize wd=OperandSize.WORD;
  final String msbVara=environment.getNextVariableString();
  final String msbVarb=environment.getNextVariableString();
  final String msbVarr=environment.getNextVariableString();
  final String tmpVar3=environment.getNextVariableString();
  final String tmpVar4=environment.getNextVariableString();
  final String shiftVal="-" + String.valueOf(size - 1);
  long baseOffset=offset;
  instructions.add(ReilHelpers.createBsh(baseOffset++,firstOperandSize,firstOperand,wd,shiftVal,bt,msbVara));
  instructions.add(ReilHelpers.createBsh(baseOffset++,secondOperandSize,secondOperand,wd,shiftVal,bt,msbVarb));
  instructions.add(ReilHelpers.createBsh(baseOffset++,resultOperandSize,resultOperand,wd,shiftVal,bt,msbVarr));
  instructions.add(ReilHelpers.createAnd(baseOffset++,bt,msbVara,bt,String.valueOf(1),bt,msbVara));
  instructions.add(ReilHelpers.createAnd(baseOffset++,bt,msbVarb,bt,String.valueOf(1),bt,msbVarb));
  instructions.add(ReilHelpers.createAnd(baseOffset++,bt,msbVarr,bt,String.valueOf(1),bt,msbVarr));
  instructions.add(ReilHelpers.createXor(baseOffset++,bt,msbVara,bt,msbVarb,bt,tmpVar4));
  instructions.add(ReilHelpers.createXor(baseOffset++,bt,msbVara,bt,msbVarr,bt,tmpVar3));
  instructions.add(ReilHelpers.createAnd(baseOffset++,bt,tmpVar4,bt,tmpVar3,bt,overflow));
}

public static void subOverflow ( final long offset , final ITranslationEnvironment environment , final IInstruction instruction , final List < ReilInstruction > instructions , final OperandSize firstOperandSize , final String firstOperand , final OperandSize secondOperandSize , final String secondOperand , final OperandSize resultOperandSize , final String resultOperand , final String overflow , final long size ) { final OperandSize bt = OperandSize . BYTE ; final OperandSize wd = OperandSize . WORD ; final String msbVara = environment . getNextVariableString ( ) ; final String msbVarb = environment . getNextVariableString ( ) ; final String msbVarr = environment . getNextVariableString ( ) ; final String tmpVar3 = environment . getNextVariableString ( ) ; final String tmpVar4 = environment . getNextVariableString ( ) ; final String shiftVal = "-" + String . valueOf ( size - 1 ) ; long baseOffset = offset ; instructions . add ( ReilHelpers . createBsh ( baseOffset ++ , firstOperandSize , firstOperand , wd , shiftVal , bt , msbVara ) ) ; instructions . add ( ReilHelpers . createBsh ( baseOffset ++ , secondOperandSize , secondOperand , wd , shiftVal , bt , msbVarb ) ) ; instructions . add ( ReilHelpers . createBsh ( baseOffset ++ , resultOperandSize , resultOperand , wd , shiftVal , bt , msbVarr ) ) ; instructions . add ( ReilHelpers . createAnd ( baseOffset ++ , bt , msbVara , bt , String . valueOf ( 1 ) , bt , msbVara ) ) ; instructions . add ( ReilHelpers . createAnd ( baseOffset ++ , bt , msbVarb , bt , String . valueOf ( 1 ) , bt , msbVarb ) ) ; instructions . add ( ReilHelpers . createAnd ( baseOffset ++ , bt , msbVarr , bt , String . valueOf ( 1 ) , bt , msbVarr ) ) ; instructions . add ( ReilHelpers . createXor ( baseOffset ++ , bt , msbVara , bt , msbVarb , bt , tmpVar4 ) ) ; instructions . add ( ReilHelpers . createXor ( baseOffset ++ , bt , msbVara , bt , msbVarr , bt , tmpVar3 ) ) ; instructions . add ( ReilHelpers . createAnd ( baseOffset ++ , bt , tmpVar4 , bt , tmpVar3 , bt , overflow ) ) ; }
overflow condition if operation was a subtraction
