
int set_permissions(permission_context *ctx,char *name,int desc)

{
  int iVar1;
  int iVar2;
  int *piVar3;
  undefined4 *puVar4;
  FILE *fp;
  uint uVar5;
  undefined *puVar6;
  _Bool acls_set;
  _Bool must_chmod;
  FILE *local_1c;
  
  local_1c = *(FILE **)PTR___stack_chk_guard_00046624;
  acls_set = false;
  must_chmod = false;
  uVar5 = ctx->mode & 0xe00;
  if (uVar5 != 0) {
    iVar1 = chmod_or_fchmod(name,desc,ctx->mode);
    iVar2 = -1;
    if (iVar1 != 0) goto LAB_0002ec24;
  }
  iVar2 = set_acls(ctx,name,desc,0,&must_chmod,&acls_set);
  if (acls_set == false) {
    if (iVar2 != 0) {
      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();
      iVar1 = *piVar3;
      iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set);
      if (acls_set == false) {
        must_chmod = true;
        if (iVar1 == 0) goto LAB_0002ecc8;
      }
      else if (iVar1 == 0) goto LAB_0002ec1c;
      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();
      *piVar3 = iVar1;
      iVar2 = -1;
      goto LAB_0002ec1c;
    }
    iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set);
    if (acls_set != false) goto LAB_0002ec1c;
    must_chmod = true;
  }
  else {
LAB_0002ec1c:
    if (must_chmod == false) goto LAB_0002ec24;
  }
LAB_0002ecc8:
  if (uVar5 == 0) {
    if (iVar2 == 0) {
      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);
    }
    else {
      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();
      iVar1 = *piVar3;
      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);
      if (iVar1 != 0) {
        *piVar3 = iVar1;
        iVar2 = -1;
      }
    }
  }
LAB_0002ec24:
  if (local_1c != *(FILE **)PTR___stack_chk_guard_00046624) {
    fp = local_1c;
    puVar6 = PTR___stack_chk_fail_000465f4;
    (*(code *)PTR___stack_chk_fail_000465f4)();
    iVar2 = (**(code **)(puVar6 + 0x1787c))();
    uVar5 = fp->_flags;
    iVar1 = rpl_fclose(fp);
    if ((uVar5 & 0x20) == 0) {
      if (iVar1 != 0) {
        if (iVar2 == 0) {
          piVar3 = (int *)(**(code **)(puVar6 + 0x177e4))();
          iVar1 = -(uint)(*piVar3 != 9);
        }
        else {
          iVar1 = -1;
        }
      }
    }
    else if (iVar1 == 0) {
      puVar4 = (undefined4 *)(**(code **)(puVar6 + 0x177e4))();
      *puVar4 = 0;
      iVar1 = -1;
    }
    else {
      iVar1 = -1;
    }
    return iVar1;
  }
  return iVar2;
}



int set_permissions(uint *param_1,undefined4 param_2,undefined4 param_3)

{
  int iVar1;
  int iVar2;
  int *piVar3;
  undefined4 *puVar4;
  uint *puVar5;
  uint uVar6;
  undefined *puVar7;
  char local_1e;
  char local_1d;
  uint *local_1c;
  
  local_1c = *(uint **)PTR___stack_chk_guard_00046624;
  local_1e = '\0';
  local_1d = '\0';
  uVar6 = *param_1;
  if ((uVar6 & 0xe00) != 0) {
    iVar1 = chmod_or_fchmod(param_2,param_3);
    iVar2 = -1;
    if (iVar1 != 0) goto LAB_0002ec24;
  }
  iVar2 = FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e);
  if (local_1e == '\0') {
    if (iVar2 != 0) {
      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();
      iVar1 = *piVar3;
      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);
      if (local_1e == '\0') {
        local_1d = '\x01';
        if (iVar1 == 0) goto LAB_0002ecc8;
      }
      else if (iVar1 == 0) goto LAB_0002ec1c;
      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();
      *piVar3 = iVar1;
      iVar2 = -1;
      goto LAB_0002ec1c;
    }
    iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);
    if (local_1e != '\0') goto LAB_0002ec1c;
    local_1d = '\x01';
  }
  else {
LAB_0002ec1c:
    if (local_1d == '\0') goto LAB_0002ec24;
  }
LAB_0002ecc8:
  if ((uVar6 & 0xe00) == 0) {
    if (iVar2 == 0) {
      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);
    }
    else {
      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();
      iVar1 = *piVar3;
      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);
      if (iVar1 != 0) {
        *piVar3 = iVar1;
        iVar2 = -1;
      }
    }
  }
LAB_0002ec24:
  if (local_1c != *(uint **)PTR___stack_chk_guard_00046624) {
    puVar5 = local_1c;
    puVar7 = PTR___stack_chk_fail_000465f4;
    (*(code *)PTR___stack_chk_fail_000465f4)();
    iVar2 = (**(code **)(puVar7 + 0x1787c))();
    uVar6 = *puVar5;
    iVar1 = rpl_fclose(puVar5);
    if ((uVar6 & 0x20) == 0) {
      if (iVar1 != 0) {
        if (iVar2 == 0) {
          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();
          iVar1 = -(uint)(*piVar3 != 9);
        }
        else {
          iVar1 = -1;
        }
      }
    }
    else if (iVar1 == 0) {
      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();
      *puVar4 = 0;
      iVar1 = -1;
    }
    else {
      iVar1 = -1;
    }
    return iVar1;
  }
  return iVar2;
}


