
int rpl_fcntl(int fd,int action,...)

{
  undefined *puVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  undefined4 *puVar5;
  int *piVar6;
  FILE *fp;
  undefined4 in_a2;
  int iVar7;
  undefined4 uVar8;
  int target;
  undefined *puVar9;
  undefined4 in_stack_ffffffb4;
  va_list arg;
  
  puVar1 = PTR___stack_chk_guard_0002c2b8;
  puVar9 = PTR_DAT_0002c0f8;
  fp = *(FILE **)PTR___stack_chk_guard_0002c2b8;
  if (action != 0x406) {
    iVar2 = (*(code *)PTR_fcntl64_0002c230)();
    goto LAB_000182c8;
  }
  if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {
    action = 0;
    iVar2 = rpl_fcntl(fd,0);
    if ((iVar2 < 0) || (iVar7 = iVar2, *(int *)(puVar9 + -0x3b90) != -1)) goto LAB_000182c8;
LAB_00018320:
    action = 1;
    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar7);
    if (-1 < (int)uVar3) {
      action = 2;
      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar7,2,uVar3 | 1);
      iVar2 = iVar7;
      if (iVar4 != -1) goto LAB_000182c8;
    }
    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();
    uVar8 = *puVar5;
    iVar2 = -1;
    (*(code *)PTR_close_0002c1e4)(iVar7);
    *puVar5 = uVar8;
  }
  else {
    iVar2 = (*(code *)PTR_fcntl64_0002c230)();
    if (iVar2 < 0) {
      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();
      if (*piVar6 == 0x16) {
        action = 0;
        iVar2 = rpl_fcntl(fd,0,in_a2);
        if (iVar2 < 0) goto LAB_000182c8;
        *(undefined4 *)(puVar9 + -0x3b90) = 0xffffffff;
        iVar7 = iVar2;
        goto LAB_00018320;
      }
    }
    *(undefined4 *)(puVar9 + -0x3b90) = 1;
  }
