
int simple_copy(char *from,char *to)

{
  int iVar1;
  int iVar2;
  undefined4 *puVar3;
  int iVar4;
  int iVar5;
  undefined4 uVar6;
  char buf [8192];
  
  iVar1 = (*(code *)PTR_open64_0004db5c)(from,0);
  if (iVar1 < 0) {
    iVar5 = -1;
  }
  else {
    iVar2 = (*(code *)PTR_open64_0004db5c)(to,0x301,0x1ff);
    puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();
    if (iVar2 < 0) {
      iVar1 = FUN_0001d6f4();
      return iVar1;
    }
    while( true ) {
      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,buf,0x2000);
      if (iVar5 < 1) break;
      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,buf,iVar5);
      if (iVar4 != iVar5) {
        uVar6 = *puVar3;
        (*(code *)PTR_close_0004da40)(iVar1);
        (*(code *)PTR_close_0004da40)(iVar2);
        *puVar3 = uVar6;
        return -1;
      }
    }
    uVar6 = *puVar3;
    (*(code *)PTR_close_0004da40)(iVar1);
    (*(code *)PTR_close_0004da40)(iVar2);
    if (iVar5 != 0) {
      *puVar3 = uVar6;
      iVar5 = -1;
    }
  }
  return iVar5;
}



undefined4 FUN_0001d590(undefined4 param_1,undefined4 param_2)

{
  int iVar1;
  int iVar2;
  undefined4 *puVar3;
  int iVar4;
  int iVar5;
  undefined4 uVar6;
  undefined1 auStack_2018 [8192];
  
  iVar1 = (*(code *)PTR_open64_0004db5c)(param_1,0);
  if (iVar1 < 0) {
    return 0xffffffff;
  }
  iVar2 = (*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff);
  puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();
  if (iVar2 < 0) {
    uVar6 = *puVar3;
    iVar2 = iVar1;
  }
  else {
    do {
      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);
      if (iVar5 < 1) {
        uVar6 = *puVar3;
        (*(code *)PTR_close_0004da40)(iVar1);
        (*(code *)PTR_close_0004da40)(iVar2);
        if (iVar5 == 0) {
          return 0;
        }
        *puVar3 = uVar6;
        return 0xffffffff;
      }
      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);
    } while (iVar4 == iVar5);
    uVar6 = *puVar3;
    (*(code *)PTR_close_0004da40)(iVar1);
  }
  (*(code *)PTR_close_0004da40)(iVar2);
  *puVar3 = uVar6;
  return 0xffffffff;
}


