
int i_ring_push(I_ring *ir,int val)

{
  int iVar1;
  uint uVar2;
  uint uVar3;
  
  uVar3 = ir->ir_empty ^ 1;
  uVar2 = uVar3 + ir->ir_front & 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 i_ring_push(int param_1,undefined4 param_2)

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


lbu a2,0x1c(a0)
xori a2,a2,0x1
lw v1,0x14(a0)
addu v1,a2,v1
andi v1,v1,0x3
sll a3,v1,0x2
addu a3,a0,a3
lw v0,0x0(a3)
sw a1,0x0(a3)
sw v1,0x14(a0)
lw a1,0x18(a0)
beq a1,v1,0x0002094c
_addu a2,a2,a1
jr ra
_sb zero,0x1c(a0)
andi a2,a2,0x3
b 0x00020944
_sw a2,0x18(a0)
(translation_unit "undefined4 i_ring_push(int param_1,undefined4 param_2)\n\n{\n  undefined4 uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined4 *puVar4;\n  \n  uVar3 = *(byte *)(param_1 + 0x1c) ^ 1;\n  uVar2 = uVar3 + *(int *)(param_1 + 0x14) & 3;\n  puVar4 = (undefined4 *)(param_1 + uVar2 * 4);\n  uVar1 = *puVar4;\n  *puVar4 = param_2;\n  *(uint *)(param_1 + 0x14) = uVar2;\n  if (*(uint *)(param_1 + 0x18) == uVar2) {\n    *(uint *)(param_1 + 0x18) = uVar3 + *(uint *)(param_1 + 0x18) & 3;\n  }\n  *(undefined1 *)(param_1 + 0x1c) = 0;\n  return uVar1;\n}\n\n" (function_definition "undefined4 i_ring_push(int param_1,undefined4 param_2)\n\n{\n  undefined4 uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined4 *puVar4;\n  \n  uVar3 = *(byte *)(param_1 + 0x1c) ^ 1;\n  uVar2 = uVar3 + *(int *)(param_1 + 0x14) & 3;\n  puVar4 = (undefined4 *)(param_1 + uVar2 * 4);\n  uVar1 = *puVar4;\n  *puVar4 = param_2;\n  *(uint *)(param_1 + 0x14) = uVar2;\n  if (*(uint *)(param_1 + 0x18) == uVar2) {\n    *(uint *)(param_1 + 0x18) = uVar3 + *(uint *)(param_1 + 0x18) & 3;\n  }\n  *(undefined1 *)(param_1 + 0x1c) = 0;\n  return uVar1;\n}" type_identifier (function_declarator "i_ring_push(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 uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined4 *puVar4;\n  \n  uVar3 = *(byte *)(param_1 + 0x1c) ^ 1;\n  uVar2 = uVar3 + *(int *)(param_1 + 0x14) & 3;\n  puVar4 = (undefined4 *)(param_1 + uVar2 * 4);\n  uVar1 = *puVar4;\n  *puVar4 = param_2;\n  *(uint *)(param_1 + 0x14) = uVar2;\n  if (*(uint *)(param_1 + 0x18) == uVar2) {\n    *(uint *)(param_1 + 0x18) = uVar3 + *(uint *)(param_1 + 0x18) & 3;\n  }\n  *(undefined1 *)(param_1 + 0x1c) = 0;\n  return uVar1;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "undefined4 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (expression_statement "uVar3 = *(byte *)(param_1 + 0x1c) ^ 1;" (assignment_expression "uVar3 = *(byte *)(param_1 + 0x1c) ^ 1" identifier = (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 "uVar2 = uVar3 + *(int *)(param_1 + 0x14) & 3;" (assignment_expression "uVar2 = uVar3 + *(int *)(param_1 + 0x14) & 3" identifier = (binary_expression "uVar3 + *(int *)(param_1 + 0x14) & 3" (binary_expression "uVar3 + *(int *)(param_1 + 0x14)" identifier + (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) ))))) & number_literal)) ;) (expression_statement "puVar4 = (undefined4 *)(param_1 + uVar2 * 4);" (assignment_expression "puVar4 = (undefined4 *)(param_1 + uVar2 * 4)" identifier = (cast_expression "(undefined4 *)(param_1 + uVar2 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + uVar2 * 4)" ( (binary_expression "param_1 + uVar2 * 4" identifier + (binary_expression "uVar2 * 4" identifier * number_literal)) )))) ;) (expression_statement "uVar1 = *puVar4;" (assignment_expression "uVar1 = *puVar4" identifier = (pointer_expression "*puVar4" * identifier)) ;) (expression_statement "*puVar4 = param_2;" (assignment_expression "*puVar4 = param_2" (pointer_expression "*puVar4" * identifier) = identifier) ;) (expression_statement "*(uint *)(param_1 + 0x14) = uVar2;" (assignment_expression "*(uint *)(param_1 + 0x14) = uVar2" (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) == uVar2) {\n    *(uint *)(param_1 + 0x18) = uVar3 + *(uint *)(param_1 + 0x18) & 3;\n  }" if (parenthesized_expression "(*(uint *)(param_1 + 0x18) == uVar2)" ( (binary_expression "*(uint *)(param_1 + 0x18) == uVar2" (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) = uVar3 + *(uint *)(param_1 + 0x18) & 3;\n  }" { (expression_statement "*(uint *)(param_1 + 0x18) = uVar3 + *(uint *)(param_1 + 0x18) & 3;" (assignment_expression "*(uint *)(param_1 + 0x18) = uVar3 + *(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 "uVar3 + *(uint *)(param_1 + 0x18) & 3" (binary_expression "uVar3 + *(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 uVar1;" return identifier ;) })))
(translation_unit "int i_ring_push(I_ring *ir,int val)\n\n{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar3 = ir->ir_empty ^ 1;\n  uVar2 = uVar3 + ir->ir_front & 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" (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 = ir->ir_empty ^ 1;\n  uVar2 = uVar3 + ir->ir_front & 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 = ir->ir_empty ^ 1;\n  uVar2 = uVar3 + ir->ir_front & 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 = ir->ir_empty ^ 1;" (assignment_expression "uVar3 = ir->ir_empty ^ 1" identifier = (binary_expression "ir->ir_empty ^ 1" (field_expression "ir->ir_empty" identifier -> field_identifier) ^ number_literal)) ;) (expression_statement "uVar2 = uVar3 + ir->ir_front & 3;" (assignment_expression "uVar2 = uVar3 + ir->ir_front & 3" identifier = (binary_expression "uVar3 + ir->ir_front & 3" (binary_expression "uVar3 + ir->ir_front" identifier + (field_expression "ir->ir_front" identifier -> field_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 i_ring_push(int param_1,undefined4 param_2)\n\n{\n  undefined4 uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined4 *puVar4;\n  \n  uVar3 = *(byte *)(param_1 + 0x1c) ^ 1;\n  uVar2 = uVar3 + *(int *)(param_1 + 0x14) & 3;\n  puVar4 = (undefined4 *)(param_1 + uVar2 * 4);\n  uVar1 = *puVar4;\n  *puVar4 = param_2;\n  *(uint *)(param_1 + 0x14) = uVar2;\n  if (*(uint *)(param_1 + 0x18) == uVar2) {\n    *(uint *)(param_1 + 0x18) = uVar3 + *(uint *)(param_1 + 0x18) & 3;\n  }\n  *(undefined1 *)(param_1 + 0x1c) = 0;\n  return uVar1;\n}\n\n" (function_definition "undefined4 i_ring_push(int param_1,undefined4 param_2)\n\n{\n  undefined4 uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined4 *puVar4;\n  \n  uVar3 = *(byte *)(param_1 + 0x1c) ^ 1;\n  uVar2 = uVar3 + *(int *)(param_1 + 0x14) & 3;\n  puVar4 = (undefined4 *)(param_1 + uVar2 * 4);\n  uVar1 = *puVar4;\n  *puVar4 = param_2;\n  *(uint *)(param_1 + 0x14) = uVar2;\n  if (*(uint *)(param_1 + 0x18) == uVar2) {\n    *(uint *)(param_1 + 0x18) = uVar3 + *(uint *)(param_1 + 0x18) & 3;\n  }\n  *(undefined1 *)(param_1 + 0x1c) = 0;\n  return uVar1;\n}" type_identifier (function_declarator "i_ring_push(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 uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined4 *puVar4;\n  \n  uVar3 = *(byte *)(param_1 + 0x1c) ^ 1;\n  uVar2 = uVar3 + *(int *)(param_1 + 0x14) & 3;\n  puVar4 = (undefined4 *)(param_1 + uVar2 * 4);\n  uVar1 = *puVar4;\n  *puVar4 = param_2;\n  *(uint *)(param_1 + 0x14) = uVar2;\n  if (*(uint *)(param_1 + 0x18) == uVar2) {\n    *(uint *)(param_1 + 0x18) = uVar3 + *(uint *)(param_1 + 0x18) & 3;\n  }\n  *(undefined1 *)(param_1 + 0x1c) = 0;\n  return uVar1;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "undefined4 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (expression_statement "uVar3 = *(byte *)(param_1 + 0x1c) ^ 1;" (assignment_expression "uVar3 = *(byte *)(param_1 + 0x1c) ^ 1" identifier = (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 "uVar2 = uVar3 + *(int *)(param_1 + 0x14) & 3;" (assignment_expression "uVar2 = uVar3 + *(int *)(param_1 + 0x14) & 3" identifier = (binary_expression "uVar3 + *(int *)(param_1 + 0x14) & 3" (binary_expression "uVar3 + *(int *)(param_1 + 0x14)" identifier + (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) ))))) & number_literal)) ;) (expression_statement "puVar4 = (undefined4 *)(param_1 + uVar2 * 4);" (assignment_expression "puVar4 = (undefined4 *)(param_1 + uVar2 * 4)" identifier = (cast_expression "(undefined4 *)(param_1 + uVar2 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + uVar2 * 4)" ( (binary_expression "param_1 + uVar2 * 4" identifier + (binary_expression "uVar2 * 4" identifier * number_literal)) )))) ;) (expression_statement "uVar1 = *puVar4;" (assignment_expression "uVar1 = *puVar4" identifier = (pointer_expression "*puVar4" * identifier)) ;) (expression_statement "*puVar4 = param_2;" (assignment_expression "*puVar4 = param_2" (pointer_expression "*puVar4" * identifier) = identifier) ;) (expression_statement "*(uint *)(param_1 + 0x14) = uVar2;" (assignment_expression "*(uint *)(param_1 + 0x14) = uVar2" (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) == uVar2) {\n    *(uint *)(param_1 + 0x18) = uVar3 + *(uint *)(param_1 + 0x18) & 3;\n  }" if (parenthesized_expression "(*(uint *)(param_1 + 0x18) == uVar2)" ( (binary_expression "*(uint *)(param_1 + 0x18) == uVar2" (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) = uVar3 + *(uint *)(param_1 + 0x18) & 3;\n  }" { (expression_statement "*(uint *)(param_1 + 0x18) = uVar3 + *(uint *)(param_1 + 0x18) & 3;" (assignment_expression "*(uint *)(param_1 + 0x18) = uVar3 + *(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 "uVar3 + *(uint *)(param_1 + 0x18) & 3" (binary_expression "uVar3 + *(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 uVar1;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (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 IDENT + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) & 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 i_ring_push(int param_1,undefined4 param_2)\n\n{\n  undefined4 uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined4 *puVar4;\n  \n  uVar3 = *(byte *)(param_1 + 0x1c) ^ 1;\n  uVar2 = uVar3 + *(int *)(param_1 + 0x14) & 3;\n  puVar4 = (undefined4 *)(param_1 + uVar2 * 4);\n  uVar1 = *puVar4;\n  *puVar4 = param_2;\n  *(uint *)(param_1 + 0x14) = uVar2;\n  if (*(uint *)(param_1 + 0x18) == uVar2) {\n    *(uint *)(param_1 + 0x18) = uVar3 + *(uint *)(param_1 + 0x18) & 3;\n  }\n  *(undefined1 *)(param_1 + 0x1c) = 0;\n  return uVar1;\n}" (type_identifier "undefined4") (function_declarator "i_ring_push(int param_1,undefined4 param_2)" (identifier "i_ring_push") (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 uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined4 *puVar4;\n  \n  uVar3 = *(byte *)(param_1 + 0x1c) ^ 1;\n  uVar2 = uVar3 + *(int *)(param_1 + 0x14) & 3;\n  puVar4 = (undefined4 *)(param_1 + uVar2 * 4);\n  uVar1 = *puVar4;\n  *puVar4 = param_2;\n  *(uint *)(param_1 + 0x14) = uVar2;\n  if (*(uint *)(param_1 + 0x18) == uVar2) {\n    *(uint *)(param_1 + 0x18) = uVar3 + *(uint *)(param_1 + 0x18) & 3;\n  }\n  *(undefined1 *)(param_1 + 0x1c) = 0;\n  return uVar1;\n}" ({ "{") (declaration "undefined4 uVar1;" (type_identifier "undefined4") (identifier "uVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "undefined4 *puVar4;" (type_identifier "undefined4") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (expression_statement "uVar3 = *(byte *)(param_1 + 0x1c) ^ 1;" (assignment_expression "uVar3 = *(byte *)(param_1 + 0x1c) ^ 1" (identifier "uVar3") (= "=") (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 "uVar2 = uVar3 + *(int *)(param_1 + 0x14) & 3;" (assignment_expression "uVar2 = uVar3 + *(int *)(param_1 + 0x14) & 3" (identifier "uVar2") (= "=") (binary_expression "uVar3 + *(int *)(param_1 + 0x14) & 3" (binary_expression "uVar3 + *(int *)(param_1 + 0x14)" (identifier "uVar3") (+ "+") (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")) () ")"))))) (& "&") (number_literal "3"))) (; ";")) (expression_statement "puVar4 = (undefined4 *)(param_1 + uVar2 * 4);" (assignment_expression "puVar4 = (undefined4 *)(param_1 + uVar2 * 4)" (identifier "puVar4") (= "=") (cast_expression "(undefined4 *)(param_1 + uVar2 * 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + uVar2 * 4)" (( "(") (binary_expression "param_1 + uVar2 * 4" (identifier "param_1") (+ "+") (binary_expression "uVar2 * 4" (identifier "uVar2") (* "*") (number_literal "4"))) () ")")))) (; ";")) (expression_statement "uVar1 = *puVar4;" (assignment_expression "uVar1 = *puVar4" (identifier "uVar1") (= "=") (pointer_expression "*puVar4" (* "*") (identifier "puVar4"))) (; ";")) (expression_statement "*puVar4 = param_2;" (assignment_expression "*puVar4 = param_2" (pointer_expression "*puVar4" (* "*") (identifier "puVar4")) (= "=") (identifier "param_2")) (; ";")) (expression_statement "*(uint *)(param_1 + 0x14) = uVar2;" (assignment_expression "*(uint *)(param_1 + 0x14) = uVar2" (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 "uVar2")) (; ";")) (if_statement "if (*(uint *)(param_1 + 0x18) == uVar2) {\n    *(uint *)(param_1 + 0x18) = uVar3 + *(uint *)(param_1 + 0x18) & 3;\n  }" (if "if") (parenthesized_expression "(*(uint *)(param_1 + 0x18) == uVar2)" (( "(") (binary_expression "*(uint *)(param_1 + 0x18) == uVar2" (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 "uVar2")) () ")")) (compound_statement "{\n    *(uint *)(param_1 + 0x18) = uVar3 + *(uint *)(param_1 + 0x18) & 3;\n  }" ({ "{") (expression_statement "*(uint *)(param_1 + 0x18) = uVar3 + *(uint *)(param_1 + 0x18) & 3;" (assignment_expression "*(uint *)(param_1 + 0x18) = uVar3 + *(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 "uVar3 + *(uint *)(param_1 + 0x18) & 3" (binary_expression "uVar3 + *(uint *)(param_1 + 0x18)" (identifier "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")) () ")"))))) (& "&") (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 uVar1;" (return "return") (identifier "uVar1") (; ";")) (} "}")))

int function_1(type_1 *ir,int val)

{
  int iVar1;
  type_2 var_2;
  type_2 var_1;
  
  var_1 = ir->ir_empty ^ 1;
  var_2 = var_1 + ir->ir_front & 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: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (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: (identifier) right: (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: (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 uVar1;
  uint uVar2;
  uint uVar3;
  undefined4 *puVar4;
  
  uVar3 = *(byte *)(param_1 + 0x1c) ^ 1;
  uVar2 = uVar3 + *(int *)(param_1 + 0x14) & 3;
  puVar4 = (undefined4 *)(param_1 + uVar2 * 4);
  uVar1 = *puVar4;
  *puVar4 = param_2;
  *(uint *)(param_1 + 0x14) = uVar2;
  if (*(uint *)(param_1 + 0x18) == uVar2) {
    *(uint *)(param_1 + 0x18) = uVar3 + *(uint *)(param_1 + 0x18) & 3;
  }
  *(undefined1 *)(param_1 + 0x1c) = 0;
  return uVar1;
}