lui gp,0x2
addiu gp,gp,-0x9f0
addu gp,gp,t9
addiu sp,sp,-0x40
sw ra,0x3c(sp)
sw s4,0x38(sp)
sw s3,0x34(sp)
sw s2,0x30(sp)
sw s1,0x2c(sp)
sw s0,0x28(sp)
sw gp,0x18(sp)
or s0,a0,zero
or s1,a1,zero
or s2,a2,zero
lw v0,-0x7acc(gp)
lw v0,0x0(v0)
sw v0,0x24(sp)
sb zero,0x22(sp)
sb zero,0x23(sp)
lw a2,0x0(a0)
andi s3,a2,0xe00
beq s3,zero,0x0002eb60
_addiu v0,sp,0x22
or a1,s2,zero
or a0,s1,zero
lw t9,-0x7d28(gp)
bal 0x0002ea80
_nop
lw gp,0x18(sp)
bne v0,zero,0x0002ec24
_li v0,-0x1
addiu v0,sp,0x22
sw v0,0x14(sp)
addiu v0,sp,0x23
sw v0,0x10(sp)
or a3,zero,zero
or a2,s2,zero
or a1,s1,zero
or a0,s0,zero
lw t9,-0x7fc8(gp)
addiu t9,t9,-0x1760
bal 0x0002e8a0
_nop
lw gp,0x18(sp)
lbu v1,0x22(sp)
bne v1,zero,0x0002ec1c
_lbu v1,0x23(sp)
beq v0,zero,0x0002ec84
_addiu v0,sp,0x22
lw t9,-0x7bdc(gp)
jalr t9
_nop
lw gp,0x18(sp)
lw s4,0x0(v0)
addiu v0,sp,0x22
sw v0,0x14(sp)
addiu v0,sp,0x23
sw v0,0x10(sp)
li a3,0x1
or a2,s2,zero
or a1,s1,zero
or a0,s0,zero
lw t9,-0x7fc8(gp)
addiu t9,t9,-0x1760
bal 0x0002e8a0
_nop
lw gp,0x18(sp)
lbu v1,0x22(sp)
bne v1,zero,0x0002ec54
_li v1,0x1
beq s4,zero,0x0002ecc8
_sb v1,0x23(sp)
lw t9,-0x7bdc(gp)
jalr t9
_nop
lw gp,0x18(sp)
sw s4,0x0(v0)
li v0,-0x1
lbu v1,0x23(sp)
bne v1,zero,0x0002ecc8
_nop
lw a0,0x24(sp)
lw v1,-0x7acc(gp)
lw v1,0x0(v1)
bne a0,v1,0x0002ed20
_lw ra,0x3c(sp)
lw s4,0x38(sp)
lw s3,0x34(sp)
lw s2,0x30(sp)
lw s1,0x2c(sp)
lw s0,0x28(sp)
jr ra
_addiu sp,sp,0x40
bne s4,zero,0x0002ec04
_lw t9,-0x7bdc(gp)
b 0x0002ec1c
_lbu v1,0x23(sp)
lw a2,0x0(s0)
or a0,s1,zero
lw t9,-0x7d28(gp)
bal 0x0002ea80
_nop
lw gp,0x18(sp)
b 0x0002ec24
_nop
sw v0,0x14(sp)
addiu v0,sp,0x23
sw v0,0x10(sp)
li a3,0x1
or a2,s2,zero
or a1,s1,zero
or a0,s0,zero
lw t9,-0x7fc8(gp)
addiu t9,t9,-0x1760
bal 0x0002e8a0
_nop
lw gp,0x18(sp)
lbu v1,0x22(sp)
bne v1,zero,0x0002ec1c
_lbu v1,0x23(sp)
li v1,0x1
sb v1,0x23(sp)
bne s3,zero,0x0002ec24
_nop
beq v0,zero,0x0002ec64
_or a1,s2,zero
lw t9,-0x7bdc(gp)
jalr t9
_nop
lw gp,0x18(sp)
or s3,v0,zero
lw s4,0x0(v0)
lw a2,0x0(s0)
or a1,s2,zero
or a0,s1,zero
lw t9,-0x7d28(gp)
bal 0x0002ea80
_nop
lw gp,0x18(sp)
beq s4,zero,0x0002ec24
_nop
sw s4,0x0(s3)
b 0x0002ec24
_li v0,-0x1
lw t9,-0x7afc(gp)
jalr t9
_nop
nop
(translation_unit "int set_permissions(uint *param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 *puVar4;\n  uint *puVar5;\n  uint uVar6;\n  undefined *puVar7;\n  char local_1e;\n  char local_1d;\n  uint *local_1c;\n  \n  local_1c = *(uint **)PTR___stack_chk_guard_00046624;\n  local_1e = '\0';\n  local_1d = '\0';\n  uVar6 = *param_1;\n  if ((uVar6 & 0xe00) != 0) {\n    iVar1 = chmod_or_fchmod(param_2,param_3);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }\n  iVar2 = FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e);\n  if (local_1e == '\0') {\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n    if (local_1e != '\0') goto LAB_0002ec1c;\n    local_1d = '\x01';\n  }\n  else {\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }\nLAB_0002ecc8:\n  if ((uVar6 & 0xe00) == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }\nLAB_0002ec24:\n  if (local_1c != *(uint **)PTR___stack_chk_guard_00046624) {\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }\n  return iVar2;\n}\n\n" (function_definition "int set_permissions(uint *param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 *puVar4;\n  uint *puVar5;\n  uint uVar6;\n  undefined *puVar7;\n  char local_1e;\n  char local_1d;\n  uint *local_1c;\n  \n  local_1c = *(uint **)PTR___stack_chk_guard_00046624;\n  local_1e = '\0';\n  local_1d = '\0';\n  uVar6 = *param_1;\n  if ((uVar6 & 0xe00) != 0) {\n    iVar1 = chmod_or_fchmod(param_2,param_3);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }\n  iVar2 = FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e);\n  if (local_1e == '\0') {\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n    if (local_1e != '\0') goto LAB_0002ec1c;\n    local_1d = '\x01';\n  }\n  else {\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }\nLAB_0002ecc8:\n  if ((uVar6 & 0xe00) == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }\nLAB_0002ec24:\n  if (local_1c != *(uint **)PTR___stack_chk_guard_00046624) {\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }\n  return iVar2;\n}" primitive_type (function_declarator "set_permissions(uint *param_1,undefined4 param_2,undefined4 param_3)" identifier (parameter_list "(uint *param_1,undefined4 param_2,undefined4 param_3)" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 *puVar4;\n  uint *puVar5;\n  uint uVar6;\n  undefined *puVar7;\n  char local_1e;\n  char local_1d;\n  uint *local_1c;\n  \n  local_1c = *(uint **)PTR___stack_chk_guard_00046624;\n  local_1e = '\0';\n  local_1d = '\0';\n  uVar6 = *param_1;\n  if ((uVar6 & 0xe00) != 0) {\n    iVar1 = chmod_or_fchmod(param_2,param_3);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }\n  iVar2 = FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e);\n  if (local_1e == '\0') {\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n    if (local_1e != '\0') goto LAB_0002ec1c;\n    local_1d = '\x01';\n  }\n  else {\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }\nLAB_0002ecc8:\n  if ((uVar6 & 0xe00) == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }\nLAB_0002ec24:\n  if (local_1c != *(uint **)PTR___stack_chk_guard_00046624) {\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }\n  return iVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "undefined4 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "uint *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "uint uVar6;" type_identifier identifier ;) (declaration "undefined *puVar7;" type_identifier (pointer_declarator "*puVar7" * identifier) ;) (declaration "char local_1e;" primitive_type identifier ;) (declaration "char local_1d;" primitive_type identifier ;) (declaration "uint *local_1c;" type_identifier (pointer_declarator "*local_1c" * identifier) ;) (expression_statement "local_1c = *(uint **)PTR___stack_chk_guard_00046624;" (assignment_expression "local_1c = *(uint **)PTR___stack_chk_guard_00046624" identifier = (pointer_expression "*(uint **)PTR___stack_chk_guard_00046624" * (cast_expression "(uint **)PTR___stack_chk_guard_00046624" ( (type_descriptor "uint **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "local_1e = '\0';" (assignment_expression "local_1e = '\0'" identifier = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "local_1d = '\0';" (assignment_expression "local_1d = '\0'" identifier = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "uVar6 = *param_1;" (assignment_expression "uVar6 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if ((uVar6 & 0xe00) != 0) {\n    iVar1 = chmod_or_fchmod(param_2,param_3);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }" if (parenthesized_expression "((uVar6 & 0xe00) != 0)" ( (binary_expression "(uVar6 & 0xe00) != 0" (parenthesized_expression "(uVar6 & 0xe00)" ( (binary_expression "uVar6 & 0xe00" identifier & number_literal) )) != number_literal) )) (compound_statement "{\n    iVar1 = chmod_or_fchmod(param_2,param_3);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }" { (expression_statement "iVar1 = chmod_or_fchmod(param_2,param_3);" (assignment_expression "iVar1 = chmod_or_fchmod(param_2,param_3)" identifier = (call_expression "chmod_or_fchmod(param_2,param_3)" identifier (argument_list "(param_2,param_3)" ( identifier , identifier )))) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (if_statement "if (iVar1 != 0) goto LAB_0002ec24;" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (goto_statement "goto LAB_0002ec24;" goto statement_identifier ;)) })) (expression_statement "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e);" (assignment_expression "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e)" identifier = (call_expression "FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e)" identifier (argument_list "(param_1,param_2,param_3,0,&local_1d,&local_1e)" ( identifier , identifier , identifier , number_literal , (pointer_expression "&local_1d" & identifier) , (pointer_expression "&local_1e" & identifier) )))) ;) (if_statement "if (local_1e == '\0') {\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n    if (local_1e != '\0') goto LAB_0002ec1c;\n    local_1d = '\x01';\n  }\n  else {\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }" if (parenthesized_expression "(local_1e == '\0')" ( (binary_expression "local_1e == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n    if (local_1e != '\0') goto LAB_0002ec1c;\n    local_1d = '\x01';\n  }" { (if_statement "if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }" { (expression_statement "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();" (assignment_expression "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_00046514)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00046514)()" (parenthesized_expression "(*(code *)PTR___errno_location_00046514)" ( (pointer_expression "*(code *)PTR___errno_location_00046514" * (cast_expression "(code *)PTR___errno_location_00046514" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);" (assignment_expression "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e)" identifier = (call_expression "FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e)" identifier (argument_list "(param_1,param_2,param_3,1,&local_1d,&local_1e)" ( identifier , identifier , identifier , number_literal , (pointer_expression "&local_1d" & identifier) , (pointer_expression "&local_1e" & identifier) )))) ;) (if_statement "if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;" if (parenthesized_expression "(local_1e == '\0')" ( (binary_expression "local_1e == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }" { (expression_statement "local_1d = '\x01';" (assignment_expression "local_1d = '\x01'" identifier = (char_literal "'\x01'" ' escape_sequence ')) ;) (if_statement "if (iVar1 == 0) goto LAB_0002ecc8;" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0002ecc8;" goto statement_identifier ;)) }) (else_clause "else if (iVar1 == 0) goto LAB_0002ec1c;" else (if_statement "if (iVar1 == 0) goto LAB_0002ec1c;" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0002ec1c;" goto statement_identifier ;)))) (expression_statement "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();" (assignment_expression "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_00046514)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00046514)()" (parenthesized_expression "(*(code *)PTR___errno_location_00046514)" ( (pointer_expression "*(code *)PTR___errno_location_00046514" * (cast_expression "(code *)PTR___errno_location_00046514" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (goto_statement "goto LAB_0002ec1c;" goto statement_identifier ;) })) (expression_statement "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);" (assignment_expression "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e)" identifier = (call_expression "FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e)" identifier (argument_list "(param_1,param_2,param_3,1,&local_1d,&local_1e)" ( identifier , identifier , identifier , number_literal , (pointer_expression "&local_1d" & identifier) , (pointer_expression "&local_1e" & identifier) )))) ;) (if_statement "if (local_1e != '\0') goto LAB_0002ec1c;" if (parenthesized_expression "(local_1e != '\0')" ( (binary_expression "local_1e != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (goto_statement "goto LAB_0002ec1c;" goto statement_identifier ;)) (expression_statement "local_1d = '\x01';" (assignment_expression "local_1d = '\x01'" identifier = (char_literal "'\x01'" ' escape_sequence ')) ;) }) (else_clause "else {\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }" else (compound_statement "{\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }" { (labeled_statement "LAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;" statement_identifier : (if_statement "if (local_1d == '\0') goto LAB_0002ec24;" if (parenthesized_expression "(local_1d == '\0')" ( (binary_expression "local_1d == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (goto_statement "goto LAB_0002ec24;" goto statement_identifier ;))) }))) (labeled_statement "LAB_0002ecc8:\n  if ((uVar6 & 0xe00) == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }" statement_identifier : (if_statement "if ((uVar6 & 0xe00) == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }" if (parenthesized_expression "((uVar6 & 0xe00) == 0)" ( (binary_expression "(uVar6 & 0xe00) == 0" (parenthesized_expression "(uVar6 & 0xe00)" ( (binary_expression "uVar6 & 0xe00" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }" { (if_statement "if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }" { (expression_statement "iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);" (assignment_expression "iVar2 = chmod_or_fchmod(param_2,param_3,*param_1)" identifier = (call_expression "chmod_or_fchmod(param_2,param_3,*param_1)" identifier (argument_list "(param_2,param_3,*param_1)" ( identifier , identifier , (pointer_expression "*param_1" * identifier) )))) ;) }) (else_clause "else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }" else (compound_statement "{\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }" { (expression_statement "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();" (assignment_expression "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_00046514)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00046514)()" (parenthesized_expression "(*(code *)PTR___errno_location_00046514)" ( (pointer_expression "*(code *)PTR___errno_location_00046514" * (cast_expression "(code *)PTR___errno_location_00046514" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);" (assignment_expression "iVar2 = chmod_or_fchmod(param_2,param_3,*param_1)" identifier = (call_expression "chmod_or_fchmod(param_2,param_3,*param_1)" identifier (argument_list "(param_2,param_3,*param_1)" ( identifier , identifier , (pointer_expression "*param_1" * identifier) )))) ;) (if_statement "if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }" { (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) })) }))) }))) (labeled_statement "LAB_0002ec24:\n  if (local_1c != *(uint **)PTR___stack_chk_guard_00046624) {\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }" statement_identifier : (if_statement "if (local_1c != *(uint **)PTR___stack_chk_guard_00046624) {\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }" if (parenthesized_expression "(local_1c != *(uint **)PTR___stack_chk_guard_00046624)" ( (binary_expression "local_1c != *(uint **)PTR___stack_chk_guard_00046624" identifier != (pointer_expression "*(uint **)PTR___stack_chk_guard_00046624" * (cast_expression "(uint **)PTR___stack_chk_guard_00046624" ( (type_descriptor "uint **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) )) (compound_statement "{\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }" { (expression_statement "puVar5 = local_1c;" (assignment_expression "puVar5 = local_1c" identifier = identifier) ;) (expression_statement "puVar7 = PTR___stack_chk_fail_000465f4;" (assignment_expression "puVar7 = PTR___stack_chk_fail_000465f4" identifier = identifier) ;) (expression_statement "(*(code *)PTR___stack_chk_fail_000465f4)();" (call_expression "(*(code *)PTR___stack_chk_fail_000465f4)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_000465f4)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_000465f4" * (cast_expression "(code *)PTR___stack_chk_fail_000465f4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "iVar2 = (**(code **)(puVar7 + 0x1787c))();" (assignment_expression "iVar2 = (**(code **)(puVar7 + 0x1787c))()" identifier = (call_expression "(**(code **)(puVar7 + 0x1787c))()" (parenthesized_expression "(**(code **)(puVar7 + 0x1787c))" ( (pointer_expression "**(code **)(puVar7 + 0x1787c)" * (pointer_expression "*(code **)(puVar7 + 0x1787c)" * (cast_expression "(code **)(puVar7 + 0x1787c)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar7 + 0x1787c)" ( (binary_expression "puVar7 + 0x1787c" identifier + number_literal) ))))) )) (argument_list "()" ( )))) ;) (expression_statement "uVar6 = *puVar5;" (assignment_expression "uVar6 = *puVar5" identifier = (pointer_expression "*puVar5" * identifier)) ;) (expression_statement "iVar1 = rpl_fclose(puVar5);" (assignment_expression "iVar1 = rpl_fclose(puVar5)" identifier = (call_expression "rpl_fclose(puVar5)" identifier (argument_list "(puVar5)" ( identifier )))) ;) (if_statement "if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }" if (parenthesized_expression "((uVar6 & 0x20) == 0)" ( (binary_expression "(uVar6 & 0x20) == 0" (parenthesized_expression "(uVar6 & 0x20)" ( (binary_expression "uVar6 & 0x20" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }" { (if_statement "if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }" { (if_statement "if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }" { (expression_statement "piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();" (assignment_expression "piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))()" identifier = (cast_expression "(int *)(**(code **)(puVar7 + 0x177e4))()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(**(code **)(puVar7 + 0x177e4))()" (parenthesized_expression "(**(code **)(puVar7 + 0x177e4))" ( (pointer_expression "**(code **)(puVar7 + 0x177e4)" * (pointer_expression "*(code **)(puVar7 + 0x177e4)" * (cast_expression "(code **)(puVar7 + 0x177e4)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar7 + 0x177e4)" ( (binary_expression "puVar7 + 0x177e4" identifier + number_literal) ))))) )) (argument_list "()" ( ))))) ;) (expression_statement "iVar1 = -(uint)(*piVar3 != 9);" (assignment_expression "iVar1 = -(uint)(*piVar3 != 9)" identifier = (unary_expression "-(uint)(*piVar3 != 9)" - (call_expression "(uint)(*piVar3 != 9)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(*piVar3 != 9)" ( (binary_expression "*piVar3 != 9" (pointer_expression "*piVar3" * identifier) != number_literal) ))))) ;) }) (else_clause "else {\n          iVar1 = -1;\n        }" else (compound_statement "{\n          iVar1 = -1;\n        }" { (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) }))) })) }) (else_clause "else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }" else (if_statement "if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }" { (expression_statement "puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();" (assignment_expression "puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))()" identifier = (cast_expression "(undefined4 *)(**(code **)(puVar7 + 0x177e4))()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(**(code **)(puVar7 + 0x177e4))()" (parenthesized_expression "(**(code **)(puVar7 + 0x177e4))" ( (pointer_expression "**(code **)(puVar7 + 0x177e4)" * (pointer_expression "*(code **)(puVar7 + 0x177e4)" * (cast_expression "(code **)(puVar7 + 0x177e4)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar7 + 0x177e4)" ( (binary_expression "puVar7 + 0x177e4" identifier + number_literal) ))))) )) (argument_list "()" ( ))))) ;) (expression_statement "*puVar4 = 0;" (assignment_expression "*puVar4 = 0" (pointer_expression "*puVar4" * identifier) = number_literal) ;) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) }) (else_clause "else {\n      iVar1 = -1;\n    }" else (compound_statement "{\n      iVar1 = -1;\n    }" { (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) }))))) (return_statement "return iVar1;" return identifier ;) }))) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "int set_permissions(permission_context *ctx,char *name,int desc)\n\n{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 *puVar4;\n  FILE *fp;\n  uint uVar5;\n  undefined *puVar6;\n  _Bool acls_set;\n  _Bool must_chmod;\n  FILE *local_1c;\n  \n  local_1c = *(FILE **)PTR___stack_chk_guard_00046624;\n  acls_set = false;\n  must_chmod = false;\n  uVar5 = ctx->mode & 0xe00;\n  if (uVar5 != 0) {\n    iVar1 = chmod_or_fchmod(name,desc,ctx->mode);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }\n  iVar2 = set_acls(ctx,name,desc,0,&must_chmod,&acls_set);\n  if (acls_set == false) {\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set);\n      if (acls_set == false) {\n        must_chmod = true;\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set);\n    if (acls_set != false) goto LAB_0002ec1c;\n    must_chmod = true;\n  }\n  else {\nLAB_0002ec1c:\n    if (must_chmod == false) goto LAB_0002ec24;\n  }\nLAB_0002ecc8:\n  if (uVar5 == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }\nLAB_0002ec24:\n  if (local_1c != *(FILE **)PTR___stack_chk_guard_00046624) {\n    fp = local_1c;\n    puVar6 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar6 + 0x1787c))();\n    uVar5 = fp->_flags;\n    iVar1 = rpl_fclose(fp);\n    if ((uVar5 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar6 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar6 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }\n  return iVar2;\n}\n\n" (function_definition "int set_permissions(permission_context *ctx,char *name,int desc)\n\n{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 *puVar4;\n  FILE *fp;\n  uint uVar5;\n  undefined *puVar6;\n  _Bool acls_set;\n  _Bool must_chmod;\n  FILE *local_1c;\n  \n  local_1c = *(FILE **)PTR___stack_chk_guard_00046624;\n  acls_set = false;\n  must_chmod = false;\n  uVar5 = ctx->mode & 0xe00;\n  if (uVar5 != 0) {\n    iVar1 = chmod_or_fchmod(name,desc,ctx->mode);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }\n  iVar2 = set_acls(ctx,name,desc,0,&must_chmod,&acls_set);\n  if (acls_set == false) {\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set);\n      if (acls_set == false) {\n        must_chmod = true;\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set);\n    if (acls_set != false) goto LAB_0002ec1c;\n    must_chmod = true;\n  }\n  else {\nLAB_0002ec1c:\n    if (must_chmod == false) goto LAB_0002ec24;\n  }\nLAB_0002ecc8:\n  if (uVar5 == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }\nLAB_0002ec24:\n  if (local_1c != *(FILE **)PTR___stack_chk_guard_00046624) {\n    fp = local_1c;\n    puVar6 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar6 + 0x1787c))();\n    uVar5 = fp->_flags;\n    iVar1 = rpl_fclose(fp);\n    if ((uVar5 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar6 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar6 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }\n  return iVar2;\n}" primitive_type (function_declarator "set_permissions(permission_context *ctx,char *name,int desc)" identifier (parameter_list "(permission_context *ctx,char *name,int desc)" ( (parameter_declaration "permission_context *ctx" type_identifier (pointer_declarator "*ctx" * identifier)) , (parameter_declaration "char *name" primitive_type (pointer_declarator "*name" * identifier)) , (parameter_declaration "int desc" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 *puVar4;\n  FILE *fp;\n  uint uVar5;\n  undefined *puVar6;\n  _Bool acls_set;\n  _Bool must_chmod;\n  FILE *local_1c;\n  \n  local_1c = *(FILE **)PTR___stack_chk_guard_00046624;\n  acls_set = false;\n  must_chmod = false;\n  uVar5 = ctx->mode & 0xe00;\n  if (uVar5 != 0) {\n    iVar1 = chmod_or_fchmod(name,desc,ctx->mode);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }\n  iVar2 = set_acls(ctx,name,desc,0,&must_chmod,&acls_set);\n  if (acls_set == false) {\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set);\n      if (acls_set == false) {\n        must_chmod = true;\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set);\n    if (acls_set != false) goto LAB_0002ec1c;\n    must_chmod = true;\n  }\n  else {\nLAB_0002ec1c:\n    if (must_chmod == false) goto LAB_0002ec24;\n  }\nLAB_0002ecc8:\n  if (uVar5 == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }\nLAB_0002ec24:\n  if (local_1c != *(FILE **)PTR___stack_chk_guard_00046624) {\n    fp = local_1c;\n    puVar6 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar6 + 0x1787c))();\n    uVar5 = fp->_flags;\n    iVar1 = rpl_fclose(fp);\n    if ((uVar5 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar6 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar6 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }\n  return iVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "undefined4 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "FILE *fp;" type_identifier (pointer_declarator "*fp" * identifier) ;) (declaration "uint uVar5;" type_identifier identifier ;) (declaration "undefined *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "_Bool acls_set;" type_identifier identifier ;) (declaration "_Bool must_chmod;" type_identifier identifier ;) (declaration "FILE *local_1c;" type_identifier (pointer_declarator "*local_1c" * identifier) ;) (expression_statement "local_1c = *(FILE **)PTR___stack_chk_guard_00046624;" (assignment_expression "local_1c = *(FILE **)PTR___stack_chk_guard_00046624" identifier = (pointer_expression "*(FILE **)PTR___stack_chk_guard_00046624" * (cast_expression "(FILE **)PTR___stack_chk_guard_00046624" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "acls_set = false;" (assignment_expression "acls_set = false" identifier = false) ;) (expression_statement "must_chmod = false;" (assignment_expression "must_chmod = false" identifier = false) ;) (expression_statement "uVar5 = ctx->mode & 0xe00;" (assignment_expression "uVar5 = ctx->mode & 0xe00" identifier = (binary_expression "ctx->mode & 0xe00" (field_expression "ctx->mode" identifier -> field_identifier) & number_literal)) ;) (if_statement "if (uVar5 != 0) {\n    iVar1 = chmod_or_fchmod(name,desc,ctx->mode);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }" if (parenthesized_expression "(uVar5 != 0)" ( (binary_expression "uVar5 != 0" identifier != number_literal) )) (compound_statement "{\n    iVar1 = chmod_or_fchmod(name,desc,ctx->mode);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }" { (expression_statement "iVar1 = chmod_or_fchmod(name,desc,ctx->mode);" (assignment_expression "iVar1 = chmod_or_fchmod(name,desc,ctx->mode)" identifier = (call_expression "chmod_or_fchmod(name,desc,ctx->mode)" identifier (argument_list "(name,desc,ctx->mode)" ( identifier , identifier , (field_expression "ctx->mode" identifier -> field_identifier) )))) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (if_statement "if (iVar1 != 0) goto LAB_0002ec24;" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (goto_statement "goto LAB_0002ec24;" goto statement_identifier ;)) })) (expression_statement "iVar2 = set_acls(ctx,name,desc,0,&must_chmod,&acls_set);" (assignment_expression "iVar2 = set_acls(ctx,name,desc,0,&must_chmod,&acls_set)" identifier = (call_expression "set_acls(ctx,name,desc,0,&must_chmod,&acls_set)" identifier (argument_list "(ctx,name,desc,0,&must_chmod,&acls_set)" ( identifier , identifier , identifier , number_literal , (pointer_expression "&must_chmod" & identifier) , (pointer_expression "&acls_set" & identifier) )))) ;) (if_statement "if (acls_set == false) {\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set);\n      if (acls_set == false) {\n        must_chmod = true;\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set);\n    if (acls_set != false) goto LAB_0002ec1c;\n    must_chmod = true;\n  }\n  else {\nLAB_0002ec1c:\n    if (must_chmod == false) goto LAB_0002ec24;\n  }" if (parenthesized_expression "(acls_set == false)" ( (binary_expression "acls_set == false" identifier == false) )) (compound_statement "{\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set);\n      if (acls_set == false) {\n        must_chmod = true;\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set);\n    if (acls_set != false) goto LAB_0002ec1c;\n    must_chmod = true;\n  }" { (if_statement "if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set);\n      if (acls_set == false) {\n        must_chmod = true;\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set);\n      if (acls_set == false) {\n        must_chmod = true;\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }" { (expression_statement "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();" (assignment_expression "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_00046514)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00046514)()" (parenthesized_expression "(*(code *)PTR___errno_location_00046514)" ( (pointer_expression "*(code *)PTR___errno_location_00046514" * (cast_expression "(code *)PTR___errno_location_00046514" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set);" (assignment_expression "iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set)" identifier = (call_expression "set_acls(ctx,name,desc,1,&must_chmod,&acls_set)" identifier (argument_list "(ctx,name,desc,1,&must_chmod,&acls_set)" ( identifier , identifier , identifier , number_literal , (pointer_expression "&must_chmod" & identifier) , (pointer_expression "&acls_set" & identifier) )))) ;) (if_statement "if (acls_set == false) {\n        must_chmod = true;\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;" if (parenthesized_expression "(acls_set == false)" ( (binary_expression "acls_set == false" identifier == false) )) (compound_statement "{\n        must_chmod = true;\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }" { (expression_statement "must_chmod = true;" (assignment_expression "must_chmod = true" identifier = true) ;) (if_statement "if (iVar1 == 0) goto LAB_0002ecc8;" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0002ecc8;" goto statement_identifier ;)) }) (else_clause "else if (iVar1 == 0) goto LAB_0002ec1c;" else (if_statement "if (iVar1 == 0) goto LAB_0002ec1c;" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0002ec1c;" goto statement_identifier ;)))) (expression_statement "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();" (assignment_expression "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_00046514)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00046514)()" (parenthesized_expression "(*(code *)PTR___errno_location_00046514)" ( (pointer_expression "*(code *)PTR___errno_location_00046514" * (cast_expression "(code *)PTR___errno_location_00046514" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (goto_statement "goto LAB_0002ec1c;" goto statement_identifier ;) })) (expression_statement "iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set);" (assignment_expression "iVar2 = set_acls(ctx,name,desc,1,&must_chmod,&acls_set)" identifier = (call_expression "set_acls(ctx,name,desc,1,&must_chmod,&acls_set)" identifier (argument_list "(ctx,name,desc,1,&must_chmod,&acls_set)" ( identifier , identifier , identifier , number_literal , (pointer_expression "&must_chmod" & identifier) , (pointer_expression "&acls_set" & identifier) )))) ;) (if_statement "if (acls_set != false) goto LAB_0002ec1c;" if (parenthesized_expression "(acls_set != false)" ( (binary_expression "acls_set != false" identifier != false) )) (goto_statement "goto LAB_0002ec1c;" goto statement_identifier ;)) (expression_statement "must_chmod = true;" (assignment_expression "must_chmod = true" identifier = true) ;) }) (else_clause "else {\nLAB_0002ec1c:\n    if (must_chmod == false) goto LAB_0002ec24;\n  }" else (compound_statement "{\nLAB_0002ec1c:\n    if (must_chmod == false) goto LAB_0002ec24;\n  }" { (labeled_statement "LAB_0002ec1c:\n    if (must_chmod == false) goto LAB_0002ec24;" statement_identifier : (if_statement "if (must_chmod == false) goto LAB_0002ec24;" if (parenthesized_expression "(must_chmod == false)" ( (binary_expression "must_chmod == false" identifier == false) )) (goto_statement "goto LAB_0002ec24;" goto statement_identifier ;))) }))) (labeled_statement "LAB_0002ecc8:\n  if (uVar5 == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }" statement_identifier : (if_statement "if (uVar5 == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }" if (parenthesized_expression "(uVar5 == 0)" ( (binary_expression "uVar5 == 0" identifier == number_literal) )) (compound_statement "{\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }" { (if_statement "if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n    }" { (expression_statement "iVar2 = chmod_or_fchmod(name,desc,ctx->mode);" (assignment_expression "iVar2 = chmod_or_fchmod(name,desc,ctx->mode)" identifier = (call_expression "chmod_or_fchmod(name,desc,ctx->mode)" identifier (argument_list "(name,desc,ctx->mode)" ( identifier , identifier , (field_expression "ctx->mode" identifier -> field_identifier) )))) ;) }) (else_clause "else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }" else (compound_statement "{\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(name,desc,ctx->mode);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }" { (expression_statement "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();" (assignment_expression "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_00046514)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00046514)()" (parenthesized_expression "(*(code *)PTR___errno_location_00046514)" ( (pointer_expression "*(code *)PTR___errno_location_00046514" * (cast_expression "(code *)PTR___errno_location_00046514" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "iVar2 = chmod_or_fchmod(name,desc,ctx->mode);" (assignment_expression "iVar2 = chmod_or_fchmod(name,desc,ctx->mode)" identifier = (call_expression "chmod_or_fchmod(name,desc,ctx->mode)" identifier (argument_list "(name,desc,ctx->mode)" ( identifier , identifier , (field_expression "ctx->mode" identifier -> field_identifier) )))) ;) (if_statement "if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }" { (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) })) }))) }))) (labeled_statement "LAB_0002ec24:\n  if (local_1c != *(FILE **)PTR___stack_chk_guard_00046624) {\n    fp = local_1c;\n    puVar6 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar6 + 0x1787c))();\n    uVar5 = fp->_flags;\n    iVar1 = rpl_fclose(fp);\n    if ((uVar5 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar6 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar6 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }" statement_identifier : (if_statement "if (local_1c != *(FILE **)PTR___stack_chk_guard_00046624) {\n    fp = local_1c;\n    puVar6 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar6 + 0x1787c))();\n    uVar5 = fp->_flags;\n    iVar1 = rpl_fclose(fp);\n    if ((uVar5 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar6 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar6 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }" if (parenthesized_expression "(local_1c != *(FILE **)PTR___stack_chk_guard_00046624)" ( (binary_expression "local_1c != *(FILE **)PTR___stack_chk_guard_00046624" identifier != (pointer_expression "*(FILE **)PTR___stack_chk_guard_00046624" * (cast_expression "(FILE **)PTR___stack_chk_guard_00046624" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) )) (compound_statement "{\n    fp = local_1c;\n    puVar6 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar6 + 0x1787c))();\n    uVar5 = fp->_flags;\n    iVar1 = rpl_fclose(fp);\n    if ((uVar5 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar6 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar6 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }" { (expression_statement "fp = local_1c;" (assignment_expression "fp = local_1c" identifier = identifier) ;) (expression_statement "puVar6 = PTR___stack_chk_fail_000465f4;" (assignment_expression "puVar6 = PTR___stack_chk_fail_000465f4" identifier = identifier) ;) (expression_statement "(*(code *)PTR___stack_chk_fail_000465f4)();" (call_expression "(*(code *)PTR___stack_chk_fail_000465f4)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_000465f4)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_000465f4" * (cast_expression "(code *)PTR___stack_chk_fail_000465f4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "iVar2 = (**(code **)(puVar6 + 0x1787c))();" (assignment_expression "iVar2 = (**(code **)(puVar6 + 0x1787c))()" identifier = (call_expression "(**(code **)(puVar6 + 0x1787c))()" (parenthesized_expression "(**(code **)(puVar6 + 0x1787c))" ( (pointer_expression "**(code **)(puVar6 + 0x1787c)" * (pointer_expression "*(code **)(puVar6 + 0x1787c)" * (cast_expression "(code **)(puVar6 + 0x1787c)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar6 + 0x1787c)" ( (binary_expression "puVar6 + 0x1787c" identifier + number_literal) ))))) )) (argument_list "()" ( )))) ;) (expression_statement "uVar5 = fp->_flags;" (assignment_expression "uVar5 = fp->_flags" identifier = (field_expression "fp->_flags" identifier -> field_identifier)) ;) (expression_statement "iVar1 = rpl_fclose(fp);" (assignment_expression "iVar1 = rpl_fclose(fp)" identifier = (call_expression "rpl_fclose(fp)" identifier (argument_list "(fp)" ( identifier )))) ;) (if_statement "if ((uVar5 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar6 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar6 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }" if (parenthesized_expression "((uVar5 & 0x20) == 0)" ( (binary_expression "(uVar5 & 0x20) == 0" (parenthesized_expression "(uVar5 & 0x20)" ( (binary_expression "uVar5 & 0x20" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar6 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }" { (if_statement "if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar6 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar6 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }" { (if_statement "if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar6 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n          piVar3 = (int *)(**(code **)(puVar6 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }" { (expression_statement "piVar3 = (int *)(**(code **)(puVar6 + 0x177e4))();" (assignment_expression "piVar3 = (int *)(**(code **)(puVar6 + 0x177e4))()" identifier = (cast_expression "(int *)(**(code **)(puVar6 + 0x177e4))()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(**(code **)(puVar6 + 0x177e4))()" (parenthesized_expression "(**(code **)(puVar6 + 0x177e4))" ( (pointer_expression "**(code **)(puVar6 + 0x177e4)" * (pointer_expression "*(code **)(puVar6 + 0x177e4)" * (cast_expression "(code **)(puVar6 + 0x177e4)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar6 + 0x177e4)" ( (binary_expression "puVar6 + 0x177e4" identifier + number_literal) ))))) )) (argument_list "()" ( ))))) ;) (expression_statement "iVar1 = -(uint)(*piVar3 != 9);" (assignment_expression "iVar1 = -(uint)(*piVar3 != 9)" identifier = (unary_expression "-(uint)(*piVar3 != 9)" - (call_expression "(uint)(*piVar3 != 9)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(*piVar3 != 9)" ( (binary_expression "*piVar3 != 9" (pointer_expression "*piVar3" * identifier) != number_literal) ))))) ;) }) (else_clause "else {\n          iVar1 = -1;\n        }" else (compound_statement "{\n          iVar1 = -1;\n        }" { (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) }))) })) }) (else_clause "else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar6 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }" else (if_statement "if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar6 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      puVar4 = (undefined4 *)(**(code **)(puVar6 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }" { (expression_statement "puVar4 = (undefined4 *)(**(code **)(puVar6 + 0x177e4))();" (assignment_expression "puVar4 = (undefined4 *)(**(code **)(puVar6 + 0x177e4))()" identifier = (cast_expression "(undefined4 *)(**(code **)(puVar6 + 0x177e4))()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(**(code **)(puVar6 + 0x177e4))()" (parenthesized_expression "(**(code **)(puVar6 + 0x177e4))" ( (pointer_expression "**(code **)(puVar6 + 0x177e4)" * (pointer_expression "*(code **)(puVar6 + 0x177e4)" * (cast_expression "(code **)(puVar6 + 0x177e4)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar6 + 0x177e4)" ( (binary_expression "puVar6 + 0x177e4" identifier + number_literal) ))))) )) (argument_list "()" ( ))))) ;) (expression_statement "*puVar4 = 0;" (assignment_expression "*puVar4 = 0" (pointer_expression "*puVar4" * identifier) = number_literal) ;) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) }) (else_clause "else {\n      iVar1 = -1;\n    }" else (compound_statement "{\n      iVar1 = -1;\n    }" { (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) }))))) (return_statement "return iVar1;" return identifier ;) }))) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "int set_permissions(uint *param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 *puVar4;\n  uint *puVar5;\n  uint uVar6;\n  undefined *puVar7;\n  char local_1e;\n  char local_1d;\n  uint *local_1c;\n  \n  local_1c = *(uint **)PTR___stack_chk_guard_00046624;\n  local_1e = '\0';\n  local_1d = '\0';\n  uVar6 = *param_1;\n  if ((uVar6 & 0xe00) != 0) {\n    iVar1 = chmod_or_fchmod(param_2,param_3);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }\n  iVar2 = FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e);\n  if (local_1e == '\0') {\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n    if (local_1e != '\0') goto LAB_0002ec1c;\n    local_1d = '\x01';\n  }\n  else {\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }\nLAB_0002ecc8:\n  if ((uVar6 & 0xe00) == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }\nLAB_0002ec24:\n  if (local_1c != *(uint **)PTR___stack_chk_guard_00046624) {\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }\n  return iVar2;\n}\n\n" (function_definition "int set_permissions(uint *param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 *puVar4;\n  uint *puVar5;\n  uint uVar6;\n  undefined *puVar7;\n  char local_1e;\n  char local_1d;\n  uint *local_1c;\n  \n  local_1c = *(uint **)PTR___stack_chk_guard_00046624;\n  local_1e = '\0';\n  local_1d = '\0';\n  uVar6 = *param_1;\n  if ((uVar6 & 0xe00) != 0) {\n    iVar1 = chmod_or_fchmod(param_2,param_3);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }\n  iVar2 = FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e);\n  if (local_1e == '\0') {\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n    if (local_1e != '\0') goto LAB_0002ec1c;\n    local_1d = '\x01';\n  }\n  else {\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }\nLAB_0002ecc8:\n  if ((uVar6 & 0xe00) == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }\nLAB_0002ec24:\n  if (local_1c != *(uint **)PTR___stack_chk_guard_00046624) {\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }\n  return iVar2;\n}" primitive_type (function_declarator "set_permissions(uint *param_1,undefined4 param_2,undefined4 param_3)" identifier (parameter_list "(uint *param_1,undefined4 param_2,undefined4 param_3)" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 *puVar4;\n  uint *puVar5;\n  uint uVar6;\n  undefined *puVar7;\n  char local_1e;\n  char local_1d;\n  uint *local_1c;\n  \n  local_1c = *(uint **)PTR___stack_chk_guard_00046624;\n  local_1e = '\0';\n  local_1d = '\0';\n  uVar6 = *param_1;\n  if ((uVar6 & 0xe00) != 0) {\n    iVar1 = chmod_or_fchmod(param_2,param_3);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }\n  iVar2 = FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e);\n  if (local_1e == '\0') {\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n    if (local_1e != '\0') goto LAB_0002ec1c;\n    local_1d = '\x01';\n  }\n  else {\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }\nLAB_0002ecc8:\n  if ((uVar6 & 0xe00) == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }\nLAB_0002ec24:\n  if (local_1c != *(uint **)PTR___stack_chk_guard_00046624) {\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }\n  return iVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "undefined4 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "uint *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "uint uVar6;" type_identifier identifier ;) (declaration "undefined *puVar7;" type_identifier (pointer_declarator "*puVar7" * identifier) ;) (declaration "char local_1e;" primitive_type identifier ;) (declaration "char local_1d;" primitive_type identifier ;) (declaration "uint *local_1c;" type_identifier (pointer_declarator "*local_1c" * identifier) ;) (expression_statement "local_1c = *(uint **)PTR___stack_chk_guard_00046624;" (assignment_expression "local_1c = *(uint **)PTR___stack_chk_guard_00046624" identifier = (pointer_expression "*(uint **)PTR___stack_chk_guard_00046624" * (cast_expression "(uint **)PTR___stack_chk_guard_00046624" ( (type_descriptor "uint **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "local_1e = '\0';" (assignment_expression "local_1e = '\0'" identifier = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "local_1d = '\0';" (assignment_expression "local_1d = '\0'" identifier = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "uVar6 = *param_1;" (assignment_expression "uVar6 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if ((uVar6 & 0xe00) != 0) {\n    iVar1 = chmod_or_fchmod(param_2,param_3);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }" if (parenthesized_expression "((uVar6 & 0xe00) != 0)" ( (binary_expression "(uVar6 & 0xe00) != 0" (parenthesized_expression "(uVar6 & 0xe00)" ( (binary_expression "uVar6 & 0xe00" identifier & number_literal) )) != number_literal) )) (compound_statement "{\n    iVar1 = chmod_or_fchmod(param_2,param_3);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }" { (expression_statement "iVar1 = chmod_or_fchmod(param_2,param_3);" (assignment_expression "iVar1 = chmod_or_fchmod(param_2,param_3)" identifier = (call_expression "chmod_or_fchmod(param_2,param_3)" identifier (argument_list "(param_2,param_3)" ( identifier , identifier )))) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (if_statement "if (iVar1 != 0) goto LAB_0002ec24;" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (goto_statement "goto LAB_0002ec24;" goto statement_identifier ;)) })) (expression_statement "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e);" (assignment_expression "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e)" identifier = (call_expression "FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e)" identifier (argument_list "(param_1,param_2,param_3,0,&local_1d,&local_1e)" ( identifier , identifier , identifier , number_literal , (pointer_expression "&local_1d" & identifier) , (pointer_expression "&local_1e" & identifier) )))) ;) (if_statement "if (local_1e == '\0') {\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n    if (local_1e != '\0') goto LAB_0002ec1c;\n    local_1d = '\x01';\n  }\n  else {\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }" if (parenthesized_expression "(local_1e == '\0')" ( (binary_expression "local_1e == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n    if (local_1e != '\0') goto LAB_0002ec1c;\n    local_1d = '\x01';\n  }" { (if_statement "if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }" { (expression_statement "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();" (assignment_expression "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_00046514)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00046514)()" (parenthesized_expression "(*(code *)PTR___errno_location_00046514)" ( (pointer_expression "*(code *)PTR___errno_location_00046514" * (cast_expression "(code *)PTR___errno_location_00046514" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);" (assignment_expression "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e)" identifier = (call_expression "FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e)" identifier (argument_list "(param_1,param_2,param_3,1,&local_1d,&local_1e)" ( identifier , identifier , identifier , number_literal , (pointer_expression "&local_1d" & identifier) , (pointer_expression "&local_1e" & identifier) )))) ;) (if_statement "if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;" if (parenthesized_expression "(local_1e == '\0')" ( (binary_expression "local_1e == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }" { (expression_statement "local_1d = '\x01';" (assignment_expression "local_1d = '\x01'" identifier = (char_literal "'\x01'" ' escape_sequence ')) ;) (if_statement "if (iVar1 == 0) goto LAB_0002ecc8;" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0002ecc8;" goto statement_identifier ;)) }) (else_clause "else if (iVar1 == 0) goto LAB_0002ec1c;" else (if_statement "if (iVar1 == 0) goto LAB_0002ec1c;" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0002ec1c;" goto statement_identifier ;)))) (expression_statement "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();" (assignment_expression "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_00046514)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00046514)()" (parenthesized_expression "(*(code *)PTR___errno_location_00046514)" ( (pointer_expression "*(code *)PTR___errno_location_00046514" * (cast_expression "(code *)PTR___errno_location_00046514" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (goto_statement "goto LAB_0002ec1c;" goto statement_identifier ;) })) (expression_statement "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);" (assignment_expression "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e)" identifier = (call_expression "FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e)" identifier (argument_list "(param_1,param_2,param_3,1,&local_1d,&local_1e)" ( identifier , identifier , identifier , number_literal , (pointer_expression "&local_1d" & identifier) , (pointer_expression "&local_1e" & identifier) )))) ;) (if_statement "if (local_1e != '\0') goto LAB_0002ec1c;" if (parenthesized_expression "(local_1e != '\0')" ( (binary_expression "local_1e != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (goto_statement "goto LAB_0002ec1c;" goto statement_identifier ;)) (expression_statement "local_1d = '\x01';" (assignment_expression "local_1d = '\x01'" identifier = (char_literal "'\x01'" ' escape_sequence ')) ;) }) (else_clause "else {\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }" else (compound_statement "{\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }" { (labeled_statement "LAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;" statement_identifier : (if_statement "if (local_1d == '\0') goto LAB_0002ec24;" if (parenthesized_expression "(local_1d == '\0')" ( (binary_expression "local_1d == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (goto_statement "goto LAB_0002ec24;" goto statement_identifier ;))) }))) (labeled_statement "LAB_0002ecc8:\n  if ((uVar6 & 0xe00) == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }" statement_identifier : (if_statement "if ((uVar6 & 0xe00) == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }" if (parenthesized_expression "((uVar6 & 0xe00) == 0)" ( (binary_expression "(uVar6 & 0xe00) == 0" (parenthesized_expression "(uVar6 & 0xe00)" ( (binary_expression "uVar6 & 0xe00" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }" { (if_statement "if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }" { (expression_statement "iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);" (assignment_expression "iVar2 = chmod_or_fchmod(param_2,param_3,*param_1)" identifier = (call_expression "chmod_or_fchmod(param_2,param_3,*param_1)" identifier (argument_list "(param_2,param_3,*param_1)" ( identifier , identifier , (pointer_expression "*param_1" * identifier) )))) ;) }) (else_clause "else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }" else (compound_statement "{\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }" { (expression_statement "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();" (assignment_expression "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_00046514)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00046514)()" (parenthesized_expression "(*(code *)PTR___errno_location_00046514)" ( (pointer_expression "*(code *)PTR___errno_location_00046514" * (cast_expression "(code *)PTR___errno_location_00046514" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);" (assignment_expression "iVar2 = chmod_or_fchmod(param_2,param_3,*param_1)" identifier = (call_expression "chmod_or_fchmod(param_2,param_3,*param_1)" identifier (argument_list "(param_2,param_3,*param_1)" ( identifier , identifier , (pointer_expression "*param_1" * identifier) )))) ;) (if_statement "if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }" { (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) })) }))) }))) (labeled_statement "LAB_0002ec24:\n  if (local_1c != *(uint **)PTR___stack_chk_guard_00046624) {\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }" statement_identifier : (if_statement "if (local_1c != *(uint **)PTR___stack_chk_guard_00046624) {\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }" if (parenthesized_expression "(local_1c != *(uint **)PTR___stack_chk_guard_00046624)" ( (binary_expression "local_1c != *(uint **)PTR___stack_chk_guard_00046624" identifier != (pointer_expression "*(uint **)PTR___stack_chk_guard_00046624" * (cast_expression "(uint **)PTR___stack_chk_guard_00046624" ( (type_descriptor "uint **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) )) (compound_statement "{\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }" { (expression_statement "puVar5 = local_1c;" (assignment_expression "puVar5 = local_1c" identifier = identifier) ;) (expression_statement "puVar7 = PTR___stack_chk_fail_000465f4;" (assignment_expression "puVar7 = PTR___stack_chk_fail_000465f4" identifier = identifier) ;) (expression_statement "(*(code *)PTR___stack_chk_fail_000465f4)();" (call_expression "(*(code *)PTR___stack_chk_fail_000465f4)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_000465f4)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_000465f4" * (cast_expression "(code *)PTR___stack_chk_fail_000465f4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "iVar2 = (**(code **)(puVar7 + 0x1787c))();" (assignment_expression "iVar2 = (**(code **)(puVar7 + 0x1787c))()" identifier = (call_expression "(**(code **)(puVar7 + 0x1787c))()" (parenthesized_expression "(**(code **)(puVar7 + 0x1787c))" ( (pointer_expression "**(code **)(puVar7 + 0x1787c)" * (pointer_expression "*(code **)(puVar7 + 0x1787c)" * (cast_expression "(code **)(puVar7 + 0x1787c)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar7 + 0x1787c)" ( (binary_expression "puVar7 + 0x1787c" identifier + number_literal) ))))) )) (argument_list "()" ( )))) ;) (expression_statement "uVar6 = *puVar5;" (assignment_expression "uVar6 = *puVar5" identifier = (pointer_expression "*puVar5" * identifier)) ;) (expression_statement "iVar1 = rpl_fclose(puVar5);" (assignment_expression "iVar1 = rpl_fclose(puVar5)" identifier = (call_expression "rpl_fclose(puVar5)" identifier (argument_list "(puVar5)" ( identifier )))) ;) (if_statement "if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }" if (parenthesized_expression "((uVar6 & 0x20) == 0)" ( (binary_expression "(uVar6 & 0x20) == 0" (parenthesized_expression "(uVar6 & 0x20)" ( (binary_expression "uVar6 & 0x20" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }" { (if_statement "if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }" { (if_statement "if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }" { (expression_statement "piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();" (assignment_expression "piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))()" identifier = (cast_expression "(int *)(**(code **)(puVar7 + 0x177e4))()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(**(code **)(puVar7 + 0x177e4))()" (parenthesized_expression "(**(code **)(puVar7 + 0x177e4))" ( (pointer_expression "**(code **)(puVar7 + 0x177e4)" * (pointer_expression "*(code **)(puVar7 + 0x177e4)" * (cast_expression "(code **)(puVar7 + 0x177e4)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar7 + 0x177e4)" ( (binary_expression "puVar7 + 0x177e4" identifier + number_literal) ))))) )) (argument_list "()" ( ))))) ;) (expression_statement "iVar1 = -(uint)(*piVar3 != 9);" (assignment_expression "iVar1 = -(uint)(*piVar3 != 9)" identifier = (unary_expression "-(uint)(*piVar3 != 9)" - (call_expression "(uint)(*piVar3 != 9)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(*piVar3 != 9)" ( (binary_expression "*piVar3 != 9" (pointer_expression "*piVar3" * identifier) != number_literal) ))))) ;) }) (else_clause "else {\n          iVar1 = -1;\n        }" else (compound_statement "{\n          iVar1 = -1;\n        }" { (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) }))) })) }) (else_clause "else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }" else (if_statement "if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }" { (expression_statement "puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();" (assignment_expression "puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))()" identifier = (cast_expression "(undefined4 *)(**(code **)(puVar7 + 0x177e4))()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(**(code **)(puVar7 + 0x177e4))()" (parenthesized_expression "(**(code **)(puVar7 + 0x177e4))" ( (pointer_expression "**(code **)(puVar7 + 0x177e4)" * (pointer_expression "*(code **)(puVar7 + 0x177e4)" * (cast_expression "(code **)(puVar7 + 0x177e4)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar7 + 0x177e4)" ( (binary_expression "puVar7 + 0x177e4" identifier + number_literal) ))))) )) (argument_list "()" ( ))))) ;) (expression_statement "*puVar4 = 0;" (assignment_expression "*puVar4 = 0" (pointer_expression "*puVar4" * identifier) = number_literal) ;) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) }) (else_clause "else {\n      iVar1 = -1;\n    }" else (compound_statement "{\n      iVar1 = -1;\n    }" { (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) }))))) (return_statement "return iVar1;" return identifier ;) }))) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (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 (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) IDENT))) ;) (expression_statement (assignment_expression IDENT = (char_literal ' escape_sequence ')) ;) (expression_statement (assignment_expression IDENT = (char_literal ' escape_sequence ')) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (goto_statement goto statement_identifier ;)) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , LIT , (pointer_expression & IDENT) , (pointer_expression & IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (char_literal ' escape_sequence ')) )) (compound_statement { (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 ( ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , LIT , (pointer_expression & IDENT) , (pointer_expression & IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (char_literal ' escape_sequence ')) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) }) (else_clause else (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 (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , LIT , (pointer_expression & IDENT) , (pointer_expression & IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (char_literal ' escape_sequence ')) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (char_literal ' escape_sequence ')) ;) }) (else_clause else (compound_statement { (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == (char_literal ' escape_sequence ')) )) (goto_statement goto statement_identifier ;))) }))) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , (pointer_expression * IDENT) )))) ;) }) (else_clause else (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 ( ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , (pointer_expression * IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = 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 { (expression_statement (assignment_expression IDENT = 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 ( ))) ;) (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 ( )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (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 * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (argument_list ( ))))) ;) (expression_statement (assignment_expression IDENT = (unary_expression - (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (pointer_expression * IDENT) != LIT) ))))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }))) })) }) (else_clause else (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 * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (argument_list ( ))))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }))))) (return_statement return IDENT ;) }))) (return_statement return IDENT ;) })))
(function_definition "int set_permissions(uint *param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 *puVar4;\n  uint *puVar5;\n  uint uVar6;\n  undefined *puVar7;\n  char local_1e;\n  char local_1d;\n  uint *local_1c;\n  \n  local_1c = *(uint **)PTR___stack_chk_guard_00046624;\n  local_1e = '\0';\n  local_1d = '\0';\n  uVar6 = *param_1;\n  if ((uVar6 & 0xe00) != 0) {\n    iVar1 = chmod_or_fchmod(param_2,param_3);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }\n  iVar2 = FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e);\n  if (local_1e == '\0') {\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n    if (local_1e != '\0') goto LAB_0002ec1c;\n    local_1d = '\x01';\n  }\n  else {\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }\nLAB_0002ecc8:\n  if ((uVar6 & 0xe00) == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }\nLAB_0002ec24:\n  if (local_1c != *(uint **)PTR___stack_chk_guard_00046624) {\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }\n  return iVar2;\n}" (primitive_type "int") (function_declarator "set_permissions(uint *param_1,undefined4 param_2,undefined4 param_3)" (identifier "set_permissions") (parameter_list "(uint *param_1,undefined4 param_2,undefined4 param_3)" (( "(") (parameter_declaration "uint *param_1" (type_identifier "uint") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 *puVar4;\n  uint *puVar5;\n  uint uVar6;\n  undefined *puVar7;\n  char local_1e;\n  char local_1d;\n  uint *local_1c;\n  \n  local_1c = *(uint **)PTR___stack_chk_guard_00046624;\n  local_1e = '\0';\n  local_1d = '\0';\n  uVar6 = *param_1;\n  if ((uVar6 & 0xe00) != 0) {\n    iVar1 = chmod_or_fchmod(param_2,param_3);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }\n  iVar2 = FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e);\n  if (local_1e == '\0') {\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n    if (local_1e != '\0') goto LAB_0002ec1c;\n    local_1d = '\x01';\n  }\n  else {\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }\nLAB_0002ecc8:\n  if ((uVar6 & 0xe00) == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }\nLAB_0002ec24:\n  if (local_1c != *(uint **)PTR___stack_chk_guard_00046624) {\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }\n  return iVar2;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (declaration "undefined4 *puVar4;" (type_identifier "undefined4") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (declaration "uint *puVar5;" (type_identifier "uint") (pointer_declarator "*puVar5" (* "*") (identifier "puVar5")) (; ";")) (declaration "uint uVar6;" (type_identifier "uint") (identifier "uVar6") (; ";")) (declaration "undefined *puVar7;" (type_identifier "undefined") (pointer_declarator "*puVar7" (* "*") (identifier "puVar7")) (; ";")) (declaration "char local_1e;" (primitive_type "char") (identifier "local_1e") (; ";")) (declaration "char local_1d;" (primitive_type "char") (identifier "local_1d") (; ";")) (declaration "uint *local_1c;" (type_identifier "uint") (pointer_declarator "*local_1c" (* "*") (identifier "local_1c")) (; ";")) (expression_statement "local_1c = *(uint **)PTR___stack_chk_guard_00046624;" (assignment_expression "local_1c = *(uint **)PTR___stack_chk_guard_00046624" (identifier "local_1c") (= "=") (pointer_expression "*(uint **)PTR___stack_chk_guard_00046624" (* "*") (cast_expression "(uint **)PTR___stack_chk_guard_00046624" (( "(") (type_descriptor "uint **" (type_identifier "uint") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (identifier "PTR___stack_chk_guard_00046624")))) (; ";")) (expression_statement "local_1e = '\0';" (assignment_expression "local_1e = '\0'" (identifier "local_1e") (= "=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) (; ";")) (expression_statement "local_1d = '\0';" (assignment_expression "local_1d = '\0'" (identifier "local_1d") (= "=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) (; ";")) (expression_statement "uVar6 = *param_1;" (assignment_expression "uVar6 = *param_1" (identifier "uVar6") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (if_statement "if ((uVar6 & 0xe00) != 0) {\n    iVar1 = chmod_or_fchmod(param_2,param_3);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }" (if "if") (parenthesized_expression "((uVar6 & 0xe00) != 0)" (( "(") (binary_expression "(uVar6 & 0xe00) != 0" (parenthesized_expression "(uVar6 & 0xe00)" (( "(") (binary_expression "uVar6 & 0xe00" (identifier "uVar6") (& "&") (number_literal "0xe00")) () ")")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    iVar1 = chmod_or_fchmod(param_2,param_3);\n    iVar2 = -1;\n    if (iVar1 != 0) goto LAB_0002ec24;\n  }" ({ "{") (expression_statement "iVar1 = chmod_or_fchmod(param_2,param_3);" (assignment_expression "iVar1 = chmod_or_fchmod(param_2,param_3)" (identifier "iVar1") (= "=") (call_expression "chmod_or_fchmod(param_2,param_3)" (identifier "chmod_or_fchmod") (argument_list "(param_2,param_3)" (( "(") (identifier "param_2") (, ",") (identifier "param_3") () ")")))) (; ";")) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" (identifier "iVar2") (= "=") (number_literal "-1")) (; ";")) (if_statement "if (iVar1 != 0) goto LAB_0002ec24;" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (goto_statement "goto LAB_0002ec24;" (goto "goto") (statement_identifier "LAB_0002ec24") (; ";"))) (} "}"))) (expression_statement "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e);" (assignment_expression "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e)" (identifier "iVar2") (= "=") (call_expression "FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e)" (identifier "FUN_0002e8a0") (argument_list "(param_1,param_2,param_3,0,&local_1d,&local_1e)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") (, ",") (number_literal "0") (, ",") (pointer_expression "&local_1d" (& "&") (identifier "local_1d")) (, ",") (pointer_expression "&local_1e" (& "&") (identifier "local_1e")) () ")")))) (; ";")) (if_statement "if (local_1e == '\0') {\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n    if (local_1e != '\0') goto LAB_0002ec1c;\n    local_1d = '\x01';\n  }\n  else {\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }" (if "if") (parenthesized_expression "(local_1e == '\0')" (( "(") (binary_expression "local_1e == '\0'" (identifier "local_1e") (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n    if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }\n    iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n    if (local_1e != '\0') goto LAB_0002ec1c;\n    local_1d = '\x01';\n  }" ({ "{") (if_statement "if (iVar2 != 0) {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }" (if "if") (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);\n      if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      *piVar3 = iVar1;\n      iVar2 = -1;\n      goto LAB_0002ec1c;\n    }" ({ "{") (expression_statement "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();" (assignment_expression "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)()" (identifier "piVar3") (= "=") (cast_expression "(int *)(*(code *)PTR___errno_location_00046514)()" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___errno_location_00046514)()" (parenthesized_expression "(*(code *)PTR___errno_location_00046514)" (( "(") (pointer_expression "*(code *)PTR___errno_location_00046514" (* "*") (cast_expression "(code *)PTR___errno_location_00046514" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___errno_location_00046514"))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" (identifier "iVar1") (= "=") (pointer_expression "*piVar3" (* "*") (identifier "piVar3"))) (; ";")) (expression_statement "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);" (assignment_expression "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e)" (identifier "iVar2") (= "=") (call_expression "FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e)" (identifier "FUN_0002e8a0") (argument_list "(param_1,param_2,param_3,1,&local_1d,&local_1e)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") (, ",") (number_literal "1") (, ",") (pointer_expression "&local_1d" (& "&") (identifier "local_1d")) (, ",") (pointer_expression "&local_1e" (& "&") (identifier "local_1e")) () ")")))) (; ";")) (if_statement "if (local_1e == '\0') {\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }\n      else if (iVar1 == 0) goto LAB_0002ec1c;" (if "if") (parenthesized_expression "(local_1e == '\0')" (( "(") (binary_expression "local_1e == '\0'" (identifier "local_1e") (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n        local_1d = '\x01';\n        if (iVar1 == 0) goto LAB_0002ecc8;\n      }" ({ "{") (expression_statement "local_1d = '\x01';" (assignment_expression "local_1d = '\x01'" (identifier "local_1d") (= "=") (char_literal "'\x01'" (' "'") (escape_sequence "\x01") (' "'"))) (; ";")) (if_statement "if (iVar1 == 0) goto LAB_0002ecc8;" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_0002ecc8;" (goto "goto") (statement_identifier "LAB_0002ecc8") (; ";"))) (} "}")) (else_clause "else if (iVar1 == 0) goto LAB_0002ec1c;" (else "else") (if_statement "if (iVar1 == 0) goto LAB_0002ec1c;" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_0002ec1c;" (goto "goto") (statement_identifier "LAB_0002ec1c") (; ";"))))) (expression_statement "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();" (assignment_expression "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)()" (identifier "piVar3") (= "=") (cast_expression "(int *)(*(code *)PTR___errno_location_00046514)()" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___errno_location_00046514)()" (parenthesized_expression "(*(code *)PTR___errno_location_00046514)" (( "(") (pointer_expression "*(code *)PTR___errno_location_00046514" (* "*") (cast_expression "(code *)PTR___errno_location_00046514" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___errno_location_00046514"))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (= "=") (identifier "iVar1")) (; ";")) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" (identifier "iVar2") (= "=") (number_literal "-1")) (; ";")) (goto_statement "goto LAB_0002ec1c;" (goto "goto") (statement_identifier "LAB_0002ec1c") (; ";")) (} "}"))) (expression_statement "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);" (assignment_expression "iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e)" (identifier "iVar2") (= "=") (call_expression "FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e)" (identifier "FUN_0002e8a0") (argument_list "(param_1,param_2,param_3,1,&local_1d,&local_1e)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") (, ",") (number_literal "1") (, ",") (pointer_expression "&local_1d" (& "&") (identifier "local_1d")) (, ",") (pointer_expression "&local_1e" (& "&") (identifier "local_1e")) () ")")))) (; ";")) (if_statement "if (local_1e != '\0') goto LAB_0002ec1c;" (if "if") (parenthesized_expression "(local_1e != '\0')" (( "(") (binary_expression "local_1e != '\0'" (identifier "local_1e") (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (goto_statement "goto LAB_0002ec1c;" (goto "goto") (statement_identifier "LAB_0002ec1c") (; ";"))) (expression_statement "local_1d = '\x01';" (assignment_expression "local_1d = '\x01'" (identifier "local_1d") (= "=") (char_literal "'\x01'" (' "'") (escape_sequence "\x01") (' "'"))) (; ";")) (} "}")) (else_clause "else {\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }" (else "else") (compound_statement "{\nLAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;\n  }" ({ "{") (labeled_statement "LAB_0002ec1c:\n    if (local_1d == '\0') goto LAB_0002ec24;" (statement_identifier "LAB_0002ec1c") (: ":") (if_statement "if (local_1d == '\0') goto LAB_0002ec24;" (if "if") (parenthesized_expression "(local_1d == '\0')" (( "(") (binary_expression "local_1d == '\0'" (identifier "local_1d") (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (goto_statement "goto LAB_0002ec24;" (goto "goto") (statement_identifier "LAB_0002ec24") (; ";")))) (} "}")))) (labeled_statement "LAB_0002ecc8:\n  if ((uVar6 & 0xe00) == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }" (statement_identifier "LAB_0002ecc8") (: ":") (if_statement "if ((uVar6 & 0xe00) == 0) {\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }" (if "if") (parenthesized_expression "((uVar6 & 0xe00) == 0)" (( "(") (binary_expression "(uVar6 & 0xe00) == 0" (parenthesized_expression "(uVar6 & 0xe00)" (( "(") (binary_expression "uVar6 & 0xe00" (identifier "uVar6") (& "&") (number_literal "0xe00")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }\n  }" ({ "{") (if_statement "if (iVar2 == 0) {\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }\n    else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n    }" ({ "{") (expression_statement "iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);" (assignment_expression "iVar2 = chmod_or_fchmod(param_2,param_3,*param_1)" (identifier "iVar2") (= "=") (call_expression "chmod_or_fchmod(param_2,param_3,*param_1)" (identifier "chmod_or_fchmod") (argument_list "(param_2,param_3,*param_1)" (( "(") (identifier "param_2") (, ",") (identifier "param_3") (, ",") (pointer_expression "*param_1" (* "*") (identifier "param_1")) () ")")))) (; ";")) (} "}")) (else_clause "else {\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }" (else "else") (compound_statement "{\n      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();\n      iVar1 = *piVar3;\n      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);\n      if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }\n    }" ({ "{") (expression_statement "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();" (assignment_expression "piVar3 = (int *)(*(code *)PTR___errno_location_00046514)()" (identifier "piVar3") (= "=") (cast_expression "(int *)(*(code *)PTR___errno_location_00046514)()" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___errno_location_00046514)()" (parenthesized_expression "(*(code *)PTR___errno_location_00046514)" (( "(") (pointer_expression "*(code *)PTR___errno_location_00046514" (* "*") (cast_expression "(code *)PTR___errno_location_00046514" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___errno_location_00046514"))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" (identifier "iVar1") (= "=") (pointer_expression "*piVar3" (* "*") (identifier "piVar3"))) (; ";")) (expression_statement "iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);" (assignment_expression "iVar2 = chmod_or_fchmod(param_2,param_3,*param_1)" (identifier "iVar2") (= "=") (call_expression "chmod_or_fchmod(param_2,param_3,*param_1)" (identifier "chmod_or_fchmod") (argument_list "(param_2,param_3,*param_1)" (( "(") (identifier "param_2") (, ",") (identifier "param_3") (, ",") (pointer_expression "*param_1" (* "*") (identifier "param_1")) () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        *piVar3 = iVar1;\n        iVar2 = -1;\n      }" ({ "{") (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (= "=") (identifier "iVar1")) (; ";")) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" (identifier "iVar2") (= "=") (number_literal "-1")) (; ";")) (} "}"))) (} "}")))) (} "}")))) (labeled_statement "LAB_0002ec24:\n  if (local_1c != *(uint **)PTR___stack_chk_guard_00046624) {\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }" (statement_identifier "LAB_0002ec24") (: ":") (if_statement "if (local_1c != *(uint **)PTR___stack_chk_guard_00046624) {\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }" (if "if") (parenthesized_expression "(local_1c != *(uint **)PTR___stack_chk_guard_00046624)" (( "(") (binary_expression "local_1c != *(uint **)PTR___stack_chk_guard_00046624" (identifier "local_1c") (!= "!=") (pointer_expression "*(uint **)PTR___stack_chk_guard_00046624" (* "*") (cast_expression "(uint **)PTR___stack_chk_guard_00046624" (( "(") (type_descriptor "uint **" (type_identifier "uint") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (identifier "PTR___stack_chk_guard_00046624")))) () ")")) (compound_statement "{\n    puVar5 = local_1c;\n    puVar7 = PTR___stack_chk_fail_000465f4;\n    (*(code *)PTR___stack_chk_fail_000465f4)();\n    iVar2 = (**(code **)(puVar7 + 0x1787c))();\n    uVar6 = *puVar5;\n    iVar1 = rpl_fclose(puVar5);\n    if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }\n    return iVar1;\n  }" ({ "{") (expression_statement "puVar5 = local_1c;" (assignment_expression "puVar5 = local_1c" (identifier "puVar5") (= "=") (identifier "local_1c")) (; ";")) (expression_statement "puVar7 = PTR___stack_chk_fail_000465f4;" (assignment_expression "puVar7 = PTR___stack_chk_fail_000465f4" (identifier "puVar7") (= "=") (identifier "PTR___stack_chk_fail_000465f4")) (; ";")) (expression_statement "(*(code *)PTR___stack_chk_fail_000465f4)();" (call_expression "(*(code *)PTR___stack_chk_fail_000465f4)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_000465f4)" (( "(") (pointer_expression "*(code *)PTR___stack_chk_fail_000465f4" (* "*") (cast_expression "(code *)PTR___stack_chk_fail_000465f4" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_fail_000465f4"))) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "iVar2 = (**(code **)(puVar7 + 0x1787c))();" (assignment_expression "iVar2 = (**(code **)(puVar7 + 0x1787c))()" (identifier "iVar2") (= "=") (call_expression "(**(code **)(puVar7 + 0x1787c))()" (parenthesized_expression "(**(code **)(puVar7 + 0x1787c))" (( "(") (pointer_expression "**(code **)(puVar7 + 0x1787c)" (* "*") (pointer_expression "*(code **)(puVar7 + 0x1787c)" (* "*") (cast_expression "(code **)(puVar7 + 0x1787c)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(puVar7 + 0x1787c)" (( "(") (binary_expression "puVar7 + 0x1787c" (identifier "puVar7") (+ "+") (number_literal "0x1787c")) () ")"))))) () ")")) (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "uVar6 = *puVar5;" (assignment_expression "uVar6 = *puVar5" (identifier "uVar6") (= "=") (pointer_expression "*puVar5" (* "*") (identifier "puVar5"))) (; ";")) (expression_statement "iVar1 = rpl_fclose(puVar5);" (assignment_expression "iVar1 = rpl_fclose(puVar5)" (identifier "iVar1") (= "=") (call_expression "rpl_fclose(puVar5)" (identifier "rpl_fclose") (argument_list "(puVar5)" (( "(") (identifier "puVar5") () ")")))) (; ";")) (if_statement "if ((uVar6 & 0x20) == 0) {\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }\n    else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }" (if "if") (parenthesized_expression "((uVar6 & 0x20) == 0)" (( "(") (binary_expression "(uVar6 & 0x20) == 0" (parenthesized_expression "(uVar6 & 0x20)" (( "(") (binary_expression "uVar6 & 0x20" (identifier "uVar6") (& "&") (number_literal "0x20")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }\n    }" ({ "{") (if_statement "if (iVar1 != 0) {\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }\n      }" ({ "{") (if_statement "if (iVar2 == 0) {\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }\n        else {\n          iVar1 = -1;\n        }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();\n          iVar1 = -(uint)(*piVar3 != 9);\n        }" ({ "{") (expression_statement "piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();" (assignment_expression "piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))()" (identifier "piVar3") (= "=") (cast_expression "(int *)(**(code **)(puVar7 + 0x177e4))()" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(**(code **)(puVar7 + 0x177e4))()" (parenthesized_expression "(**(code **)(puVar7 + 0x177e4))" (( "(") (pointer_expression "**(code **)(puVar7 + 0x177e4)" (* "*") (pointer_expression "*(code **)(puVar7 + 0x177e4)" (* "*") (cast_expression "(code **)(puVar7 + 0x177e4)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(puVar7 + 0x177e4)" (( "(") (binary_expression "puVar7 + 0x177e4" (identifier "puVar7") (+ "+") (number_literal "0x177e4")) () ")"))))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "iVar1 = -(uint)(*piVar3 != 9);" (assignment_expression "iVar1 = -(uint)(*piVar3 != 9)" (identifier "iVar1") (= "=") (unary_expression "-(uint)(*piVar3 != 9)" (- "-") (call_expression "(uint)(*piVar3 != 9)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(*piVar3 != 9)" (( "(") (binary_expression "*piVar3 != 9" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (!= "!=") (number_literal "9")) () ")"))))) (; ";")) (} "}")) (else_clause "else {\n          iVar1 = -1;\n        }" (else "else") (compound_statement "{\n          iVar1 = -1;\n        }" ({ "{") (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" (identifier "iVar1") (= "=") (number_literal "-1")) (; ";")) (} "}")))) (} "}"))) (} "}")) (else_clause "else if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }" (else "else") (if_statement "if (iVar1 == 0) {\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }\n    else {\n      iVar1 = -1;\n    }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();\n      *puVar4 = 0;\n      iVar1 = -1;\n    }" ({ "{") (expression_statement "puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();" (assignment_expression "puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))()" (identifier "puVar4") (= "=") (cast_expression "(undefined4 *)(**(code **)(puVar7 + 0x177e4))()" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(**(code **)(puVar7 + 0x177e4))()" (parenthesized_expression "(**(code **)(puVar7 + 0x177e4))" (( "(") (pointer_expression "**(code **)(puVar7 + 0x177e4)" (* "*") (pointer_expression "*(code **)(puVar7 + 0x177e4)" (* "*") (cast_expression "(code **)(puVar7 + 0x177e4)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(puVar7 + 0x177e4)" (( "(") (binary_expression "puVar7 + 0x177e4" (identifier "puVar7") (+ "+") (number_literal "0x177e4")) () ")"))))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "*puVar4 = 0;" (assignment_expression "*puVar4 = 0" (pointer_expression "*puVar4" (* "*") (identifier "puVar4")) (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" (identifier "iVar1") (= "=") (number_literal "-1")) (; ";")) (} "}")) (else_clause "else {\n      iVar1 = -1;\n    }" (else "else") (compound_statement "{\n      iVar1 = -1;\n    }" ({ "{") (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" (identifier "iVar1") (= "=") (number_literal "-1")) (; ";")) (} "}")))))) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}")))) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}")))
(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (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))))) (expression_statement (assignment_expression left: (identifier) right: (char_literal (escape_sequence)))) (expression_statement (assignment_expression left: (identifier) right: (char_literal (escape_sequence)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (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) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (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: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (number_literal) (pointer_expression argument: (identifier)) (pointer_expression argument: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence)))) consequence: (compound_statement (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))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (number_literal) (pointer_expression argument: (identifier)) (pointer_expression argument: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (char_literal (escape_sequence)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier)))) alternative: (else_clause (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: (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))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (goto_statement label: (statement_identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (number_literal) (pointer_expression argument: (identifier)) (pointer_expression argument: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence)))) consequence: (goto_statement label: (statement_identifier))) (expression_statement (assignment_expression left: (identifier) right: (char_literal (escape_sequence))))) alternative: (else_clause (compound_statement (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence)))) consequence: (goto_statement label: (statement_identifier))))))) (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))) consequence: (compound_statement (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: (identifier) arguments: (argument_list (identifier) (identifier) (pointer_expression argument: (identifier))))))) alternative: (else_clause (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))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (pointer_expression argument: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) 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 (expression_statement (assignment_expression left: (identifier) right: (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))) (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)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (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: (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))))) (expression_statement (assignment_expression left: (identifier) right: (unary_expression argument: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal)))))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))))))))) alternative: (else_clause (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: (type_identifier) declarator: (abstract_pointer_declarator)) value: (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))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))))))) (return_statement (identifier))))) (return_statement (identifier)))))

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

