
/* WARNING: Unknown calling convention */

int os_isdir(int fd)

{
  undefined *puVar1;
  int iVar2;
  int iVar3;
  uint uVar4;
  stat sbuf;
  
  puVar1 = PTR___stack_chk_guard_004b238c;
  iVar2 = *(int *)PTR___stack_chk_guard_004b238c;
  iVar3 = (*(code *)PTR___fxstat64_004b2310)(3,fd,&sbuf);
  if (iVar3 == 0) {
    uVar4 = (uint)((sbuf.st_mode & 0xf000) == 0x4000);
  }
  else {
    uVar4 = 0;
  }
  if (iVar2 == *(int *)puVar1) {
    return uVar4;
  }
  (*(code *)PTR___stack_chk_fail_004b2348)();
  iVar3 = *(int *)(iVar2 + 4);
  *(undefined1 *)fd = 0;
  if (iVar3 != -1) {
    uVar4 = *(uint *)(iVar2 + 0x30) & 0xf000;
    if (uVar4 == 0x4000) {
      *(undefined1 *)fd = 1;
      return 0;
    }
    if (uVar4 < 0x4001) {
      if ((uVar4 == 0x1000) || (uVar4 == 0x2000)) {
        return 1;
      }
    }
    else {
      if (uVar4 == 0x8000) {
        return 1;
      }
      if (uVar4 == 0xc000) {
        return 1;
      }
    }
  }
  return 0;
}



bool os_isdir(undefined1 *param_1)

{
  undefined *puVar1;
  int iVar2;
  uint uVar3;
  undefined1 auStack_b0 [24];
  uint local_98;
  int local_c;
  
  puVar1 = PTR___stack_chk_guard_004b238c;
  local_c = *(int *)PTR___stack_chk_guard_004b238c;
  iVar2 = (*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0);
  if (local_c == *(int *)puVar1) {
    return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;
  }
  (*(code *)PTR___stack_chk_fail_004b2348)();
  iVar2 = *(int *)(local_c + 4);
  *param_1 = 0;
  if (iVar2 != -1) {
    uVar3 = *(uint *)(local_c + 0x30) & 0xf000;
    if (uVar3 == 0x4000) {
      *param_1 = 1;
      return false;
    }
    if (uVar3 < 0x4001) {
      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {
        return true;
      }
    }
    else {
      if (uVar3 == 0x8000) {
        return true;
      }
      if (uVar3 == 0xc000) {
        return true;
      }
    }
  }
  return false;
}


