
/* WARNING: Unknown calling convention */

int i_ring_push(I_ring *ir,int val)

{
  int iVar1;
  uint uVar2;
  uint uVar3;
  
  uVar3 = (uint)(ir->ir_empty ^ 1);
  uVar2 = ir->ir_front + uVar3 & 3;
  iVar1 = ir->ir_data[uVar2];
  ir->ir_data[uVar2] = val;
  ir->ir_front = uVar2;
  if (ir->ir_back == uVar2) {
    ir->ir_back = uVar3 + ir->ir_back & 3;
  }
  ir->ir_empty = false;
  return iVar1;
}



undefined4 FUN_0001b040(int param_1,undefined4 param_2)

{
  undefined4 *puVar1;
  undefined4 uVar2;
  uint uVar3;
  uint uVar4;
  
  uVar4 = (uint)(*(byte *)(param_1 + 0x1c) ^ 1);
  uVar3 = *(int *)(param_1 + 0x14) + uVar4 & 3;
  puVar1 = (undefined4 *)(param_1 + uVar3 * 4);
  uVar2 = *puVar1;
  *puVar1 = param_2;
  *(uint *)(param_1 + 0x14) = uVar3;
  if (*(uint *)(param_1 + 0x18) == uVar3) {
    *(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;
  }
  *(undefined1 *)(param_1 + 0x1c) = 0;
  return uVar2;
}


PUSH EDI
PUSH ESI
PUSH EBX
MOV EBX,dword ptr [ESP + 0x10]
MOV EDI,dword ptr [ESP + 0x14]
MOVZX EDX,byte ptr [EBX + 0x1c]
MOV ECX,dword ptr [EBX + 0x14]
XOR EDX,0x1
MOVZX EDX,DL
ADD ECX,EDX
AND ECX,0x3
LEA ESI,[EBX + ECX*0x4]
MOV EAX,dword ptr [ESI]
MOV dword ptr [ESI],EDI
MOV ESI,dword ptr [EBX + 0x18]
MOV dword ptr [EBX + 0x14],ECX
CMP ESI,ECX
JNZ 0x0001b076
ADD EDX,ESI
AND EDX,0x3
MOV dword ptr [EBX + 0x18],EDX
MOV byte ptr [EBX + 0x1c],0x0
POP EBX
POP ESI
POP EDI
RET
(translation_unit "undefined4 FUN_0001b040(int param_1,undefined4 param_2)\n\n{\n  undefined4 *puVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar4 = (uint)(*(byte *)(param_1 + 0x1c) ^ 1);\n  uVar3 = *(int *)(param_1 + 0x14) + uVar4 & 3;\n  puVar1 = (undefined4 *)(param_1 + uVar3 * 4);\n  uVar2 = *puVar1;\n  *puVar1 = param_2;\n  *(uint *)(param_1 + 0x14) = uVar3;\n  if (*(uint *)(param_1 + 0x18) == uVar3) {\n    *(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;\n  }\n  *(undefined1 *)(param_1 + 0x1c) = 0;\n  return uVar2;\n}\n\n" (function_definition "undefined4 FUN_0001b040(int param_1,undefined4 param_2)\n\n{\n  undefined4 *puVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar4 = (uint)(*(byte *)(param_1 + 0x1c) ^ 1);\n  uVar3 = *(int *)(param_1 + 0x14) + uVar4 & 3;\n  puVar1 = (undefined4 *)(param_1 + uVar3 * 4);\n  uVar2 = *puVar1;\n  *puVar1 = param_2;\n  *(uint *)(param_1 + 0x14) = uVar3;\n  if (*(uint *)(param_1 + 0x18) == uVar3) {\n    *(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;\n  }\n  *(undefined1 *)(param_1 + 0x1c) = 0;\n  return uVar2;\n}" type_identifier (function_declarator "FUN_0001b040(int param_1,undefined4 param_2)" identifier (parameter_list "(int param_1,undefined4 param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar4 = (uint)(*(byte *)(param_1 + 0x1c) ^ 1);\n  uVar3 = *(int *)(param_1 + 0x14) + uVar4 & 3;\n  puVar1 = (undefined4 *)(param_1 + uVar3 * 4);\n  uVar2 = *puVar1;\n  *puVar1 = param_2;\n  *(uint *)(param_1 + 0x14) = uVar3;\n  if (*(uint *)(param_1 + 0x18) == uVar3) {\n    *(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;\n  }\n  *(undefined1 *)(param_1 + 0x1c) = 0;\n  return uVar2;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "uVar4 = (uint)(*(byte *)(param_1 + 0x1c) ^ 1);" (assignment_expression "uVar4 = (uint)(*(byte *)(param_1 + 0x1c) ^ 1)" identifier = (call_expression "(uint)(*(byte *)(param_1 + 0x1c) ^ 1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(*(byte *)(param_1 + 0x1c) ^ 1)" ( (binary_expression "*(byte *)(param_1 + 0x1c) ^ 1" (pointer_expression "*(byte *)(param_1 + 0x1c)" * (cast_expression "(byte *)(param_1 + 0x1c)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) )))) ^ number_literal) )))) ;) (expression_statement "uVar3 = *(int *)(param_1 + 0x14) + uVar4 & 3;" (assignment_expression "uVar3 = *(int *)(param_1 + 0x14) + uVar4 & 3" identifier = (binary_expression "*(int *)(param_1 + 0x14) + uVar4 & 3" (binary_expression "*(int *)(param_1 + 0x14) + uVar4" (pointer_expression "*(int *)(param_1 + 0x14)" * (cast_expression "(int *)(param_1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) + identifier) & number_literal)) ;) (expression_statement "puVar1 = (undefined4 *)(param_1 + uVar3 * 4);" (assignment_expression "puVar1 = (undefined4 *)(param_1 + uVar3 * 4)" identifier = (cast_expression "(undefined4 *)(param_1 + uVar3 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + uVar3 * 4)" ( (binary_expression "param_1 + uVar3 * 4" identifier + (binary_expression "uVar3 * 4" identifier * number_literal)) )))) ;) (expression_statement "uVar2 = *puVar1;" (assignment_expression "uVar2 = *puVar1" identifier = (pointer_expression "*puVar1" * identifier)) ;) (expression_statement "*puVar1 = param_2;" (assignment_expression "*puVar1 = param_2" (pointer_expression "*puVar1" * identifier) = identifier) ;) (expression_statement "*(uint *)(param_1 + 0x14) = uVar3;" (assignment_expression "*(uint *)(param_1 + 0x14) = uVar3" (pointer_expression "*(uint *)(param_1 + 0x14)" * (cast_expression "(uint *)(param_1 + 0x14)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) = identifier) ;) (if_statement "if (*(uint *)(param_1 + 0x18) == uVar3) {\n    *(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;\n  }" if (parenthesized_expression "(*(uint *)(param_1 + 0x18) == uVar3)" ( (binary_expression "*(uint *)(param_1 + 0x18) == uVar3" (pointer_expression "*(uint *)(param_1 + 0x18)" * (cast_expression "(uint *)(param_1 + 0x18)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) )))) == identifier) )) (compound_statement "{\n    *(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;\n  }" { (expression_statement "*(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;" (assignment_expression "*(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3" (pointer_expression "*(uint *)(param_1 + 0x18)" * (cast_expression "(uint *)(param_1 + 0x18)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) )))) = (binary_expression "uVar4 + *(uint *)(param_1 + 0x18) & 3" (binary_expression "uVar4 + *(uint *)(param_1 + 0x18)" identifier + (pointer_expression "*(uint *)(param_1 + 0x18)" * (cast_expression "(uint *)(param_1 + 0x18)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) ))))) & number_literal)) ;) })) (expression_statement "*(undefined1 *)(param_1 + 0x1c) = 0;" (assignment_expression "*(undefined1 *)(param_1 + 0x1c) = 0" (pointer_expression "*(undefined1 *)(param_1 + 0x1c)" * (cast_expression "(undefined1 *)(param_1 + 0x1c)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) )))) = number_literal) ;) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit "/* WARNING: Unknown calling convention */\n\nint i_ring_push(I_ring *ir,int val)\n\n{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar3 = (uint)(ir->ir_empty ^ 1);\n  uVar2 = ir->ir_front + uVar3 & 3;\n  iVar1 = ir->ir_data[uVar2];\n  ir->ir_data[uVar2] = val;\n  ir->ir_front = uVar2;\n  if (ir->ir_back == uVar2) {\n    ir->ir_back = uVar3 + ir->ir_back & 3;\n  }\n  ir->ir_empty = false;\n  return iVar1;\n}\n\n" comment (function_definition "int i_ring_push(I_ring *ir,int val)\n\n{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar3 = (uint)(ir->ir_empty ^ 1);\n  uVar2 = ir->ir_front + uVar3 & 3;\n  iVar1 = ir->ir_data[uVar2];\n  ir->ir_data[uVar2] = val;\n  ir->ir_front = uVar2;\n  if (ir->ir_back == uVar2) {\n    ir->ir_back = uVar3 + ir->ir_back & 3;\n  }\n  ir->ir_empty = false;\n  return iVar1;\n}" primitive_type (function_declarator "i_ring_push(I_ring *ir,int val)" identifier (parameter_list "(I_ring *ir,int val)" ( (parameter_declaration "I_ring *ir" type_identifier (pointer_declarator "*ir" * identifier)) , (parameter_declaration "int val" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar3 = (uint)(ir->ir_empty ^ 1);\n  uVar2 = ir->ir_front + uVar3 & 3;\n  iVar1 = ir->ir_data[uVar2];\n  ir->ir_data[uVar2] = val;\n  ir->ir_front = uVar2;\n  if (ir->ir_back == uVar2) {\n    ir->ir_back = uVar3 + ir->ir_back & 3;\n  }\n  ir->ir_empty = false;\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "uVar3 = (uint)(ir->ir_empty ^ 1);" (assignment_expression "uVar3 = (uint)(ir->ir_empty ^ 1)" identifier = (call_expression "(uint)(ir->ir_empty ^ 1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(ir->ir_empty ^ 1)" ( (binary_expression "ir->ir_empty ^ 1" (field_expression "ir->ir_empty" identifier -> field_identifier) ^ number_literal) )))) ;) (expression_statement "uVar2 = ir->ir_front + uVar3 & 3;" (assignment_expression "uVar2 = ir->ir_front + uVar3 & 3" identifier = (binary_expression "ir->ir_front + uVar3 & 3" (binary_expression "ir->ir_front + uVar3" (field_expression "ir->ir_front" identifier -> field_identifier) + identifier) & number_literal)) ;) (expression_statement "iVar1 = ir->ir_data[uVar2];" (assignment_expression "iVar1 = ir->ir_data[uVar2]" identifier = (subscript_expression "ir->ir_data[uVar2]" (field_expression "ir->ir_data" identifier -> field_identifier) [ identifier ])) ;) (expression_statement "ir->ir_data[uVar2] = val;" (assignment_expression "ir->ir_data[uVar2] = val" (subscript_expression "ir->ir_data[uVar2]" (field_expression "ir->ir_data" identifier -> field_identifier) [ identifier ]) = identifier) ;) (expression_statement "ir->ir_front = uVar2;" (assignment_expression "ir->ir_front = uVar2" (field_expression "ir->ir_front" identifier -> field_identifier) = identifier) ;) (if_statement "if (ir->ir_back == uVar2) {\n    ir->ir_back = uVar3 + ir->ir_back & 3;\n  }" if (parenthesized_expression "(ir->ir_back == uVar2)" ( (binary_expression "ir->ir_back == uVar2" (field_expression "ir->ir_back" identifier -> field_identifier) == identifier) )) (compound_statement "{\n    ir->ir_back = uVar3 + ir->ir_back & 3;\n  }" { (expression_statement "ir->ir_back = uVar3 + ir->ir_back & 3;" (assignment_expression "ir->ir_back = uVar3 + ir->ir_back & 3" (field_expression "ir->ir_back" identifier -> field_identifier) = (binary_expression "uVar3 + ir->ir_back & 3" (binary_expression "uVar3 + ir->ir_back" identifier + (field_expression "ir->ir_back" identifier -> field_identifier)) & number_literal)) ;) })) (expression_statement "ir->ir_empty = false;" (assignment_expression "ir->ir_empty = false" (field_expression "ir->ir_empty" identifier -> field_identifier) = false) ;) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "undefined4 FUN_0001b040(int param_1,undefined4 param_2)\n\n{\n  undefined4 *puVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar4 = (uint)(*(byte *)(param_1 + 0x1c) ^ 1);\n  uVar3 = *(int *)(param_1 + 0x14) + uVar4 & 3;\n  puVar1 = (undefined4 *)(param_1 + uVar3 * 4);\n  uVar2 = *puVar1;\n  *puVar1 = param_2;\n  *(uint *)(param_1 + 0x14) = uVar3;\n  if (*(uint *)(param_1 + 0x18) == uVar3) {\n    *(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;\n  }\n  *(undefined1 *)(param_1 + 0x1c) = 0;\n  return uVar2;\n}\n\n" (function_definition "undefined4 FUN_0001b040(int param_1,undefined4 param_2)\n\n{\n  undefined4 *puVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar4 = (uint)(*(byte *)(param_1 + 0x1c) ^ 1);\n  uVar3 = *(int *)(param_1 + 0x14) + uVar4 & 3;\n  puVar1 = (undefined4 *)(param_1 + uVar3 * 4);\n  uVar2 = *puVar1;\n  *puVar1 = param_2;\n  *(uint *)(param_1 + 0x14) = uVar3;\n  if (*(uint *)(param_1 + 0x18) == uVar3) {\n    *(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;\n  }\n  *(undefined1 *)(param_1 + 0x1c) = 0;\n  return uVar2;\n}" type_identifier (function_declarator "FUN_0001b040(int param_1,undefined4 param_2)" identifier (parameter_list "(int param_1,undefined4 param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar4 = (uint)(*(byte *)(param_1 + 0x1c) ^ 1);\n  uVar3 = *(int *)(param_1 + 0x14) + uVar4 & 3;\n  puVar1 = (undefined4 *)(param_1 + uVar3 * 4);\n  uVar2 = *puVar1;\n  *puVar1 = param_2;\n  *(uint *)(param_1 + 0x14) = uVar3;\n  if (*(uint *)(param_1 + 0x18) == uVar3) {\n    *(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;\n  }\n  *(undefined1 *)(param_1 + 0x1c) = 0;\n  return uVar2;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "uVar4 = (uint)(*(byte *)(param_1 + 0x1c) ^ 1);" (assignment_expression "uVar4 = (uint)(*(byte *)(param_1 + 0x1c) ^ 1)" identifier = (call_expression "(uint)(*(byte *)(param_1 + 0x1c) ^ 1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(*(byte *)(param_1 + 0x1c) ^ 1)" ( (binary_expression "*(byte *)(param_1 + 0x1c) ^ 1" (pointer_expression "*(byte *)(param_1 + 0x1c)" * (cast_expression "(byte *)(param_1 + 0x1c)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) )))) ^ number_literal) )))) ;) (expression_statement "uVar3 = *(int *)(param_1 + 0x14) + uVar4 & 3;" (assignment_expression "uVar3 = *(int *)(param_1 + 0x14) + uVar4 & 3" identifier = (binary_expression "*(int *)(param_1 + 0x14) + uVar4 & 3" (binary_expression "*(int *)(param_1 + 0x14) + uVar4" (pointer_expression "*(int *)(param_1 + 0x14)" * (cast_expression "(int *)(param_1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) + identifier) & number_literal)) ;) (expression_statement "puVar1 = (undefined4 *)(param_1 + uVar3 * 4);" (assignment_expression "puVar1 = (undefined4 *)(param_1 + uVar3 * 4)" identifier = (cast_expression "(undefined4 *)(param_1 + uVar3 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + uVar3 * 4)" ( (binary_expression "param_1 + uVar3 * 4" identifier + (binary_expression "uVar3 * 4" identifier * number_literal)) )))) ;) (expression_statement "uVar2 = *puVar1;" (assignment_expression "uVar2 = *puVar1" identifier = (pointer_expression "*puVar1" * identifier)) ;) (expression_statement "*puVar1 = param_2;" (assignment_expression "*puVar1 = param_2" (pointer_expression "*puVar1" * identifier) = identifier) ;) (expression_statement "*(uint *)(param_1 + 0x14) = uVar3;" (assignment_expression "*(uint *)(param_1 + 0x14) = uVar3" (pointer_expression "*(uint *)(param_1 + 0x14)" * (cast_expression "(uint *)(param_1 + 0x14)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) = identifier) ;) (if_statement "if (*(uint *)(param_1 + 0x18) == uVar3) {\n    *(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;\n  }" if (parenthesized_expression "(*(uint *)(param_1 + 0x18) == uVar3)" ( (binary_expression "*(uint *)(param_1 + 0x18) == uVar3" (pointer_expression "*(uint *)(param_1 + 0x18)" * (cast_expression "(uint *)(param_1 + 0x18)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) )))) == identifier) )) (compound_statement "{\n    *(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;\n  }" { (expression_statement "*(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;" (assignment_expression "*(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3" (pointer_expression "*(uint *)(param_1 + 0x18)" * (cast_expression "(uint *)(param_1 + 0x18)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) )))) = (binary_expression "uVar4 + *(uint *)(param_1 + 0x18) & 3" (binary_expression "uVar4 + *(uint *)(param_1 + 0x18)" identifier + (pointer_expression "*(uint *)(param_1 + 0x18)" * (cast_expression "(uint *)(param_1 + 0x18)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) ))))) & number_literal)) ;) })) (expression_statement "*(undefined1 *)(param_1 + 0x1c) = 0;" (assignment_expression "*(undefined1 *)(param_1 + 0x1c) = 0" (pointer_expression "*(undefined1 *)(param_1 + 0x1c)" * (cast_expression "(undefined1 *)(param_1 + 0x1c)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) )))) = number_literal) ;) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ^ LIT) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + IDENT) & LIT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == 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 + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) & LIT)) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (return_statement return IDENT ;) })))
(function_definition "undefined4 FUN_0001b040(int param_1,undefined4 param_2)\n\n{\n  undefined4 *puVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar4 = (uint)(*(byte *)(param_1 + 0x1c) ^ 1);\n  uVar3 = *(int *)(param_1 + 0x14) + uVar4 & 3;\n  puVar1 = (undefined4 *)(param_1 + uVar3 * 4);\n  uVar2 = *puVar1;\n  *puVar1 = param_2;\n  *(uint *)(param_1 + 0x14) = uVar3;\n  if (*(uint *)(param_1 + 0x18) == uVar3) {\n    *(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;\n  }\n  *(undefined1 *)(param_1 + 0x1c) = 0;\n  return uVar2;\n}" (type_identifier "undefined4") (function_declarator "FUN_0001b040(int param_1,undefined4 param_2)" (identifier "FUN_0001b040") (parameter_list "(int param_1,undefined4 param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) () ")"))) (compound_statement "{\n  undefined4 *puVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar4 = (uint)(*(byte *)(param_1 + 0x1c) ^ 1);\n  uVar3 = *(int *)(param_1 + 0x14) + uVar4 & 3;\n  puVar1 = (undefined4 *)(param_1 + uVar3 * 4);\n  uVar2 = *puVar1;\n  *puVar1 = param_2;\n  *(uint *)(param_1 + 0x14) = uVar3;\n  if (*(uint *)(param_1 + 0x18) == uVar3) {\n    *(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;\n  }\n  *(undefined1 *)(param_1 + 0x1c) = 0;\n  return uVar2;\n}" ({ "{") (declaration "undefined4 *puVar1;" (type_identifier "undefined4") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (expression_statement "uVar4 = (uint)(*(byte *)(param_1 + 0x1c) ^ 1);" (assignment_expression "uVar4 = (uint)(*(byte *)(param_1 + 0x1c) ^ 1)" (identifier "uVar4") (= "=") (call_expression "(uint)(*(byte *)(param_1 + 0x1c) ^ 1)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(*(byte *)(param_1 + 0x1c) ^ 1)" (( "(") (binary_expression "*(byte *)(param_1 + 0x1c) ^ 1" (pointer_expression "*(byte *)(param_1 + 0x1c)" (* "*") (cast_expression "(byte *)(param_1 + 0x1c)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1c)" (( "(") (binary_expression "param_1 + 0x1c" (identifier "param_1") (+ "+") (number_literal "0x1c")) () ")")))) (^ "^") (number_literal "1")) () ")")))) (; ";")) (expression_statement "uVar3 = *(int *)(param_1 + 0x14) + uVar4 & 3;" (assignment_expression "uVar3 = *(int *)(param_1 + 0x14) + uVar4 & 3" (identifier "uVar3") (= "=") (binary_expression "*(int *)(param_1 + 0x14) + uVar4 & 3" (binary_expression "*(int *)(param_1 + 0x14) + uVar4" (pointer_expression "*(int *)(param_1 + 0x14)" (* "*") (cast_expression "(int *)(param_1 + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")")))) (+ "+") (identifier "uVar4")) (& "&") (number_literal "3"))) (; ";")) (expression_statement "puVar1 = (undefined4 *)(param_1 + uVar3 * 4);" (assignment_expression "puVar1 = (undefined4 *)(param_1 + uVar3 * 4)" (identifier "puVar1") (= "=") (cast_expression "(undefined4 *)(param_1 + uVar3 * 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + uVar3 * 4)" (( "(") (binary_expression "param_1 + uVar3 * 4" (identifier "param_1") (+ "+") (binary_expression "uVar3 * 4" (identifier "uVar3") (* "*") (number_literal "4"))) () ")")))) (; ";")) (expression_statement "uVar2 = *puVar1;" (assignment_expression "uVar2 = *puVar1" (identifier "uVar2") (= "=") (pointer_expression "*puVar1" (* "*") (identifier "puVar1"))) (; ";")) (expression_statement "*puVar1 = param_2;" (assignment_expression "*puVar1 = param_2" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (= "=") (identifier "param_2")) (; ";")) (expression_statement "*(uint *)(param_1 + 0x14) = uVar3;" (assignment_expression "*(uint *)(param_1 + 0x14) = uVar3" (pointer_expression "*(uint *)(param_1 + 0x14)" (* "*") (cast_expression "(uint *)(param_1 + 0x14)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")")))) (= "=") (identifier "uVar3")) (; ";")) (if_statement "if (*(uint *)(param_1 + 0x18) == uVar3) {\n    *(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;\n  }" (if "if") (parenthesized_expression "(*(uint *)(param_1 + 0x18) == uVar3)" (( "(") (binary_expression "*(uint *)(param_1 + 0x18) == uVar3" (pointer_expression "*(uint *)(param_1 + 0x18)" (* "*") (cast_expression "(uint *)(param_1 + 0x18)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x18)" (( "(") (binary_expression "param_1 + 0x18" (identifier "param_1") (+ "+") (number_literal "0x18")) () ")")))) (== "==") (identifier "uVar3")) () ")")) (compound_statement "{\n    *(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;\n  }" ({ "{") (expression_statement "*(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;" (assignment_expression "*(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3" (pointer_expression "*(uint *)(param_1 + 0x18)" (* "*") (cast_expression "(uint *)(param_1 + 0x18)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x18)" (( "(") (binary_expression "param_1 + 0x18" (identifier "param_1") (+ "+") (number_literal "0x18")) () ")")))) (= "=") (binary_expression "uVar4 + *(uint *)(param_1 + 0x18) & 3" (binary_expression "uVar4 + *(uint *)(param_1 + 0x18)" (identifier "uVar4") (+ "+") (pointer_expression "*(uint *)(param_1 + 0x18)" (* "*") (cast_expression "(uint *)(param_1 + 0x18)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x18)" (( "(") (binary_expression "param_1 + 0x18" (identifier "param_1") (+ "+") (number_literal "0x18")) () ")"))))) (& "&") (number_literal "3"))) (; ";")) (} "}"))) (expression_statement "*(undefined1 *)(param_1 + 0x1c) = 0;" (assignment_expression "*(undefined1 *)(param_1 + 0x1c) = 0" (pointer_expression "*(undefined1 *)(param_1 + 0x1c)" (* "*") (cast_expression "(undefined1 *)(param_1 + 0x1c)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1c)" (( "(") (binary_expression "param_1 + 0x1c" (identifier "param_1") (+ "+") (number_literal "0x1c")) () ")")))) (= "=") (number_literal "0")) (; ";")) (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}")))