{
  int iVar1;
  int iVar2;
  int *piVar3;
  undefined4 *puVar4;
  uint *puVar5;
  uint uVar6;
  undefined *puVar7;
  char local_1e;
  char local_1d;
  uint *local_1c;
  
  local_1c = *(uint **)PTR___stack_chk_guard_00046624;
  local_1e = '\0';
  local_1d = '\0';
  uVar6 = *param_1;
  if ((uVar6 & 0xe00) != 0) {
    iVar1 = chmod_or_fchmod(param_2,param_3);
    iVar2 = -1;
    if (iVar1 != 0) goto LAB_0002ec24;
  }
  iVar2 = FUN_0002e8a0(param_1,param_2,param_3,0,&local_1d,&local_1e);
  if (local_1e == '\0') {
    if (iVar2 != 0) {
      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();
      iVar1 = *piVar3;
      iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);
      if (local_1e == '\0') {
        local_1d = '\x01';
        if (iVar1 == 0) goto LAB_0002ecc8;
      }
      else if (iVar1 == 0) goto LAB_0002ec1c;
      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();
      *piVar3 = iVar1;
      iVar2 = -1;
      goto LAB_0002ec1c;
    }
    iVar2 = FUN_0002e8a0(param_1,param_2,param_3,1,&local_1d,&local_1e);
    if (local_1e != '\0') goto LAB_0002ec1c;
    local_1d = '\x01';
  }
  else {
LAB_0002ec1c:
    if (local_1d == '\0') goto LAB_0002ec24;
  }