lui gp,0x4
addiu gp,gp,-0x7d20
addu gp,gp,t9
addiu sp,sp,-0x2030
lw t9,-0x7d14(gp)
sw s0,0x2018(sp)
or s0,a1,zero
or a1,zero,zero
sw gp,0x10(sp)
sw ra,0x202c(sp)
sw s4,0x2028(sp)
sw s3,0x2024(sp)
sw s2,0x2020(sp)
jalr t9
_sw s1,0x201c(sp)
bltz v0,0x0001d6ec
_lw gp,0x10(sp)
lw t9,-0x7d14(gp)
li a2,0x1ff
li a1,0x301
or a0,s0,zero
jalr t9
_or s2,v0,zero
lw gp,0x10(sp)
or s3,v0,zero
lw t9,-0x7d48(gp)
jalr t9
_addiu s1,sp,0x18
lw gp,0x10(sp)
bgez s3,0x0001d624
_or s4,v0,zero
b 0x0001d6f4
_lw s1,0x0(v0)
jalr t9
_nop
bne v0,s0,0x0001d6a0
_lw gp,0x10(sp)
lw t9,-0x7bd4(gp)
li a2,0x2000
or a1,s1,zero
jalr t9
_or a0,s2,zero
or a1,s1,zero
lw gp,0x10(sp)
or a0,s3,zero
or s0,v0,zero
or a2,v0,zero
bgtz v0,0x0001d614
_lw t9,-0x7d0c(gp)
lw t9,-0x7e30(gp)
or a0,s2,zero
jalr t9
_lw s1,0x0(s4)
lw gp,0x10(sp)
lw t9,-0x7e30(gp)
jalr t9
_or a0,s3,zero
bne s0,zero,0x0001d6fc
_nop
lw ra,0x202c(sp)
or v0,s0,zero
lw s4,0x2028(sp)
lw s3,0x2024(sp)
lw s2,0x2020(sp)
lw s1,0x201c(sp)
lw s0,0x2018(sp)
jr ra
_addiu sp,sp,0x2030
lw t9,-0x7e30(gp)
or a0,s2,zero
jalr t9
_lw s1,0x0(s4)
or a0,s3,zero
lw gp,0x10(sp)
lw t9,-0x7e30(gp)
jalr t9
_li s0,-0x1
or v0,s0,zero
lw ra,0x202c(sp)
lw s3,0x2024(sp)
lw s2,0x2020(sp)
lw s0,0x2018(sp)
sw s1,0x0(s4)
lw s4,0x2028(sp)
lw s1,0x201c(sp)
jr ra
_addiu sp,sp,0x2030
b 0x0001d67c
_li s0,-0x1
b 0x0001d6b8
_or a0,s2,zero
sw s1,0x0(s4)
b 0x0001d67c
_li s0,-0x1
(translation_unit "undefined4 FUN_0001d590(undefined4 param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  undefined1 auStack_2018 [8192];\n  \n  iVar1 = (*(code *)PTR_open64_0004db5c)(param_1,0);\n  if (iVar1 < 0) {\n    return 0xffffffff;\n  }\n  iVar2 = (*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff);\n  puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();\n  if (iVar2 < 0) {\n    uVar6 = *puVar3;\n    iVar2 = iVar1;\n  }\n  else {\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }\n  (*(code *)PTR_close_0004da40)(iVar2);\n  *puVar3 = uVar6;\n  return 0xffffffff;\n}\n\n" (function_definition "undefined4 FUN_0001d590(undefined4 param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  undefined1 auStack_2018 [8192];\n  \n  iVar1 = (*(code *)PTR_open64_0004db5c)(param_1,0);\n  if (iVar1 < 0) {\n    return 0xffffffff;\n  }\n  iVar2 = (*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff);\n  puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();\n  if (iVar2 < 0) {\n    uVar6 = *puVar3;\n    iVar2 = iVar1;\n  }\n  else {\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }\n  (*(code *)PTR_close_0004da40)(iVar2);\n  *puVar3 = uVar6;\n  return 0xffffffff;\n}" type_identifier (function_declarator "FUN_0001d590(undefined4 param_1,undefined4 param_2)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  undefined1 auStack_2018 [8192];\n  \n  iVar1 = (*(code *)PTR_open64_0004db5c)(param_1,0);\n  if (iVar1 < 0) {\n    return 0xffffffff;\n  }\n  iVar2 = (*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff);\n  puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();\n  if (iVar2 < 0) {\n    uVar6 = *puVar3;\n    iVar2 = iVar1;\n  }\n  else {\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }\n  (*(code *)PTR_close_0004da40)(iVar2);\n  *puVar3 = uVar6;\n  return 0xffffffff;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "undefined4 uVar6;" type_identifier identifier ;) (declaration "undefined1 auStack_2018 [8192];" type_identifier (array_declarator "auStack_2018 [8192]" identifier [ number_literal ]) ;) (expression_statement "iVar1 = (*(code *)PTR_open64_0004db5c)(param_1,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_0004db5c)(param_1,0)" identifier = (call_expression "(*(code *)PTR_open64_0004db5c)(param_1,0)" (parenthesized_expression "(*(code *)PTR_open64_0004db5c)" ( (pointer_expression "*(code *)PTR_open64_0004db5c" * (cast_expression "(code *)PTR_open64_0004db5c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0)" ( identifier , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n    return 0xffffffff;\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    return 0xffffffff;\n  }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (expression_statement "iVar2 = (*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff);" (assignment_expression "iVar2 = (*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff)" identifier = (call_expression "(*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff)" (parenthesized_expression "(*(code *)PTR_open64_0004db5c)" ( (pointer_expression "*(code *)PTR_open64_0004db5c" * (cast_expression "(code *)PTR_open64_0004db5c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_2,0x301,0x1ff)" ( identifier , number_literal , number_literal )))) ;) (expression_statement "puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();" (assignment_expression "puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_0004db28)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_0004db28)()" (parenthesized_expression "(*(code *)PTR___errno_location_0004db28)" ( (pointer_expression "*(code *)PTR___errno_location_0004db28" * (cast_expression "(code *)PTR___errno_location_0004db28" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (if_statement "if (iVar2 < 0) {\n    uVar6 = *puVar3;\n    iVar2 = iVar1;\n  }\n  else {\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (compound_statement "{\n    uVar6 = *puVar3;\n    iVar2 = iVar1;\n  }" { (expression_statement "uVar6 = *puVar3;" (assignment_expression "uVar6 = *puVar3" identifier = (pointer_expression "*puVar3" * identifier)) ;) (expression_statement "iVar2 = iVar1;" (assignment_expression "iVar2 = iVar1" identifier = identifier) ;) }) (else_clause "else {\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }" else (compound_statement "{\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }" { (do_statement "do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);" do (compound_statement "{\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    }" { (expression_statement "iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);" (assignment_expression "iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000)" identifier = (call_expression "(*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000)" (parenthesized_expression "(*(code *)PTR_read_0004dc9c)" ( (pointer_expression "*(code *)PTR_read_0004dc9c" * (cast_expression "(code *)PTR_read_0004dc9c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1,auStack_2018,0x2000)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }" if (parenthesized_expression "(iVar5 < 1)" ( (binary_expression "iVar5 < 1" identifier < number_literal) )) (compound_statement "{\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }" { (expression_statement "uVar6 = *puVar3;" (assignment_expression "uVar6 = *puVar3" identifier = (pointer_expression "*puVar3" * identifier)) ;) (expression_statement "(*(code *)PTR_close_0004da40)(iVar1);" (call_expression "(*(code *)PTR_close_0004da40)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_0004da40)" ( (pointer_expression "*(code *)PTR_close_0004da40" * (cast_expression "(code *)PTR_close_0004da40" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "(*(code *)PTR_close_0004da40)(iVar2);" (call_expression "(*(code *)PTR_close_0004da40)(iVar2)" (parenthesized_expression "(*(code *)PTR_close_0004da40)" ( (pointer_expression "*(code *)PTR_close_0004da40" * (cast_expression "(code *)PTR_close_0004da40" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2)" ( identifier ))) ;) (if_statement "if (iVar5 == 0) {\n          return 0;\n        }" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (compound_statement "{\n          return 0;\n        }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "*puVar3 = uVar6;" (assignment_expression "*puVar3 = uVar6" (pointer_expression "*puVar3" * identifier) = identifier) ;) (return_statement "return 0xffffffff;" return number_literal ;) })) (expression_statement "iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);" (assignment_expression "iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5)" identifier = (call_expression "(*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5)" (parenthesized_expression "(*(code *)PTR_write_0004db64)" ( (pointer_expression "*(code *)PTR_write_0004db64" * (cast_expression "(code *)PTR_write_0004db64" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2,auStack_2018,iVar5)" ( identifier , identifier , identifier )))) ;) }) while (parenthesized_expression "(iVar4 == iVar5)" ( (binary_expression "iVar4 == iVar5" identifier == identifier) )) ;) (expression_statement "uVar6 = *puVar3;" (assignment_expression "uVar6 = *puVar3" identifier = (pointer_expression "*puVar3" * identifier)) ;) (expression_statement "(*(code *)PTR_close_0004da40)(iVar1);" (call_expression "(*(code *)PTR_close_0004da40)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_0004da40)" ( (pointer_expression "*(code *)PTR_close_0004da40" * (cast_expression "(code *)PTR_close_0004da40" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) }))) (expression_statement "(*(code *)PTR_close_0004da40)(iVar2);" (call_expression "(*(code *)PTR_close_0004da40)(iVar2)" (parenthesized_expression "(*(code *)PTR_close_0004da40)" ( (pointer_expression "*(code *)PTR_close_0004da40" * (cast_expression "(code *)PTR_close_0004da40" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2)" ( identifier ))) ;) (expression_statement "*puVar3 = uVar6;" (assignment_expression "*puVar3 = uVar6" (pointer_expression "*puVar3" * identifier) = identifier) ;) (return_statement "return 0xffffffff;" return number_literal ;) })))
(translation_unit "int simple_copy(char *from,char *to)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  char buf [8192];\n  \n  iVar1 = (*(code *)PTR_open64_0004db5c)(from,0);\n  if (iVar1 < 0) {\n    iVar5 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_0004db5c)(to,0x301,0x1ff);\n    puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();\n    if (iVar2 < 0) {\n      iVar1 = FUN_0001d6f4();\n      return iVar1;\n    }\n    while( true ) {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,buf,0x2000);\n      if (iVar5 < 1) break;\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,buf,iVar5);\n      if (iVar4 != iVar5) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        *puVar3 = uVar6;\n        return -1;\n      }\n    }\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n    (*(code *)PTR_close_0004da40)(iVar2);\n    if (iVar5 != 0) {\n      *puVar3 = uVar6;\n      iVar5 = -1;\n    }\n  }\n  return iVar5;\n}\n\n" (function_definition "int simple_copy(char *from,char *to)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  char buf [8192];\n  \n  iVar1 = (*(code *)PTR_open64_0004db5c)(from,0);\n  if (iVar1 < 0) {\n    iVar5 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_0004db5c)(to,0x301,0x1ff);\n    puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();\n    if (iVar2 < 0) {\n      iVar1 = FUN_0001d6f4();\n      return iVar1;\n    }\n    while( true ) {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,buf,0x2000);\n      if (iVar5 < 1) break;\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,buf,iVar5);\n      if (iVar4 != iVar5) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        *puVar3 = uVar6;\n        return -1;\n      }\n    }\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n    (*(code *)PTR_close_0004da40)(iVar2);\n    if (iVar5 != 0) {\n      *puVar3 = uVar6;\n      iVar5 = -1;\n    }\n  }\n  return iVar5;\n}" primitive_type (function_declarator "simple_copy(char *from,char *to)" identifier (parameter_list "(char *from,char *to)" ( (parameter_declaration "char *from" primitive_type (pointer_declarator "*from" * identifier)) , (parameter_declaration "char *to" primitive_type (pointer_declarator "*to" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  char buf [8192];\n  \n  iVar1 = (*(code *)PTR_open64_0004db5c)(from,0);\n  if (iVar1 < 0) {\n    iVar5 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_0004db5c)(to,0x301,0x1ff);\n    puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();\n    if (iVar2 < 0) {\n      iVar1 = FUN_0001d6f4();\n      return iVar1;\n    }\n    while( true ) {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,buf,0x2000);\n      if (iVar5 < 1) break;\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,buf,iVar5);\n      if (iVar4 != iVar5) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        *puVar3 = uVar6;\n        return -1;\n      }\n    }\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n    (*(code *)PTR_close_0004da40)(iVar2);\n    if (iVar5 != 0) {\n      *puVar3 = uVar6;\n      iVar5 = -1;\n    }\n  }\n  return iVar5;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "undefined4 uVar6;" type_identifier identifier ;) (declaration "char buf [8192];" primitive_type (array_declarator "buf [8192]" identifier [ number_literal ]) ;) (expression_statement "iVar1 = (*(code *)PTR_open64_0004db5c)(from,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_0004db5c)(from,0)" identifier = (call_expression "(*(code *)PTR_open64_0004db5c)(from,0)" (parenthesized_expression "(*(code *)PTR_open64_0004db5c)" ( (pointer_expression "*(code *)PTR_open64_0004db5c" * (cast_expression "(code *)PTR_open64_0004db5c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(from,0)" ( identifier , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n    iVar5 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_0004db5c)(to,0x301,0x1ff);\n    puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();\n    if (iVar2 < 0) {\n      iVar1 = FUN_0001d6f4();\n      return iVar1;\n    }\n    while( true ) {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,buf,0x2000);\n      if (iVar5 < 1) break;\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,buf,iVar5);\n      if (iVar4 != iVar5) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        *puVar3 = uVar6;\n        return -1;\n      }\n    }\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n    (*(code *)PTR_close_0004da40)(iVar2);\n    if (iVar5 != 0) {\n      *puVar3 = uVar6;\n      iVar5 = -1;\n    }\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    iVar5 = -1;\n  }" { (expression_statement "iVar5 = -1;" (assignment_expression "iVar5 = -1" identifier = number_literal) ;) }) (else_clause "else {\n    iVar2 = (*(code *)PTR_open64_0004db5c)(to,0x301,0x1ff);\n    puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();\n    if (iVar2 < 0) {\n      iVar1 = FUN_0001d6f4();\n      return iVar1;\n    }\n    while( true ) {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,buf,0x2000);\n      if (iVar5 < 1) break;\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,buf,iVar5);\n      if (iVar4 != iVar5) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        *puVar3 = uVar6;\n        return -1;\n      }\n    }\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n    (*(code *)PTR_close_0004da40)(iVar2);\n    if (iVar5 != 0) {\n      *puVar3 = uVar6;\n      iVar5 = -1;\n    }\n  }" else (compound_statement "{\n    iVar2 = (*(code *)PTR_open64_0004db5c)(to,0x301,0x1ff);\n    puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();\n    if (iVar2 < 0) {\n      iVar1 = FUN_0001d6f4();\n      return iVar1;\n    }\n    while( true ) {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,buf,0x2000);\n      if (iVar5 < 1) break;\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,buf,iVar5);\n      if (iVar4 != iVar5) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        *puVar3 = uVar6;\n        return -1;\n      }\n    }\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n    (*(code *)PTR_close_0004da40)(iVar2);\n    if (iVar5 != 0) {\n      *puVar3 = uVar6;\n      iVar5 = -1;\n    }\n  }" { (expression_statement "iVar2 = (*(code *)PTR_open64_0004db5c)(to,0x301,0x1ff);" (assignment_expression "iVar2 = (*(code *)PTR_open64_0004db5c)(to,0x301,0x1ff)" identifier = (call_expression "(*(code *)PTR_open64_0004db5c)(to,0x301,0x1ff)" (parenthesized_expression "(*(code *)PTR_open64_0004db5c)" ( (pointer_expression "*(code *)PTR_open64_0004db5c" * (cast_expression "(code *)PTR_open64_0004db5c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(to,0x301,0x1ff)" ( identifier , number_literal , number_literal )))) ;) (expression_statement "puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();" (assignment_expression "puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_0004db28)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_0004db28)()" (parenthesized_expression "(*(code *)PTR___errno_location_0004db28)" ( (pointer_expression "*(code *)PTR___errno_location_0004db28" * (cast_expression "(code *)PTR___errno_location_0004db28" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (if_statement "if (iVar2 < 0) {\n      iVar1 = FUN_0001d6f4();\n      return iVar1;\n    }" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (compound_statement "{\n      iVar1 = FUN_0001d6f4();\n      return iVar1;\n    }" { (expression_statement "iVar1 = FUN_0001d6f4();" (assignment_expression "iVar1 = FUN_0001d6f4()" identifier = (call_expression "FUN_0001d6f4()" identifier (argument_list "()" ( )))) ;) (return_statement "return iVar1;" return identifier ;) })) (while_statement "while( true ) {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,buf,0x2000);\n      if (iVar5 < 1) break;\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,buf,iVar5);\n      if (iVar4 != iVar5) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        *puVar3 = uVar6;\n        return -1;\n      }\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,buf,0x2000);\n      if (iVar5 < 1) break;\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,buf,iVar5);\n      if (iVar4 != iVar5) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        *puVar3 = uVar6;\n        return -1;\n      }\n    }" { (expression_statement "iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,buf,0x2000);" (assignment_expression "iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,buf,0x2000)" identifier = (call_expression "(*(code *)PTR_read_0004dc9c)(iVar1,buf,0x2000)" (parenthesized_expression "(*(code *)PTR_read_0004dc9c)" ( (pointer_expression "*(code *)PTR_read_0004dc9c" * (cast_expression "(code *)PTR_read_0004dc9c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1,buf,0x2000)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (iVar5 < 1) break;" if (parenthesized_expression "(iVar5 < 1)" ( (binary_expression "iVar5 < 1" identifier < number_literal) )) (break_statement "break;" break ;)) (expression_statement "iVar4 = (*(code *)PTR_write_0004db64)(iVar2,buf,iVar5);" (assignment_expression "iVar4 = (*(code *)PTR_write_0004db64)(iVar2,buf,iVar5)" identifier = (call_expression "(*(code *)PTR_write_0004db64)(iVar2,buf,iVar5)" (parenthesized_expression "(*(code *)PTR_write_0004db64)" ( (pointer_expression "*(code *)PTR_write_0004db64" * (cast_expression "(code *)PTR_write_0004db64" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2,buf,iVar5)" ( identifier , identifier , identifier )))) ;) (if_statement "if (iVar4 != iVar5) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        *puVar3 = uVar6;\n        return -1;\n      }" if (parenthesized_expression "(iVar4 != iVar5)" ( (binary_expression "iVar4 != iVar5" identifier != identifier) )) (compound_statement "{\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        *puVar3 = uVar6;\n        return -1;\n      }" { (expression_statement "uVar6 = *puVar3;" (assignment_expression "uVar6 = *puVar3" identifier = (pointer_expression "*puVar3" * identifier)) ;) (expression_statement "(*(code *)PTR_close_0004da40)(iVar1);" (call_expression "(*(code *)PTR_close_0004da40)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_0004da40)" ( (pointer_expression "*(code *)PTR_close_0004da40" * (cast_expression "(code *)PTR_close_0004da40" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "(*(code *)PTR_close_0004da40)(iVar2);" (call_expression "(*(code *)PTR_close_0004da40)(iVar2)" (parenthesized_expression "(*(code *)PTR_close_0004da40)" ( (pointer_expression "*(code *)PTR_close_0004da40" * (cast_expression "(code *)PTR_close_0004da40" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2)" ( identifier ))) ;) (expression_statement "*puVar3 = uVar6;" (assignment_expression "*puVar3 = uVar6" (pointer_expression "*puVar3" * identifier) = identifier) ;) (return_statement "return -1;" return number_literal ;) })) })) (expression_statement "uVar6 = *puVar3;" (assignment_expression "uVar6 = *puVar3" identifier = (pointer_expression "*puVar3" * identifier)) ;) (expression_statement "(*(code *)PTR_close_0004da40)(iVar1);" (call_expression "(*(code *)PTR_close_0004da40)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_0004da40)" ( (pointer_expression "*(code *)PTR_close_0004da40" * (cast_expression "(code *)PTR_close_0004da40" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "(*(code *)PTR_close_0004da40)(iVar2);" (call_expression "(*(code *)PTR_close_0004da40)(iVar2)" (parenthesized_expression "(*(code *)PTR_close_0004da40)" ( (pointer_expression "*(code *)PTR_close_0004da40" * (cast_expression "(code *)PTR_close_0004da40" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2)" ( identifier ))) ;) (if_statement "if (iVar5 != 0) {\n      *puVar3 = uVar6;\n      iVar5 = -1;\n    }" if (parenthesized_expression "(iVar5 != 0)" ( (binary_expression "iVar5 != 0" identifier != number_literal) )) (compound_statement "{\n      *puVar3 = uVar6;\n      iVar5 = -1;\n    }" { (expression_statement "*puVar3 = uVar6;" (assignment_expression "*puVar3 = uVar6" (pointer_expression "*puVar3" * identifier) = identifier) ;) (expression_statement "iVar5 = -1;" (assignment_expression "iVar5 = -1" identifier = number_literal) ;) })) }))) (return_statement "return iVar5;" return identifier ;) })))
(translation_unit "undefined4 FUN_0001d590(undefined4 param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  undefined1 auStack_2018 [8192];\n  \n  iVar1 = (*(code *)PTR_open64_0004db5c)(param_1,0);\n  if (iVar1 < 0) {\n    return 0xffffffff;\n  }\n  iVar2 = (*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff);\n  puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();\n  if (iVar2 < 0) {\n    uVar6 = *puVar3;\n    iVar2 = iVar1;\n  }\n  else {\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }\n  (*(code *)PTR_close_0004da40)(iVar2);\n  *puVar3 = uVar6;\n  return 0xffffffff;\n}\n\n" (function_definition "undefined4 FUN_0001d590(undefined4 param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  undefined1 auStack_2018 [8192];\n  \n  iVar1 = (*(code *)PTR_open64_0004db5c)(param_1,0);\n  if (iVar1 < 0) {\n    return 0xffffffff;\n  }\n  iVar2 = (*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff);\n  puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();\n  if (iVar2 < 0) {\n    uVar6 = *puVar3;\n    iVar2 = iVar1;\n  }\n  else {\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }\n  (*(code *)PTR_close_0004da40)(iVar2);\n  *puVar3 = uVar6;\n  return 0xffffffff;\n}" type_identifier (function_declarator "FUN_0001d590(undefined4 param_1,undefined4 param_2)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  undefined1 auStack_2018 [8192];\n  \n  iVar1 = (*(code *)PTR_open64_0004db5c)(param_1,0);\n  if (iVar1 < 0) {\n    return 0xffffffff;\n  }\n  iVar2 = (*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff);\n  puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();\n  if (iVar2 < 0) {\n    uVar6 = *puVar3;\n    iVar2 = iVar1;\n  }\n  else {\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }\n  (*(code *)PTR_close_0004da40)(iVar2);\n  *puVar3 = uVar6;\n  return 0xffffffff;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "undefined4 uVar6;" type_identifier identifier ;) (declaration "undefined1 auStack_2018 [8192];" type_identifier (array_declarator "auStack_2018 [8192]" identifier [ number_literal ]) ;) (expression_statement "iVar1 = (*(code *)PTR_open64_0004db5c)(param_1,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_0004db5c)(param_1,0)" identifier = (call_expression "(*(code *)PTR_open64_0004db5c)(param_1,0)" (parenthesized_expression "(*(code *)PTR_open64_0004db5c)" ( (pointer_expression "*(code *)PTR_open64_0004db5c" * (cast_expression "(code *)PTR_open64_0004db5c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0)" ( identifier , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n    return 0xffffffff;\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    return 0xffffffff;\n  }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (expression_statement "iVar2 = (*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff);" (assignment_expression "iVar2 = (*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff)" identifier = (call_expression "(*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff)" (parenthesized_expression "(*(code *)PTR_open64_0004db5c)" ( (pointer_expression "*(code *)PTR_open64_0004db5c" * (cast_expression "(code *)PTR_open64_0004db5c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_2,0x301,0x1ff)" ( identifier , number_literal , number_literal )))) ;) (expression_statement "puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();" (assignment_expression "puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_0004db28)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_0004db28)()" (parenthesized_expression "(*(code *)PTR___errno_location_0004db28)" ( (pointer_expression "*(code *)PTR___errno_location_0004db28" * (cast_expression "(code *)PTR___errno_location_0004db28" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (if_statement "if (iVar2 < 0) {\n    uVar6 = *puVar3;\n    iVar2 = iVar1;\n  }\n  else {\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (compound_statement "{\n    uVar6 = *puVar3;\n    iVar2 = iVar1;\n  }" { (expression_statement "uVar6 = *puVar3;" (assignment_expression "uVar6 = *puVar3" identifier = (pointer_expression "*puVar3" * identifier)) ;) (expression_statement "iVar2 = iVar1;" (assignment_expression "iVar2 = iVar1" identifier = identifier) ;) }) (else_clause "else {\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }" else (compound_statement "{\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }" { (do_statement "do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);" do (compound_statement "{\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    }" { (expression_statement "iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);" (assignment_expression "iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000)" identifier = (call_expression "(*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000)" (parenthesized_expression "(*(code *)PTR_read_0004dc9c)" ( (pointer_expression "*(code *)PTR_read_0004dc9c" * (cast_expression "(code *)PTR_read_0004dc9c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1,auStack_2018,0x2000)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }" if (parenthesized_expression "(iVar5 < 1)" ( (binary_expression "iVar5 < 1" identifier < number_literal) )) (compound_statement "{\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }" { (expression_statement "uVar6 = *puVar3;" (assignment_expression "uVar6 = *puVar3" identifier = (pointer_expression "*puVar3" * identifier)) ;) (expression_statement "(*(code *)PTR_close_0004da40)(iVar1);" (call_expression "(*(code *)PTR_close_0004da40)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_0004da40)" ( (pointer_expression "*(code *)PTR_close_0004da40" * (cast_expression "(code *)PTR_close_0004da40" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "(*(code *)PTR_close_0004da40)(iVar2);" (call_expression "(*(code *)PTR_close_0004da40)(iVar2)" (parenthesized_expression "(*(code *)PTR_close_0004da40)" ( (pointer_expression "*(code *)PTR_close_0004da40" * (cast_expression "(code *)PTR_close_0004da40" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2)" ( identifier ))) ;) (if_statement "if (iVar5 == 0) {\n          return 0;\n        }" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (compound_statement "{\n          return 0;\n        }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "*puVar3 = uVar6;" (assignment_expression "*puVar3 = uVar6" (pointer_expression "*puVar3" * identifier) = identifier) ;) (return_statement "return 0xffffffff;" return number_literal ;) })) (expression_statement "iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);" (assignment_expression "iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5)" identifier = (call_expression "(*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5)" (parenthesized_expression "(*(code *)PTR_write_0004db64)" ( (pointer_expression "*(code *)PTR_write_0004db64" * (cast_expression "(code *)PTR_write_0004db64" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2,auStack_2018,iVar5)" ( identifier , identifier , identifier )))) ;) }) while (parenthesized_expression "(iVar4 == iVar5)" ( (binary_expression "iVar4 == iVar5" identifier == identifier) )) ;) (expression_statement "uVar6 = *puVar3;" (assignment_expression "uVar6 = *puVar3" identifier = (pointer_expression "*puVar3" * identifier)) ;) (expression_statement "(*(code *)PTR_close_0004da40)(iVar1);" (call_expression "(*(code *)PTR_close_0004da40)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_0004da40)" ( (pointer_expression "*(code *)PTR_close_0004da40" * (cast_expression "(code *)PTR_close_0004da40" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) }))) (expression_statement "(*(code *)PTR_close_0004da40)(iVar2);" (call_expression "(*(code *)PTR_close_0004da40)(iVar2)" (parenthesized_expression "(*(code *)PTR_close_0004da40)" ( (pointer_expression "*(code *)PTR_close_0004da40" * (cast_expression "(code *)PTR_close_0004da40" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2)" ( identifier ))) ;) (expression_statement "*puVar3 = uVar6;" (assignment_expression "*puVar3 = uVar6" (pointer_expression "*puVar3" * identifier) = identifier) ;) (return_statement "return 0xffffffff;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , LIT , LIT )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) (else_clause else (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT ))) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , IDENT , IDENT )))) ;) }) while (parenthesized_expression ( (binary_expression IDENT == IDENT) )) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT ))) ;) }))) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (return_statement return LIT ;) })))
(function_definition "undefined4 FUN_0001d590(undefined4 param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  undefined1 auStack_2018 [8192];\n  \n  iVar1 = (*(code *)PTR_open64_0004db5c)(param_1,0);\n  if (iVar1 < 0) {\n    return 0xffffffff;\n  }\n  iVar2 = (*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff);\n  puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();\n  if (iVar2 < 0) {\n    uVar6 = *puVar3;\n    iVar2 = iVar1;\n  }\n  else {\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }\n  (*(code *)PTR_close_0004da40)(iVar2);\n  *puVar3 = uVar6;\n  return 0xffffffff;\n}" (type_identifier "undefined4") (function_declarator "FUN_0001d590(undefined4 param_1,undefined4 param_2)" (identifier "FUN_0001d590") (parameter_list "(undefined4 param_1,undefined4 param_2)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  undefined1 auStack_2018 [8192];\n  \n  iVar1 = (*(code *)PTR_open64_0004db5c)(param_1,0);\n  if (iVar1 < 0) {\n    return 0xffffffff;\n  }\n  iVar2 = (*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff);\n  puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();\n  if (iVar2 < 0) {\n    uVar6 = *puVar3;\n    iVar2 = iVar1;\n  }\n  else {\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }\n  (*(code *)PTR_close_0004da40)(iVar2);\n  *puVar3 = uVar6;\n  return 0xffffffff;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined4 *puVar3;" (type_identifier "undefined4") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (declaration "undefined4 uVar6;" (type_identifier "undefined4") (identifier "uVar6") (; ";")) (declaration "undefined1 auStack_2018 [8192];" (type_identifier "undefined1") (array_declarator "auStack_2018 [8192]" (identifier "auStack_2018") ([ "[") (number_literal "8192") (] "]")) (; ";")) (expression_statement "iVar1 = (*(code *)PTR_open64_0004db5c)(param_1,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_0004db5c)(param_1,0)" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_open64_0004db5c)(param_1,0)" (parenthesized_expression "(*(code *)PTR_open64_0004db5c)" (( "(") (pointer_expression "*(code *)PTR_open64_0004db5c" (* "*") (cast_expression "(code *)PTR_open64_0004db5c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_open64_0004db5c"))) () ")")) (argument_list "(param_1,0)" (( "(") (identifier "param_1") (, ",") (number_literal "0") () ")")))) (; ";")) (if_statement "if (iVar1 < 0) {\n    return 0xffffffff;\n  }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n    return 0xffffffff;\n  }" ({ "{") (return_statement "return 0xffffffff;" (return "return") (number_literal "0xffffffff") (; ";")) (} "}"))) (expression_statement "iVar2 = (*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff);" (assignment_expression "iVar2 = (*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff)" (parenthesized_expression "(*(code *)PTR_open64_0004db5c)" (( "(") (pointer_expression "*(code *)PTR_open64_0004db5c" (* "*") (cast_expression "(code *)PTR_open64_0004db5c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_open64_0004db5c"))) () ")")) (argument_list "(param_2,0x301,0x1ff)" (( "(") (identifier "param_2") (, ",") (number_literal "0x301") (, ",") (number_literal "0x1ff") () ")")))) (; ";")) (expression_statement "puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();" (assignment_expression "puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)()" (identifier "puVar3") (= "=") (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_0004db28)()" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___errno_location_0004db28)()" (parenthesized_expression "(*(code *)PTR___errno_location_0004db28)" (( "(") (pointer_expression "*(code *)PTR___errno_location_0004db28" (* "*") (cast_expression "(code *)PTR___errno_location_0004db28" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___errno_location_0004db28"))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (if_statement "if (iVar2 < 0) {\n    uVar6 = *puVar3;\n    iVar2 = iVar1;\n  }\n  else {\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }" (if "if") (parenthesized_expression "(iVar2 < 0)" (( "(") (binary_expression "iVar2 < 0" (identifier "iVar2") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n    uVar6 = *puVar3;\n    iVar2 = iVar1;\n  }" ({ "{") (expression_statement "uVar6 = *puVar3;" (assignment_expression "uVar6 = *puVar3" (identifier "uVar6") (= "=") (pointer_expression "*puVar3" (* "*") (identifier "puVar3"))) (; ";")) (expression_statement "iVar2 = iVar1;" (assignment_expression "iVar2 = iVar1" (identifier "iVar2") (= "=") (identifier "iVar1")) (; ";")) (} "}")) (else_clause "else {\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }" (else "else") (compound_statement "{\n    do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);\n    uVar6 = *puVar3;\n    (*(code *)PTR_close_0004da40)(iVar1);\n  }" ({ "{") (do_statement "do {\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    } while (iVar4 == iVar5);" (do "do") (compound_statement "{\n      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);\n      if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }\n      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);\n    }" ({ "{") (expression_statement "iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);" (assignment_expression "iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000)" (identifier "iVar5") (= "=") (call_expression "(*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000)" (parenthesized_expression "(*(code *)PTR_read_0004dc9c)" (( "(") (pointer_expression "*(code *)PTR_read_0004dc9c" (* "*") (cast_expression "(code *)PTR_read_0004dc9c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_read_0004dc9c"))) () ")")) (argument_list "(iVar1,auStack_2018,0x2000)" (( "(") (identifier "iVar1") (, ",") (identifier "auStack_2018") (, ",") (number_literal "0x2000") () ")")))) (; ";")) (if_statement "if (iVar5 < 1) {\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }" (if "if") (parenthesized_expression "(iVar5 < 1)" (( "(") (binary_expression "iVar5 < 1" (identifier "iVar5") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n        uVar6 = *puVar3;\n        (*(code *)PTR_close_0004da40)(iVar1);\n        (*(code *)PTR_close_0004da40)(iVar2);\n        if (iVar5 == 0) {\n          return 0;\n        }\n        *puVar3 = uVar6;\n        return 0xffffffff;\n      }" ({ "{") (expression_statement "uVar6 = *puVar3;" (assignment_expression "uVar6 = *puVar3" (identifier "uVar6") (= "=") (pointer_expression "*puVar3" (* "*") (identifier "puVar3"))) (; ";")) (expression_statement "(*(code *)PTR_close_0004da40)(iVar1);" (call_expression "(*(code *)PTR_close_0004da40)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_0004da40)" (( "(") (pointer_expression "*(code *)PTR_close_0004da40" (* "*") (cast_expression "(code *)PTR_close_0004da40" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_close_0004da40"))) () ")")) (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))) (; ";")) (expression_statement "(*(code *)PTR_close_0004da40)(iVar2);" (call_expression "(*(code *)PTR_close_0004da40)(iVar2)" (parenthesized_expression "(*(code *)PTR_close_0004da40)" (( "(") (pointer_expression "*(code *)PTR_close_0004da40" (* "*") (cast_expression "(code *)PTR_close_0004da40" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_close_0004da40"))) () ")")) (argument_list "(iVar2)" (( "(") (identifier "iVar2") () ")"))) (; ";")) (if_statement "if (iVar5 == 0) {\n          return 0;\n        }" (if "if") (parenthesized_expression "(iVar5 == 0)" (( "(") (binary_expression "iVar5 == 0" (identifier "iVar5") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n          return 0;\n        }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "*puVar3 = uVar6;" (assignment_expression "*puVar3 = uVar6" (pointer_expression "*puVar3" (* "*") (identifier "puVar3")) (= "=") (identifier "uVar6")) (; ";")) (return_statement "return 0xffffffff;" (return "return") (number_literal "0xffffffff") (; ";")) (} "}"))) (expression_statement "iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);" (assignment_expression "iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5)" (identifier "iVar4") (= "=") (call_expression "(*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5)" (parenthesized_expression "(*(code *)PTR_write_0004db64)" (( "(") (pointer_expression "*(code *)PTR_write_0004db64" (* "*") (cast_expression "(code *)PTR_write_0004db64" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_write_0004db64"))) () ")")) (argument_list "(iVar2,auStack_2018,iVar5)" (( "(") (identifier "iVar2") (, ",") (identifier "auStack_2018") (, ",") (identifier "iVar5") () ")")))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(iVar4 == iVar5)" (( "(") (binary_expression "iVar4 == iVar5" (identifier "iVar4") (== "==") (identifier "iVar5")) () ")")) (; ";")) (expression_statement "uVar6 = *puVar3;" (assignment_expression "uVar6 = *puVar3" (identifier "uVar6") (= "=") (pointer_expression "*puVar3" (* "*") (identifier "puVar3"))) (; ";")) (expression_statement "(*(code *)PTR_close_0004da40)(iVar1);" (call_expression "(*(code *)PTR_close_0004da40)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_0004da40)" (( "(") (pointer_expression "*(code *)PTR_close_0004da40" (* "*") (cast_expression "(code *)PTR_close_0004da40" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_close_0004da40"))) () ")")) (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))) (; ";")) (} "}")))) (expression_statement "(*(code *)PTR_close_0004da40)(iVar2);" (call_expression "(*(code *)PTR_close_0004da40)(iVar2)" (parenthesized_expression "(*(code *)PTR_close_0004da40)" (( "(") (pointer_expression "*(code *)PTR_close_0004da40" (* "*") (cast_expression "(code *)PTR_close_0004da40" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_close_0004da40"))) () ")")) (argument_list "(iVar2)" (( "(") (identifier "iVar2") () ")"))) (; ";")) (expression_statement "*puVar3 = uVar6;" (assignment_expression "*puVar3 = uVar6" (pointer_expression "*puVar3" (* "*") (identifier "puVar3")) (= "=") (identifier "uVar6")) (; ";")) (return_statement "return 0xffffffff;" (return "return") (number_literal "0xffffffff") (; ";")) (} "}")))

int function_1(char *from,char *to)

{
  int var_1;
  int var_2;
  type_1 *puVar3;
  int var_5;
  int var_4;
  type_1 uVar6;
  char buf [8192];
  
  var_1 = (*(type_2 *)PTR_open64_0004db5c)(from,0);
  if (var_1 < 0) {
    var_4 = -1;
  }
  else {
    var_2 = (*(type_2 *)PTR_open64_0004db5c)(to,0x301,0x1ff);
    puVar3 = (type_1 *)(*(type_2 *)PTR___errno_location_0004db28)();
    if (var_2 < 0) {
      var_1 = var_3();
      return var_1;
    }
    while( true ) {
      var_4 = (*(type_2 *)PTR_read_0004dc9c)(var_1,buf,0x2000);
      if (var_4 < 1) break;
      var_5 = (*(type_2 *)PTR_write_0004db64)(var_2,buf,var_4);
      if (var_5 != var_4) {
        uVar6 = *puVar3;
        (*(type_2 *)PTR_close_0004da40)(var_1);
        (*(type_2 *)PTR_close_0004da40)(var_2);
        *puVar3 = uVar6;
        return -1;
      }
    }
    uVar6 = *puVar3;
    (*(type_2 *)PTR_close_0004da40)(var_1);
    (*(type_2 *)PTR_close_0004da40)(var_2);
    if (var_4 != 0) {
      *puVar3 = uVar6;
      var_4 = -1;
    }
  }
  return var_4;
}


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

undefined4 MASKED(undefined4 param_1,undefined4 param_2)

{
  int iVar1;
  int iVar2;
  undefined4 *puVar3;
  int iVar4;
  int iVar5;
  undefined4 uVar6;
  undefined1 auStack_2018 [8192];
  
  iVar1 = (*(code *)PTR_open64_0004db5c)(param_1,0);
  if (iVar1 < 0) {
    return 0xffffffff;
  }
  iVar2 = (*(code *)PTR_open64_0004db5c)(param_2,0x301,0x1ff);
  puVar3 = (undefined4 *)(*(code *)PTR___errno_location_0004db28)();
  if (iVar2 < 0) {
    uVar6 = *puVar3;
    iVar2 = iVar1;
  }
  else {
    do {
      iVar5 = (*(code *)PTR_read_0004dc9c)(iVar1,auStack_2018,0x2000);
      if (iVar5 < 1) {
        uVar6 = *puVar3;
        (*(code *)PTR_close_0004da40)(iVar1);
        (*(code *)PTR_close_0004da40)(iVar2);
        if (iVar5 == 0) {
          return 0;
        }
        *puVar3 = uVar6;
        return 0xffffffff;
      }
      iVar4 = (*(code *)PTR_write_0004db64)(iVar2,auStack_2018,iVar5);
    } while (iVar4 == iVar5);
    uVar6 = *puVar3;
    (*(code *)PTR_close_0004da40)(iVar1);
  }
  (*(code *)PTR_close_0004da40)(iVar2);
  *puVar3 = uVar6;
  return 0xffffffff;
}

