
int xdup_CLOEXEC_and_close(int fd,int avoid_fd)

{
  undefined *puVar1;
  int iVar2;
  int iVar3;
  
  puVar1 = PTR_bb_errno_0012a214;
  do {
    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(fd,0x406,avoid_fd + 1);
    if (-1 < iVar2) {
      (*(code *)PTR_close_0012ac8c)(fd);
      return iVar2;
    }
    iVar3 = **(int **)puVar1;
  } while ((iVar3 == 0x10) || (iVar3 == 4));
  if (iVar3 == 9) {
    return fd;
  }
                    /* WARNING: Subroutine does not return */
  ash_msg_and_raise_error(PTR_UINT_0012a18c + 0x7340,iVar2);
}



int FUN_0006ff4c(int param_1,int param_2)

{
  undefined *puVar1;
  int iVar2;
  int iVar3;
  
  puVar1 = PTR_DAT_0012a214;
  do {
    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);
    if (-1 < iVar2) {
      (*(code *)PTR_close_0012ac8c)(param_1);
      return iVar2;
    }
    iVar3 = **(int **)puVar1;
  } while ((iVar3 == 0x10) || (iVar3 == 4));
  if (iVar3 == 9) {
    return param_1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0006ee68(PTR_UINT_0012a18c + 0x7340,iVar2);
}