LAB_000182c8:
  if (fp == *(FILE **)puVar1) {
    return iVar2;
  }
  puVar9 = PTR___stack_chk_fail_0002c2a4;
  (*(code *)PTR___stack_chk_fail_0002c2a4)();
  if (fp != (FILE *)0x0) {
    iVar2 = (**(code **)(puVar9 + 0x13e70))();
    if ((iVar2 != 0) && ((fp->_flags & 0x100U) != 0)) {
      rpl_fseeko(fp,CONCAT44(1,in_stack_ffffffb4),action);
                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */
                    /* WARNING: Treating indirect jump as call */
      iVar2 = (**(code **)(puVar9 + 0x13ecc))(fp);
      return iVar2;
    }
  }
                    /* WARNING: Could not recover jumptable at 0x00018458. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  iVar2 = (**(code **)(puVar9 + 0x13ecc))(fp);
  return iVar2;
}



int rpl_fcntl(undefined4 param_1,int param_2,undefined4 param_3)

{
  undefined *puVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  undefined4 *puVar5;
  int *piVar6;
  uint *puVar7;
  int iVar8;
  undefined4 uVar9;
  undefined *puVar10;
  
  puVar1 = PTR___stack_chk_guard_0002c2b8;
  puVar10 = PTR_DAT_0002c0f8;
  puVar7 = *(uint **)PTR___stack_chk_guard_0002c2b8;
  if (param_2 != 0x406) {
    iVar2 = (*(code *)PTR_fcntl64_0002c230)();
    goto LAB_000182c8;
  }
  if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {
    iVar2 = rpl_fcntl(param_1,0);
    if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;
LAB_00018320:
    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);
    if (-1 < (int)uVar3) {
      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);
      iVar2 = iVar8;
      if (iVar4 != -1) goto LAB_000182c8;
    }
    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();
    uVar9 = *puVar5;
    iVar2 = -1;
    (*(code *)PTR_close_0002c1e4)(iVar8);
    *puVar5 = uVar9;
  }
  else {
    iVar2 = (*(code *)PTR_fcntl64_0002c230)();
    if (iVar2 < 0) {
      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();
      if (*piVar6 == 0x16) {
        iVar2 = rpl_fcntl(param_1,0,param_3);
        if (iVar2 < 0) goto LAB_000182c8;
        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;
        iVar8 = iVar2;
        goto LAB_00018320;
      }
    }
    *(undefined4 *)(puVar10 + -0x3b90) = 1;
  }
LAB_000182c8:
  if (puVar7 == *(uint **)puVar1) {
    return iVar2;
  }
  puVar10 = PTR___stack_chk_fail_0002c2a4;
  (*(code *)PTR___stack_chk_fail_0002c2a4)();
  if (puVar7 != (uint *)0x0) {
    iVar2 = (**(code **)(puVar10 + 0x13e70))();
    if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {
      rpl_fseeko(puVar7);
                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */
                    /* WARNING: Treating indirect jump as call */
      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);
      return iVar2;
    }
  }
                    /* WARNING: Could not recover jumptable at 0x00018458. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);
  return iVar2;
}


lui gp,0x2
addiu gp,gp,-0x4170
addu gp,gp,t9
addiu sp,sp,-0x38
li v0,0x406
addiu v1,sp,0x40
sw s0,0x20(sp)
sw a2,0x40(sp)
sw a3,0x44(sp)
sw v1,0x18(sp)
lw s0,-0x7e18(gp)
sw gp,0x10(sp)
sw ra,0x34(sp)
sw s4,0x30(sp)
sw s3,0x2c(sp)
sw s2,0x28(sp)
sw s1,0x24(sp)
lw v1,0x0(s0)
sw v1,0x1c(sp)
bne a1,v0,0x0001838c
_lw s2,-0x7fd8(gp)
addiu v0,sp,0x44
sw v0,0x18(sp)
lw v0,-0x3b90(s2)
bltz v0,0x000182f8
_or s4,a2,zero
lw t9,-0x7ea0(gp)
jalr t9
_or s3,a0,zero
lw gp,0x10(sp)
bltz v0,0x000183a4
_or s1,v0,zero
li v0,0x1
sw v0,-0x3b90(s2)
lw a0,0x1c(sp)
or v0,s1,zero
lw v1,0x0(s0)
bne a0,v1,0x000183ec
_lw ra,0x34(sp)
lw s4,0x30(sp)
lw s3,0x2c(sp)
lw s2,0x28(sp)
lw s1,0x24(sp)
lw s0,0x20(sp)
jr ra
_addiu sp,sp,0x38
lw t9,-0x7f38(gp)
bal 0x00018240
_or a1,zero,zero
lw gp,0x10(sp)
bltz v0,0x000182c8
_or s1,v0,zero
lw v1,-0x3b90(s2)
li v0,-0x1
bne v1,v0,0x000182c8
_nop
lw t9,-0x7ea0(gp)
li a1,0x1
jalr t9
_or a0,s1,zero
bltz v0,0x00018358
_lw gp,0x10(sp)
lw t9,-0x7ea0(gp)
li a1,0x2
ori a2,v0,0x1
jalr t9
_or a0,s1,zero
li v1,-0x1
bne v0,v1,0x000182c8
_lw gp,0x10(sp)
lw t9,-0x7e8c(gp)
jalr t9
_nop
or a0,s1,zero
lw gp,0x10(sp)
or s2,v0,zero
lw s3,0x0(v0)
lw t9,-0x7eec(gp)
jalr t9
_li s1,-0x1
lw gp,0x10(sp)
b 0x000182c8
_sw s3,0x0(s2)
lw t9,-0x7ea0(gp)
jalr t9
_nop
lw gp,0x10(sp)
b 0x000182c8
_or s1,v0,zero
lw t9,-0x7e8c(gp)
jalr t9
_nop
li v1,0x16
lw v0,0x0(v0)
bne v0,v1,0x000182c0
_lw gp,0x10(sp)
lw t9,-0x7f38(gp)
or a1,zero,zero
or a2,s4,zero
bal 0x00018240
_or a0,s3,zero
lw gp,0x10(sp)
bltz v0,0x000182c8
_or s1,v0,zero
li v0,-0x1
b 0x00018320
_sw v0,-0x3b90(s2)
lw t9,-0x7e2c(gp)
jalr t9
_nop
nop
nop
(translation_unit "int rpl_fcntl(undefined4 param_1,int param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  int iVar4;\n  undefined4 *puVar5;\n  int *piVar6;\n  uint *puVar7;\n  int iVar8;\n  undefined4 uVar9;\n  undefined *puVar10;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2b8;\n  puVar10 = PTR_DAT_0002c0f8;\n  puVar7 = *(uint **)PTR___stack_chk_guard_0002c2b8;\n  if (param_2 != 0x406) {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }\n  if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {\n    iVar2 = rpl_fcntl(param_1,0);\n    if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);\n    if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar9 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar8);\n    *puVar5 = uVar9;\n  }\n  else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }\nLAB_000182c8:\n  if (puVar7 == *(uint **)puVar1) {\n    return iVar2;\n  }\n  puVar10 = PTR___stack_chk_fail_0002c2a4;\n  (*(code *)PTR___stack_chk_fail_0002c2a4)();\n  if (puVar7 != (uint *)0x0) {\n    iVar2 = (**(code **)(puVar10 + 0x13e70))();\n    if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }\n  }\n                    /* WARNING: Could not recover jumptable at 0x00018458. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n  iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n  return iVar2;\n}\n\n" (function_definition "int rpl_fcntl(undefined4 param_1,int param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  int iVar4;\n  undefined4 *puVar5;\n  int *piVar6;\n  uint *puVar7;\n  int iVar8;\n  undefined4 uVar9;\n  undefined *puVar10;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2b8;\n  puVar10 = PTR_DAT_0002c0f8;\n  puVar7 = *(uint **)PTR___stack_chk_guard_0002c2b8;\n  if (param_2 != 0x406) {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }\n  if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {\n    iVar2 = rpl_fcntl(param_1,0);\n    if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);\n    if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar9 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar8);\n    *puVar5 = uVar9;\n  }\n  else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }\nLAB_000182c8:\n  if (puVar7 == *(uint **)puVar1) {\n    return iVar2;\n  }\n  puVar10 = PTR___stack_chk_fail_0002c2a4;\n  (*(code *)PTR___stack_chk_fail_0002c2a4)();\n  if (puVar7 != (uint *)0x0) {\n    iVar2 = (**(code **)(puVar10 + 0x13e70))();\n    if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }\n  }\n                    /* WARNING: Could not recover jumptable at 0x00018458. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n  iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n  return iVar2;\n}" primitive_type (function_declarator "rpl_fcntl(undefined4 param_1,int param_2,undefined4 param_3)" identifier (parameter_list "(undefined4 param_1,int param_2,undefined4 param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  int iVar4;\n  undefined4 *puVar5;\n  int *piVar6;\n  uint *puVar7;\n  int iVar8;\n  undefined4 uVar9;\n  undefined *puVar10;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2b8;\n  puVar10 = PTR_DAT_0002c0f8;\n  puVar7 = *(uint **)PTR___stack_chk_guard_0002c2b8;\n  if (param_2 != 0x406) {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }\n  if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {\n    iVar2 = rpl_fcntl(param_1,0);\n    if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);\n    if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar9 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar8);\n    *puVar5 = uVar9;\n  }\n  else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }\nLAB_000182c8:\n  if (puVar7 == *(uint **)puVar1) {\n    return iVar2;\n  }\n  puVar10 = PTR___stack_chk_fail_0002c2a4;\n  (*(code *)PTR___stack_chk_fail_0002c2a4)();\n  if (puVar7 != (uint *)0x0) {\n    iVar2 = (**(code **)(puVar10 + 0x13e70))();\n    if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }\n  }\n                    /* WARNING: Could not recover jumptable at 0x00018458. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n  iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n  return iVar2;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "undefined4 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "int *piVar6;" primitive_type (pointer_declarator "*piVar6" * identifier) ;) (declaration "uint *puVar7;" type_identifier (pointer_declarator "*puVar7" * identifier) ;) (declaration "int iVar8;" primitive_type identifier ;) (declaration "undefined4 uVar9;" type_identifier identifier ;) (declaration "undefined *puVar10;" type_identifier (pointer_declarator "*puVar10" * identifier) ;) (expression_statement "puVar1 = PTR___stack_chk_guard_0002c2b8;" (assignment_expression "puVar1 = PTR___stack_chk_guard_0002c2b8" identifier = identifier) ;) (expression_statement "puVar10 = PTR_DAT_0002c0f8;" (assignment_expression "puVar10 = PTR_DAT_0002c0f8" identifier = identifier) ;) (expression_statement "puVar7 = *(uint **)PTR___stack_chk_guard_0002c2b8;" (assignment_expression "puVar7 = *(uint **)PTR___stack_chk_guard_0002c2b8" identifier = (pointer_expression "*(uint **)PTR___stack_chk_guard_0002c2b8" * (cast_expression "(uint **)PTR___stack_chk_guard_0002c2b8" ( (type_descriptor "uint **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (if_statement "if (param_2 != 0x406) {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }" if (parenthesized_expression "(param_2 != 0x406)" ( (binary_expression "param_2 != 0x406" identifier != number_literal) )) (compound_statement "{\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }" { (expression_statement "iVar2 = (*(code *)PTR_fcntl64_0002c230)();" (assignment_expression "iVar2 = (*(code *)PTR_fcntl64_0002c230)()" identifier = (call_expression "(*(code *)PTR_fcntl64_0002c230)()" (parenthesized_expression "(*(code *)PTR_fcntl64_0002c230)" ( (pointer_expression "*(code *)PTR_fcntl64_0002c230" * (cast_expression "(code *)PTR_fcntl64_0002c230" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (goto_statement "goto LAB_000182c8;" goto statement_identifier ;) })) (if_statement "if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {\n    iVar2 = rpl_fcntl(param_1,0);\n    if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);\n    if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar9 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar8);\n    *puVar5 = uVar9;\n  }\n  else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }" if (parenthesized_expression "(*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0)" ( (binary_expression "*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0" (pointer_expression "*(int *)(PTR_DAT_0002c0f8 + -0x3b90)" * (cast_expression "(int *)(PTR_DAT_0002c0f8 + -0x3b90)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_DAT_0002c0f8 + -0x3b90)" ( (binary_expression "PTR_DAT_0002c0f8 + -0x3b90" identifier + number_literal) )))) < number_literal) )) (compound_statement "{\n    iVar2 = rpl_fcntl(param_1,0);\n    if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);\n    if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar9 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar8);\n    *puVar5 = uVar9;\n  }" { (expression_statement "iVar2 = rpl_fcntl(param_1,0);" (assignment_expression "iVar2 = rpl_fcntl(param_1,0)" identifier = (call_expression "rpl_fcntl(param_1,0)" identifier (argument_list "(param_1,0)" ( identifier , number_literal )))) ;) (if_statement "if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;" if (parenthesized_expression "((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1))" ( (binary_expression "(iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)" (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) || (parenthesized_expression "(iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)" ( (comma_expression "iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1" (assignment_expression "iVar8 = iVar2" identifier = identifier) , (binary_expression "*(int *)(puVar10 + -0x3b90) != -1" (pointer_expression "*(int *)(puVar10 + -0x3b90)" * (cast_expression "(int *)(puVar10 + -0x3b90)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar10 + -0x3b90)" ( (binary_expression "puVar10 + -0x3b90" identifier + number_literal) )))) != number_literal)) ))) )) (goto_statement "goto LAB_000182c8;" goto statement_identifier ;)) (labeled_statement "LAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);" statement_identifier : (expression_statement "uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);" (assignment_expression "uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1)" identifier = (call_expression "(*(code *)PTR_fcntl64_0002c230)(iVar8,1)" (parenthesized_expression "(*(code *)PTR_fcntl64_0002c230)" ( (pointer_expression "*(code *)PTR_fcntl64_0002c230" * (cast_expression "(code *)PTR_fcntl64_0002c230" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar8,1)" ( identifier , number_literal )))) ;)) (if_statement "if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }" if (parenthesized_expression "(-1 < (int)uVar3)" ( (binary_expression "-1 < (int)uVar3" number_literal < (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }" { (expression_statement "iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);" (assignment_expression "iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1)" identifier = (call_expression "(*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1)" (parenthesized_expression "(*(code *)PTR_fcntl64_0002c230)" ( (pointer_expression "*(code *)PTR_fcntl64_0002c230" * (cast_expression "(code *)PTR_fcntl64_0002c230" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar8,2,uVar3 | 1)" ( identifier , number_literal , (binary_expression "uVar3 | 1" identifier | number_literal) )))) ;) (expression_statement "iVar2 = iVar8;" (assignment_expression "iVar2 = iVar8" identifier = identifier) ;) (if_statement "if (iVar4 != -1) goto LAB_000182c8;" if (parenthesized_expression "(iVar4 != -1)" ( (binary_expression "iVar4 != -1" identifier != number_literal) )) (goto_statement "goto LAB_000182c8;" goto statement_identifier ;)) })) (expression_statement "puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();" (assignment_expression "puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_0002c244)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_0002c244)()" (parenthesized_expression "(*(code *)PTR___errno_location_0002c244)" ( (pointer_expression "*(code *)PTR___errno_location_0002c244" * (cast_expression "(code *)PTR___errno_location_0002c244" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "uVar9 = *puVar5;" (assignment_expression "uVar9 = *puVar5" identifier = (pointer_expression "*puVar5" * identifier)) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (expression_statement "(*(code *)PTR_close_0002c1e4)(iVar8);" (call_expression "(*(code *)PTR_close_0002c1e4)(iVar8)" (parenthesized_expression "(*(code *)PTR_close_0002c1e4)" ( (pointer_expression "*(code *)PTR_close_0002c1e4" * (cast_expression "(code *)PTR_close_0002c1e4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar8)" ( identifier ))) ;) (expression_statement "*puVar5 = uVar9;" (assignment_expression "*puVar5 = uVar9" (pointer_expression "*puVar5" * identifier) = identifier) ;) }) (else_clause "else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }" else (compound_statement "{\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }" { (expression_statement "iVar2 = (*(code *)PTR_fcntl64_0002c230)();" (assignment_expression "iVar2 = (*(code *)PTR_fcntl64_0002c230)()" identifier = (call_expression "(*(code *)PTR_fcntl64_0002c230)()" (parenthesized_expression "(*(code *)PTR_fcntl64_0002c230)" ( (pointer_expression "*(code *)PTR_fcntl64_0002c230" * (cast_expression "(code *)PTR_fcntl64_0002c230" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (if_statement "if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (compound_statement "{\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }" { (expression_statement "piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();" (assignment_expression "piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_0002c244)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_0002c244)()" (parenthesized_expression "(*(code *)PTR___errno_location_0002c244)" ( (pointer_expression "*(code *)PTR___errno_location_0002c244" * (cast_expression "(code *)PTR___errno_location_0002c244" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (if_statement "if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }" if (parenthesized_expression "(*piVar6 == 0x16)" ( (binary_expression "*piVar6 == 0x16" (pointer_expression "*piVar6" * identifier) == number_literal) )) (compound_statement "{\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }" { (expression_statement "iVar2 = rpl_fcntl(param_1,0,param_3);" (assignment_expression "iVar2 = rpl_fcntl(param_1,0,param_3)" identifier = (call_expression "rpl_fcntl(param_1,0,param_3)" identifier (argument_list "(param_1,0,param_3)" ( identifier , number_literal , identifier )))) ;) (if_statement "if (iVar2 < 0) goto LAB_000182c8;" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (goto_statement "goto LAB_000182c8;" goto statement_identifier ;)) (expression_statement "*(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;" (assignment_expression "*(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff" (pointer_expression "*(undefined4 *)(puVar10 + -0x3b90)" * (cast_expression "(undefined4 *)(puVar10 + -0x3b90)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar10 + -0x3b90)" ( (binary_expression "puVar10 + -0x3b90" identifier + number_literal) )))) = number_literal) ;) (expression_statement "iVar8 = iVar2;" (assignment_expression "iVar8 = iVar2" identifier = identifier) ;) (goto_statement "goto LAB_00018320;" goto statement_identifier ;) })) })) (expression_statement "*(undefined4 *)(puVar10 + -0x3b90) = 1;" (assignment_expression "*(undefined4 *)(puVar10 + -0x3b90) = 1" (pointer_expression "*(undefined4 *)(puVar10 + -0x3b90)" * (cast_expression "(undefined4 *)(puVar10 + -0x3b90)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar10 + -0x3b90)" ( (binary_expression "puVar10 + -0x3b90" identifier + number_literal) )))) = number_literal) ;) }))) (labeled_statement "LAB_000182c8:\n  if (puVar7 == *(uint **)puVar1) {\n    return iVar2;\n  }" statement_identifier : (if_statement "if (puVar7 == *(uint **)puVar1) {\n    return iVar2;\n  }" if (parenthesized_expression "(puVar7 == *(uint **)puVar1)" ( (binary_expression "puVar7 == *(uint **)puVar1" identifier == (pointer_expression "*(uint **)puVar1" * (cast_expression "(uint **)puVar1" ( (type_descriptor "uint **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) )) (compound_statement "{\n    return iVar2;\n  }" { (return_statement "return iVar2;" return identifier ;) }))) (expression_statement "puVar10 = PTR___stack_chk_fail_0002c2a4;" (assignment_expression "puVar10 = PTR___stack_chk_fail_0002c2a4" identifier = identifier) ;) (expression_statement "(*(code *)PTR___stack_chk_fail_0002c2a4)();" (call_expression "(*(code *)PTR___stack_chk_fail_0002c2a4)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0002c2a4)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_0002c2a4" * (cast_expression "(code *)PTR___stack_chk_fail_0002c2a4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (if_statement "if (puVar7 != (uint *)0x0) {\n    iVar2 = (**(code **)(puVar10 + 0x13e70))();\n    if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }\n  }" if (parenthesized_expression "(puVar7 != (uint *)0x0)" ( (binary_expression "puVar7 != (uint *)0x0" identifier != (cast_expression "(uint *)0x0" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = (**(code **)(puVar10 + 0x13e70))();\n    if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }\n  }" { (expression_statement "iVar2 = (**(code **)(puVar10 + 0x13e70))();" (assignment_expression "iVar2 = (**(code **)(puVar10 + 0x13e70))()" identifier = (call_expression "(**(code **)(puVar10 + 0x13e70))()" (parenthesized_expression "(**(code **)(puVar10 + 0x13e70))" ( (pointer_expression "**(code **)(puVar10 + 0x13e70)" * (pointer_expression "*(code **)(puVar10 + 0x13e70)" * (cast_expression "(code **)(puVar10 + 0x13e70)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar10 + 0x13e70)" ( (binary_expression "puVar10 + 0x13e70" identifier + number_literal) ))))) )) (argument_list "()" ( )))) ;) (if_statement "if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }" if (parenthesized_expression "((iVar2 != 0) && ((*puVar7 & 0x100) != 0))" ( (binary_expression "(iVar2 != 0) && ((*puVar7 & 0x100) != 0)" (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) && (parenthesized_expression "((*puVar7 & 0x100) != 0)" ( (binary_expression "(*puVar7 & 0x100) != 0" (parenthesized_expression "(*puVar7 & 0x100)" ( (binary_expression "*puVar7 & 0x100" (pointer_expression "*puVar7" * identifier) & number_literal) )) != number_literal) ))) )) (compound_statement "{\n      rpl_fseeko(puVar7);\n                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }" { (expression_statement "rpl_fseeko(puVar7);" (call_expression "rpl_fseeko(puVar7)" identifier (argument_list "(puVar7)" ( identifier ))) ;) comment comment (expression_statement "iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);" (assignment_expression "iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7)" identifier = (call_expression "(**(code **)(puVar10 + 0x13ecc))(puVar7)" (parenthesized_expression "(**(code **)(puVar10 + 0x13ecc))" ( (pointer_expression "**(code **)(puVar10 + 0x13ecc)" * (pointer_expression "*(code **)(puVar10 + 0x13ecc)" * (cast_expression "(code **)(puVar10 + 0x13ecc)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar10 + 0x13ecc)" ( (binary_expression "puVar10 + 0x13ecc" identifier + number_literal) ))))) )) (argument_list "(puVar7)" ( identifier )))) ;) (return_statement "return iVar2;" return identifier ;) })) })) comment comment (expression_statement "iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);" (assignment_expression "iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7)" identifier = (call_expression "(**(code **)(puVar10 + 0x13ecc))(puVar7)" (parenthesized_expression "(**(code **)(puVar10 + 0x13ecc))" ( (pointer_expression "**(code **)(puVar10 + 0x13ecc)" * (pointer_expression "*(code **)(puVar10 + 0x13ecc)" * (cast_expression "(code **)(puVar10 + 0x13ecc)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar10 + 0x13ecc)" ( (binary_expression "puVar10 + 0x13ecc" identifier + number_literal) ))))) )) (argument_list "(puVar7)" ( identifier )))) ;) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "int rpl_fcntl(int fd,int action,...)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  int iVar4;\n  undefined4 *puVar5;\n  int *piVar6;\n  FILE *fp;\n  undefined4 in_a2;\n  int iVar7;\n  undefined4 uVar8;\n  int target;\n  undefined *puVar9;\n  undefined4 in_stack_ffffffb4;\n  va_list arg;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2b8;\n  puVar9 = PTR_DAT_0002c0f8;\n  fp = *(FILE **)PTR___stack_chk_guard_0002c2b8;\n  if (action != 0x406) {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }\n  if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {\n    action = 0;\n    iVar2 = rpl_fcntl(fd,0);\n    if ((iVar2 < 0) || (iVar7 = iVar2, *(int *)(puVar9 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    action = 1;\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar7);\n    if (-1 < (int)uVar3) {\n      action = 2;\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar7,2,uVar3 | 1);\n      iVar2 = iVar7;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar8 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar7);\n    *puVar5 = uVar8;\n  }\n  else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        action = 0;\n        iVar2 = rpl_fcntl(fd,0,in_a2);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar9 + -0x3b90) = 0xffffffff;\n        iVar7 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar9 + -0x3b90) = 1;\n  }\nLAB_000182c8:\n  if (fp == *(FILE **)puVar1) {\n    return iVar2;\n  }\n  puVar9 = PTR___stack_chk_fail_0002c2a4;\n  (*(code *)PTR___stack_chk_fail_0002c2a4)();\n  if (fp != (FILE *)0x0) {\n    iVar2 = (**(code **)(puVar9 + 0x13e70))();\n    if ((iVar2 != 0) && ((fp->_flags & 0x100U) != 0)) {\n      rpl_fseeko(fp,CONCAT44(1,in_stack_ffffffb4),action);\n                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n      iVar2 = (**(code **)(puVar9 + 0x13ecc))(fp);\n      return iVar2;\n    }\n  }\n                    /* WARNING: Could not recover jumptable at 0x00018458. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n  iVar2 = (**(code **)(puVar9 + 0x13ecc))(fp);\n  return iVar2;\n}\n\n" (function_definition "int rpl_fcntl(int fd,int action,...)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  int iVar4;\n  undefined4 *puVar5;\n  int *piVar6;\n  FILE *fp;\n  undefined4 in_a2;\n  int iVar7;\n  undefined4 uVar8;\n  int target;\n  undefined *puVar9;\n  undefined4 in_stack_ffffffb4;\n  va_list arg;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2b8;\n  puVar9 = PTR_DAT_0002c0f8;\n  fp = *(FILE **)PTR___stack_chk_guard_0002c2b8;\n  if (action != 0x406) {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }\n  if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {\n    action = 0;\n    iVar2 = rpl_fcntl(fd,0);\n    if ((iVar2 < 0) || (iVar7 = iVar2, *(int *)(puVar9 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    action = 1;\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar7);\n    if (-1 < (int)uVar3) {\n      action = 2;\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar7,2,uVar3 | 1);\n      iVar2 = iVar7;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar8 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar7);\n    *puVar5 = uVar8;\n  }\n  else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        action = 0;\n        iVar2 = rpl_fcntl(fd,0,in_a2);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar9 + -0x3b90) = 0xffffffff;\n        iVar7 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar9 + -0x3b90) = 1;\n  }\nLAB_000182c8:\n  if (fp == *(FILE **)puVar1) {\n    return iVar2;\n  }\n  puVar9 = PTR___stack_chk_fail_0002c2a4;\n  (*(code *)PTR___stack_chk_fail_0002c2a4)();\n  if (fp != (FILE *)0x0) {\n    iVar2 = (**(code **)(puVar9 + 0x13e70))();\n    if ((iVar2 != 0) && ((fp->_flags & 0x100U) != 0)) {\n      rpl_fseeko(fp,CONCAT44(1,in_stack_ffffffb4),action);\n                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n      iVar2 = (**(code **)(puVar9 + 0x13ecc))(fp);\n      return iVar2;\n    }\n  }\n                    /* WARNING: Could not recover jumptable at 0x00018458. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n  iVar2 = (**(code **)(puVar9 + 0x13ecc))(fp);\n  return iVar2;\n}" primitive_type (function_declarator "rpl_fcntl(int fd,int action,...)" identifier (parameter_list "(int fd,int action,...)" ( (parameter_declaration "int fd" primitive_type identifier) , (parameter_declaration "int action" primitive_type identifier) , (variadic_parameter "..." ...) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  int iVar4;\n  undefined4 *puVar5;\n  int *piVar6;\n  FILE *fp;\n  undefined4 in_a2;\n  int iVar7;\n  undefined4 uVar8;\n  int target;\n  undefined *puVar9;\n  undefined4 in_stack_ffffffb4;\n  va_list arg;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2b8;\n  puVar9 = PTR_DAT_0002c0f8;\n  fp = *(FILE **)PTR___stack_chk_guard_0002c2b8;\n  if (action != 0x406) {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }\n  if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {\n    action = 0;\n    iVar2 = rpl_fcntl(fd,0);\n    if ((iVar2 < 0) || (iVar7 = iVar2, *(int *)(puVar9 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    action = 1;\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar7);\n    if (-1 < (int)uVar3) {\n      action = 2;\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar7,2,uVar3 | 1);\n      iVar2 = iVar7;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar8 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar7);\n    *puVar5 = uVar8;\n  }\n  else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        action = 0;\n        iVar2 = rpl_fcntl(fd,0,in_a2);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar9 + -0x3b90) = 0xffffffff;\n        iVar7 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar9 + -0x3b90) = 1;\n  }\nLAB_000182c8:\n  if (fp == *(FILE **)puVar1) {\n    return iVar2;\n  }\n  puVar9 = PTR___stack_chk_fail_0002c2a4;\n  (*(code *)PTR___stack_chk_fail_0002c2a4)();\n  if (fp != (FILE *)0x0) {\n    iVar2 = (**(code **)(puVar9 + 0x13e70))();\n    if ((iVar2 != 0) && ((fp->_flags & 0x100U) != 0)) {\n      rpl_fseeko(fp,CONCAT44(1,in_stack_ffffffb4),action);\n                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n      iVar2 = (**(code **)(puVar9 + 0x13ecc))(fp);\n      return iVar2;\n    }\n  }\n                    /* WARNING: Could not recover jumptable at 0x00018458. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n  iVar2 = (**(code **)(puVar9 + 0x13ecc))(fp);\n  return iVar2;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "undefined4 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "int *piVar6;" primitive_type (pointer_declarator "*piVar6" * identifier) ;) (declaration "FILE *fp;" type_identifier (pointer_declarator "*fp" * identifier) ;) (declaration "undefined4 in_a2;" type_identifier identifier ;) (declaration "int iVar7;" primitive_type identifier ;) (declaration "undefined4 uVar8;" type_identifier identifier ;) (declaration "int target;" primitive_type identifier ;) (declaration "undefined *puVar9;" type_identifier (pointer_declarator "*puVar9" * identifier) ;) (declaration "undefined4 in_stack_ffffffb4;" type_identifier identifier ;) (declaration "va_list arg;" type_identifier identifier ;) (expression_statement "puVar1 = PTR___stack_chk_guard_0002c2b8;" (assignment_expression "puVar1 = PTR___stack_chk_guard_0002c2b8" identifier = identifier) ;) (expression_statement "puVar9 = PTR_DAT_0002c0f8;" (assignment_expression "puVar9 = PTR_DAT_0002c0f8" identifier = identifier) ;) (expression_statement "fp = *(FILE **)PTR___stack_chk_guard_0002c2b8;" (assignment_expression "fp = *(FILE **)PTR___stack_chk_guard_0002c2b8" identifier = (pointer_expression "*(FILE **)PTR___stack_chk_guard_0002c2b8" * (cast_expression "(FILE **)PTR___stack_chk_guard_0002c2b8" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (if_statement "if (action != 0x406) {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }" if (parenthesized_expression "(action != 0x406)" ( (binary_expression "action != 0x406" identifier != number_literal) )) (compound_statement "{\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }" { (expression_statement "iVar2 = (*(code *)PTR_fcntl64_0002c230)();" (assignment_expression "iVar2 = (*(code *)PTR_fcntl64_0002c230)()" identifier = (call_expression "(*(code *)PTR_fcntl64_0002c230)()" (parenthesized_expression "(*(code *)PTR_fcntl64_0002c230)" ( (pointer_expression "*(code *)PTR_fcntl64_0002c230" * (cast_expression "(code *)PTR_fcntl64_0002c230" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (goto_statement "goto LAB_000182c8;" goto statement_identifier ;) })) (if_statement "if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {\n    action = 0;\n    iVar2 = rpl_fcntl(fd,0);\n    if ((iVar2 < 0) || (iVar7 = iVar2, *(int *)(puVar9 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    action = 1;\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar7);\n    if (-1 < (int)uVar3) {\n      action = 2;\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar7,2,uVar3 | 1);\n      iVar2 = iVar7;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar8 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar7);\n    *puVar5 = uVar8;\n  }\n  else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        action = 0;\n        iVar2 = rpl_fcntl(fd,0,in_a2);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar9 + -0x3b90) = 0xffffffff;\n        iVar7 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar9 + -0x3b90) = 1;\n  }" if (parenthesized_expression "(*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0)" ( (binary_expression "*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0" (pointer_expression "*(int *)(PTR_DAT_0002c0f8 + -0x3b90)" * (cast_expression "(int *)(PTR_DAT_0002c0f8 + -0x3b90)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_DAT_0002c0f8 + -0x3b90)" ( (binary_expression "PTR_DAT_0002c0f8 + -0x3b90" identifier + number_literal) )))) < number_literal) )) (compound_statement "{\n    action = 0;\n    iVar2 = rpl_fcntl(fd,0);\n    if ((iVar2 < 0) || (iVar7 = iVar2, *(int *)(puVar9 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    action = 1;\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar7);\n    if (-1 < (int)uVar3) {\n      action = 2;\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar7,2,uVar3 | 1);\n      iVar2 = iVar7;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar8 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar7);\n    *puVar5 = uVar8;\n  }" { (expression_statement "action = 0;" (assignment_expression "action = 0" identifier = number_literal) ;) (expression_statement "iVar2 = rpl_fcntl(fd,0);" (assignment_expression "iVar2 = rpl_fcntl(fd,0)" identifier = (call_expression "rpl_fcntl(fd,0)" identifier (argument_list "(fd,0)" ( identifier , number_literal )))) ;) (if_statement "if ((iVar2 < 0) || (iVar7 = iVar2, *(int *)(puVar9 + -0x3b90) != -1)) goto LAB_000182c8;" if (parenthesized_expression "((iVar2 < 0) || (iVar7 = iVar2, *(int *)(puVar9 + -0x3b90) != -1))" ( (binary_expression "(iVar2 < 0) || (iVar7 = iVar2, *(int *)(puVar9 + -0x3b90) != -1)" (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) || (parenthesized_expression "(iVar7 = iVar2, *(int *)(puVar9 + -0x3b90) != -1)" ( (comma_expression "iVar7 = iVar2, *(int *)(puVar9 + -0x3b90) != -1" (assignment_expression "iVar7 = iVar2" identifier = identifier) , (binary_expression "*(int *)(puVar9 + -0x3b90) != -1" (pointer_expression "*(int *)(puVar9 + -0x3b90)" * (cast_expression "(int *)(puVar9 + -0x3b90)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar9 + -0x3b90)" ( (binary_expression "puVar9 + -0x3b90" identifier + number_literal) )))) != number_literal)) ))) )) (goto_statement "goto LAB_000182c8;" goto statement_identifier ;)) (labeled_statement "LAB_00018320:\n    action = 1;" statement_identifier : (expression_statement "action = 1;" (assignment_expression "action = 1" identifier = number_literal) ;)) (expression_statement "uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar7);" (assignment_expression "uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar7)" identifier = (call_expression "(*(code *)PTR_fcntl64_0002c230)(iVar7)" (parenthesized_expression "(*(code *)PTR_fcntl64_0002c230)" ( (pointer_expression "*(code *)PTR_fcntl64_0002c230" * (cast_expression "(code *)PTR_fcntl64_0002c230" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar7)" ( identifier )))) ;) (if_statement "if (-1 < (int)uVar3) {\n      action = 2;\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar7,2,uVar3 | 1);\n      iVar2 = iVar7;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }" if (parenthesized_expression "(-1 < (int)uVar3)" ( (binary_expression "-1 < (int)uVar3" number_literal < (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n      action = 2;\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar7,2,uVar3 | 1);\n      iVar2 = iVar7;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }" { (expression_statement "action = 2;" (assignment_expression "action = 2" identifier = number_literal) ;) (expression_statement "iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar7,2,uVar3 | 1);" (assignment_expression "iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar7,2,uVar3 | 1)" identifier = (call_expression "(*(code *)PTR_fcntl64_0002c230)(iVar7,2,uVar3 | 1)" (parenthesized_expression "(*(code *)PTR_fcntl64_0002c230)" ( (pointer_expression "*(code *)PTR_fcntl64_0002c230" * (cast_expression "(code *)PTR_fcntl64_0002c230" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar7,2,uVar3 | 1)" ( identifier , number_literal , (binary_expression "uVar3 | 1" identifier | number_literal) )))) ;) (expression_statement "iVar2 = iVar7;" (assignment_expression "iVar2 = iVar7" identifier = identifier) ;) (if_statement "if (iVar4 != -1) goto LAB_000182c8;" if (parenthesized_expression "(iVar4 != -1)" ( (binary_expression "iVar4 != -1" identifier != number_literal) )) (goto_statement "goto LAB_000182c8;" goto statement_identifier ;)) })) (expression_statement "puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();" (assignment_expression "puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_0002c244)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_0002c244)()" (parenthesized_expression "(*(code *)PTR___errno_location_0002c244)" ( (pointer_expression "*(code *)PTR___errno_location_0002c244" * (cast_expression "(code *)PTR___errno_location_0002c244" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "uVar8 = *puVar5;" (assignment_expression "uVar8 = *puVar5" identifier = (pointer_expression "*puVar5" * identifier)) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (expression_statement "(*(code *)PTR_close_0002c1e4)(iVar7);" (call_expression "(*(code *)PTR_close_0002c1e4)(iVar7)" (parenthesized_expression "(*(code *)PTR_close_0002c1e4)" ( (pointer_expression "*(code *)PTR_close_0002c1e4" * (cast_expression "(code *)PTR_close_0002c1e4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar7)" ( identifier ))) ;) (expression_statement "*puVar5 = uVar8;" (assignment_expression "*puVar5 = uVar8" (pointer_expression "*puVar5" * identifier) = identifier) ;) }) (else_clause "else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        action = 0;\n        iVar2 = rpl_fcntl(fd,0,in_a2);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar9 + -0x3b90) = 0xffffffff;\n        iVar7 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar9 + -0x3b90) = 1;\n  }" else (compound_statement "{\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        action = 0;\n        iVar2 = rpl_fcntl(fd,0,in_a2);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar9 + -0x3b90) = 0xffffffff;\n        iVar7 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar9 + -0x3b90) = 1;\n  }" { (expression_statement "iVar2 = (*(code *)PTR_fcntl64_0002c230)();" (assignment_expression "iVar2 = (*(code *)PTR_fcntl64_0002c230)()" identifier = (call_expression "(*(code *)PTR_fcntl64_0002c230)()" (parenthesized_expression "(*(code *)PTR_fcntl64_0002c230)" ( (pointer_expression "*(code *)PTR_fcntl64_0002c230" * (cast_expression "(code *)PTR_fcntl64_0002c230" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (if_statement "if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        action = 0;\n        iVar2 = rpl_fcntl(fd,0,in_a2);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar9 + -0x3b90) = 0xffffffff;\n        iVar7 = iVar2;\n        goto LAB_00018320;\n      }\n    }" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (compound_statement "{\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        action = 0;\n        iVar2 = rpl_fcntl(fd,0,in_a2);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar9 + -0x3b90) = 0xffffffff;\n        iVar7 = iVar2;\n        goto LAB_00018320;\n      }\n    }" { (expression_statement "piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();" (assignment_expression "piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_0002c244)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_0002c244)()" (parenthesized_expression "(*(code *)PTR___errno_location_0002c244)" ( (pointer_expression "*(code *)PTR___errno_location_0002c244" * (cast_expression "(code *)PTR___errno_location_0002c244" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (if_statement "if (*piVar6 == 0x16) {\n        action = 0;\n        iVar2 = rpl_fcntl(fd,0,in_a2);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar9 + -0x3b90) = 0xffffffff;\n        iVar7 = iVar2;\n        goto LAB_00018320;\n      }" if (parenthesized_expression "(*piVar6 == 0x16)" ( (binary_expression "*piVar6 == 0x16" (pointer_expression "*piVar6" * identifier) == number_literal) )) (compound_statement "{\n        action = 0;\n        iVar2 = rpl_fcntl(fd,0,in_a2);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar9 + -0x3b90) = 0xffffffff;\n        iVar7 = iVar2;\n        goto LAB_00018320;\n      }" { (expression_statement "action = 0;" (assignment_expression "action = 0" identifier = number_literal) ;) (expression_statement "iVar2 = rpl_fcntl(fd,0,in_a2);" (assignment_expression "iVar2 = rpl_fcntl(fd,0,in_a2)" identifier = (call_expression "rpl_fcntl(fd,0,in_a2)" identifier (argument_list "(fd,0,in_a2)" ( identifier , number_literal , identifier )))) ;) (if_statement "if (iVar2 < 0) goto LAB_000182c8;" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (goto_statement "goto LAB_000182c8;" goto statement_identifier ;)) (expression_statement "*(undefined4 *)(puVar9 + -0x3b90) = 0xffffffff;" (assignment_expression "*(undefined4 *)(puVar9 + -0x3b90) = 0xffffffff" (pointer_expression "*(undefined4 *)(puVar9 + -0x3b90)" * (cast_expression "(undefined4 *)(puVar9 + -0x3b90)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar9 + -0x3b90)" ( (binary_expression "puVar9 + -0x3b90" identifier + number_literal) )))) = number_literal) ;) (expression_statement "iVar7 = iVar2;" (assignment_expression "iVar7 = iVar2" identifier = identifier) ;) (goto_statement "goto LAB_00018320;" goto statement_identifier ;) })) })) (expression_statement "*(undefined4 *)(puVar9 + -0x3b90) = 1;" (assignment_expression "*(undefined4 *)(puVar9 + -0x3b90) = 1" (pointer_expression "*(undefined4 *)(puVar9 + -0x3b90)" * (cast_expression "(undefined4 *)(puVar9 + -0x3b90)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar9 + -0x3b90)" ( (binary_expression "puVar9 + -0x3b90" identifier + number_literal) )))) = number_literal) ;) }))) (labeled_statement "LAB_000182c8:\n  if (fp == *(FILE **)puVar1) {\n    return iVar2;\n  }" statement_identifier : (if_statement "if (fp == *(FILE **)puVar1) {\n    return iVar2;\n  }" if (parenthesized_expression "(fp == *(FILE **)puVar1)" ( (binary_expression "fp == *(FILE **)puVar1" identifier == (pointer_expression "*(FILE **)puVar1" * (cast_expression "(FILE **)puVar1" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) )) (compound_statement "{\n    return iVar2;\n  }" { (return_statement "return iVar2;" return identifier ;) }))) (expression_statement "puVar9 = PTR___stack_chk_fail_0002c2a4;" (assignment_expression "puVar9 = PTR___stack_chk_fail_0002c2a4" identifier = identifier) ;) (expression_statement "(*(code *)PTR___stack_chk_fail_0002c2a4)();" (call_expression "(*(code *)PTR___stack_chk_fail_0002c2a4)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0002c2a4)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_0002c2a4" * (cast_expression "(code *)PTR___stack_chk_fail_0002c2a4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (if_statement "if (fp != (FILE *)0x0) {\n    iVar2 = (**(code **)(puVar9 + 0x13e70))();\n    if ((iVar2 != 0) && ((fp->_flags & 0x100U) != 0)) {\n      rpl_fseeko(fp,CONCAT44(1,in_stack_ffffffb4),action);\n                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n      iVar2 = (**(code **)(puVar9 + 0x13ecc))(fp);\n      return iVar2;\n    }\n  }" if (parenthesized_expression "(fp != (FILE *)0x0)" ( (binary_expression "fp != (FILE *)0x0" identifier != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = (**(code **)(puVar9 + 0x13e70))();\n    if ((iVar2 != 0) && ((fp->_flags & 0x100U) != 0)) {\n      rpl_fseeko(fp,CONCAT44(1,in_stack_ffffffb4),action);\n                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n      iVar2 = (**(code **)(puVar9 + 0x13ecc))(fp);\n      return iVar2;\n    }\n  }" { (expression_statement "iVar2 = (**(code **)(puVar9 + 0x13e70))();" (assignment_expression "iVar2 = (**(code **)(puVar9 + 0x13e70))()" identifier = (call_expression "(**(code **)(puVar9 + 0x13e70))()" (parenthesized_expression "(**(code **)(puVar9 + 0x13e70))" ( (pointer_expression "**(code **)(puVar9 + 0x13e70)" * (pointer_expression "*(code **)(puVar9 + 0x13e70)" * (cast_expression "(code **)(puVar9 + 0x13e70)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar9 + 0x13e70)" ( (binary_expression "puVar9 + 0x13e70" identifier + number_literal) ))))) )) (argument_list "()" ( )))) ;) (if_statement "if ((iVar2 != 0) && ((fp->_flags & 0x100U) != 0)) {\n      rpl_fseeko(fp,CONCAT44(1,in_stack_ffffffb4),action);\n                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n      iVar2 = (**(code **)(puVar9 + 0x13ecc))(fp);\n      return iVar2;\n    }" if (parenthesized_expression "((iVar2 != 0) && ((fp->_flags & 0x100U) != 0))" ( (binary_expression "(iVar2 != 0) && ((fp->_flags & 0x100U) != 0)" (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) && (parenthesized_expression "((fp->_flags & 0x100U) != 0)" ( (binary_expression "(fp->_flags & 0x100U) != 0" (parenthesized_expression "(fp->_flags & 0x100U)" ( (binary_expression "fp->_flags & 0x100U" (field_expression "fp->_flags" identifier -> field_identifier) & number_literal) )) != number_literal) ))) )) (compound_statement "{\n      rpl_fseeko(fp,CONCAT44(1,in_stack_ffffffb4),action);\n                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n      iVar2 = (**(code **)(puVar9 + 0x13ecc))(fp);\n      return iVar2;\n    }" { (expression_statement "rpl_fseeko(fp,CONCAT44(1,in_stack_ffffffb4),action);" (call_expression "rpl_fseeko(fp,CONCAT44(1,in_stack_ffffffb4),action)" identifier (argument_list "(fp,CONCAT44(1,in_stack_ffffffb4),action)" ( identifier , (call_expression "CONCAT44(1,in_stack_ffffffb4)" identifier (argument_list "(1,in_stack_ffffffb4)" ( number_literal , identifier ))) , identifier ))) ;) comment comment (expression_statement "iVar2 = (**(code **)(puVar9 + 0x13ecc))(fp);" (assignment_expression "iVar2 = (**(code **)(puVar9 + 0x13ecc))(fp)" identifier = (call_expression "(**(code **)(puVar9 + 0x13ecc))(fp)" (parenthesized_expression "(**(code **)(puVar9 + 0x13ecc))" ( (pointer_expression "**(code **)(puVar9 + 0x13ecc)" * (pointer_expression "*(code **)(puVar9 + 0x13ecc)" * (cast_expression "(code **)(puVar9 + 0x13ecc)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar9 + 0x13ecc)" ( (binary_expression "puVar9 + 0x13ecc" identifier + number_literal) ))))) )) (argument_list "(fp)" ( identifier )))) ;) (return_statement "return iVar2;" return identifier ;) })) })) comment comment (expression_statement "iVar2 = (**(code **)(puVar9 + 0x13ecc))(fp);" (assignment_expression "iVar2 = (**(code **)(puVar9 + 0x13ecc))(fp)" identifier = (call_expression "(**(code **)(puVar9 + 0x13ecc))(fp)" (parenthesized_expression "(**(code **)(puVar9 + 0x13ecc))" ( (pointer_expression "**(code **)(puVar9 + 0x13ecc)" * (pointer_expression "*(code **)(puVar9 + 0x13ecc)" * (cast_expression "(code **)(puVar9 + 0x13ecc)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar9 + 0x13ecc)" ( (binary_expression "puVar9 + 0x13ecc" identifier + number_literal) ))))) )) (argument_list "(fp)" ( identifier )))) ;) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "int rpl_fcntl(undefined4 param_1,int param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  int iVar4;\n  undefined4 *puVar5;\n  int *piVar6;\n  uint *puVar7;\n  int iVar8;\n  undefined4 uVar9;\n  undefined *puVar10;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2b8;\n  puVar10 = PTR_DAT_0002c0f8;\n  puVar7 = *(uint **)PTR___stack_chk_guard_0002c2b8;\n  if (param_2 != 0x406) {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }\n  if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {\n    iVar2 = rpl_fcntl(param_1,0);\n    if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);\n    if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar9 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar8);\n    *puVar5 = uVar9;\n  }\n  else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }\nLAB_000182c8:\n  if (puVar7 == *(uint **)puVar1) {\n    return iVar2;\n  }\n  puVar10 = PTR___stack_chk_fail_0002c2a4;\n  (*(code *)PTR___stack_chk_fail_0002c2a4)();\n  if (puVar7 != (uint *)0x0) {\n    iVar2 = (**(code **)(puVar10 + 0x13e70))();\n    if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    \n                    \n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }\n  }\n                    \n                    \n  iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n  return iVar2;\n}\n\n" (function_definition "int rpl_fcntl(undefined4 param_1,int param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  int iVar4;\n  undefined4 *puVar5;\n  int *piVar6;\n  uint *puVar7;\n  int iVar8;\n  undefined4 uVar9;\n  undefined *puVar10;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2b8;\n  puVar10 = PTR_DAT_0002c0f8;\n  puVar7 = *(uint **)PTR___stack_chk_guard_0002c2b8;\n  if (param_2 != 0x406) {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }\n  if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {\n    iVar2 = rpl_fcntl(param_1,0);\n    if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);\n    if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar9 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar8);\n    *puVar5 = uVar9;\n  }\n  else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }\nLAB_000182c8:\n  if (puVar7 == *(uint **)puVar1) {\n    return iVar2;\n  }\n  puVar10 = PTR___stack_chk_fail_0002c2a4;\n  (*(code *)PTR___stack_chk_fail_0002c2a4)();\n  if (puVar7 != (uint *)0x0) {\n    iVar2 = (**(code **)(puVar10 + 0x13e70))();\n    if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    \n                    \n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }\n  }\n                    \n                    \n  iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n  return iVar2;\n}" primitive_type (function_declarator "rpl_fcntl(undefined4 param_1,int param_2,undefined4 param_3)" identifier (parameter_list "(undefined4 param_1,int param_2,undefined4 param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  int iVar4;\n  undefined4 *puVar5;\n  int *piVar6;\n  uint *puVar7;\n  int iVar8;\n  undefined4 uVar9;\n  undefined *puVar10;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2b8;\n  puVar10 = PTR_DAT_0002c0f8;\n  puVar7 = *(uint **)PTR___stack_chk_guard_0002c2b8;\n  if (param_2 != 0x406) {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }\n  if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {\n    iVar2 = rpl_fcntl(param_1,0);\n    if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);\n    if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar9 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar8);\n    *puVar5 = uVar9;\n  }\n  else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }\nLAB_000182c8:\n  if (puVar7 == *(uint **)puVar1) {\n    return iVar2;\n  }\n  puVar10 = PTR___stack_chk_fail_0002c2a4;\n  (*(code *)PTR___stack_chk_fail_0002c2a4)();\n  if (puVar7 != (uint *)0x0) {\n    iVar2 = (**(code **)(puVar10 + 0x13e70))();\n    if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    \n                    \n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }\n  }\n                    \n                    \n  iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n  return iVar2;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "undefined4 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "int *piVar6;" primitive_type (pointer_declarator "*piVar6" * identifier) ;) (declaration "uint *puVar7;" type_identifier (pointer_declarator "*puVar7" * identifier) ;) (declaration "int iVar8;" primitive_type identifier ;) (declaration "undefined4 uVar9;" type_identifier identifier ;) (declaration "undefined *puVar10;" type_identifier (pointer_declarator "*puVar10" * identifier) ;) (expression_statement "puVar1 = PTR___stack_chk_guard_0002c2b8;" (assignment_expression "puVar1 = PTR___stack_chk_guard_0002c2b8" identifier = identifier) ;) (expression_statement "puVar10 = PTR_DAT_0002c0f8;" (assignment_expression "puVar10 = PTR_DAT_0002c0f8" identifier = identifier) ;) (expression_statement "puVar7 = *(uint **)PTR___stack_chk_guard_0002c2b8;" (assignment_expression "puVar7 = *(uint **)PTR___stack_chk_guard_0002c2b8" identifier = (pointer_expression "*(uint **)PTR___stack_chk_guard_0002c2b8" * (cast_expression "(uint **)PTR___stack_chk_guard_0002c2b8" ( (type_descriptor "uint **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (if_statement "if (param_2 != 0x406) {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }" if (parenthesized_expression "(param_2 != 0x406)" ( (binary_expression "param_2 != 0x406" identifier != number_literal) )) (compound_statement "{\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }" { (expression_statement "iVar2 = (*(code *)PTR_fcntl64_0002c230)();" (assignment_expression "iVar2 = (*(code *)PTR_fcntl64_0002c230)()" identifier = (call_expression "(*(code *)PTR_fcntl64_0002c230)()" (parenthesized_expression "(*(code *)PTR_fcntl64_0002c230)" ( (pointer_expression "*(code *)PTR_fcntl64_0002c230" * (cast_expression "(code *)PTR_fcntl64_0002c230" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (goto_statement "goto LAB_000182c8;" goto statement_identifier ;) })) (if_statement "if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {\n    iVar2 = rpl_fcntl(param_1,0);\n    if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);\n    if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar9 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar8);\n    *puVar5 = uVar9;\n  }\n  else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }" if (parenthesized_expression "(*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0)" ( (binary_expression "*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0" (pointer_expression "*(int *)(PTR_DAT_0002c0f8 + -0x3b90)" * (cast_expression "(int *)(PTR_DAT_0002c0f8 + -0x3b90)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_DAT_0002c0f8 + -0x3b90)" ( (binary_expression "PTR_DAT_0002c0f8 + -0x3b90" identifier + number_literal) )))) < number_literal) )) (compound_statement "{\n    iVar2 = rpl_fcntl(param_1,0);\n    if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);\n    if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar9 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar8);\n    *puVar5 = uVar9;\n  }" { (expression_statement "iVar2 = rpl_fcntl(param_1,0);" (assignment_expression "iVar2 = rpl_fcntl(param_1,0)" identifier = (call_expression "rpl_fcntl(param_1,0)" identifier (argument_list "(param_1,0)" ( identifier , number_literal )))) ;) (if_statement "if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;" if (parenthesized_expression "((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1))" ( (binary_expression "(iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)" (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) || (parenthesized_expression "(iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)" ( (comma_expression "iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1" (assignment_expression "iVar8 = iVar2" identifier = identifier) , (binary_expression "*(int *)(puVar10 + -0x3b90) != -1" (pointer_expression "*(int *)(puVar10 + -0x3b90)" * (cast_expression "(int *)(puVar10 + -0x3b90)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar10 + -0x3b90)" ( (binary_expression "puVar10 + -0x3b90" identifier + number_literal) )))) != number_literal)) ))) )) (goto_statement "goto LAB_000182c8;" goto statement_identifier ;)) (labeled_statement "LAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);" statement_identifier : (expression_statement "uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);" (assignment_expression "uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1)" identifier = (call_expression "(*(code *)PTR_fcntl64_0002c230)(iVar8,1)" (parenthesized_expression "(*(code *)PTR_fcntl64_0002c230)" ( (pointer_expression "*(code *)PTR_fcntl64_0002c230" * (cast_expression "(code *)PTR_fcntl64_0002c230" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar8,1)" ( identifier , number_literal )))) ;)) (if_statement "if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }" if (parenthesized_expression "(-1 < (int)uVar3)" ( (binary_expression "-1 < (int)uVar3" number_literal < (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }" { (expression_statement "iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);" (assignment_expression "iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1)" identifier = (call_expression "(*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1)" (parenthesized_expression "(*(code *)PTR_fcntl64_0002c230)" ( (pointer_expression "*(code *)PTR_fcntl64_0002c230" * (cast_expression "(code *)PTR_fcntl64_0002c230" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar8,2,uVar3 | 1)" ( identifier , number_literal , (binary_expression "uVar3 | 1" identifier | number_literal) )))) ;) (expression_statement "iVar2 = iVar8;" (assignment_expression "iVar2 = iVar8" identifier = identifier) ;) (if_statement "if (iVar4 != -1) goto LAB_000182c8;" if (parenthesized_expression "(iVar4 != -1)" ( (binary_expression "iVar4 != -1" identifier != number_literal) )) (goto_statement "goto LAB_000182c8;" goto statement_identifier ;)) })) (expression_statement "puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();" (assignment_expression "puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_0002c244)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_0002c244)()" (parenthesized_expression "(*(code *)PTR___errno_location_0002c244)" ( (pointer_expression "*(code *)PTR___errno_location_0002c244" * (cast_expression "(code *)PTR___errno_location_0002c244" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "uVar9 = *puVar5;" (assignment_expression "uVar9 = *puVar5" identifier = (pointer_expression "*puVar5" * identifier)) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (expression_statement "(*(code *)PTR_close_0002c1e4)(iVar8);" (call_expression "(*(code *)PTR_close_0002c1e4)(iVar8)" (parenthesized_expression "(*(code *)PTR_close_0002c1e4)" ( (pointer_expression "*(code *)PTR_close_0002c1e4" * (cast_expression "(code *)PTR_close_0002c1e4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar8)" ( identifier ))) ;) (expression_statement "*puVar5 = uVar9;" (assignment_expression "*puVar5 = uVar9" (pointer_expression "*puVar5" * identifier) = identifier) ;) }) (else_clause "else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }" else (compound_statement "{\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }" { (expression_statement "iVar2 = (*(code *)PTR_fcntl64_0002c230)();" (assignment_expression "iVar2 = (*(code *)PTR_fcntl64_0002c230)()" identifier = (call_expression "(*(code *)PTR_fcntl64_0002c230)()" (parenthesized_expression "(*(code *)PTR_fcntl64_0002c230)" ( (pointer_expression "*(code *)PTR_fcntl64_0002c230" * (cast_expression "(code *)PTR_fcntl64_0002c230" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (if_statement "if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (compound_statement "{\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }" { (expression_statement "piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();" (assignment_expression "piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_0002c244)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_0002c244)()" (parenthesized_expression "(*(code *)PTR___errno_location_0002c244)" ( (pointer_expression "*(code *)PTR___errno_location_0002c244" * (cast_expression "(code *)PTR___errno_location_0002c244" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (if_statement "if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }" if (parenthesized_expression "(*piVar6 == 0x16)" ( (binary_expression "*piVar6 == 0x16" (pointer_expression "*piVar6" * identifier) == number_literal) )) (compound_statement "{\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }" { (expression_statement "iVar2 = rpl_fcntl(param_1,0,param_3);" (assignment_expression "iVar2 = rpl_fcntl(param_1,0,param_3)" identifier = (call_expression "rpl_fcntl(param_1,0,param_3)" identifier (argument_list "(param_1,0,param_3)" ( identifier , number_literal , identifier )))) ;) (if_statement "if (iVar2 < 0) goto LAB_000182c8;" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (goto_statement "goto LAB_000182c8;" goto statement_identifier ;)) (expression_statement "*(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;" (assignment_expression "*(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff" (pointer_expression "*(undefined4 *)(puVar10 + -0x3b90)" * (cast_expression "(undefined4 *)(puVar10 + -0x3b90)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar10 + -0x3b90)" ( (binary_expression "puVar10 + -0x3b90" identifier + number_literal) )))) = number_literal) ;) (expression_statement "iVar8 = iVar2;" (assignment_expression "iVar8 = iVar2" identifier = identifier) ;) (goto_statement "goto LAB_00018320;" goto statement_identifier ;) })) })) (expression_statement "*(undefined4 *)(puVar10 + -0x3b90) = 1;" (assignment_expression "*(undefined4 *)(puVar10 + -0x3b90) = 1" (pointer_expression "*(undefined4 *)(puVar10 + -0x3b90)" * (cast_expression "(undefined4 *)(puVar10 + -0x3b90)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar10 + -0x3b90)" ( (binary_expression "puVar10 + -0x3b90" identifier + number_literal) )))) = number_literal) ;) }))) (labeled_statement "LAB_000182c8:\n  if (puVar7 == *(uint **)puVar1) {\n    return iVar2;\n  }" statement_identifier : (if_statement "if (puVar7 == *(uint **)puVar1) {\n    return iVar2;\n  }" if (parenthesized_expression "(puVar7 == *(uint **)puVar1)" ( (binary_expression "puVar7 == *(uint **)puVar1" identifier == (pointer_expression "*(uint **)puVar1" * (cast_expression "(uint **)puVar1" ( (type_descriptor "uint **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) )) (compound_statement "{\n    return iVar2;\n  }" { (return_statement "return iVar2;" return identifier ;) }))) (expression_statement "puVar10 = PTR___stack_chk_fail_0002c2a4;" (assignment_expression "puVar10 = PTR___stack_chk_fail_0002c2a4" identifier = identifier) ;) (expression_statement "(*(code *)PTR___stack_chk_fail_0002c2a4)();" (call_expression "(*(code *)PTR___stack_chk_fail_0002c2a4)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0002c2a4)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_0002c2a4" * (cast_expression "(code *)PTR___stack_chk_fail_0002c2a4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (if_statement "if (puVar7 != (uint *)0x0) {\n    iVar2 = (**(code **)(puVar10 + 0x13e70))();\n    if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    \n                    \n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }\n  }" if (parenthesized_expression "(puVar7 != (uint *)0x0)" ( (binary_expression "puVar7 != (uint *)0x0" identifier != (cast_expression "(uint *)0x0" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = (**(code **)(puVar10 + 0x13e70))();\n    if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    \n                    \n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }\n  }" { (expression_statement "iVar2 = (**(code **)(puVar10 + 0x13e70))();" (assignment_expression "iVar2 = (**(code **)(puVar10 + 0x13e70))()" identifier = (call_expression "(**(code **)(puVar10 + 0x13e70))()" (parenthesized_expression "(**(code **)(puVar10 + 0x13e70))" ( (pointer_expression "**(code **)(puVar10 + 0x13e70)" * (pointer_expression "*(code **)(puVar10 + 0x13e70)" * (cast_expression "(code **)(puVar10 + 0x13e70)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar10 + 0x13e70)" ( (binary_expression "puVar10 + 0x13e70" identifier + number_literal) ))))) )) (argument_list "()" ( )))) ;) (if_statement "if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    \n                    \n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }" if (parenthesized_expression "((iVar2 != 0) && ((*puVar7 & 0x100) != 0))" ( (binary_expression "(iVar2 != 0) && ((*puVar7 & 0x100) != 0)" (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) && (parenthesized_expression "((*puVar7 & 0x100) != 0)" ( (binary_expression "(*puVar7 & 0x100) != 0" (parenthesized_expression "(*puVar7 & 0x100)" ( (binary_expression "*puVar7 & 0x100" (pointer_expression "*puVar7" * identifier) & number_literal) )) != number_literal) ))) )) (compound_statement "{\n      rpl_fseeko(puVar7);\n                    \n                    \n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }" { (expression_statement "rpl_fseeko(puVar7);" (call_expression "rpl_fseeko(puVar7)" identifier (argument_list "(puVar7)" ( identifier ))) ;) (expression_statement "iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);" (assignment_expression "iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7)" identifier = (call_expression "(**(code **)(puVar10 + 0x13ecc))(puVar7)" (parenthesized_expression "(**(code **)(puVar10 + 0x13ecc))" ( (pointer_expression "**(code **)(puVar10 + 0x13ecc)" * (pointer_expression "*(code **)(puVar10 + 0x13ecc)" * (cast_expression "(code **)(puVar10 + 0x13ecc)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar10 + 0x13ecc)" ( (binary_expression "puVar10 + 0x13ecc" identifier + number_literal) ))))) )) (argument_list "(puVar7)" ( identifier )))) ;) (return_statement "return iVar2;" return identifier ;) })) })) (expression_statement "iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);" (assignment_expression "iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7)" identifier = (call_expression "(**(code **)(puVar10 + 0x13ecc))(puVar7)" (parenthesized_expression "(**(code **)(puVar10 + 0x13ecc))" ( (pointer_expression "**(code **)(puVar10 + 0x13ecc)" * (pointer_expression "*(code **)(puVar10 + 0x13ecc)" * (cast_expression "(code **)(puVar10 + 0x13ecc)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar10 + 0x13ecc)" ( (binary_expression "puVar10 + 0x13ecc" identifier + number_literal) ))))) )) (argument_list "(puVar7)" ( identifier )))) ;) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( )))) ;) (goto_statement goto statement_identifier ;) })) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT < LIT) )) || (parenthesized_expression ( (comma_expression (assignment_expression IDENT = IDENT) , (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != LIT)) ))) )) (goto_statement goto statement_identifier ;)) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , LIT )))) ;)) (if_statement if (parenthesized_expression ( (binary_expression LIT < (cast_expression ( (type_descriptor TYPE) ) IDENT)) )) (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) )))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (goto_statement goto statement_identifier ;)) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (goto_statement goto statement_identifier ;) })) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) }))) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) IDENT))) )) (compound_statement { (return_statement return IDENT ;) }))) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != LIT) )) && (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) & LIT) )) != LIT) ))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (argument_list ( IDENT )))) ;) (return_statement return IDENT ;) })) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (argument_list ( IDENT )))) ;) (return_statement return IDENT ;) })))
(function_definition "int rpl_fcntl(undefined4 param_1,int param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  int iVar4;\n  undefined4 *puVar5;\n  int *piVar6;\n  uint *puVar7;\n  int iVar8;\n  undefined4 uVar9;\n  undefined *puVar10;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2b8;\n  puVar10 = PTR_DAT_0002c0f8;\n  puVar7 = *(uint **)PTR___stack_chk_guard_0002c2b8;\n  if (param_2 != 0x406) {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }\n  if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {\n    iVar2 = rpl_fcntl(param_1,0);\n    if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);\n    if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar9 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar8);\n    *puVar5 = uVar9;\n  }\n  else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }\nLAB_000182c8:\n  if (puVar7 == *(uint **)puVar1) {\n    return iVar2;\n  }\n  puVar10 = PTR___stack_chk_fail_0002c2a4;\n  (*(code *)PTR___stack_chk_fail_0002c2a4)();\n  if (puVar7 != (uint *)0x0) {\n    iVar2 = (**(code **)(puVar10 + 0x13e70))();\n    if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    \n                    \n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }\n  }\n                    \n                    \n  iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n  return iVar2;\n}" (primitive_type "int") (function_declarator "rpl_fcntl(undefined4 param_1,int param_2,undefined4 param_3)" (identifier "rpl_fcntl") (parameter_list "(undefined4 param_1,int param_2,undefined4 param_3)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) () ")"))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  int iVar4;\n  undefined4 *puVar5;\n  int *piVar6;\n  uint *puVar7;\n  int iVar8;\n  undefined4 uVar9;\n  undefined *puVar10;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2b8;\n  puVar10 = PTR_DAT_0002c0f8;\n  puVar7 = *(uint **)PTR___stack_chk_guard_0002c2b8;\n  if (param_2 != 0x406) {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }\n  if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {\n    iVar2 = rpl_fcntl(param_1,0);\n    if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);\n    if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar9 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar8);\n    *puVar5 = uVar9;\n  }\n  else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }\nLAB_000182c8:\n  if (puVar7 == *(uint **)puVar1) {\n    return iVar2;\n  }\n  puVar10 = PTR___stack_chk_fail_0002c2a4;\n  (*(code *)PTR___stack_chk_fail_0002c2a4)();\n  if (puVar7 != (uint *)0x0) {\n    iVar2 = (**(code **)(puVar10 + 0x13e70))();\n    if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    \n                    \n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }\n  }\n                    \n                    \n  iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n  return iVar2;\n}" ({ "{") (declaration "undefined *puVar1;" (type_identifier "undefined") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "undefined4 *puVar5;" (type_identifier "undefined4") (pointer_declarator "*puVar5" (* "*") (identifier "puVar5")) (; ";")) (declaration "int *piVar6;" (primitive_type "int") (pointer_declarator "*piVar6" (* "*") (identifier "piVar6")) (; ";")) (declaration "uint *puVar7;" (type_identifier "uint") (pointer_declarator "*puVar7" (* "*") (identifier "puVar7")) (; ";")) (declaration "int iVar8;" (primitive_type "int") (identifier "iVar8") (; ";")) (declaration "undefined4 uVar9;" (type_identifier "undefined4") (identifier "uVar9") (; ";")) (declaration "undefined *puVar10;" (type_identifier "undefined") (pointer_declarator "*puVar10" (* "*") (identifier "puVar10")) (; ";")) (expression_statement "puVar1 = PTR___stack_chk_guard_0002c2b8;" (assignment_expression "puVar1 = PTR___stack_chk_guard_0002c2b8" (identifier "puVar1") (= "=") (identifier "PTR___stack_chk_guard_0002c2b8")) (; ";")) (expression_statement "puVar10 = PTR_DAT_0002c0f8;" (assignment_expression "puVar10 = PTR_DAT_0002c0f8" (identifier "puVar10") (= "=") (identifier "PTR_DAT_0002c0f8")) (; ";")) (expression_statement "puVar7 = *(uint **)PTR___stack_chk_guard_0002c2b8;" (assignment_expression "puVar7 = *(uint **)PTR___stack_chk_guard_0002c2b8" (identifier "puVar7") (= "=") (pointer_expression "*(uint **)PTR___stack_chk_guard_0002c2b8" (* "*") (cast_expression "(uint **)PTR___stack_chk_guard_0002c2b8" (( "(") (type_descriptor "uint **" (type_identifier "uint") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (identifier "PTR___stack_chk_guard_0002c2b8")))) (; ";")) (if_statement "if (param_2 != 0x406) {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }" (if "if") (parenthesized_expression "(param_2 != 0x406)" (( "(") (binary_expression "param_2 != 0x406" (identifier "param_2") (!= "!=") (number_literal "0x406")) () ")")) (compound_statement "{\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    goto LAB_000182c8;\n  }" ({ "{") (expression_statement "iVar2 = (*(code *)PTR_fcntl64_0002c230)();" (assignment_expression "iVar2 = (*(code *)PTR_fcntl64_0002c230)()" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_fcntl64_0002c230)()" (parenthesized_expression "(*(code *)PTR_fcntl64_0002c230)" (( "(") (pointer_expression "*(code *)PTR_fcntl64_0002c230" (* "*") (cast_expression "(code *)PTR_fcntl64_0002c230" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_fcntl64_0002c230"))) () ")")) (argument_list "()" (( "(") () ")")))) (; ";")) (goto_statement "goto LAB_000182c8;" (goto "goto") (statement_identifier "LAB_000182c8") (; ";")) (} "}"))) (if_statement "if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {\n    iVar2 = rpl_fcntl(param_1,0);\n    if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);\n    if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar9 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar8);\n    *puVar5 = uVar9;\n  }\n  else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }" (if "if") (parenthesized_expression "(*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0)" (( "(") (binary_expression "*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0" (pointer_expression "*(int *)(PTR_DAT_0002c0f8 + -0x3b90)" (* "*") (cast_expression "(int *)(PTR_DAT_0002c0f8 + -0x3b90)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(PTR_DAT_0002c0f8 + -0x3b90)" (( "(") (binary_expression "PTR_DAT_0002c0f8 + -0x3b90" (identifier "PTR_DAT_0002c0f8") (+ "+") (number_literal "-0x3b90")) () ")")))) (< "<") (number_literal "0")) () ")")) (compound_statement "{\n    iVar2 = rpl_fcntl(param_1,0);\n    if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;\nLAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);\n    if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }\n    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();\n    uVar9 = *puVar5;\n    iVar2 = -1;\n    (*(code *)PTR_close_0002c1e4)(iVar8);\n    *puVar5 = uVar9;\n  }" ({ "{") (expression_statement "iVar2 = rpl_fcntl(param_1,0);" (assignment_expression "iVar2 = rpl_fcntl(param_1,0)" (identifier "iVar2") (= "=") (call_expression "rpl_fcntl(param_1,0)" (identifier "rpl_fcntl") (argument_list "(param_1,0)" (( "(") (identifier "param_1") (, ",") (number_literal "0") () ")")))) (; ";")) (if_statement "if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;" (if "if") (parenthesized_expression "((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1))" (( "(") (binary_expression "(iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)" (parenthesized_expression "(iVar2 < 0)" (( "(") (binary_expression "iVar2 < 0" (identifier "iVar2") (< "<") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)" (( "(") (comma_expression "iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1" (assignment_expression "iVar8 = iVar2" (identifier "iVar8") (= "=") (identifier "iVar2")) (, ",") (binary_expression "*(int *)(puVar10 + -0x3b90) != -1" (pointer_expression "*(int *)(puVar10 + -0x3b90)" (* "*") (cast_expression "(int *)(puVar10 + -0x3b90)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar10 + -0x3b90)" (( "(") (binary_expression "puVar10 + -0x3b90" (identifier "puVar10") (+ "+") (number_literal "-0x3b90")) () ")")))) (!= "!=") (number_literal "-1"))) () ")"))) () ")")) (goto_statement "goto LAB_000182c8;" (goto "goto") (statement_identifier "LAB_000182c8") (; ";"))) (labeled_statement "LAB_00018320:\n    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);" (statement_identifier "LAB_00018320") (: ":") (expression_statement "uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);" (assignment_expression "uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1)" (identifier "uVar3") (= "=") (call_expression "(*(code *)PTR_fcntl64_0002c230)(iVar8,1)" (parenthesized_expression "(*(code *)PTR_fcntl64_0002c230)" (( "(") (pointer_expression "*(code *)PTR_fcntl64_0002c230" (* "*") (cast_expression "(code *)PTR_fcntl64_0002c230" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_fcntl64_0002c230"))) () ")")) (argument_list "(iVar8,1)" (( "(") (identifier "iVar8") (, ",") (number_literal "1") () ")")))) (; ";"))) (if_statement "if (-1 < (int)uVar3) {\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }" (if "if") (parenthesized_expression "(-1 < (int)uVar3)" (( "(") (binary_expression "-1 < (int)uVar3" (number_literal "-1") (< "<") (cast_expression "(int)uVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar3"))) () ")")) (compound_statement "{\n      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);\n      iVar2 = iVar8;\n      if (iVar4 != -1) goto LAB_000182c8;\n    }" ({ "{") (expression_statement "iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);" (assignment_expression "iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1)" (identifier "iVar4") (= "=") (call_expression "(*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1)" (parenthesized_expression "(*(code *)PTR_fcntl64_0002c230)" (( "(") (pointer_expression "*(code *)PTR_fcntl64_0002c230" (* "*") (cast_expression "(code *)PTR_fcntl64_0002c230" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_fcntl64_0002c230"))) () ")")) (argument_list "(iVar8,2,uVar3 | 1)" (( "(") (identifier "iVar8") (, ",") (number_literal "2") (, ",") (binary_expression "uVar3 | 1" (identifier "uVar3") (| "|") (number_literal "1")) () ")")))) (; ";")) (expression_statement "iVar2 = iVar8;" (assignment_expression "iVar2 = iVar8" (identifier "iVar2") (= "=") (identifier "iVar8")) (; ";")) (if_statement "if (iVar4 != -1) goto LAB_000182c8;" (if "if") (parenthesized_expression "(iVar4 != -1)" (( "(") (binary_expression "iVar4 != -1" (identifier "iVar4") (!= "!=") (number_literal "-1")) () ")")) (goto_statement "goto LAB_000182c8;" (goto "goto") (statement_identifier "LAB_000182c8") (; ";"))) (} "}"))) (expression_statement "puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();" (assignment_expression "puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)()" (identifier "puVar5") (= "=") (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_0002c244)()" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___errno_location_0002c244)()" (parenthesized_expression "(*(code *)PTR___errno_location_0002c244)" (( "(") (pointer_expression "*(code *)PTR___errno_location_0002c244" (* "*") (cast_expression "(code *)PTR___errno_location_0002c244" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___errno_location_0002c244"))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "uVar9 = *puVar5;" (assignment_expression "uVar9 = *puVar5" (identifier "uVar9") (= "=") (pointer_expression "*puVar5" (* "*") (identifier "puVar5"))) (; ";")) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" (identifier "iVar2") (= "=") (number_literal "-1")) (; ";")) (expression_statement "(*(code *)PTR_close_0002c1e4)(iVar8);" (call_expression "(*(code *)PTR_close_0002c1e4)(iVar8)" (parenthesized_expression "(*(code *)PTR_close_0002c1e4)" (( "(") (pointer_expression "*(code *)PTR_close_0002c1e4" (* "*") (cast_expression "(code *)PTR_close_0002c1e4" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_close_0002c1e4"))) () ")")) (argument_list "(iVar8)" (( "(") (identifier "iVar8") () ")"))) (; ";")) (expression_statement "*puVar5 = uVar9;" (assignment_expression "*puVar5 = uVar9" (pointer_expression "*puVar5" (* "*") (identifier "puVar5")) (= "=") (identifier "uVar9")) (; ";")) (} "}")) (else_clause "else {\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }" (else "else") (compound_statement "{\n    iVar2 = (*(code *)PTR_fcntl64_0002c230)();\n    if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }\n    *(undefined4 *)(puVar10 + -0x3b90) = 1;\n  }" ({ "{") (expression_statement "iVar2 = (*(code *)PTR_fcntl64_0002c230)();" (assignment_expression "iVar2 = (*(code *)PTR_fcntl64_0002c230)()" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_fcntl64_0002c230)()" (parenthesized_expression "(*(code *)PTR_fcntl64_0002c230)" (( "(") (pointer_expression "*(code *)PTR_fcntl64_0002c230" (* "*") (cast_expression "(code *)PTR_fcntl64_0002c230" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_fcntl64_0002c230"))) () ")")) (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (iVar2 < 0) {\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }" (if "if") (parenthesized_expression "(iVar2 < 0)" (( "(") (binary_expression "iVar2 < 0" (identifier "iVar2") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();\n      if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }\n    }" ({ "{") (expression_statement "piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();" (assignment_expression "piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)()" (identifier "piVar6") (= "=") (cast_expression "(int *)(*(code *)PTR___errno_location_0002c244)()" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___errno_location_0002c244)()" (parenthesized_expression "(*(code *)PTR___errno_location_0002c244)" (( "(") (pointer_expression "*(code *)PTR___errno_location_0002c244" (* "*") (cast_expression "(code *)PTR___errno_location_0002c244" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___errno_location_0002c244"))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (if_statement "if (*piVar6 == 0x16) {\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }" (if "if") (parenthesized_expression "(*piVar6 == 0x16)" (( "(") (binary_expression "*piVar6 == 0x16" (pointer_expression "*piVar6" (* "*") (identifier "piVar6")) (== "==") (number_literal "0x16")) () ")")) (compound_statement "{\n        iVar2 = rpl_fcntl(param_1,0,param_3);\n        if (iVar2 < 0) goto LAB_000182c8;\n        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;\n        iVar8 = iVar2;\n        goto LAB_00018320;\n      }" ({ "{") (expression_statement "iVar2 = rpl_fcntl(param_1,0,param_3);" (assignment_expression "iVar2 = rpl_fcntl(param_1,0,param_3)" (identifier "iVar2") (= "=") (call_expression "rpl_fcntl(param_1,0,param_3)" (identifier "rpl_fcntl") (argument_list "(param_1,0,param_3)" (( "(") (identifier "param_1") (, ",") (number_literal "0") (, ",") (identifier "param_3") () ")")))) (; ";")) (if_statement "if (iVar2 < 0) goto LAB_000182c8;" (if "if") (parenthesized_expression "(iVar2 < 0)" (( "(") (binary_expression "iVar2 < 0" (identifier "iVar2") (< "<") (number_literal "0")) () ")")) (goto_statement "goto LAB_000182c8;" (goto "goto") (statement_identifier "LAB_000182c8") (; ";"))) (expression_statement "*(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;" (assignment_expression "*(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff" (pointer_expression "*(undefined4 *)(puVar10 + -0x3b90)" (* "*") (cast_expression "(undefined4 *)(puVar10 + -0x3b90)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar10 + -0x3b90)" (( "(") (binary_expression "puVar10 + -0x3b90" (identifier "puVar10") (+ "+") (number_literal "-0x3b90")) () ")")))) (= "=") (number_literal "0xffffffff")) (; ";")) (expression_statement "iVar8 = iVar2;" (assignment_expression "iVar8 = iVar2" (identifier "iVar8") (= "=") (identifier "iVar2")) (; ";")) (goto_statement "goto LAB_00018320;" (goto "goto") (statement_identifier "LAB_00018320") (; ";")) (} "}"))) (} "}"))) (expression_statement "*(undefined4 *)(puVar10 + -0x3b90) = 1;" (assignment_expression "*(undefined4 *)(puVar10 + -0x3b90) = 1" (pointer_expression "*(undefined4 *)(puVar10 + -0x3b90)" (* "*") (cast_expression "(undefined4 *)(puVar10 + -0x3b90)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar10 + -0x3b90)" (( "(") (binary_expression "puVar10 + -0x3b90" (identifier "puVar10") (+ "+") (number_literal "-0x3b90")) () ")")))) (= "=") (number_literal "1")) (; ";")) (} "}")))) (labeled_statement "LAB_000182c8:\n  if (puVar7 == *(uint **)puVar1) {\n    return iVar2;\n  }" (statement_identifier "LAB_000182c8") (: ":") (if_statement "if (puVar7 == *(uint **)puVar1) {\n    return iVar2;\n  }" (if "if") (parenthesized_expression "(puVar7 == *(uint **)puVar1)" (( "(") (binary_expression "puVar7 == *(uint **)puVar1" (identifier "puVar7") (== "==") (pointer_expression "*(uint **)puVar1" (* "*") (cast_expression "(uint **)puVar1" (( "(") (type_descriptor "uint **" (type_identifier "uint") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (identifier "puVar1")))) () ")")) (compound_statement "{\n    return iVar2;\n  }" ({ "{") (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}")))) (expression_statement "puVar10 = PTR___stack_chk_fail_0002c2a4;" (assignment_expression "puVar10 = PTR___stack_chk_fail_0002c2a4" (identifier "puVar10") (= "=") (identifier "PTR___stack_chk_fail_0002c2a4")) (; ";")) (expression_statement "(*(code *)PTR___stack_chk_fail_0002c2a4)();" (call_expression "(*(code *)PTR___stack_chk_fail_0002c2a4)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0002c2a4)" (( "(") (pointer_expression "*(code *)PTR___stack_chk_fail_0002c2a4" (* "*") (cast_expression "(code *)PTR___stack_chk_fail_0002c2a4" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_fail_0002c2a4"))) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (if_statement "if (puVar7 != (uint *)0x0) {\n    iVar2 = (**(code **)(puVar10 + 0x13e70))();\n    if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    \n                    \n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }\n  }" (if "if") (parenthesized_expression "(puVar7 != (uint *)0x0)" (( "(") (binary_expression "puVar7 != (uint *)0x0" (identifier "puVar7") (!= "!=") (cast_expression "(uint *)0x0" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    iVar2 = (**(code **)(puVar10 + 0x13e70))();\n    if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    \n                    \n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }\n  }" ({ "{") (expression_statement "iVar2 = (**(code **)(puVar10 + 0x13e70))();" (assignment_expression "iVar2 = (**(code **)(puVar10 + 0x13e70))()" (identifier "iVar2") (= "=") (call_expression "(**(code **)(puVar10 + 0x13e70))()" (parenthesized_expression "(**(code **)(puVar10 + 0x13e70))" (( "(") (pointer_expression "**(code **)(puVar10 + 0x13e70)" (* "*") (pointer_expression "*(code **)(puVar10 + 0x13e70)" (* "*") (cast_expression "(code **)(puVar10 + 0x13e70)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(puVar10 + 0x13e70)" (( "(") (binary_expression "puVar10 + 0x13e70" (identifier "puVar10") (+ "+") (number_literal "0x13e70")) () ")"))))) () ")")) (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {\n      rpl_fseeko(puVar7);\n                    \n                    \n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }" (if "if") (parenthesized_expression "((iVar2 != 0) && ((*puVar7 & 0x100) != 0))" (( "(") (binary_expression "(iVar2 != 0) && ((*puVar7 & 0x100) != 0)" (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "((*puVar7 & 0x100) != 0)" (( "(") (binary_expression "(*puVar7 & 0x100) != 0" (parenthesized_expression "(*puVar7 & 0x100)" (( "(") (binary_expression "*puVar7 & 0x100" (pointer_expression "*puVar7" (* "*") (identifier "puVar7")) (& "&") (number_literal "0x100")) () ")")) (!= "!=") (number_literal "0")) () ")"))) () ")")) (compound_statement "{\n      rpl_fseeko(puVar7);\n                    \n                    \n      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);\n      return iVar2;\n    }" ({ "{") (expression_statement "rpl_fseeko(puVar7);" (call_expression "rpl_fseeko(puVar7)" (identifier "rpl_fseeko") (argument_list "(puVar7)" (( "(") (identifier "puVar7") () ")"))) (; ";")) (expression_statement "iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);" (assignment_expression "iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7)" (identifier "iVar2") (= "=") (call_expression "(**(code **)(puVar10 + 0x13ecc))(puVar7)" (parenthesized_expression "(**(code **)(puVar10 + 0x13ecc))" (( "(") (pointer_expression "**(code **)(puVar10 + 0x13ecc)" (* "*") (pointer_expression "*(code **)(puVar10 + 0x13ecc)" (* "*") (cast_expression "(code **)(puVar10 + 0x13ecc)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(puVar10 + 0x13ecc)" (( "(") (binary_expression "puVar10 + 0x13ecc" (identifier "puVar10") (+ "+") (number_literal "0x13ecc")) () ")"))))) () ")")) (argument_list "(puVar7)" (( "(") (identifier "puVar7") () ")")))) (; ";")) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (} "}"))) (expression_statement "iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);" (assignment_expression "iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7)" (identifier "iVar2") (= "=") (call_expression "(**(code **)(puVar10 + 0x13ecc))(puVar7)" (parenthesized_expression "(**(code **)(puVar10 + 0x13ecc))" (( "(") (pointer_expression "**(code **)(puVar10 + 0x13ecc)" (* "*") (pointer_expression "*(code **)(puVar10 + 0x13ecc)" (* "*") (cast_expression "(code **)(puVar10 + 0x13ecc)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(puVar10 + 0x13ecc)" (( "(") (binary_expression "puVar10 + 0x13ecc" (identifier "puVar10") (+ "+") (number_literal "0x13ecc")) () ")"))))) () ")")) (argument_list "(puVar7)" (( "(") (identifier "puVar7") () ")")))) (; ";")) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}")))

int function_1(int fd,int var_1,...)

{
  type_1 *puVar1;
  int var_3;
  type_2 var_5;
  int var_6;
  type_3 *puVar5;
  int *piVar6;
  type_4 *var_7;
  type_3 in_a2;
  int iVar7;
  type_3 uVar8;
  int target;
  type_1 *var_4;
  type_3 in_stack_ffffffb4;
  type_5 arg;
  
  puVar1 = PTR___stack_chk_guard_0002c2b8;
  var_4 = var_2;
  var_7 = *(type_4 **)PTR___stack_chk_guard_0002c2b8;
  if (var_1 != 0x406) {
    var_3 = (*(type_6 *)PTR_fcntl64_0002c230)();
    goto LAB_000182c8;
  }
  if (*(int *)(var_2 + -0x3b90) < 0) {
    var_1 = 0;
    var_3 = function_1(fd,0);
    if ((var_3 < 0) || (iVar7 = var_3, *(int *)(var_4 + -0x3b90) != -1)) goto LAB_000182c8;
LAB_00018320:
    var_1 = 1;
    var_5 = (*(type_6 *)PTR_fcntl64_0002c230)(iVar7);
    if (-1 < (int)var_5) {
      var_1 = 2;
      var_6 = (*(type_6 *)PTR_fcntl64_0002c230)(iVar7,2,var_5 | 1);
      var_3 = iVar7;
      if (var_6 != -1) goto LAB_000182c8;
    }
    puVar5 = (type_3 *)(*(type_6 *)PTR___errno_location_0002c244)();
    uVar8 = *puVar5;
    var_3 = -1;
    (*(type_6 *)PTR_close_0002c1e4)(iVar7);
    *puVar5 = uVar8;
  }
  else {
    var_3 = (*(type_6 *)PTR_fcntl64_0002c230)();
    if (var_3 < 0) {
      piVar6 = (int *)(*(type_6 *)PTR___errno_location_0002c244)();
      if (*piVar6 == 0x16) {
        var_1 = 0;
        var_3 = function_1(fd,0,in_a2);
        if (var_3 < 0) goto LAB_000182c8;
        *(type_3 *)(var_4 + -0x3b90) = 0xffffffff;
        iVar7 = var_3;
        goto LAB_00018320;
      }
    }
    *(type_3 *)(var_4 + -0x3b90) = 1;
  }
LAB_000182c8:
  if (var_7 == *(type_4 **)puVar1) {
    return var_3;
  }
  var_4 = PTR___stack_chk_fail_0002c2a4;
  (*(type_6 *)PTR___stack_chk_fail_0002c2a4)();
  if (var_7 != (type_4 *)0x0) {
    var_3 = (**(type_6 **)(var_4 + 0x13e70))();
    if ((var_3 != 0) && ((var_7->_flags & 0x100U) != 0)) {
      var_8(var_7,var_9(1,in_stack_ffffffb4),var_1);
                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */
                    /* WARNING: Treating indirect jump as call */
      var_3 = (**(type_6 **)(var_4 + 0x13ecc))(var_7);
      return var_3;
    }
  }
                    /* WARNING: Could not recover jumptable at 0x00018458. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  var_3 = (**(type_6 **)(var_4 + 0x13ecc))(var_7);
  return var_3;
}


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

int MASKED(undefined4 param_1,int param_2,undefined4 param_3)

{
  undefined *puVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  undefined4 *puVar5;
  int *piVar6;
  uint *puVar7;
  int iVar8;
  undefined4 uVar9;
  undefined *puVar10;
  
  puVar1 = PTR___stack_chk_guard_0002c2b8;
  puVar10 = PTR_DAT_0002c0f8;
  puVar7 = *(uint **)PTR___stack_chk_guard_0002c2b8;
  if (param_2 != 0x406) {
    iVar2 = (*(code *)PTR_fcntl64_0002c230)();
    goto LAB_000182c8;
  }
  if (*(int *)(PTR_DAT_0002c0f8 + -0x3b90) < 0) {
    iVar2 = MASKED(param_1,0);
    if ((iVar2 < 0) || (iVar8 = iVar2, *(int *)(puVar10 + -0x3b90) != -1)) goto LAB_000182c8;
LAB_00018320:
    uVar3 = (*(code *)PTR_fcntl64_0002c230)(iVar8,1);
    if (-1 < (int)uVar3) {
      iVar4 = (*(code *)PTR_fcntl64_0002c230)(iVar8,2,uVar3 | 1);
      iVar2 = iVar8;
      if (iVar4 != -1) goto LAB_000182c8;
    }
    puVar5 = (undefined4 *)(*(code *)PTR___errno_location_0002c244)();
    uVar9 = *puVar5;
    iVar2 = -1;
    (*(code *)PTR_close_0002c1e4)(iVar8);
    *puVar5 = uVar9;
  }
  else {
    iVar2 = (*(code *)PTR_fcntl64_0002c230)();
    if (iVar2 < 0) {
      piVar6 = (int *)(*(code *)PTR___errno_location_0002c244)();
      if (*piVar6 == 0x16) {
        iVar2 = MASKED(param_1,0,param_3);
        if (iVar2 < 0) goto LAB_000182c8;
        *(undefined4 *)(puVar10 + -0x3b90) = 0xffffffff;
        iVar8 = iVar2;
        goto LAB_00018320;
      }
    }
    *(undefined4 *)(puVar10 + -0x3b90) = 1;
  }
LAB_000182c8:
  if (puVar7 == *(uint **)puVar1) {
    return iVar2;
  }
  puVar10 = PTR___stack_chk_fail_0002c2a4;
  (*(code *)PTR___stack_chk_fail_0002c2a4)();
  if (puVar7 != (uint *)0x0) {
    iVar2 = (**(code **)(puVar10 + 0x13e70))();
    if ((iVar2 != 0) && ((*puVar7 & 0x100) != 0)) {
      rpl_fseeko(puVar7);
                    /* WARNING: Could not recover jumptable at 0x0001848c. Too many branches */
                    /* WARNING: Treating indirect jump as call */
      iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);
      return iVar2;
    }
  }
                    /* WARNING: Could not recover jumptable at 0x00018458. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  iVar2 = (**(code **)(puVar10 + 0x13ecc))(puVar7);
  return iVar2;
}