lui gp,0x4c
addiu sp,sp,-0xc8
addiu gp,gp,-0x64e0
or a1,a0,zero
sw s0,0xc0(sp)
addiu a2,sp,0x18
lw s0,-0x7794(gp)
li a0,0x3
lw t9,-0x7810(gp)
sw gp,0x10(sp)
sw ra,0xc4(sp)
lw v0,0x0(s0)
sw v0,0xbc(sp)
jalr t9
_nop
bne v0,zero,0x0045a134
_lw gp,0x10(sp)
lw v0,0x30(sp)
andi v0,v0,0xf000
xori v0,v0,0x4000
sltiu v0,v0,0x1
lw a0,0xbc(sp)
lw v1,0x0(s0)
bne a0,v1,0x0045a13c
_lw ra,0xc4(sp)
lw s0,0xc0(sp)
jr ra
_addiu sp,sp,0xc8
b 0x0045a118
_or v0,zero,zero
lw t9,-0x77d8(gp)
jalr t9
_nop
(translation_unit "bool os_isdir(undefined1 *param_1)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  undefined1 auStack_b0 [24];\n  uint local_98;\n  int local_c;\n  \n  puVar1 = PTR___stack_chk_guard_004b238c;\n  local_c = *(int *)PTR___stack_chk_guard_004b238c;\n  iVar2 = (*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0);\n  if (local_c == *(int *)puVar1) {\n    return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;\n  }\n  (*(code *)PTR___stack_chk_fail_004b2348)();\n  iVar2 = *(int *)(local_c + 4);\n  *param_1 = 0;\n  if (iVar2 != -1) {\n    uVar3 = *(uint *)(local_c + 0x30) & 0xf000;\n    if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }\n    if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }\n  }\n  return false;\n}\n\n" (function_definition "bool os_isdir(undefined1 *param_1)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  undefined1 auStack_b0 [24];\n  uint local_98;\n  int local_c;\n  \n  puVar1 = PTR___stack_chk_guard_004b238c;\n  local_c = *(int *)PTR___stack_chk_guard_004b238c;\n  iVar2 = (*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0);\n  if (local_c == *(int *)puVar1) {\n    return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;\n  }\n  (*(code *)PTR___stack_chk_fail_004b2348)();\n  iVar2 = *(int *)(local_c + 4);\n  *param_1 = 0;\n  if (iVar2 != -1) {\n    uVar3 = *(uint *)(local_c + 0x30) & 0xf000;\n    if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }\n    if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }\n  }\n  return false;\n}" primitive_type (function_declarator "os_isdir(undefined1 *param_1)" identifier (parameter_list "(undefined1 *param_1)" ( (parameter_declaration "undefined1 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  undefined1 auStack_b0 [24];\n  uint local_98;\n  int local_c;\n  \n  puVar1 = PTR___stack_chk_guard_004b238c;\n  local_c = *(int *)PTR___stack_chk_guard_004b238c;\n  iVar2 = (*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0);\n  if (local_c == *(int *)puVar1) {\n    return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;\n  }\n  (*(code *)PTR___stack_chk_fail_004b2348)();\n  iVar2 = *(int *)(local_c + 4);\n  *param_1 = 0;\n  if (iVar2 != -1) {\n    uVar3 = *(uint *)(local_c + 0x30) & 0xf000;\n    if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }\n    if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }\n  }\n  return false;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "undefined1 auStack_b0 [24];" type_identifier (array_declarator "auStack_b0 [24]" identifier [ number_literal ]) ;) (declaration "uint local_98;" type_identifier identifier ;) (declaration "int local_c;" primitive_type identifier ;) (expression_statement "puVar1 = PTR___stack_chk_guard_004b238c;" (assignment_expression "puVar1 = PTR___stack_chk_guard_004b238c" identifier = identifier) ;) (expression_statement "local_c = *(int *)PTR___stack_chk_guard_004b238c;" (assignment_expression "local_c = *(int *)PTR___stack_chk_guard_004b238c" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_004b238c" * (cast_expression "(int *)PTR___stack_chk_guard_004b238c" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar2 = (*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0);" (assignment_expression "iVar2 = (*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0)" identifier = (call_expression "(*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0)" (parenthesized_expression "(*(code *)PTR___fxstat64_004b2310)" ( (pointer_expression "*(code *)PTR___fxstat64_004b2310" * (cast_expression "(code *)PTR___fxstat64_004b2310" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(3,param_1,auStack_b0)" ( number_literal , identifier , identifier )))) ;) (if_statement "if (local_c == *(int *)puVar1) {\n    return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;\n  }" if (parenthesized_expression "(local_c == *(int *)puVar1)" ( (binary_expression "local_c == *(int *)puVar1" identifier == (pointer_expression "*(int *)puVar1" * (cast_expression "(int *)puVar1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;\n  }" { (return_statement "return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;" return (binary_expression "iVar2 == 0 && (local_98 & 0xf000) == 0x4000" (binary_expression "iVar2 == 0" identifier == number_literal) && (binary_expression "(local_98 & 0xf000) == 0x4000" (parenthesized_expression "(local_98 & 0xf000)" ( (binary_expression "local_98 & 0xf000" identifier & number_literal) )) == number_literal)) ;) })) (expression_statement "(*(code *)PTR___stack_chk_fail_004b2348)();" (call_expression "(*(code *)PTR___stack_chk_fail_004b2348)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_004b2348)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_004b2348" * (cast_expression "(code *)PTR___stack_chk_fail_004b2348" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "iVar2 = *(int *)(local_c + 4);" (assignment_expression "iVar2 = *(int *)(local_c + 4)" identifier = (pointer_expression "*(int *)(local_c + 4)" * (cast_expression "(int *)(local_c + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_c + 4)" ( (binary_expression "local_c + 4" identifier + number_literal) ))))) ;) (expression_statement "*param_1 = 0;" (assignment_expression "*param_1 = 0" (pointer_expression "*param_1" * identifier) = number_literal) ;) (if_statement "if (iVar2 != -1) {\n    uVar3 = *(uint *)(local_c + 0x30) & 0xf000;\n    if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }\n    if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }\n  }" if (parenthesized_expression "(iVar2 != -1)" ( (binary_expression "iVar2 != -1" identifier != number_literal) )) (compound_statement "{\n    uVar3 = *(uint *)(local_c + 0x30) & 0xf000;\n    if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }\n    if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }\n  }" { (expression_statement "uVar3 = *(uint *)(local_c + 0x30) & 0xf000;" (assignment_expression "uVar3 = *(uint *)(local_c + 0x30) & 0xf000" identifier = (binary_expression "*(uint *)(local_c + 0x30) & 0xf000" (pointer_expression "*(uint *)(local_c + 0x30)" * (cast_expression "(uint *)(local_c + 0x30)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_c + 0x30)" ( (binary_expression "local_c + 0x30" identifier + number_literal) )))) & number_literal)) ;) (if_statement "if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }" if (parenthesized_expression "(uVar3 == 0x4000)" ( (binary_expression "uVar3 == 0x4000" identifier == number_literal) )) (compound_statement "{\n      *param_1 = 1;\n      return false;\n    }" { (expression_statement "*param_1 = 1;" (assignment_expression "*param_1 = 1" (pointer_expression "*param_1" * identifier) = number_literal) ;) (return_statement "return false;" return false ;) })) (if_statement "if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }" if (parenthesized_expression "(uVar3 < 0x4001)" ( (binary_expression "uVar3 < 0x4001" identifier < number_literal) )) (compound_statement "{\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }" { (if_statement "if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }" if (parenthesized_expression "((uVar3 == 0x1000) || (uVar3 == 0x2000))" ( (binary_expression "(uVar3 == 0x1000) || (uVar3 == 0x2000)" (parenthesized_expression "(uVar3 == 0x1000)" ( (binary_expression "uVar3 == 0x1000" identifier == number_literal) )) || (parenthesized_expression "(uVar3 == 0x2000)" ( (binary_expression "uVar3 == 0x2000" identifier == number_literal) ))) )) (compound_statement "{\n        return true;\n      }" { (return_statement "return true;" return true ;) })) }) (else_clause "else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }" else (compound_statement "{\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }" { (if_statement "if (uVar3 == 0x8000) {\n        return true;\n      }" if (parenthesized_expression "(uVar3 == 0x8000)" ( (binary_expression "uVar3 == 0x8000" identifier == number_literal) )) (compound_statement "{\n        return true;\n      }" { (return_statement "return true;" return true ;) })) (if_statement "if (uVar3 == 0xc000) {\n        return true;\n      }" if (parenthesized_expression "(uVar3 == 0xc000)" ( (binary_expression "uVar3 == 0xc000" identifier == number_literal) )) (compound_statement "{\n        return true;\n      }" { (return_statement "return true;" return true ;) })) }))) })) (return_statement "return false;" return false ;) })))
(translation_unit "/* WARNING: Unknown calling convention */\n\nint os_isdir(int fd)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  uint uVar4;\n  stat sbuf;\n  \n  puVar1 = PTR___stack_chk_guard_004b238c;\n  iVar2 = *(int *)PTR___stack_chk_guard_004b238c;\n  iVar3 = (*(code *)PTR___fxstat64_004b2310)(3,fd,&sbuf);\n  if (iVar3 == 0) {\n    uVar4 = (uint)((sbuf.st_mode & 0xf000) == 0x4000);\n  }\n  else {\n    uVar4 = 0;\n  }\n  if (iVar2 == *(int *)puVar1) {\n    return uVar4;\n  }\n  (*(code *)PTR___stack_chk_fail_004b2348)();\n  iVar3 = *(int *)(iVar2 + 4);\n  *(undefined1 *)fd = 0;\n  if (iVar3 != -1) {\n    uVar4 = *(uint *)(iVar2 + 0x30) & 0xf000;\n    if (uVar4 == 0x4000) {\n      *(undefined1 *)fd = 1;\n      return 0;\n    }\n    if (uVar4 < 0x4001) {\n      if ((uVar4 == 0x1000) || (uVar4 == 0x2000)) {\n        return 1;\n      }\n    }\n    else {\n      if (uVar4 == 0x8000) {\n        return 1;\n      }\n      if (uVar4 == 0xc000) {\n        return 1;\n      }\n    }\n  }\n  return 0;\n}\n\n" comment (function_definition "int os_isdir(int fd)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  uint uVar4;\n  stat sbuf;\n  \n  puVar1 = PTR___stack_chk_guard_004b238c;\n  iVar2 = *(int *)PTR___stack_chk_guard_004b238c;\n  iVar3 = (*(code *)PTR___fxstat64_004b2310)(3,fd,&sbuf);\n  if (iVar3 == 0) {\n    uVar4 = (uint)((sbuf.st_mode & 0xf000) == 0x4000);\n  }\n  else {\n    uVar4 = 0;\n  }\n  if (iVar2 == *(int *)puVar1) {\n    return uVar4;\n  }\n  (*(code *)PTR___stack_chk_fail_004b2348)();\n  iVar3 = *(int *)(iVar2 + 4);\n  *(undefined1 *)fd = 0;\n  if (iVar3 != -1) {\n    uVar4 = *(uint *)(iVar2 + 0x30) & 0xf000;\n    if (uVar4 == 0x4000) {\n      *(undefined1 *)fd = 1;\n      return 0;\n    }\n    if (uVar4 < 0x4001) {\n      if ((uVar4 == 0x1000) || (uVar4 == 0x2000)) {\n        return 1;\n      }\n    }\n    else {\n      if (uVar4 == 0x8000) {\n        return 1;\n      }\n      if (uVar4 == 0xc000) {\n        return 1;\n      }\n    }\n  }\n  return 0;\n}" primitive_type (function_declarator "os_isdir(int fd)" identifier (parameter_list "(int fd)" ( (parameter_declaration "int fd" primitive_type identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  uint uVar4;\n  stat sbuf;\n  \n  puVar1 = PTR___stack_chk_guard_004b238c;\n  iVar2 = *(int *)PTR___stack_chk_guard_004b238c;\n  iVar3 = (*(code *)PTR___fxstat64_004b2310)(3,fd,&sbuf);\n  if (iVar3 == 0) {\n    uVar4 = (uint)((sbuf.st_mode & 0xf000) == 0x4000);\n  }\n  else {\n    uVar4 = 0;\n  }\n  if (iVar2 == *(int *)puVar1) {\n    return uVar4;\n  }\n  (*(code *)PTR___stack_chk_fail_004b2348)();\n  iVar3 = *(int *)(iVar2 + 4);\n  *(undefined1 *)fd = 0;\n  if (iVar3 != -1) {\n    uVar4 = *(uint *)(iVar2 + 0x30) & 0xf000;\n    if (uVar4 == 0x4000) {\n      *(undefined1 *)fd = 1;\n      return 0;\n    }\n    if (uVar4 < 0x4001) {\n      if ((uVar4 == 0x1000) || (uVar4 == 0x2000)) {\n        return 1;\n      }\n    }\n    else {\n      if (uVar4 == 0x8000) {\n        return 1;\n      }\n      if (uVar4 == 0xc000) {\n        return 1;\n      }\n    }\n  }\n  return 0;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "stat sbuf;" type_identifier identifier ;) (expression_statement "puVar1 = PTR___stack_chk_guard_004b238c;" (assignment_expression "puVar1 = PTR___stack_chk_guard_004b238c" identifier = identifier) ;) (expression_statement "iVar2 = *(int *)PTR___stack_chk_guard_004b238c;" (assignment_expression "iVar2 = *(int *)PTR___stack_chk_guard_004b238c" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_004b238c" * (cast_expression "(int *)PTR___stack_chk_guard_004b238c" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar3 = (*(code *)PTR___fxstat64_004b2310)(3,fd,&sbuf);" (assignment_expression "iVar3 = (*(code *)PTR___fxstat64_004b2310)(3,fd,&sbuf)" identifier = (call_expression "(*(code *)PTR___fxstat64_004b2310)(3,fd,&sbuf)" (parenthesized_expression "(*(code *)PTR___fxstat64_004b2310)" ( (pointer_expression "*(code *)PTR___fxstat64_004b2310" * (cast_expression "(code *)PTR___fxstat64_004b2310" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(3,fd,&sbuf)" ( number_literal , identifier , (pointer_expression "&sbuf" & identifier) )))) ;) (if_statement "if (iVar3 == 0) {\n    uVar4 = (uint)((sbuf.st_mode & 0xf000) == 0x4000);\n  }\n  else {\n    uVar4 = 0;\n  }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar4 = (uint)((sbuf.st_mode & 0xf000) == 0x4000);\n  }" { (expression_statement "uVar4 = (uint)((sbuf.st_mode & 0xf000) == 0x4000);" (assignment_expression "uVar4 = (uint)((sbuf.st_mode & 0xf000) == 0x4000)" identifier = (call_expression "(uint)((sbuf.st_mode & 0xf000) == 0x4000)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((sbuf.st_mode & 0xf000) == 0x4000)" ( (binary_expression "(sbuf.st_mode & 0xf000) == 0x4000" (parenthesized_expression "(sbuf.st_mode & 0xf000)" ( (binary_expression "sbuf.st_mode & 0xf000" (field_expression "sbuf.st_mode" identifier . field_identifier) & number_literal) )) == number_literal) )))) ;) }) (else_clause "else {\n    uVar4 = 0;\n  }" else (compound_statement "{\n    uVar4 = 0;\n  }" { (expression_statement "uVar4 = 0;" (assignment_expression "uVar4 = 0" identifier = number_literal) ;) }))) (if_statement "if (iVar2 == *(int *)puVar1) {\n    return uVar4;\n  }" if (parenthesized_expression "(iVar2 == *(int *)puVar1)" ( (binary_expression "iVar2 == *(int *)puVar1" identifier == (pointer_expression "*(int *)puVar1" * (cast_expression "(int *)puVar1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    return uVar4;\n  }" { (return_statement "return uVar4;" return identifier ;) })) (expression_statement "(*(code *)PTR___stack_chk_fail_004b2348)();" (call_expression "(*(code *)PTR___stack_chk_fail_004b2348)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_004b2348)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_004b2348" * (cast_expression "(code *)PTR___stack_chk_fail_004b2348" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "iVar3 = *(int *)(iVar2 + 4);" (assignment_expression "iVar3 = *(int *)(iVar2 + 4)" identifier = (pointer_expression "*(int *)(iVar2 + 4)" * (cast_expression "(int *)(iVar2 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 4)" ( (binary_expression "iVar2 + 4" identifier + number_literal) ))))) ;) (expression_statement "*(undefined1 *)fd = 0;" (assignment_expression "*(undefined1 *)fd = 0" (pointer_expression "*(undefined1 *)fd" * (cast_expression "(undefined1 *)fd" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) = number_literal) ;) (if_statement "if (iVar3 != -1) {\n    uVar4 = *(uint *)(iVar2 + 0x30) & 0xf000;\n    if (uVar4 == 0x4000) {\n      *(undefined1 *)fd = 1;\n      return 0;\n    }\n    if (uVar4 < 0x4001) {\n      if ((uVar4 == 0x1000) || (uVar4 == 0x2000)) {\n        return 1;\n      }\n    }\n    else {\n      if (uVar4 == 0x8000) {\n        return 1;\n      }\n      if (uVar4 == 0xc000) {\n        return 1;\n      }\n    }\n  }" if (parenthesized_expression "(iVar3 != -1)" ( (binary_expression "iVar3 != -1" identifier != number_literal) )) (compound_statement "{\n    uVar4 = *(uint *)(iVar2 + 0x30) & 0xf000;\n    if (uVar4 == 0x4000) {\n      *(undefined1 *)fd = 1;\n      return 0;\n    }\n    if (uVar4 < 0x4001) {\n      if ((uVar4 == 0x1000) || (uVar4 == 0x2000)) {\n        return 1;\n      }\n    }\n    else {\n      if (uVar4 == 0x8000) {\n        return 1;\n      }\n      if (uVar4 == 0xc000) {\n        return 1;\n      }\n    }\n  }" { (expression_statement "uVar4 = *(uint *)(iVar2 + 0x30) & 0xf000;" (assignment_expression "uVar4 = *(uint *)(iVar2 + 0x30) & 0xf000" identifier = (binary_expression "*(uint *)(iVar2 + 0x30) & 0xf000" (pointer_expression "*(uint *)(iVar2 + 0x30)" * (cast_expression "(uint *)(iVar2 + 0x30)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 0x30)" ( (binary_expression "iVar2 + 0x30" identifier + number_literal) )))) & number_literal)) ;) (if_statement "if (uVar4 == 0x4000) {\n      *(undefined1 *)fd = 1;\n      return 0;\n    }" if (parenthesized_expression "(uVar4 == 0x4000)" ( (binary_expression "uVar4 == 0x4000" identifier == number_literal) )) (compound_statement "{\n      *(undefined1 *)fd = 1;\n      return 0;\n    }" { (expression_statement "*(undefined1 *)fd = 1;" (assignment_expression "*(undefined1 *)fd = 1" (pointer_expression "*(undefined1 *)fd" * (cast_expression "(undefined1 *)fd" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) = number_literal) ;) (return_statement "return 0;" return number_literal ;) })) (if_statement "if (uVar4 < 0x4001) {\n      if ((uVar4 == 0x1000) || (uVar4 == 0x2000)) {\n        return 1;\n      }\n    }\n    else {\n      if (uVar4 == 0x8000) {\n        return 1;\n      }\n      if (uVar4 == 0xc000) {\n        return 1;\n      }\n    }" if (parenthesized_expression "(uVar4 < 0x4001)" ( (binary_expression "uVar4 < 0x4001" identifier < number_literal) )) (compound_statement "{\n      if ((uVar4 == 0x1000) || (uVar4 == 0x2000)) {\n        return 1;\n      }\n    }" { (if_statement "if ((uVar4 == 0x1000) || (uVar4 == 0x2000)) {\n        return 1;\n      }" if (parenthesized_expression "((uVar4 == 0x1000) || (uVar4 == 0x2000))" ( (binary_expression "(uVar4 == 0x1000) || (uVar4 == 0x2000)" (parenthesized_expression "(uVar4 == 0x1000)" ( (binary_expression "uVar4 == 0x1000" identifier == number_literal) )) || (parenthesized_expression "(uVar4 == 0x2000)" ( (binary_expression "uVar4 == 0x2000" identifier == number_literal) ))) )) (compound_statement "{\n        return 1;\n      }" { (return_statement "return 1;" return number_literal ;) })) }) (else_clause "else {\n      if (uVar4 == 0x8000) {\n        return 1;\n      }\n      if (uVar4 == 0xc000) {\n        return 1;\n      }\n    }" else (compound_statement "{\n      if (uVar4 == 0x8000) {\n        return 1;\n      }\n      if (uVar4 == 0xc000) {\n        return 1;\n      }\n    }" { (if_statement "if (uVar4 == 0x8000) {\n        return 1;\n      }" if (parenthesized_expression "(uVar4 == 0x8000)" ( (binary_expression "uVar4 == 0x8000" identifier == number_literal) )) (compound_statement "{\n        return 1;\n      }" { (return_statement "return 1;" return number_literal ;) })) (if_statement "if (uVar4 == 0xc000) {\n        return 1;\n      }" if (parenthesized_expression "(uVar4 == 0xc000)" ( (binary_expression "uVar4 == 0xc000" identifier == number_literal) )) (compound_statement "{\n        return 1;\n      }" { (return_statement "return 1;" return number_literal ;) })) }))) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "bool os_isdir(undefined1 *param_1)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  undefined1 auStack_b0 [24];\n  uint local_98;\n  int local_c;\n  \n  puVar1 = PTR___stack_chk_guard_004b238c;\n  local_c = *(int *)PTR___stack_chk_guard_004b238c;\n  iVar2 = (*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0);\n  if (local_c == *(int *)puVar1) {\n    return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;\n  }\n  (*(code *)PTR___stack_chk_fail_004b2348)();\n  iVar2 = *(int *)(local_c + 4);\n  *param_1 = 0;\n  if (iVar2 != -1) {\n    uVar3 = *(uint *)(local_c + 0x30) & 0xf000;\n    if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }\n    if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }\n  }\n  return false;\n}\n\n" (function_definition "bool os_isdir(undefined1 *param_1)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  undefined1 auStack_b0 [24];\n  uint local_98;\n  int local_c;\n  \n  puVar1 = PTR___stack_chk_guard_004b238c;\n  local_c = *(int *)PTR___stack_chk_guard_004b238c;\n  iVar2 = (*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0);\n  if (local_c == *(int *)puVar1) {\n    return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;\n  }\n  (*(code *)PTR___stack_chk_fail_004b2348)();\n  iVar2 = *(int *)(local_c + 4);\n  *param_1 = 0;\n  if (iVar2 != -1) {\n    uVar3 = *(uint *)(local_c + 0x30) & 0xf000;\n    if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }\n    if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }\n  }\n  return false;\n}" primitive_type (function_declarator "os_isdir(undefined1 *param_1)" identifier (parameter_list "(undefined1 *param_1)" ( (parameter_declaration "undefined1 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  undefined1 auStack_b0 [24];\n  uint local_98;\n  int local_c;\n  \n  puVar1 = PTR___stack_chk_guard_004b238c;\n  local_c = *(int *)PTR___stack_chk_guard_004b238c;\n  iVar2 = (*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0);\n  if (local_c == *(int *)puVar1) {\n    return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;\n  }\n  (*(code *)PTR___stack_chk_fail_004b2348)();\n  iVar2 = *(int *)(local_c + 4);\n  *param_1 = 0;\n  if (iVar2 != -1) {\n    uVar3 = *(uint *)(local_c + 0x30) & 0xf000;\n    if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }\n    if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }\n  }\n  return false;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "undefined1 auStack_b0 [24];" type_identifier (array_declarator "auStack_b0 [24]" identifier [ number_literal ]) ;) (declaration "uint local_98;" type_identifier identifier ;) (declaration "int local_c;" primitive_type identifier ;) (expression_statement "puVar1 = PTR___stack_chk_guard_004b238c;" (assignment_expression "puVar1 = PTR___stack_chk_guard_004b238c" identifier = identifier) ;) (expression_statement "local_c = *(int *)PTR___stack_chk_guard_004b238c;" (assignment_expression "local_c = *(int *)PTR___stack_chk_guard_004b238c" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_004b238c" * (cast_expression "(int *)PTR___stack_chk_guard_004b238c" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar2 = (*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0);" (assignment_expression "iVar2 = (*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0)" identifier = (call_expression "(*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0)" (parenthesized_expression "(*(code *)PTR___fxstat64_004b2310)" ( (pointer_expression "*(code *)PTR___fxstat64_004b2310" * (cast_expression "(code *)PTR___fxstat64_004b2310" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(3,param_1,auStack_b0)" ( number_literal , identifier , identifier )))) ;) (if_statement "if (local_c == *(int *)puVar1) {\n    return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;\n  }" if (parenthesized_expression "(local_c == *(int *)puVar1)" ( (binary_expression "local_c == *(int *)puVar1" identifier == (pointer_expression "*(int *)puVar1" * (cast_expression "(int *)puVar1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;\n  }" { (return_statement "return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;" return (binary_expression "iVar2 == 0 && (local_98 & 0xf000) == 0x4000" (binary_expression "iVar2 == 0" identifier == number_literal) && (binary_expression "(local_98 & 0xf000) == 0x4000" (parenthesized_expression "(local_98 & 0xf000)" ( (binary_expression "local_98 & 0xf000" identifier & number_literal) )) == number_literal)) ;) })) (expression_statement "(*(code *)PTR___stack_chk_fail_004b2348)();" (call_expression "(*(code *)PTR___stack_chk_fail_004b2348)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_004b2348)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_004b2348" * (cast_expression "(code *)PTR___stack_chk_fail_004b2348" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "iVar2 = *(int *)(local_c + 4);" (assignment_expression "iVar2 = *(int *)(local_c + 4)" identifier = (pointer_expression "*(int *)(local_c + 4)" * (cast_expression "(int *)(local_c + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_c + 4)" ( (binary_expression "local_c + 4" identifier + number_literal) ))))) ;) (expression_statement "*param_1 = 0;" (assignment_expression "*param_1 = 0" (pointer_expression "*param_1" * identifier) = number_literal) ;) (if_statement "if (iVar2 != -1) {\n    uVar3 = *(uint *)(local_c + 0x30) & 0xf000;\n    if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }\n    if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }\n  }" if (parenthesized_expression "(iVar2 != -1)" ( (binary_expression "iVar2 != -1" identifier != number_literal) )) (compound_statement "{\n    uVar3 = *(uint *)(local_c + 0x30) & 0xf000;\n    if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }\n    if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }\n  }" { (expression_statement "uVar3 = *(uint *)(local_c + 0x30) & 0xf000;" (assignment_expression "uVar3 = *(uint *)(local_c + 0x30) & 0xf000" identifier = (binary_expression "*(uint *)(local_c + 0x30) & 0xf000" (pointer_expression "*(uint *)(local_c + 0x30)" * (cast_expression "(uint *)(local_c + 0x30)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_c + 0x30)" ( (binary_expression "local_c + 0x30" identifier + number_literal) )))) & number_literal)) ;) (if_statement "if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }" if (parenthesized_expression "(uVar3 == 0x4000)" ( (binary_expression "uVar3 == 0x4000" identifier == number_literal) )) (compound_statement "{\n      *param_1 = 1;\n      return false;\n    }" { (expression_statement "*param_1 = 1;" (assignment_expression "*param_1 = 1" (pointer_expression "*param_1" * identifier) = number_literal) ;) (return_statement "return false;" return false ;) })) (if_statement "if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }" if (parenthesized_expression "(uVar3 < 0x4001)" ( (binary_expression "uVar3 < 0x4001" identifier < number_literal) )) (compound_statement "{\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }" { (if_statement "if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }" if (parenthesized_expression "((uVar3 == 0x1000) || (uVar3 == 0x2000))" ( (binary_expression "(uVar3 == 0x1000) || (uVar3 == 0x2000)" (parenthesized_expression "(uVar3 == 0x1000)" ( (binary_expression "uVar3 == 0x1000" identifier == number_literal) )) || (parenthesized_expression "(uVar3 == 0x2000)" ( (binary_expression "uVar3 == 0x2000" identifier == number_literal) ))) )) (compound_statement "{\n        return true;\n      }" { (return_statement "return true;" return true ;) })) }) (else_clause "else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }" else (compound_statement "{\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }" { (if_statement "if (uVar3 == 0x8000) {\n        return true;\n      }" if (parenthesized_expression "(uVar3 == 0x8000)" ( (binary_expression "uVar3 == 0x8000" identifier == number_literal) )) (compound_statement "{\n        return true;\n      }" { (return_statement "return true;" return true ;) })) (if_statement "if (uVar3 == 0xc000) {\n        return true;\n      }" if (parenthesized_expression "(uVar3 == 0xc000)" ( (binary_expression "uVar3 == 0xc000" identifier == number_literal) )) (compound_statement "{\n        return true;\n      }" { (return_statement "return true;" return true ;) })) }))) })) (return_statement "return false;" return false ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( LIT , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) )) (compound_statement { (return_statement return (binary_expression (binary_expression IDENT == LIT) && (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT)) ;) })) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) & LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (return_statement return BOOL ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) || (parenthesized_expression ( (binary_expression IDENT == LIT) ))) )) (compound_statement { (return_statement return BOOL ;) })) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return BOOL ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return BOOL ;) })) }))) })) (return_statement return BOOL ;) })))
(function_definition "bool os_isdir(undefined1 *param_1)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  undefined1 auStack_b0 [24];\n  uint local_98;\n  int local_c;\n  \n  puVar1 = PTR___stack_chk_guard_004b238c;\n  local_c = *(int *)PTR___stack_chk_guard_004b238c;\n  iVar2 = (*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0);\n  if (local_c == *(int *)puVar1) {\n    return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;\n  }\n  (*(code *)PTR___stack_chk_fail_004b2348)();\n  iVar2 = *(int *)(local_c + 4);\n  *param_1 = 0;\n  if (iVar2 != -1) {\n    uVar3 = *(uint *)(local_c + 0x30) & 0xf000;\n    if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }\n    if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }\n  }\n  return false;\n}" (primitive_type "bool") (function_declarator "os_isdir(undefined1 *param_1)" (identifier "os_isdir") (parameter_list "(undefined1 *param_1)" (( "(") (parameter_declaration "undefined1 *param_1" (type_identifier "undefined1") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  uint uVar3;\n  undefined1 auStack_b0 [24];\n  uint local_98;\n  int local_c;\n  \n  puVar1 = PTR___stack_chk_guard_004b238c;\n  local_c = *(int *)PTR___stack_chk_guard_004b238c;\n  iVar2 = (*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0);\n  if (local_c == *(int *)puVar1) {\n    return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;\n  }\n  (*(code *)PTR___stack_chk_fail_004b2348)();\n  iVar2 = *(int *)(local_c + 4);\n  *param_1 = 0;\n  if (iVar2 != -1) {\n    uVar3 = *(uint *)(local_c + 0x30) & 0xf000;\n    if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }\n    if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }\n  }\n  return false;\n}" ({ "{") (declaration "undefined *puVar1;" (type_identifier "undefined") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "undefined1 auStack_b0 [24];" (type_identifier "undefined1") (array_declarator "auStack_b0 [24]" (identifier "auStack_b0") ([ "[") (number_literal "24") (] "]")) (; ";")) (declaration "uint local_98;" (type_identifier "uint") (identifier "local_98") (; ";")) (declaration "int local_c;" (primitive_type "int") (identifier "local_c") (; ";")) (expression_statement "puVar1 = PTR___stack_chk_guard_004b238c;" (assignment_expression "puVar1 = PTR___stack_chk_guard_004b238c" (identifier "puVar1") (= "=") (identifier "PTR___stack_chk_guard_004b238c")) (; ";")) (expression_statement "local_c = *(int *)PTR___stack_chk_guard_004b238c;" (assignment_expression "local_c = *(int *)PTR___stack_chk_guard_004b238c" (identifier "local_c") (= "=") (pointer_expression "*(int *)PTR___stack_chk_guard_004b238c" (* "*") (cast_expression "(int *)PTR___stack_chk_guard_004b238c" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_guard_004b238c")))) (; ";")) (expression_statement "iVar2 = (*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0);" (assignment_expression "iVar2 = (*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0)" (parenthesized_expression "(*(code *)PTR___fxstat64_004b2310)" (( "(") (pointer_expression "*(code *)PTR___fxstat64_004b2310" (* "*") (cast_expression "(code *)PTR___fxstat64_004b2310" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___fxstat64_004b2310"))) () ")")) (argument_list "(3,param_1,auStack_b0)" (( "(") (number_literal "3") (, ",") (identifier "param_1") (, ",") (identifier "auStack_b0") () ")")))) (; ";")) (if_statement "if (local_c == *(int *)puVar1) {\n    return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;\n  }" (if "if") (parenthesized_expression "(local_c == *(int *)puVar1)" (( "(") (binary_expression "local_c == *(int *)puVar1" (identifier "local_c") (== "==") (pointer_expression "*(int *)puVar1" (* "*") (cast_expression "(int *)puVar1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar1")))) () ")")) (compound_statement "{\n    return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;\n  }" ({ "{") (return_statement "return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;" (return "return") (binary_expression "iVar2 == 0 && (local_98 & 0xf000) == 0x4000" (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) (&& "&&") (binary_expression "(local_98 & 0xf000) == 0x4000" (parenthesized_expression "(local_98 & 0xf000)" (( "(") (binary_expression "local_98 & 0xf000" (identifier "local_98") (& "&") (number_literal "0xf000")) () ")")) (== "==") (number_literal "0x4000"))) (; ";")) (} "}"))) (expression_statement "(*(code *)PTR___stack_chk_fail_004b2348)();" (call_expression "(*(code *)PTR___stack_chk_fail_004b2348)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_004b2348)" (( "(") (pointer_expression "*(code *)PTR___stack_chk_fail_004b2348" (* "*") (cast_expression "(code *)PTR___stack_chk_fail_004b2348" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_fail_004b2348"))) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "iVar2 = *(int *)(local_c + 4);" (assignment_expression "iVar2 = *(int *)(local_c + 4)" (identifier "iVar2") (= "=") (pointer_expression "*(int *)(local_c + 4)" (* "*") (cast_expression "(int *)(local_c + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(local_c + 4)" (( "(") (binary_expression "local_c + 4" (identifier "local_c") (+ "+") (number_literal "4")) () ")"))))) (; ";")) (expression_statement "*param_1 = 0;" (assignment_expression "*param_1 = 0" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (number_literal "0")) (; ";")) (if_statement "if (iVar2 != -1) {\n    uVar3 = *(uint *)(local_c + 0x30) & 0xf000;\n    if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }\n    if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }\n  }" (if "if") (parenthesized_expression "(iVar2 != -1)" (( "(") (binary_expression "iVar2 != -1" (identifier "iVar2") (!= "!=") (number_literal "-1")) () ")")) (compound_statement "{\n    uVar3 = *(uint *)(local_c + 0x30) & 0xf000;\n    if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }\n    if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }\n  }" ({ "{") (expression_statement "uVar3 = *(uint *)(local_c + 0x30) & 0xf000;" (assignment_expression "uVar3 = *(uint *)(local_c + 0x30) & 0xf000" (identifier "uVar3") (= "=") (binary_expression "*(uint *)(local_c + 0x30) & 0xf000" (pointer_expression "*(uint *)(local_c + 0x30)" (* "*") (cast_expression "(uint *)(local_c + 0x30)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(local_c + 0x30)" (( "(") (binary_expression "local_c + 0x30" (identifier "local_c") (+ "+") (number_literal "0x30")) () ")")))) (& "&") (number_literal "0xf000"))) (; ";")) (if_statement "if (uVar3 == 0x4000) {\n      *param_1 = 1;\n      return false;\n    }" (if "if") (parenthesized_expression "(uVar3 == 0x4000)" (( "(") (binary_expression "uVar3 == 0x4000" (identifier "uVar3") (== "==") (number_literal "0x4000")) () ")")) (compound_statement "{\n      *param_1 = 1;\n      return false;\n    }" ({ "{") (expression_statement "*param_1 = 1;" (assignment_expression "*param_1 = 1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (number_literal "1")) (; ";")) (return_statement "return false;" (return "return") (false "false") (; ";")) (} "}"))) (if_statement "if (uVar3 < 0x4001) {\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }\n    else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }" (if "if") (parenthesized_expression "(uVar3 < 0x4001)" (( "(") (binary_expression "uVar3 < 0x4001" (identifier "uVar3") (< "<") (number_literal "0x4001")) () ")")) (compound_statement "{\n      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }\n    }" ({ "{") (if_statement "if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {\n        return true;\n      }" (if "if") (parenthesized_expression "((uVar3 == 0x1000) || (uVar3 == 0x2000))" (( "(") (binary_expression "(uVar3 == 0x1000) || (uVar3 == 0x2000)" (parenthesized_expression "(uVar3 == 0x1000)" (( "(") (binary_expression "uVar3 == 0x1000" (identifier "uVar3") (== "==") (number_literal "0x1000")) () ")")) (|| "||") (parenthesized_expression "(uVar3 == 0x2000)" (( "(") (binary_expression "uVar3 == 0x2000" (identifier "uVar3") (== "==") (number_literal "0x2000")) () ")"))) () ")")) (compound_statement "{\n        return true;\n      }" ({ "{") (return_statement "return true;" (return "return") (true "true") (; ";")) (} "}"))) (} "}")) (else_clause "else {\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }" (else "else") (compound_statement "{\n      if (uVar3 == 0x8000) {\n        return true;\n      }\n      if (uVar3 == 0xc000) {\n        return true;\n      }\n    }" ({ "{") (if_statement "if (uVar3 == 0x8000) {\n        return true;\n      }" (if "if") (parenthesized_expression "(uVar3 == 0x8000)" (( "(") (binary_expression "uVar3 == 0x8000" (identifier "uVar3") (== "==") (number_literal "0x8000")) () ")")) (compound_statement "{\n        return true;\n      }" ({ "{") (return_statement "return true;" (return "return") (true "true") (; ";")) (} "}"))) (if_statement "if (uVar3 == 0xc000) {\n        return true;\n      }" (if "if") (parenthesized_expression "(uVar3 == 0xc000)" (( "(") (binary_expression "uVar3 == 0xc000" (identifier "uVar3") (== "==") (number_literal "0xc000")) () ")")) (compound_statement "{\n        return true;\n      }" ({ "{") (return_statement "return true;" (return "return") (true "true") (; ";")) (} "}"))) (} "}")))) (} "}"))) (return_statement "return false;" (return "return") (false "false") (; ";")) (} "}")))

/* WARNING: Unknown calling convention */

int function_1(int fd)

{
  type_1 *puVar1;
  int var_2;
  int var_1;
  type_2 var_3;
  type_3 sbuf;
  
  puVar1 = PTR___stack_chk_guard_004b238c;
  var_2 = *(int *)PTR___stack_chk_guard_004b238c;
  var_1 = (*(type_4 *)PTR___fxstat64_004b2310)(3,fd,&sbuf);
  if (var_1 == 0) {
    var_3 = (type_2)((sbuf.st_mode & 0xf000) == 0x4000);
  }
  else {
    var_3 = 0;
  }
  if (var_2 == *(int *)puVar1) {
    return var_3;
  }
  (*(type_4 *)PTR___stack_chk_fail_004b2348)();
  var_1 = *(int *)(var_2 + 4);
  *(type_5 *)fd = 0;
  if (var_1 != -1) {
    var_3 = *(type_2 *)(var_2 + 0x30) & 0xf000;
    if (var_3 == 0x4000) {
      *(type_5 *)fd = 1;
      return 0;
    }
    if (var_3 < 0x4001) {
      if ((var_3 == 0x1000) || (var_3 == 0x2000)) {
        return 1;
      }
    }
    else {
      if (var_3 == 0x8000) {
        return 1;
      }
      if (var_3 == 0xc000) {
        return 1;
      }
    }
  }
  return 0;
}


(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))))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (number_literal) (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (identifier))))) consequence: (compound_statement (return_statement (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal)))))) (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal)))) (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: (number_literal))) (return_statement (false)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) consequence: (compound_statement (return_statement (true))))) alternative: (else_clause (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (true)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (true))))))))) (return_statement (false)))))

bool MASKED(undefined1 *param_1)

{
  undefined *puVar1;
  int iVar2;
  uint uVar3;
  undefined1 auStack_b0 [24];
  uint local_98;
  int local_c;
  
  puVar1 = PTR___stack_chk_guard_004b238c;
  local_c = *(int *)PTR___stack_chk_guard_004b238c;
  iVar2 = (*(code *)PTR___fxstat64_004b2310)(3,param_1,auStack_b0);
  if (local_c == *(int *)puVar1) {
    return iVar2 == 0 && (local_98 & 0xf000) == 0x4000;
  }
  (*(code *)PTR___stack_chk_fail_004b2348)();
  iVar2 = *(int *)(local_c + 4);
  *param_1 = 0;
  if (iVar2 != -1) {
    uVar3 = *(uint *)(local_c + 0x30) & 0xf000;
    if (uVar3 == 0x4000) {
      *param_1 = 1;
      return false;
    }
    if (uVar3 < 0x4001) {
      if ((uVar3 == 0x1000) || (uVar3 == 0x2000)) {
        return true;
      }
    }
    else {
      if (uVar3 == 0x8000) {
        return true;
      }
      if (uVar3 == 0xc000) {
        return true;
      }
    }
  }
  return false;
}