lui gp,0xc
addiu gp,gp,0x2204
addu gp,gp,t9
addiu sp,sp,-0x38
sw s5,0x30(sp)
sw s4,0x2c(sp)
addiu s4,a1,0x1
sw s3,0x28(sp)
li s3,0x10
sw s2,0x24(sp)
li s2,0x4
sw s0,0x1c(sp)
or s0,a0,zero
sw gp,0x10(sp)
sw ra,0x34(sp)
sw s1,0x20(sp)
lw s5,-0x7f3c(gp)
lw t9,-0x734c(gp)
li a1,0x406
or a2,s4,zero
jalr t9
_or a0,s0,zero
lw gp,0x10(sp)
bgez v0,0x0006fff4
_or s1,v0,zero
lw v0,0x0(s5)
lw v0,0x0(v0)
beq v0,s3,0x0006ff94
_lw t9,-0x734c(gp)
beq v0,s2,0x0006ff94
_li v1,0x9
bne v0,v1,0x0007002c
_lw ra,0x34(sp)
or v0,s0,zero
lw s5,0x30(sp)
lw s4,0x2c(sp)
lw s3,0x28(sp)
lw s2,0x24(sp)
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x38
lw t9,-0x74c4(gp)
or a0,s0,zero
jalr t9
_or s0,s1,zero
or v0,s0,zero
lw ra,0x34(sp)
lw s5,0x30(sp)
lw s4,0x2c(sp)
lw s3,0x28(sp)
lw s2,0x24(sp)
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x38
lw a0,-0x7fc4(gp)
or a1,s1,zero
lw t9,-0x793c(gp)
addiu t9,t9,-0x1198
bal 0x0006ee68
_addiu a0,a0,0x7340
(translation_unit "int FUN_0006ff4c(int param_1,int param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  \n  puVar1 = PTR_DAT_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  } while ((iVar3 == 0x10) || (iVar3 == 4));\n  if (iVar3 == 9) {\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0006ee68(PTR_UINT_0012a18c + 0x7340,iVar2);\n}\n\n" (function_definition "int FUN_0006ff4c(int param_1,int param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  \n  puVar1 = PTR_DAT_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  } while ((iVar3 == 0x10) || (iVar3 == 4));\n  if (iVar3 == 9) {\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0006ee68(PTR_UINT_0012a18c + 0x7340,iVar2);\n}" primitive_type (function_declarator "FUN_0006ff4c(int param_1,int param_2)" identifier (parameter_list "(int param_1,int param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  \n  puVar1 = PTR_DAT_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  } while ((iVar3 == 0x10) || (iVar3 == 4));\n  if (iVar3 == 9) {\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0006ee68(PTR_UINT_0012a18c + 0x7340,iVar2);\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "puVar1 = PTR_DAT_0012a214;" (assignment_expression "puVar1 = PTR_DAT_0012a214" identifier = identifier) ;) (do_statement "do {\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  } while ((iVar3 == 0x10) || (iVar3 == 4));" do (compound_statement "{\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  }" { (expression_statement "iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);" (assignment_expression "iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1)" identifier = (call_expression "(*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1)" (parenthesized_expression "(*(code *)PTR_fcntl64_0012ae04)" ( (pointer_expression "*(code *)PTR_fcntl64_0012ae04" * (cast_expression "(code *)PTR_fcntl64_0012ae04" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0x406,param_2 + 1)" ( identifier , number_literal , (binary_expression "param_2 + 1" identifier + number_literal) )))) ;) (if_statement "if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }" { (expression_statement "(*(code *)PTR_close_0012ac8c)(param_1);" (call_expression "(*(code *)PTR_close_0012ac8c)(param_1)" (parenthesized_expression "(*(code *)PTR_close_0012ac8c)" ( (pointer_expression "*(code *)PTR_close_0012ac8c" * (cast_expression "(code *)PTR_close_0012ac8c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return iVar2;" return identifier ;) })) (expression_statement "iVar3 = **(int **)puVar1;" (assignment_expression "iVar3 = **(int **)puVar1" identifier = (pointer_expression "**(int **)puVar1" * (pointer_expression "*(int **)puVar1" * (cast_expression "(int **)puVar1" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)))) ;) }) while (parenthesized_expression "((iVar3 == 0x10) || (iVar3 == 4))" ( (binary_expression "(iVar3 == 0x10) || (iVar3 == 4)" (parenthesized_expression "(iVar3 == 0x10)" ( (binary_expression "iVar3 == 0x10" identifier == number_literal) )) || (parenthesized_expression "(iVar3 == 4)" ( (binary_expression "iVar3 == 4" identifier == number_literal) ))) )) ;) (if_statement "if (iVar3 == 9) {\n    return param_1;\n  }" if (parenthesized_expression "(iVar3 == 9)" ( (binary_expression "iVar3 == 9" identifier == number_literal) )) (compound_statement "{\n    return param_1;\n  }" { (return_statement "return param_1;" return identifier ;) })) comment (expression_statement "FUN_0006ee68(PTR_UINT_0012a18c + 0x7340,iVar2);" (call_expression "FUN_0006ee68(PTR_UINT_0012a18c + 0x7340,iVar2)" identifier (argument_list "(PTR_UINT_0012a18c + 0x7340,iVar2)" ( (binary_expression "PTR_UINT_0012a18c + 0x7340" identifier + number_literal) , identifier ))) ;) })))
(translation_unit "int xdup_CLOEXEC_and_close(int fd,int avoid_fd)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  \n  puVar1 = PTR_bb_errno_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(fd,0x406,avoid_fd + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(fd);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  } while ((iVar3 == 0x10) || (iVar3 == 4));\n  if (iVar3 == 9) {\n    return fd;\n  }\n                    /* WARNING: Subroutine does not return */\n  ash_msg_and_raise_error(PTR_UINT_0012a18c + 0x7340,iVar2);\n}\n\n" (function_definition "int xdup_CLOEXEC_and_close(int fd,int avoid_fd)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  \n  puVar1 = PTR_bb_errno_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(fd,0x406,avoid_fd + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(fd);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  } while ((iVar3 == 0x10) || (iVar3 == 4));\n  if (iVar3 == 9) {\n    return fd;\n  }\n                    /* WARNING: Subroutine does not return */\n  ash_msg_and_raise_error(PTR_UINT_0012a18c + 0x7340,iVar2);\n}" primitive_type (function_declarator "xdup_CLOEXEC_and_close(int fd,int avoid_fd)" identifier (parameter_list "(int fd,int avoid_fd)" ( (parameter_declaration "int fd" primitive_type identifier) , (parameter_declaration "int avoid_fd" primitive_type identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  \n  puVar1 = PTR_bb_errno_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(fd,0x406,avoid_fd + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(fd);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  } while ((iVar3 == 0x10) || (iVar3 == 4));\n  if (iVar3 == 9) {\n    return fd;\n  }\n                    /* WARNING: Subroutine does not return */\n  ash_msg_and_raise_error(PTR_UINT_0012a18c + 0x7340,iVar2);\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "puVar1 = PTR_bb_errno_0012a214;" (assignment_expression "puVar1 = PTR_bb_errno_0012a214" identifier = identifier) ;) (do_statement "do {\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(fd,0x406,avoid_fd + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(fd);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  } while ((iVar3 == 0x10) || (iVar3 == 4));" do (compound_statement "{\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(fd,0x406,avoid_fd + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(fd);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  }" { (expression_statement "iVar2 = (*(code *)PTR_fcntl64_0012ae04)(fd,0x406,avoid_fd + 1);" (assignment_expression "iVar2 = (*(code *)PTR_fcntl64_0012ae04)(fd,0x406,avoid_fd + 1)" identifier = (call_expression "(*(code *)PTR_fcntl64_0012ae04)(fd,0x406,avoid_fd + 1)" (parenthesized_expression "(*(code *)PTR_fcntl64_0012ae04)" ( (pointer_expression "*(code *)PTR_fcntl64_0012ae04" * (cast_expression "(code *)PTR_fcntl64_0012ae04" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(fd,0x406,avoid_fd + 1)" ( identifier , number_literal , (binary_expression "avoid_fd + 1" identifier + number_literal) )))) ;) (if_statement "if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(fd);\n      return iVar2;\n    }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n      (*(code *)PTR_close_0012ac8c)(fd);\n      return iVar2;\n    }" { (expression_statement "(*(code *)PTR_close_0012ac8c)(fd);" (call_expression "(*(code *)PTR_close_0012ac8c)(fd)" (parenthesized_expression "(*(code *)PTR_close_0012ac8c)" ( (pointer_expression "*(code *)PTR_close_0012ac8c" * (cast_expression "(code *)PTR_close_0012ac8c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(fd)" ( identifier ))) ;) (return_statement "return iVar2;" return identifier ;) })) (expression_statement "iVar3 = **(int **)puVar1;" (assignment_expression "iVar3 = **(int **)puVar1" identifier = (pointer_expression "**(int **)puVar1" * (pointer_expression "*(int **)puVar1" * (cast_expression "(int **)puVar1" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)))) ;) }) while (parenthesized_expression "((iVar3 == 0x10) || (iVar3 == 4))" ( (binary_expression "(iVar3 == 0x10) || (iVar3 == 4)" (parenthesized_expression "(iVar3 == 0x10)" ( (binary_expression "iVar3 == 0x10" identifier == number_literal) )) || (parenthesized_expression "(iVar3 == 4)" ( (binary_expression "iVar3 == 4" identifier == number_literal) ))) )) ;) (if_statement "if (iVar3 == 9) {\n    return fd;\n  }" if (parenthesized_expression "(iVar3 == 9)" ( (binary_expression "iVar3 == 9" identifier == number_literal) )) (compound_statement "{\n    return fd;\n  }" { (return_statement "return fd;" return identifier ;) })) comment (expression_statement "ash_msg_and_raise_error(PTR_UINT_0012a18c + 0x7340,iVar2);" (call_expression "ash_msg_and_raise_error(PTR_UINT_0012a18c + 0x7340,iVar2)" identifier (argument_list "(PTR_UINT_0012a18c + 0x7340,iVar2)" ( (binary_expression "PTR_UINT_0012a18c + 0x7340" identifier + number_literal) , identifier ))) ;) })))
(translation_unit "int FUN_0006ff4c(int param_1,int param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  \n  puVar1 = PTR_DAT_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  } while ((iVar3 == 0x10) || (iVar3 == 4));\n  if (iVar3 == 9) {\n    return param_1;\n  }\n                    \n  FUN_0006ee68(PTR_UINT_0012a18c + 0x7340,iVar2);\n}\n\n" (function_definition "int FUN_0006ff4c(int param_1,int param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  \n  puVar1 = PTR_DAT_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  } while ((iVar3 == 0x10) || (iVar3 == 4));\n  if (iVar3 == 9) {\n    return param_1;\n  }\n                    \n  FUN_0006ee68(PTR_UINT_0012a18c + 0x7340,iVar2);\n}" primitive_type (function_declarator "FUN_0006ff4c(int param_1,int param_2)" identifier (parameter_list "(int param_1,int param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  \n  puVar1 = PTR_DAT_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  } while ((iVar3 == 0x10) || (iVar3 == 4));\n  if (iVar3 == 9) {\n    return param_1;\n  }\n                    \n  FUN_0006ee68(PTR_UINT_0012a18c + 0x7340,iVar2);\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "puVar1 = PTR_DAT_0012a214;" (assignment_expression "puVar1 = PTR_DAT_0012a214" identifier = identifier) ;) (do_statement "do {\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  } while ((iVar3 == 0x10) || (iVar3 == 4));" do (compound_statement "{\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  }" { (expression_statement "iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);" (assignment_expression "iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1)" identifier = (call_expression "(*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1)" (parenthesized_expression "(*(code *)PTR_fcntl64_0012ae04)" ( (pointer_expression "*(code *)PTR_fcntl64_0012ae04" * (cast_expression "(code *)PTR_fcntl64_0012ae04" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0x406,param_2 + 1)" ( identifier , number_literal , (binary_expression "param_2 + 1" identifier + number_literal) )))) ;) (if_statement "if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }" { (expression_statement "(*(code *)PTR_close_0012ac8c)(param_1);" (call_expression "(*(code *)PTR_close_0012ac8c)(param_1)" (parenthesized_expression "(*(code *)PTR_close_0012ac8c)" ( (pointer_expression "*(code *)PTR_close_0012ac8c" * (cast_expression "(code *)PTR_close_0012ac8c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return iVar2;" return identifier ;) })) (expression_statement "iVar3 = **(int **)puVar1;" (assignment_expression "iVar3 = **(int **)puVar1" identifier = (pointer_expression "**(int **)puVar1" * (pointer_expression "*(int **)puVar1" * (cast_expression "(int **)puVar1" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)))) ;) }) while (parenthesized_expression "((iVar3 == 0x10) || (iVar3 == 4))" ( (binary_expression "(iVar3 == 0x10) || (iVar3 == 4)" (parenthesized_expression "(iVar3 == 0x10)" ( (binary_expression "iVar3 == 0x10" identifier == number_literal) )) || (parenthesized_expression "(iVar3 == 4)" ( (binary_expression "iVar3 == 4" identifier == number_literal) ))) )) ;) (if_statement "if (iVar3 == 9) {\n    return param_1;\n  }" if (parenthesized_expression "(iVar3 == 9)" ( (binary_expression "iVar3 == 9" identifier == number_literal) )) (compound_statement "{\n    return param_1;\n  }" { (return_statement "return param_1;" return identifier ;) })) (expression_statement "FUN_0006ee68(PTR_UINT_0012a18c + 0x7340,iVar2);" (call_expression "FUN_0006ee68(PTR_UINT_0012a18c + 0x7340,iVar2)" identifier (argument_list "(PTR_UINT_0012a18c + 0x7340,iVar2)" ( (binary_expression "PTR_UINT_0012a18c + 0x7340" identifier + number_literal) , 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 ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , LIT , (binary_expression IDENT + LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT ))) ;) (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) IDENT)))) ;) }) while (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) || (parenthesized_expression ( (binary_expression IDENT == LIT) ))) )) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , IDENT ))) ;) })))
(function_definition "int FUN_0006ff4c(int param_1,int param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  \n  puVar1 = PTR_DAT_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  } while ((iVar3 == 0x10) || (iVar3 == 4));\n  if (iVar3 == 9) {\n    return param_1;\n  }\n                    \n  FUN_0006ee68(PTR_UINT_0012a18c + 0x7340,iVar2);\n}" (primitive_type "int") (function_declarator "FUN_0006ff4c(int param_1,int param_2)" (identifier "FUN_0006ff4c") (parameter_list "(int param_1,int param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  \n  puVar1 = PTR_DAT_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  } while ((iVar3 == 0x10) || (iVar3 == 4));\n  if (iVar3 == 9) {\n    return param_1;\n  }\n                    \n  FUN_0006ee68(PTR_UINT_0012a18c + 0x7340,iVar2);\n}" ({ "{") (declaration "undefined *puVar1;" (type_identifier "undefined") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (expression_statement "puVar1 = PTR_DAT_0012a214;" (assignment_expression "puVar1 = PTR_DAT_0012a214" (identifier "puVar1") (= "=") (identifier "PTR_DAT_0012a214")) (; ";")) (do_statement "do {\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  } while ((iVar3 == 0x10) || (iVar3 == 4));" (do "do") (compound_statement "{\n    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);\n    if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }\n    iVar3 = **(int **)puVar1;\n  }" ({ "{") (expression_statement "iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);" (assignment_expression "iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1)" (parenthesized_expression "(*(code *)PTR_fcntl64_0012ae04)" (( "(") (pointer_expression "*(code *)PTR_fcntl64_0012ae04" (* "*") (cast_expression "(code *)PTR_fcntl64_0012ae04" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_fcntl64_0012ae04"))) () ")")) (argument_list "(param_1,0x406,param_2 + 1)" (( "(") (identifier "param_1") (, ",") (number_literal "0x406") (, ",") (binary_expression "param_2 + 1" (identifier "param_2") (+ "+") (number_literal "1")) () ")")))) (; ";")) (if_statement "if (-1 < iVar2) {\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }" (if "if") (parenthesized_expression "(-1 < iVar2)" (( "(") (binary_expression "-1 < iVar2" (number_literal "-1") (< "<") (identifier "iVar2")) () ")")) (compound_statement "{\n      (*(code *)PTR_close_0012ac8c)(param_1);\n      return iVar2;\n    }" ({ "{") (expression_statement "(*(code *)PTR_close_0012ac8c)(param_1);" (call_expression "(*(code *)PTR_close_0012ac8c)(param_1)" (parenthesized_expression "(*(code *)PTR_close_0012ac8c)" (( "(") (pointer_expression "*(code *)PTR_close_0012ac8c" (* "*") (cast_expression "(code *)PTR_close_0012ac8c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_close_0012ac8c"))) () ")")) (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (expression_statement "iVar3 = **(int **)puVar1;" (assignment_expression "iVar3 = **(int **)puVar1" (identifier "iVar3") (= "=") (pointer_expression "**(int **)puVar1" (* "*") (pointer_expression "*(int **)puVar1" (* "*") (cast_expression "(int **)puVar1" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (identifier "puVar1"))))) (; ";")) (} "}")) (while "while") (parenthesized_expression "((iVar3 == 0x10) || (iVar3 == 4))" (( "(") (binary_expression "(iVar3 == 0x10) || (iVar3 == 4)" (parenthesized_expression "(iVar3 == 0x10)" (( "(") (binary_expression "iVar3 == 0x10" (identifier "iVar3") (== "==") (number_literal "0x10")) () ")")) (|| "||") (parenthesized_expression "(iVar3 == 4)" (( "(") (binary_expression "iVar3 == 4" (identifier "iVar3") (== "==") (number_literal "4")) () ")"))) () ")")) (; ";")) (if_statement "if (iVar3 == 9) {\n    return param_1;\n  }" (if "if") (parenthesized_expression "(iVar3 == 9)" (( "(") (binary_expression "iVar3 == 9" (identifier "iVar3") (== "==") (number_literal "9")) () ")")) (compound_statement "{\n    return param_1;\n  }" ({ "{") (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}"))) (expression_statement "FUN_0006ee68(PTR_UINT_0012a18c + 0x7340,iVar2);" (call_expression "FUN_0006ee68(PTR_UINT_0012a18c + 0x7340,iVar2)" (identifier "FUN_0006ee68") (argument_list "(PTR_UINT_0012a18c + 0x7340,iVar2)" (( "(") (binary_expression "PTR_UINT_0012a18c + 0x7340" (identifier "PTR_UINT_0012a18c") (+ "+") (number_literal "0x7340")) (, ",") (identifier "iVar2") () ")"))) (; ";")) (} "}")))
(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: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier) (number_literal) (binary_expression left: (identifier) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier)))) (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (identifier))))))) condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal)) (identifier)))))))

int MASKED(int param_1,int param_2)

{
  undefined *puVar1;
  int iVar2;
  int iVar3;
  
  puVar1 = PTR_DAT_0012a214;
  do {
    iVar2 = (*(code *)PTR_fcntl64_0012ae04)(param_1,0x406,param_2 + 1);
    if (-1 < iVar2) {
      (*(code *)PTR_close_0012ac8c)(param_1);
      return iVar2;
    }
    iVar3 = **(int **)puVar1;
  } while ((iVar3 == 0x10) || (iVar3 == 4));
  if (iVar3 == 9) {
    return param_1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0006ee68(PTR_UINT_0012a18c + 0x7340,iVar2);
}