/* WARNING: Unknown calling convention */

int function_1(type_1 *ir,int val)

{
  int iVar1;
  type_2 var_2;
  type_2 var_1;
  
  var_1 = (type_2)(ir->ir_empty ^ 1);
  var_2 = ir->ir_front + var_1 & 3;
  iVar1 = ir->ir_data[var_2];
  ir->ir_data[var_2] = val;
  ir->ir_front = var_2;
  if (ir->ir_back == var_2) {
    ir->ir_back = var_1 + ir->ir_back & 3;
  }
  ir->ir_empty = false;
  return iVar1;
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (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: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (binary_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: (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier)) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (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: (identifier))) (if_statement condition: (parenthesized_expression (binary_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: (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: (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: (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: (number_literal))) (return_statement (identifier)))))

undefined4 MASKED(int param_1,undefined4 param_2)

{
  undefined4 *puVar1;
  undefined4 uVar2;
  uint uVar3;
  uint uVar4;
  
  uVar4 = (uint)(*(byte *)(param_1 + 0x1c) ^ 1);
  uVar3 = *(int *)(param_1 + 0x14) + uVar4 & 3;
  puVar1 = (undefined4 *)(param_1 + uVar3 * 4);
  uVar2 = *puVar1;
  *puVar1 = param_2;
  *(uint *)(param_1 + 0x14) = uVar3;
  if (*(uint *)(param_1 + 0x18) == uVar3) {
    *(uint *)(param_1 + 0x18) = uVar4 + *(uint *)(param_1 + 0x18) & 3;
  }
  *(undefined1 *)(param_1 + 0x1c) = 0;
  return uVar2;
}

