
void subtract_from_result(expressionS *resultP,offsetT amount,int rhs_highbit)

{
  byte bVar1;
  uint uVar2;
  byte bVar3;
  
  uVar2 = resultP->X_add_number;
  bVar1 = resultP->field_0xd;
  resultP->X_add_number = uVar2 - amount;
  bVar3 = (bVar1 >> 1 ^ (byte)rhs_highbit) & 1;
  if ((uint)amount <= uVar2) {
    resultP->field_0xd = bVar1 & 0xfd | bVar3 * '\x02';
    return;
  }
  resultP->field_0xd = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;
  return;
}



void FUN_00020d90(int param_1,uint param_2,byte param_3)

{
  byte bVar1;
  uint uVar2;
  byte bVar3;
  
  uVar2 = *(uint *)(param_1 + 8);
  bVar1 = *(byte *)(param_1 + 0xd);
  *(uint *)(param_1 + 8) = uVar2 - param_2;
  bVar3 = (bVar1 >> 1 ^ param_3) & 1;
  if (param_2 <= uVar2) {
    *(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';
    return;
  }
  *(byte *)(param_1 + 0xd) = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;
  return;
}


PUSH ESI
PUSH EBX
MOV ECX,dword ptr [ESP + 0xc]
MOV EBX,dword ptr [ESP + 0x10]
MOV ESI,dword ptr [ECX + 0x8]
MOVZX EDX,byte ptr [ECX + 0xd]
MOV EAX,ESI
SUB EAX,EBX
MOV dword ptr [ECX + 0x8],EAX
MOV EAX,EDX
SHR AL,0x1
XOR AL,byte ptr [ESP + 0x14]
AND EAX,0x1
CMP ESI,EBX
JC 0x00020dd0
LEA EBX,[EAX + EAX*0x1]
MOV EAX,EDX
AND EAX,0xfffffffd
OR EAX,EBX
MOV byte ptr [ECX + 0xd],AL
POP EBX
POP ESI
RET
XOR EAX,0x1
AND EDX,0xfffffffd
AND EAX,0x1
ADD EAX,EAX
OR EAX,EDX
MOV byte ptr [ECX + 0xd],AL
POP EBX
POP ESI
RET
(translation_unit "void FUN_00020d90(int param_1,uint param_2,byte param_3)\n\n{\n  byte bVar1;\n  uint uVar2;\n  byte bVar3;\n  \n  uVar2 = *(uint *)(param_1 + 8);\n  bVar1 = *(byte *)(param_1 + 0xd);\n  *(uint *)(param_1 + 8) = uVar2 - param_2;\n  bVar3 = (bVar1 >> 1 ^ param_3) & 1;\n  if (param_2 <= uVar2) {\n    *(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }\n  *(byte *)(param_1 + 0xd) = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;\n  return;\n}\n\n" (function_definition "void FUN_00020d90(int param_1,uint param_2,byte param_3)\n\n{\n  byte bVar1;\n  uint uVar2;\n  byte bVar3;\n  \n  uVar2 = *(uint *)(param_1 + 8);\n  bVar1 = *(byte *)(param_1 + 0xd);\n  *(uint *)(param_1 + 8) = uVar2 - param_2;\n  bVar3 = (bVar1 >> 1 ^ param_3) & 1;\n  if (param_2 <= uVar2) {\n    *(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }\n  *(byte *)(param_1 + 0xd) = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;\n  return;\n}" primitive_type (function_declarator "FUN_00020d90(int param_1,uint param_2,byte param_3)" identifier (parameter_list "(int param_1,uint param_2,byte param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "byte param_3" type_identifier identifier) ))) (compound_statement "{\n  byte bVar1;\n  uint uVar2;\n  byte bVar3;\n  \n  uVar2 = *(uint *)(param_1 + 8);\n  bVar1 = *(byte *)(param_1 + 0xd);\n  *(uint *)(param_1 + 8) = uVar2 - param_2;\n  bVar3 = (bVar1 >> 1 ^ param_3) & 1;\n  if (param_2 <= uVar2) {\n    *(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }\n  *(byte *)(param_1 + 0xd) = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;\n  return;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "byte bVar3;" type_identifier identifier ;) (expression_statement "uVar2 = *(uint *)(param_1 + 8);" (assignment_expression "uVar2 = *(uint *)(param_1 + 8)" identifier = (pointer_expression "*(uint *)(param_1 + 8)" * (cast_expression "(uint *)(param_1 + 8)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (expression_statement "bVar1 = *(byte *)(param_1 + 0xd);" (assignment_expression "bVar1 = *(byte *)(param_1 + 0xd)" identifier = (pointer_expression "*(byte *)(param_1 + 0xd)" * (cast_expression "(byte *)(param_1 + 0xd)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd)" ( (binary_expression "param_1 + 0xd" identifier + number_literal) ))))) ;) (expression_statement "*(uint *)(param_1 + 8) = uVar2 - param_2;" (assignment_expression "*(uint *)(param_1 + 8) = uVar2 - param_2" (pointer_expression "*(uint *)(param_1 + 8)" * (cast_expression "(uint *)(param_1 + 8)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = (binary_expression "uVar2 - param_2" identifier - identifier)) ;) (expression_statement "bVar3 = (bVar1 >> 1 ^ param_3) & 1;" (assignment_expression "bVar3 = (bVar1 >> 1 ^ param_3) & 1" identifier = (binary_expression "(bVar1 >> 1 ^ param_3) & 1" (parenthesized_expression "(bVar1 >> 1 ^ param_3)" ( (binary_expression "bVar1 >> 1 ^ param_3" (binary_expression "bVar1 >> 1" identifier >> number_literal) ^ identifier) )) & number_literal)) ;) (if_statement "if (param_2 <= uVar2) {\n    *(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }" if (parenthesized_expression "(param_2 <= uVar2)" ( (binary_expression "param_2 <= uVar2" identifier <= identifier) )) (compound_statement "{\n    *(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }" { (expression_statement "*(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';" (assignment_expression "*(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02'" (pointer_expression "*(byte *)(param_1 + 0xd)" * (cast_expression "(byte *)(param_1 + 0xd)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd)" ( (binary_expression "param_1 + 0xd" identifier + number_literal) )))) = (binary_expression "bVar1 & 0xfd | bVar3 * '\x02'" (binary_expression "bVar1 & 0xfd" identifier & number_literal) | (binary_expression "bVar3 * '\x02'" identifier * (char_literal "'\x02'" ' escape_sequence ')))) ;) (return_statement "return;" return ;) })) (expression_statement "*(byte *)(param_1 + 0xd) = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;" (assignment_expression "*(byte *)(param_1 + 0xd) = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd" (pointer_expression "*(byte *)(param_1 + 0xd)" * (cast_expression "(byte *)(param_1 + 0xd)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd)" ( (binary_expression "param_1 + 0xd" identifier + number_literal) )))) = (binary_expression "(bVar3 ^ 1) * '\x02' | bVar1 & 0xfd" (binary_expression "(bVar3 ^ 1) * '\x02'" (parenthesized_expression "(bVar3 ^ 1)" ( (binary_expression "bVar3 ^ 1" identifier ^ number_literal) )) * (char_literal "'\x02'" ' escape_sequence ')) | (binary_expression "bVar1 & 0xfd" identifier & number_literal))) ;) (return_statement "return;" return ;) })))
(translation_unit "void subtract_from_result(expressionS *resultP,offsetT amount,int rhs_highbit)\n\n{\n  byte bVar1;\n  uint uVar2;\n  byte bVar3;\n  \n  uVar2 = resultP->X_add_number;\n  bVar1 = resultP->field_0xd;\n  resultP->X_add_number = uVar2 - amount;\n  bVar3 = (bVar1 >> 1 ^ (byte)rhs_highbit) & 1;\n  if ((uint)amount <= uVar2) {\n    resultP->field_0xd = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }\n  resultP->field_0xd = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;\n  return;\n}\n\n" (function_definition "void subtract_from_result(expressionS *resultP,offsetT amount,int rhs_highbit)\n\n{\n  byte bVar1;\n  uint uVar2;\n  byte bVar3;\n  \n  uVar2 = resultP->X_add_number;\n  bVar1 = resultP->field_0xd;\n  resultP->X_add_number = uVar2 - amount;\n  bVar3 = (bVar1 >> 1 ^ (byte)rhs_highbit) & 1;\n  if ((uint)amount <= uVar2) {\n    resultP->field_0xd = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }\n  resultP->field_0xd = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;\n  return;\n}" primitive_type (function_declarator "subtract_from_result(expressionS *resultP,offsetT amount,int rhs_highbit)" identifier (parameter_list "(expressionS *resultP,offsetT amount,int rhs_highbit)" ( (parameter_declaration "expressionS *resultP" type_identifier (pointer_declarator "*resultP" * identifier)) , (parameter_declaration "offsetT amount" type_identifier identifier) , (parameter_declaration "int rhs_highbit" primitive_type identifier) ))) (compound_statement "{\n  byte bVar1;\n  uint uVar2;\n  byte bVar3;\n  \n  uVar2 = resultP->X_add_number;\n  bVar1 = resultP->field_0xd;\n  resultP->X_add_number = uVar2 - amount;\n  bVar3 = (bVar1 >> 1 ^ (byte)rhs_highbit) & 1;\n  if ((uint)amount <= uVar2) {\n    resultP->field_0xd = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }\n  resultP->field_0xd = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;\n  return;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "byte bVar3;" type_identifier identifier ;) (expression_statement "uVar2 = resultP->X_add_number;" (assignment_expression "uVar2 = resultP->X_add_number" identifier = (field_expression "resultP->X_add_number" identifier -> field_identifier)) ;) (expression_statement "bVar1 = resultP->field_0xd;" (assignment_expression "bVar1 = resultP->field_0xd" identifier = (field_expression "resultP->field_0xd" identifier -> field_identifier)) ;) (expression_statement "resultP->X_add_number = uVar2 - amount;" (assignment_expression "resultP->X_add_number = uVar2 - amount" (field_expression "resultP->X_add_number" identifier -> field_identifier) = (binary_expression "uVar2 - amount" identifier - identifier)) ;) (expression_statement "bVar3 = (bVar1 >> 1 ^ (byte)rhs_highbit) & 1;" (assignment_expression "bVar3 = (bVar1 >> 1 ^ (byte)rhs_highbit) & 1" identifier = (binary_expression "(bVar1 >> 1 ^ (byte)rhs_highbit) & 1" (parenthesized_expression "(bVar1 >> 1 ^ (byte)rhs_highbit)" ( (binary_expression "bVar1 >> 1 ^ (byte)rhs_highbit" (binary_expression "bVar1 >> 1" identifier >> number_literal) ^ (cast_expression "(byte)rhs_highbit" ( (type_descriptor "byte" type_identifier) ) identifier)) )) & number_literal)) ;) (if_statement "if ((uint)amount <= uVar2) {\n    resultP->field_0xd = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }" if (parenthesized_expression "((uint)amount <= uVar2)" ( (binary_expression "(uint)amount <= uVar2" (cast_expression "(uint)amount" ( (type_descriptor "uint" type_identifier) ) identifier) <= identifier) )) (compound_statement "{\n    resultP->field_0xd = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }" { (expression_statement "resultP->field_0xd = bVar1 & 0xfd | bVar3 * '\x02';" (assignment_expression "resultP->field_0xd = bVar1 & 0xfd | bVar3 * '\x02'" (field_expression "resultP->field_0xd" identifier -> field_identifier) = (binary_expression "bVar1 & 0xfd | bVar3 * '\x02'" (binary_expression "bVar1 & 0xfd" identifier & number_literal) | (binary_expression "bVar3 * '\x02'" identifier * (char_literal "'\x02'" ' escape_sequence ')))) ;) (return_statement "return;" return ;) })) (expression_statement "resultP->field_0xd = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;" (assignment_expression "resultP->field_0xd = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd" (field_expression "resultP->field_0xd" identifier -> field_identifier) = (binary_expression "(bVar3 ^ 1) * '\x02' | bVar1 & 0xfd" (binary_expression "(bVar3 ^ 1) * '\x02'" (parenthesized_expression "(bVar3 ^ 1)" ( (binary_expression "bVar3 ^ 1" identifier ^ number_literal) )) * (char_literal "'\x02'" ' escape_sequence ')) | (binary_expression "bVar1 & 0xfd" identifier & number_literal))) ;) (return_statement "return;" return ;) })))
(translation_unit "void FUN_00020d90(int param_1,uint param_2,byte param_3)\n\n{\n  byte bVar1;\n  uint uVar2;\n  byte bVar3;\n  \n  uVar2 = *(uint *)(param_1 + 8);\n  bVar1 = *(byte *)(param_1 + 0xd);\n  *(uint *)(param_1 + 8) = uVar2 - param_2;\n  bVar3 = (bVar1 >> 1 ^ param_3) & 1;\n  if (param_2 <= uVar2) {\n    *(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }\n  *(byte *)(param_1 + 0xd) = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;\n  return;\n}\n\n" (function_definition "void FUN_00020d90(int param_1,uint param_2,byte param_3)\n\n{\n  byte bVar1;\n  uint uVar2;\n  byte bVar3;\n  \n  uVar2 = *(uint *)(param_1 + 8);\n  bVar1 = *(byte *)(param_1 + 0xd);\n  *(uint *)(param_1 + 8) = uVar2 - param_2;\n  bVar3 = (bVar1 >> 1 ^ param_3) & 1;\n  if (param_2 <= uVar2) {\n    *(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }\n  *(byte *)(param_1 + 0xd) = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;\n  return;\n}" primitive_type (function_declarator "FUN_00020d90(int param_1,uint param_2,byte param_3)" identifier (parameter_list "(int param_1,uint param_2,byte param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "byte param_3" type_identifier identifier) ))) (compound_statement "{\n  byte bVar1;\n  uint uVar2;\n  byte bVar3;\n  \n  uVar2 = *(uint *)(param_1 + 8);\n  bVar1 = *(byte *)(param_1 + 0xd);\n  *(uint *)(param_1 + 8) = uVar2 - param_2;\n  bVar3 = (bVar1 >> 1 ^ param_3) & 1;\n  if (param_2 <= uVar2) {\n    *(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }\n  *(byte *)(param_1 + 0xd) = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;\n  return;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "byte bVar3;" type_identifier identifier ;) (expression_statement "uVar2 = *(uint *)(param_1 + 8);" (assignment_expression "uVar2 = *(uint *)(param_1 + 8)" identifier = (pointer_expression "*(uint *)(param_1 + 8)" * (cast_expression "(uint *)(param_1 + 8)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (expression_statement "bVar1 = *(byte *)(param_1 + 0xd);" (assignment_expression "bVar1 = *(byte *)(param_1 + 0xd)" identifier = (pointer_expression "*(byte *)(param_1 + 0xd)" * (cast_expression "(byte *)(param_1 + 0xd)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd)" ( (binary_expression "param_1 + 0xd" identifier + number_literal) ))))) ;) (expression_statement "*(uint *)(param_1 + 8) = uVar2 - param_2;" (assignment_expression "*(uint *)(param_1 + 8) = uVar2 - param_2" (pointer_expression "*(uint *)(param_1 + 8)" * (cast_expression "(uint *)(param_1 + 8)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = (binary_expression "uVar2 - param_2" identifier - identifier)) ;) (expression_statement "bVar3 = (bVar1 >> 1 ^ param_3) & 1;" (assignment_expression "bVar3 = (bVar1 >> 1 ^ param_3) & 1" identifier = (binary_expression "(bVar1 >> 1 ^ param_3) & 1" (parenthesized_expression "(bVar1 >> 1 ^ param_3)" ( (binary_expression "bVar1 >> 1 ^ param_3" (binary_expression "bVar1 >> 1" identifier >> number_literal) ^ identifier) )) & number_literal)) ;) (if_statement "if (param_2 <= uVar2) {\n    *(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }" if (parenthesized_expression "(param_2 <= uVar2)" ( (binary_expression "param_2 <= uVar2" identifier <= identifier) )) (compound_statement "{\n    *(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }" { (expression_statement "*(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';" (assignment_expression "*(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02'" (pointer_expression "*(byte *)(param_1 + 0xd)" * (cast_expression "(byte *)(param_1 + 0xd)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd)" ( (binary_expression "param_1 + 0xd" identifier + number_literal) )))) = (binary_expression "bVar1 & 0xfd | bVar3 * '\x02'" (binary_expression "bVar1 & 0xfd" identifier & number_literal) | (binary_expression "bVar3 * '\x02'" identifier * (char_literal "'\x02'" ' escape_sequence ')))) ;) (return_statement "return;" return ;) })) (expression_statement "*(byte *)(param_1 + 0xd) = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;" (assignment_expression "*(byte *)(param_1 + 0xd) = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd" (pointer_expression "*(byte *)(param_1 + 0xd)" * (cast_expression "(byte *)(param_1 + 0xd)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd)" ( (binary_expression "param_1 + 0xd" identifier + number_literal) )))) = (binary_expression "(bVar3 ^ 1) * '\x02' | bVar1 & 0xfd" (binary_expression "(bVar3 ^ 1) * '\x02'" (parenthesized_expression "(bVar3 ^ 1)" ( (binary_expression "bVar3 ^ 1" identifier ^ number_literal) )) * (char_literal "'\x02'" ' escape_sequence ')) | (binary_expression "bVar1 & 0xfd" identifier & number_literal))) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression IDENT - IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression (binary_expression IDENT >> LIT) ^ IDENT) )) & LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (binary_expression IDENT & LIT) | (binary_expression IDENT * (char_literal ' escape_sequence ')))) ;) (return_statement return ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (binary_expression (parenthesized_expression ( (binary_expression IDENT ^ LIT) )) * (char_literal ' escape_sequence ')) | (binary_expression IDENT & LIT))) ;) (return_statement return ;) })))
(function_definition "void FUN_00020d90(int param_1,uint param_2,byte param_3)\n\n{\n  byte bVar1;\n  uint uVar2;\n  byte bVar3;\n  \n  uVar2 = *(uint *)(param_1 + 8);\n  bVar1 = *(byte *)(param_1 + 0xd);\n  *(uint *)(param_1 + 8) = uVar2 - param_2;\n  bVar3 = (bVar1 >> 1 ^ param_3) & 1;\n  if (param_2 <= uVar2) {\n    *(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }\n  *(byte *)(param_1 + 0xd) = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;\n  return;\n}" (primitive_type "void") (function_declarator "FUN_00020d90(int param_1,uint param_2,byte param_3)" (identifier "FUN_00020d90") (parameter_list "(int param_1,uint param_2,byte param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) (, ",") (parameter_declaration "byte param_3" (type_identifier "byte") (identifier "param_3")) () ")"))) (compound_statement "{\n  byte bVar1;\n  uint uVar2;\n  byte bVar3;\n  \n  uVar2 = *(uint *)(param_1 + 8);\n  bVar1 = *(byte *)(param_1 + 0xd);\n  *(uint *)(param_1 + 8) = uVar2 - param_2;\n  bVar3 = (bVar1 >> 1 ^ param_3) & 1;\n  if (param_2 <= uVar2) {\n    *(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }\n  *(byte *)(param_1 + 0xd) = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;\n  return;\n}" ({ "{") (declaration "byte bVar1;" (type_identifier "byte") (identifier "bVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "byte bVar3;" (type_identifier "byte") (identifier "bVar3") (; ";")) (expression_statement "uVar2 = *(uint *)(param_1 + 8);" (assignment_expression "uVar2 = *(uint *)(param_1 + 8)" (identifier "uVar2") (= "=") (pointer_expression "*(uint *)(param_1 + 8)" (* "*") (cast_expression "(uint *)(param_1 + 8)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")"))))) (; ";")) (expression_statement "bVar1 = *(byte *)(param_1 + 0xd);" (assignment_expression "bVar1 = *(byte *)(param_1 + 0xd)" (identifier "bVar1") (= "=") (pointer_expression "*(byte *)(param_1 + 0xd)" (* "*") (cast_expression "(byte *)(param_1 + 0xd)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xd)" (( "(") (binary_expression "param_1 + 0xd" (identifier "param_1") (+ "+") (number_literal "0xd")) () ")"))))) (; ";")) (expression_statement "*(uint *)(param_1 + 8) = uVar2 - param_2;" (assignment_expression "*(uint *)(param_1 + 8) = uVar2 - param_2" (pointer_expression "*(uint *)(param_1 + 8)" (* "*") (cast_expression "(uint *)(param_1 + 8)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (= "=") (binary_expression "uVar2 - param_2" (identifier "uVar2") (- "-") (identifier "param_2"))) (; ";")) (expression_statement "bVar3 = (bVar1 >> 1 ^ param_3) & 1;" (assignment_expression "bVar3 = (bVar1 >> 1 ^ param_3) & 1" (identifier "bVar3") (= "=") (binary_expression "(bVar1 >> 1 ^ param_3) & 1" (parenthesized_expression "(bVar1 >> 1 ^ param_3)" (( "(") (binary_expression "bVar1 >> 1 ^ param_3" (binary_expression "bVar1 >> 1" (identifier "bVar1") (>> ">>") (number_literal "1")) (^ "^") (identifier "param_3")) () ")")) (& "&") (number_literal "1"))) (; ";")) (if_statement "if (param_2 <= uVar2) {\n    *(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }" (if "if") (parenthesized_expression "(param_2 <= uVar2)" (( "(") (binary_expression "param_2 <= uVar2" (identifier "param_2") (<= "<=") (identifier "uVar2")) () ")")) (compound_statement "{\n    *(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';\n    return;\n  }" ({ "{") (expression_statement "*(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';" (assignment_expression "*(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02'" (pointer_expression "*(byte *)(param_1 + 0xd)" (* "*") (cast_expression "(byte *)(param_1 + 0xd)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xd)" (( "(") (binary_expression "param_1 + 0xd" (identifier "param_1") (+ "+") (number_literal "0xd")) () ")")))) (= "=") (binary_expression "bVar1 & 0xfd | bVar3 * '\x02'" (binary_expression "bVar1 & 0xfd" (identifier "bVar1") (& "&") (number_literal "0xfd")) (| "|") (binary_expression "bVar3 * '\x02'" (identifier "bVar3") (* "*") (char_literal "'\x02'" (' "'") (escape_sequence "\x02") (' "'"))))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "*(byte *)(param_1 + 0xd) = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;" (assignment_expression "*(byte *)(param_1 + 0xd) = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd" (pointer_expression "*(byte *)(param_1 + 0xd)" (* "*") (cast_expression "(byte *)(param_1 + 0xd)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xd)" (( "(") (binary_expression "param_1 + 0xd" (identifier "param_1") (+ "+") (number_literal "0xd")) () ")")))) (= "=") (binary_expression "(bVar3 ^ 1) * '\x02' | bVar1 & 0xfd" (binary_expression "(bVar3 ^ 1) * '\x02'" (parenthesized_expression "(bVar3 ^ 1)" (( "(") (binary_expression "bVar3 ^ 1" (identifier "bVar3") (^ "^") (number_literal "1")) () ")")) (* "*") (char_literal "'\x02'" (' "'") (escape_sequence "\x02") (' "'"))) (| "|") (binary_expression "bVar1 & 0xfd" (identifier "bVar1") (& "&") (number_literal "0xfd")))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

void function_1(type_1 *resultP,type_2 var_2,int rhs_highbit)

{
  type_3 var_3;
  type_4 var_1;
  type_3 var_4;
  
  var_1 = resultP->X_add_number;
  var_3 = resultP->field_0xd;
  resultP->X_add_number = var_1 - var_2;
  var_4 = (var_3 >> 1 ^ (type_3)rhs_highbit) & 1;
  if ((type_4)var_2 <= var_1) {
    resultP->field_0xd = var_3 & 0xfd | var_4 * '\x02';
    return;
  }
  resultP->field_0xd = (var_4 ^ 1) * '\x02' | var_3 & 0xfd;
  return;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (binary_expression left: (identifier) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (identifier))) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (binary_expression left: (identifier) right: (char_literal (escape_sequence)))))) (return_statement))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (char_literal (escape_sequence))) right: (binary_expression left: (identifier) right: (number_literal))))) (return_statement))))

void MASKED(int param_1,uint param_2,byte param_3)

{
  byte bVar1;
  uint uVar2;
  byte bVar3;
  
  uVar2 = *(uint *)(param_1 + 8);
  bVar1 = *(byte *)(param_1 + 0xd);
  *(uint *)(param_1 + 8) = uVar2 - param_2;
  bVar3 = (bVar1 >> 1 ^ param_3) & 1;
  if (param_2 <= uVar2) {
    *(byte *)(param_1 + 0xd) = bVar1 & 0xfd | bVar3 * '\x02';
    return;
  }
  *(byte *)(param_1 + 0xd) = (bVar3 ^ 1) * '\x02' | bVar1 & 0xfd;
  return;
}