LAB_0002ecc8:
  if ((uVar6 & 0xe00) == 0) {
    if (iVar2 == 0) {
      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);
    }
    else {
      piVar3 = (int *)(*(code *)PTR___errno_location_00046514)();
      iVar1 = *piVar3;
      iVar2 = chmod_or_fchmod(param_2,param_3,*param_1);
      if (iVar1 != 0) {
        *piVar3 = iVar1;
        iVar2 = -1;
      }
    }
  }
LAB_0002ec24:
  if (local_1c != *(uint **)PTR___stack_chk_guard_00046624) {
    puVar5 = local_1c;
    puVar7 = PTR___stack_chk_fail_000465f4;
    (*(code *)PTR___stack_chk_fail_000465f4)();
    iVar2 = (**(code **)(puVar7 + 0x1787c))();
    uVar6 = *puVar5;
    iVar1 = rpl_fclose(puVar5);
    if ((uVar6 & 0x20) == 0) {
      if (iVar1 != 0) {
        if (iVar2 == 0) {
          piVar3 = (int *)(**(code **)(puVar7 + 0x177e4))();
          iVar1 = -(uint)(*piVar3 != 9);
        }
        else {
          iVar1 = -1;
        }
      }
    }
    else if (iVar1 == 0) {
      puVar4 = (undefined4 *)(**(code **)(puVar7 + 0x177e4))();
      *puVar4 = 0;
      iVar1 = -1;
    }
    else {
      iVar1 = -1;
    }
    return iVar1;
  }
  return iVar2;
}

