
char * areadlink_with_size(char *file,size_t size)

{
  bool bVar1;
  char *pcVar2;
  uint uVar3;
  int *piVar4;
  undefined4 *puVar5;
  uint uVar6;
  
  if (size < 0x401) {
    uVar6 = size + 1;
  }
  else {
    uVar6 = 0x401;
  }
  while( true ) {
    pcVar2 = (char *)(*(code *)PTR_malloc_00049560)(uVar6);
    if (pcVar2 == (char *)0x0) {
      return (char *)0x0;
    }
    uVar3 = (*(code *)PTR_readlink_000495b4)(file,pcVar2,uVar6);
    if (((int)uVar3 < 0) &&
       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;
    if (uVar3 < uVar6) {
      pcVar2[uVar3] = '\0';
      return pcVar2;
    }
    (*(code *)PTR_free_00049608)(pcVar2);
    bVar1 = 0x7ffffffe < uVar6;
    if (uVar6 < 0x40000000) {
      uVar6 = uVar6 << 1;
    }
    else {
      uVar6 = 0x7fffffff;
      if (bVar1) {
        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();
        *puVar5 = 0xc;
        return (char *)0x0;
      }
    }
  }
  (*(code *)PTR_free_00049608)(pcVar2);
  return (char *)0x0;
}



int areadlink_with_size(undefined4 param_1,uint param_2)

{
  bool bVar1;
  int iVar2;
  uint uVar3;
  int *piVar4;
  undefined4 *puVar5;
  
  if (param_2 < 0x401) {
    param_2 = param_2 + 1;
  }
  else {
    param_2 = 0x401;
  }
  while( true ) {
    iVar2 = (*(code *)PTR_malloc_00049560)(param_2);
    if (iVar2 == 0) {
      return 0;
    }
    uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);
    if (((int)uVar3 < 0) &&
       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;
    if (uVar3 < param_2) {
      *(undefined1 *)(iVar2 + uVar3) = 0;
      return iVar2;
    }
    (*(code *)PTR_free_00049608)(iVar2);
    bVar1 = 0x7ffffffe < param_2;
    if (param_2 < 0x40000000) {
      param_2 = param_2 << 1;
    }
    else {
      param_2 = 0x7fffffff;
      if (bVar1) {
        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();
        *puVar5 = 0xc;
        return 0;
      }
    }
  }
  (*(code *)PTR_free_00049608)(iVar2);
  return 0;
}


lui gp,0x3
addiu gp,gp,0x3010
addu gp,gp,t9
addiu sp,sp,-0x38
sltiu v0,a1,0x401
sw gp,0x10(sp)
sw s4,0x28(sp)
or s4,a0,zero
sw ra,0x34(sp)
sw s6,0x30(sp)
sw s5,0x2c(sp)
sw s3,0x24(sp)
sw s2,0x20(sp)
sw s1,0x1c(sp)
beq v0,zero,0x0001e2f4
_sw s0,0x18(sp)
addiu s0,a1,0x1
lui s3,0x7fff
li s6,0x22
lui s5,0x4000
ori s3,s3,0xffff
lw t9,-0x7c80(gp)
jalr t9
_or a0,s0,zero
or a2,s0,zero
lw gp,0x10(sp)
or a0,s4,zero
or s1,v0,zero
or a1,v0,zero
beq v0,zero,0x0001e2c8
_lw t9,-0x7c2c(gp)
jalr t9
_nop
lw gp,0x10(sp)
or s2,v0,zero
bltz v0,0x0001e2a4
_lw t9,-0x7cc8(gp)
sltu v0,s2,s0
lw t9,-0x7bd8(gp)
bne v0,zero,0x0001e2fc
_or a0,s1,zero
jalr t9
_nop
sltu v0,s0,s5
lw gp,0x10(sp)
beq v0,zero,0x0001e294
_sltu v1,s0,s3
b 0x0001e224
_sll s0,s0,0x1
beq v1,zero,0x0001e330
_or s0,s3,zero
b 0x0001e228
_lw t9,-0x7c80(gp)
jalr t9
_nop
lw v0,0x0(v0)
beq v0,s6,0x0001e264
_lw gp,0x10(sp)
lw t9,-0x7bd8(gp)
or a0,s1,zero
jalr t9
_or s1,zero,zero
lw ra,0x34(sp)
or v0,s1,zero
lw s6,0x30(sp)
lw s5,0x2c(sp)
lw s4,0x28(sp)
lw s3,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x38
b 0x0001e214
_li s0,0x401
addu s2,s1,s2
or v0,s1,zero
sb zero,0x0(s2)
lw ra,0x34(sp)
lw s6,0x30(sp)
lw s5,0x2c(sp)
lw s4,0x28(sp)
lw s3,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x38
lw t9,-0x7cc8(gp)
jalr t9
_or s1,zero,zero
li v1,0xc
lw ra,0x34(sp)
lw s6,0x30(sp)
lw s5,0x2c(sp)
lw s4,0x28(sp)
lw s3,0x24(sp)
lw s2,0x20(sp)
lw s0,0x18(sp)
sw v1,0x0(v0)
or v0,s1,zero
lw s1,0x1c(sp)
jr ra
_addiu sp,sp,0x38
(translation_unit "int areadlink_with_size(undefined4 param_1,uint param_2)\n\n{\n  bool bVar1;\n  int iVar2;\n  uint uVar3;\n  int *piVar4;\n  undefined4 *puVar5;\n  \n  if (param_2 < 0x401) {\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_2 = 0x401;\n  }\n  while( true ) {\n    iVar2 = (*(code *)PTR_malloc_00049560)(param_2);\n    if (iVar2 == 0) {\n      return 0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }\n    (*(code *)PTR_free_00049608)(iVar2);\n    bVar1 = 0x7ffffffe < param_2;\n    if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }\n  }\n  (*(code *)PTR_free_00049608)(iVar2);\n  return 0;\n}\n\n" (function_definition "int areadlink_with_size(undefined4 param_1,uint param_2)\n\n{\n  bool bVar1;\n  int iVar2;\n  uint uVar3;\n  int *piVar4;\n  undefined4 *puVar5;\n  \n  if (param_2 < 0x401) {\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_2 = 0x401;\n  }\n  while( true ) {\n    iVar2 = (*(code *)PTR_malloc_00049560)(param_2);\n    if (iVar2 == 0) {\n      return 0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }\n    (*(code *)PTR_free_00049608)(iVar2);\n    bVar1 = 0x7ffffffe < param_2;\n    if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }\n  }\n  (*(code *)PTR_free_00049608)(iVar2);\n  return 0;\n}" primitive_type (function_declarator "areadlink_with_size(undefined4 param_1,uint param_2)" identifier (parameter_list "(undefined4 param_1,uint param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  bool bVar1;\n  int iVar2;\n  uint uVar3;\n  int *piVar4;\n  undefined4 *puVar5;\n  \n  if (param_2 < 0x401) {\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_2 = 0x401;\n  }\n  while( true ) {\n    iVar2 = (*(code *)PTR_malloc_00049560)(param_2);\n    if (iVar2 == 0) {\n      return 0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }\n    (*(code *)PTR_free_00049608)(iVar2);\n    bVar1 = 0x7ffffffe < param_2;\n    if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }\n  }\n  (*(code *)PTR_free_00049608)(iVar2);\n  return 0;\n}" { (declaration "bool bVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "undefined4 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (if_statement "if (param_2 < 0x401) {\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_2 = 0x401;\n  }" if (parenthesized_expression "(param_2 < 0x401)" ( (binary_expression "param_2 < 0x401" identifier < number_literal) )) (compound_statement "{\n    param_2 = param_2 + 1;\n  }" { (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) }) (else_clause "else {\n    param_2 = 0x401;\n  }" else (compound_statement "{\n    param_2 = 0x401;\n  }" { (expression_statement "param_2 = 0x401;" (assignment_expression "param_2 = 0x401" identifier = number_literal) ;) }))) (while_statement "while( true ) {\n    iVar2 = (*(code *)PTR_malloc_00049560)(param_2);\n    if (iVar2 == 0) {\n      return 0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }\n    (*(code *)PTR_free_00049608)(iVar2);\n    bVar1 = 0x7ffffffe < param_2;\n    if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    iVar2 = (*(code *)PTR_malloc_00049560)(param_2);\n    if (iVar2 == 0) {\n      return 0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }\n    (*(code *)PTR_free_00049608)(iVar2);\n    bVar1 = 0x7ffffffe < param_2;\n    if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }\n  }" { (expression_statement "iVar2 = (*(code *)PTR_malloc_00049560)(param_2);" (assignment_expression "iVar2 = (*(code *)PTR_malloc_00049560)(param_2)" identifier = (call_expression "(*(code *)PTR_malloc_00049560)(param_2)" (parenthesized_expression "(*(code *)PTR_malloc_00049560)" ( (pointer_expression "*(code *)PTR_malloc_00049560" * (cast_expression "(code *)PTR_malloc_00049560" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_2)" ( identifier )))) ;) (if_statement "if (iVar2 == 0) {\n      return 0;\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);" (assignment_expression "uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2)" identifier = (call_expression "(*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2)" (parenthesized_expression "(*(code *)PTR_readlink_000495b4)" ( (pointer_expression "*(code *)PTR_readlink_000495b4" * (cast_expression "(code *)PTR_readlink_000495b4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,iVar2,param_2)" ( identifier , identifier , identifier )))) ;) (if_statement "if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;" if (parenthesized_expression "(((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22))" ( (binary_expression "((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)" (parenthesized_expression "((int)uVar3 < 0)" ( (binary_expression "(int)uVar3 < 0" (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) && (parenthesized_expression "(piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)" ( (comma_expression "piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22" (assignment_expression "piVar4 = (int *)(*(code *)PTR___errno_location_00049518)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_00049518)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00049518)()" (parenthesized_expression "(*(code *)PTR___errno_location_00049518)" ( (pointer_expression "*(code *)PTR___errno_location_00049518" * (cast_expression "(code *)PTR___errno_location_00049518" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) , (binary_expression "*piVar4 != 0x22" (pointer_expression "*piVar4" * identifier) != number_literal)) ))) )) (break_statement "break;" break ;)) (if_statement "if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }" if (parenthesized_expression "(uVar3 < param_2)" ( (binary_expression "uVar3 < param_2" identifier < identifier) )) (compound_statement "{\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }" { (expression_statement "*(undefined1 *)(iVar2 + uVar3) = 0;" (assignment_expression "*(undefined1 *)(iVar2 + uVar3) = 0" (pointer_expression "*(undefined1 *)(iVar2 + uVar3)" * (cast_expression "(undefined1 *)(iVar2 + uVar3)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + uVar3)" ( (binary_expression "iVar2 + uVar3" identifier + identifier) )))) = number_literal) ;) (return_statement "return iVar2;" return identifier ;) })) (expression_statement "(*(code *)PTR_free_00049608)(iVar2);" (call_expression "(*(code *)PTR_free_00049608)(iVar2)" (parenthesized_expression "(*(code *)PTR_free_00049608)" ( (pointer_expression "*(code *)PTR_free_00049608" * (cast_expression "(code *)PTR_free_00049608" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2)" ( identifier ))) ;) (expression_statement "bVar1 = 0x7ffffffe < param_2;" (assignment_expression "bVar1 = 0x7ffffffe < param_2" identifier = (binary_expression "0x7ffffffe < param_2" number_literal < identifier)) ;) (if_statement "if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }" if (parenthesized_expression "(param_2 < 0x40000000)" ( (binary_expression "param_2 < 0x40000000" identifier < number_literal) )) (compound_statement "{\n      param_2 = param_2 << 1;\n    }" { (expression_statement "param_2 = param_2 << 1;" (assignment_expression "param_2 = param_2 << 1" identifier = (binary_expression "param_2 << 1" identifier << number_literal)) ;) }) (else_clause "else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }" else (compound_statement "{\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }" { (expression_statement "param_2 = 0x7fffffff;" (assignment_expression "param_2 = 0x7fffffff" identifier = number_literal) ;) (if_statement "if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }" if (parenthesized_expression "(bVar1)" ( identifier )) (compound_statement "{\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }" { (expression_statement "puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();" (assignment_expression "puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_00049518)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00049518)()" (parenthesized_expression "(*(code *)PTR___errno_location_00049518)" ( (pointer_expression "*(code *)PTR___errno_location_00049518" * (cast_expression "(code *)PTR___errno_location_00049518" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "*puVar5 = 0xc;" (assignment_expression "*puVar5 = 0xc" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (return_statement "return 0;" return number_literal ;) })) }))) })) (expression_statement "(*(code *)PTR_free_00049608)(iVar2);" (call_expression "(*(code *)PTR_free_00049608)(iVar2)" (parenthesized_expression "(*(code *)PTR_free_00049608)" ( (pointer_expression "*(code *)PTR_free_00049608" * (cast_expression "(code *)PTR_free_00049608" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2)" ( identifier ))) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "char * areadlink_with_size(char *file,size_t size)\n\n{\n  bool bVar1;\n  char *pcVar2;\n  uint uVar3;\n  int *piVar4;\n  undefined4 *puVar5;\n  uint uVar6;\n  \n  if (size < 0x401) {\n    uVar6 = size + 1;\n  }\n  else {\n    uVar6 = 0x401;\n  }\n  while( true ) {\n    pcVar2 = (char *)(*(code *)PTR_malloc_00049560)(uVar6);\n    if (pcVar2 == (char *)0x0) {\n      return (char *)0x0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(file,pcVar2,uVar6);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < uVar6) {\n      pcVar2[uVar3] = '\0';\n      return pcVar2;\n    }\n    (*(code *)PTR_free_00049608)(pcVar2);\n    bVar1 = 0x7ffffffe < uVar6;\n    if (uVar6 < 0x40000000) {\n      uVar6 = uVar6 << 1;\n    }\n    else {\n      uVar6 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return (char *)0x0;\n      }\n    }\n  }\n  (*(code *)PTR_free_00049608)(pcVar2);\n  return (char *)0x0;\n}\n\n" (function_definition "char * areadlink_with_size(char *file,size_t size)\n\n{\n  bool bVar1;\n  char *pcVar2;\n  uint uVar3;\n  int *piVar4;\n  undefined4 *puVar5;\n  uint uVar6;\n  \n  if (size < 0x401) {\n    uVar6 = size + 1;\n  }\n  else {\n    uVar6 = 0x401;\n  }\n  while( true ) {\n    pcVar2 = (char *)(*(code *)PTR_malloc_00049560)(uVar6);\n    if (pcVar2 == (char *)0x0) {\n      return (char *)0x0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(file,pcVar2,uVar6);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < uVar6) {\n      pcVar2[uVar3] = '\0';\n      return pcVar2;\n    }\n    (*(code *)PTR_free_00049608)(pcVar2);\n    bVar1 = 0x7ffffffe < uVar6;\n    if (uVar6 < 0x40000000) {\n      uVar6 = uVar6 << 1;\n    }\n    else {\n      uVar6 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return (char *)0x0;\n      }\n    }\n  }\n  (*(code *)PTR_free_00049608)(pcVar2);\n  return (char *)0x0;\n}" primitive_type (pointer_declarator "* areadlink_with_size(char *file,size_t size)" * (function_declarator "areadlink_with_size(char *file,size_t size)" identifier (parameter_list "(char *file,size_t size)" ( (parameter_declaration "char *file" primitive_type (pointer_declarator "*file" * identifier)) , (parameter_declaration "size_t size" primitive_type identifier) )))) (compound_statement "{\n  bool bVar1;\n  char *pcVar2;\n  uint uVar3;\n  int *piVar4;\n  undefined4 *puVar5;\n  uint uVar6;\n  \n  if (size < 0x401) {\n    uVar6 = size + 1;\n  }\n  else {\n    uVar6 = 0x401;\n  }\n  while( true ) {\n    pcVar2 = (char *)(*(code *)PTR_malloc_00049560)(uVar6);\n    if (pcVar2 == (char *)0x0) {\n      return (char *)0x0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(file,pcVar2,uVar6);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < uVar6) {\n      pcVar2[uVar3] = '\0';\n      return pcVar2;\n    }\n    (*(code *)PTR_free_00049608)(pcVar2);\n    bVar1 = 0x7ffffffe < uVar6;\n    if (uVar6 < 0x40000000) {\n      uVar6 = uVar6 << 1;\n    }\n    else {\n      uVar6 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return (char *)0x0;\n      }\n    }\n  }\n  (*(code *)PTR_free_00049608)(pcVar2);\n  return (char *)0x0;\n}" { (declaration "bool bVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "undefined4 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "uint uVar6;" type_identifier identifier ;) (if_statement "if (size < 0x401) {\n    uVar6 = size + 1;\n  }\n  else {\n    uVar6 = 0x401;\n  }" if (parenthesized_expression "(size < 0x401)" ( (binary_expression "size < 0x401" identifier < number_literal) )) (compound_statement "{\n    uVar6 = size + 1;\n  }" { (expression_statement "uVar6 = size + 1;" (assignment_expression "uVar6 = size + 1" identifier = (binary_expression "size + 1" identifier + number_literal)) ;) }) (else_clause "else {\n    uVar6 = 0x401;\n  }" else (compound_statement "{\n    uVar6 = 0x401;\n  }" { (expression_statement "uVar6 = 0x401;" (assignment_expression "uVar6 = 0x401" identifier = number_literal) ;) }))) (while_statement "while( true ) {\n    pcVar2 = (char *)(*(code *)PTR_malloc_00049560)(uVar6);\n    if (pcVar2 == (char *)0x0) {\n      return (char *)0x0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(file,pcVar2,uVar6);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < uVar6) {\n      pcVar2[uVar3] = '\0';\n      return pcVar2;\n    }\n    (*(code *)PTR_free_00049608)(pcVar2);\n    bVar1 = 0x7ffffffe < uVar6;\n    if (uVar6 < 0x40000000) {\n      uVar6 = uVar6 << 1;\n    }\n    else {\n      uVar6 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return (char *)0x0;\n      }\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    pcVar2 = (char *)(*(code *)PTR_malloc_00049560)(uVar6);\n    if (pcVar2 == (char *)0x0) {\n      return (char *)0x0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(file,pcVar2,uVar6);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < uVar6) {\n      pcVar2[uVar3] = '\0';\n      return pcVar2;\n    }\n    (*(code *)PTR_free_00049608)(pcVar2);\n    bVar1 = 0x7ffffffe < uVar6;\n    if (uVar6 < 0x40000000) {\n      uVar6 = uVar6 << 1;\n    }\n    else {\n      uVar6 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return (char *)0x0;\n      }\n    }\n  }" { (expression_statement "pcVar2 = (char *)(*(code *)PTR_malloc_00049560)(uVar6);" (assignment_expression "pcVar2 = (char *)(*(code *)PTR_malloc_00049560)(uVar6)" identifier = (cast_expression "(char *)(*(code *)PTR_malloc_00049560)(uVar6)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_malloc_00049560)(uVar6)" (parenthesized_expression "(*(code *)PTR_malloc_00049560)" ( (pointer_expression "*(code *)PTR_malloc_00049560" * (cast_expression "(code *)PTR_malloc_00049560" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(uVar6)" ( identifier ))))) ;) (if_statement "if (pcVar2 == (char *)0x0) {\n      return (char *)0x0;\n    }" if (parenthesized_expression "(pcVar2 == (char *)0x0)" ( (binary_expression "pcVar2 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return (char *)0x0;\n    }" { (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "uVar3 = (*(code *)PTR_readlink_000495b4)(file,pcVar2,uVar6);" (assignment_expression "uVar3 = (*(code *)PTR_readlink_000495b4)(file,pcVar2,uVar6)" identifier = (call_expression "(*(code *)PTR_readlink_000495b4)(file,pcVar2,uVar6)" (parenthesized_expression "(*(code *)PTR_readlink_000495b4)" ( (pointer_expression "*(code *)PTR_readlink_000495b4" * (cast_expression "(code *)PTR_readlink_000495b4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(file,pcVar2,uVar6)" ( identifier , identifier , identifier )))) ;) (if_statement "if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;" if (parenthesized_expression "(((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22))" ( (binary_expression "((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)" (parenthesized_expression "((int)uVar3 < 0)" ( (binary_expression "(int)uVar3 < 0" (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) && (parenthesized_expression "(piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)" ( (comma_expression "piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22" (assignment_expression "piVar4 = (int *)(*(code *)PTR___errno_location_00049518)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_00049518)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00049518)()" (parenthesized_expression "(*(code *)PTR___errno_location_00049518)" ( (pointer_expression "*(code *)PTR___errno_location_00049518" * (cast_expression "(code *)PTR___errno_location_00049518" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) , (binary_expression "*piVar4 != 0x22" (pointer_expression "*piVar4" * identifier) != number_literal)) ))) )) (break_statement "break;" break ;)) (if_statement "if (uVar3 < uVar6) {\n      pcVar2[uVar3] = '\0';\n      return pcVar2;\n    }" if (parenthesized_expression "(uVar3 < uVar6)" ( (binary_expression "uVar3 < uVar6" identifier < identifier) )) (compound_statement "{\n      pcVar2[uVar3] = '\0';\n      return pcVar2;\n    }" { (expression_statement "pcVar2[uVar3] = '\0';" (assignment_expression "pcVar2[uVar3] = '\0'" (subscript_expression "pcVar2[uVar3]" identifier [ identifier ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (return_statement "return pcVar2;" return identifier ;) })) (expression_statement "(*(code *)PTR_free_00049608)(pcVar2);" (call_expression "(*(code *)PTR_free_00049608)(pcVar2)" (parenthesized_expression "(*(code *)PTR_free_00049608)" ( (pointer_expression "*(code *)PTR_free_00049608" * (cast_expression "(code *)PTR_free_00049608" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar2)" ( identifier ))) ;) (expression_statement "bVar1 = 0x7ffffffe < uVar6;" (assignment_expression "bVar1 = 0x7ffffffe < uVar6" identifier = (binary_expression "0x7ffffffe < uVar6" number_literal < identifier)) ;) (if_statement "if (uVar6 < 0x40000000) {\n      uVar6 = uVar6 << 1;\n    }\n    else {\n      uVar6 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return (char *)0x0;\n      }\n    }" if (parenthesized_expression "(uVar6 < 0x40000000)" ( (binary_expression "uVar6 < 0x40000000" identifier < number_literal) )) (compound_statement "{\n      uVar6 = uVar6 << 1;\n    }" { (expression_statement "uVar6 = uVar6 << 1;" (assignment_expression "uVar6 = uVar6 << 1" identifier = (binary_expression "uVar6 << 1" identifier << number_literal)) ;) }) (else_clause "else {\n      uVar6 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return (char *)0x0;\n      }\n    }" else (compound_statement "{\n      uVar6 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return (char *)0x0;\n      }\n    }" { (expression_statement "uVar6 = 0x7fffffff;" (assignment_expression "uVar6 = 0x7fffffff" identifier = number_literal) ;) (if_statement "if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return (char *)0x0;\n      }" if (parenthesized_expression "(bVar1)" ( identifier )) (compound_statement "{\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return (char *)0x0;\n      }" { (expression_statement "puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();" (assignment_expression "puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_00049518)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00049518)()" (parenthesized_expression "(*(code *)PTR___errno_location_00049518)" ( (pointer_expression "*(code *)PTR___errno_location_00049518" * (cast_expression "(code *)PTR___errno_location_00049518" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "*puVar5 = 0xc;" (assignment_expression "*puVar5 = 0xc" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) }))) })) (expression_statement "(*(code *)PTR_free_00049608)(pcVar2);" (call_expression "(*(code *)PTR_free_00049608)(pcVar2)" (parenthesized_expression "(*(code *)PTR_free_00049608)" ( (pointer_expression "*(code *)PTR_free_00049608" * (cast_expression "(code *)PTR_free_00049608" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar2)" ( identifier ))) ;) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "int areadlink_with_size(undefined4 param_1,uint param_2)\n\n{\n  bool bVar1;\n  int iVar2;\n  uint uVar3;\n  int *piVar4;\n  undefined4 *puVar5;\n  \n  if (param_2 < 0x401) {\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_2 = 0x401;\n  }\n  while( true ) {\n    iVar2 = (*(code *)PTR_malloc_00049560)(param_2);\n    if (iVar2 == 0) {\n      return 0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }\n    (*(code *)PTR_free_00049608)(iVar2);\n    bVar1 = 0x7ffffffe < param_2;\n    if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }\n  }\n  (*(code *)PTR_free_00049608)(iVar2);\n  return 0;\n}\n\n" (function_definition "int areadlink_with_size(undefined4 param_1,uint param_2)\n\n{\n  bool bVar1;\n  int iVar2;\n  uint uVar3;\n  int *piVar4;\n  undefined4 *puVar5;\n  \n  if (param_2 < 0x401) {\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_2 = 0x401;\n  }\n  while( true ) {\n    iVar2 = (*(code *)PTR_malloc_00049560)(param_2);\n    if (iVar2 == 0) {\n      return 0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }\n    (*(code *)PTR_free_00049608)(iVar2);\n    bVar1 = 0x7ffffffe < param_2;\n    if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }\n  }\n  (*(code *)PTR_free_00049608)(iVar2);\n  return 0;\n}" primitive_type (function_declarator "areadlink_with_size(undefined4 param_1,uint param_2)" identifier (parameter_list "(undefined4 param_1,uint param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  bool bVar1;\n  int iVar2;\n  uint uVar3;\n  int *piVar4;\n  undefined4 *puVar5;\n  \n  if (param_2 < 0x401) {\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_2 = 0x401;\n  }\n  while( true ) {\n    iVar2 = (*(code *)PTR_malloc_00049560)(param_2);\n    if (iVar2 == 0) {\n      return 0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }\n    (*(code *)PTR_free_00049608)(iVar2);\n    bVar1 = 0x7ffffffe < param_2;\n    if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }\n  }\n  (*(code *)PTR_free_00049608)(iVar2);\n  return 0;\n}" { (declaration "bool bVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "undefined4 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (if_statement "if (param_2 < 0x401) {\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_2 = 0x401;\n  }" if (parenthesized_expression "(param_2 < 0x401)" ( (binary_expression "param_2 < 0x401" identifier < number_literal) )) (compound_statement "{\n    param_2 = param_2 + 1;\n  }" { (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) }) (else_clause "else {\n    param_2 = 0x401;\n  }" else (compound_statement "{\n    param_2 = 0x401;\n  }" { (expression_statement "param_2 = 0x401;" (assignment_expression "param_2 = 0x401" identifier = number_literal) ;) }))) (while_statement "while( true ) {\n    iVar2 = (*(code *)PTR_malloc_00049560)(param_2);\n    if (iVar2 == 0) {\n      return 0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }\n    (*(code *)PTR_free_00049608)(iVar2);\n    bVar1 = 0x7ffffffe < param_2;\n    if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    iVar2 = (*(code *)PTR_malloc_00049560)(param_2);\n    if (iVar2 == 0) {\n      return 0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }\n    (*(code *)PTR_free_00049608)(iVar2);\n    bVar1 = 0x7ffffffe < param_2;\n    if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }\n  }" { (expression_statement "iVar2 = (*(code *)PTR_malloc_00049560)(param_2);" (assignment_expression "iVar2 = (*(code *)PTR_malloc_00049560)(param_2)" identifier = (call_expression "(*(code *)PTR_malloc_00049560)(param_2)" (parenthesized_expression "(*(code *)PTR_malloc_00049560)" ( (pointer_expression "*(code *)PTR_malloc_00049560" * (cast_expression "(code *)PTR_malloc_00049560" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_2)" ( identifier )))) ;) (if_statement "if (iVar2 == 0) {\n      return 0;\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);" (assignment_expression "uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2)" identifier = (call_expression "(*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2)" (parenthesized_expression "(*(code *)PTR_readlink_000495b4)" ( (pointer_expression "*(code *)PTR_readlink_000495b4" * (cast_expression "(code *)PTR_readlink_000495b4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,iVar2,param_2)" ( identifier , identifier , identifier )))) ;) (if_statement "if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;" if (parenthesized_expression "(((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22))" ( (binary_expression "((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)" (parenthesized_expression "((int)uVar3 < 0)" ( (binary_expression "(int)uVar3 < 0" (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) && (parenthesized_expression "(piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)" ( (comma_expression "piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22" (assignment_expression "piVar4 = (int *)(*(code *)PTR___errno_location_00049518)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_00049518)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00049518)()" (parenthesized_expression "(*(code *)PTR___errno_location_00049518)" ( (pointer_expression "*(code *)PTR___errno_location_00049518" * (cast_expression "(code *)PTR___errno_location_00049518" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) , (binary_expression "*piVar4 != 0x22" (pointer_expression "*piVar4" * identifier) != number_literal)) ))) )) (break_statement "break;" break ;)) (if_statement "if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }" if (parenthesized_expression "(uVar3 < param_2)" ( (binary_expression "uVar3 < param_2" identifier < identifier) )) (compound_statement "{\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }" { (expression_statement "*(undefined1 *)(iVar2 + uVar3) = 0;" (assignment_expression "*(undefined1 *)(iVar2 + uVar3) = 0" (pointer_expression "*(undefined1 *)(iVar2 + uVar3)" * (cast_expression "(undefined1 *)(iVar2 + uVar3)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + uVar3)" ( (binary_expression "iVar2 + uVar3" identifier + identifier) )))) = number_literal) ;) (return_statement "return iVar2;" return identifier ;) })) (expression_statement "(*(code *)PTR_free_00049608)(iVar2);" (call_expression "(*(code *)PTR_free_00049608)(iVar2)" (parenthesized_expression "(*(code *)PTR_free_00049608)" ( (pointer_expression "*(code *)PTR_free_00049608" * (cast_expression "(code *)PTR_free_00049608" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2)" ( identifier ))) ;) (expression_statement "bVar1 = 0x7ffffffe < param_2;" (assignment_expression "bVar1 = 0x7ffffffe < param_2" identifier = (binary_expression "0x7ffffffe < param_2" number_literal < identifier)) ;) (if_statement "if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }" if (parenthesized_expression "(param_2 < 0x40000000)" ( (binary_expression "param_2 < 0x40000000" identifier < number_literal) )) (compound_statement "{\n      param_2 = param_2 << 1;\n    }" { (expression_statement "param_2 = param_2 << 1;" (assignment_expression "param_2 = param_2 << 1" identifier = (binary_expression "param_2 << 1" identifier << number_literal)) ;) }) (else_clause "else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }" else (compound_statement "{\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }" { (expression_statement "param_2 = 0x7fffffff;" (assignment_expression "param_2 = 0x7fffffff" identifier = number_literal) ;) (if_statement "if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }" if (parenthesized_expression "(bVar1)" ( identifier )) (compound_statement "{\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }" { (expression_statement "puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();" (assignment_expression "puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_00049518)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00049518)()" (parenthesized_expression "(*(code *)PTR___errno_location_00049518)" ( (pointer_expression "*(code *)PTR___errno_location_00049518" * (cast_expression "(code *)PTR___errno_location_00049518" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "*puVar5 = 0xc;" (assignment_expression "*puVar5 = 0xc" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (return_statement "return 0;" return number_literal ;) })) }))) })) (expression_statement "(*(code *)PTR_free_00049608)(iVar2);" (call_expression "(*(code *)PTR_free_00049608)(iVar2)" (parenthesized_expression "(*(code *)PTR_free_00049608)" ( (pointer_expression "*(code *)PTR_free_00049608" * (cast_expression "(code *)PTR_free_00049608" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2)" ( identifier ))) ;) (return_statement "return 0;" 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 IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }))) (while_statement while (parenthesized_expression ( BOOL )) (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 )))) ;) (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 , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) < LIT) )) && (parenthesized_expression ( (comma_expression (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 ( ))))) , (binary_expression (pointer_expression * IDENT) != LIT)) ))) )) (break_statement break ;)) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) = LIT) ;) (return_statement return 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 IDENT = (binary_expression LIT < IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT << LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( IDENT )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (return_statement return LIT ;) })) }))) })) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT ))) ;) (return_statement return LIT ;) })))
(function_definition "int areadlink_with_size(undefined4 param_1,uint param_2)\n\n{\n  bool bVar1;\n  int iVar2;\n  uint uVar3;\n  int *piVar4;\n  undefined4 *puVar5;\n  \n  if (param_2 < 0x401) {\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_2 = 0x401;\n  }\n  while( true ) {\n    iVar2 = (*(code *)PTR_malloc_00049560)(param_2);\n    if (iVar2 == 0) {\n      return 0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }\n    (*(code *)PTR_free_00049608)(iVar2);\n    bVar1 = 0x7ffffffe < param_2;\n    if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }\n  }\n  (*(code *)PTR_free_00049608)(iVar2);\n  return 0;\n}" (primitive_type "int") (function_declarator "areadlink_with_size(undefined4 param_1,uint param_2)" (identifier "areadlink_with_size") (parameter_list "(undefined4 param_1,uint param_2)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) () ")"))) (compound_statement "{\n  bool bVar1;\n  int iVar2;\n  uint uVar3;\n  int *piVar4;\n  undefined4 *puVar5;\n  \n  if (param_2 < 0x401) {\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_2 = 0x401;\n  }\n  while( true ) {\n    iVar2 = (*(code *)PTR_malloc_00049560)(param_2);\n    if (iVar2 == 0) {\n      return 0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }\n    (*(code *)PTR_free_00049608)(iVar2);\n    bVar1 = 0x7ffffffe < param_2;\n    if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }\n  }\n  (*(code *)PTR_free_00049608)(iVar2);\n  return 0;\n}" ({ "{") (declaration "bool bVar1;" (primitive_type "bool") (identifier "bVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "int *piVar4;" (primitive_type "int") (pointer_declarator "*piVar4" (* "*") (identifier "piVar4")) (; ";")) (declaration "undefined4 *puVar5;" (type_identifier "undefined4") (pointer_declarator "*puVar5" (* "*") (identifier "puVar5")) (; ";")) (if_statement "if (param_2 < 0x401) {\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_2 = 0x401;\n  }" (if "if") (parenthesized_expression "(param_2 < 0x401)" (( "(") (binary_expression "param_2 < 0x401" (identifier "param_2") (< "<") (number_literal "0x401")) () ")")) (compound_statement "{\n    param_2 = param_2 + 1;\n  }" ({ "{") (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" (identifier "param_2") (= "=") (binary_expression "param_2 + 1" (identifier "param_2") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (else_clause "else {\n    param_2 = 0x401;\n  }" (else "else") (compound_statement "{\n    param_2 = 0x401;\n  }" ({ "{") (expression_statement "param_2 = 0x401;" (assignment_expression "param_2 = 0x401" (identifier "param_2") (= "=") (number_literal "0x401")) (; ";")) (} "}")))) (while_statement "while( true ) {\n    iVar2 = (*(code *)PTR_malloc_00049560)(param_2);\n    if (iVar2 == 0) {\n      return 0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }\n    (*(code *)PTR_free_00049608)(iVar2);\n    bVar1 = 0x7ffffffe < param_2;\n    if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    iVar2 = (*(code *)PTR_malloc_00049560)(param_2);\n    if (iVar2 == 0) {\n      return 0;\n    }\n    uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);\n    if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;\n    if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }\n    (*(code *)PTR_free_00049608)(iVar2);\n    bVar1 = 0x7ffffffe < param_2;\n    if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }\n  }" ({ "{") (expression_statement "iVar2 = (*(code *)PTR_malloc_00049560)(param_2);" (assignment_expression "iVar2 = (*(code *)PTR_malloc_00049560)(param_2)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_malloc_00049560)(param_2)" (parenthesized_expression "(*(code *)PTR_malloc_00049560)" (( "(") (pointer_expression "*(code *)PTR_malloc_00049560" (* "*") (cast_expression "(code *)PTR_malloc_00049560" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_malloc_00049560"))) () ")")) (argument_list "(param_2)" (( "(") (identifier "param_2") () ")")))) (; ";")) (if_statement "if (iVar2 == 0) {\n      return 0;\n    }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      return 0;\n    }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);" (assignment_expression "uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2)" (identifier "uVar3") (= "=") (call_expression "(*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2)" (parenthesized_expression "(*(code *)PTR_readlink_000495b4)" (( "(") (pointer_expression "*(code *)PTR_readlink_000495b4" (* "*") (cast_expression "(code *)PTR_readlink_000495b4" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_readlink_000495b4"))) () ")")) (argument_list "(param_1,iVar2,param_2)" (( "(") (identifier "param_1") (, ",") (identifier "iVar2") (, ",") (identifier "param_2") () ")")))) (; ";")) (if_statement "if (((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;" (if "if") (parenthesized_expression "(((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22))" (( "(") (binary_expression "((int)uVar3 < 0) &&\n       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)" (parenthesized_expression "((int)uVar3 < 0)" (( "(") (binary_expression "(int)uVar3 < 0" (cast_expression "(int)uVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar3")) (< "<") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)" (( "(") (comma_expression "piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22" (assignment_expression "piVar4 = (int *)(*(code *)PTR___errno_location_00049518)()" (identifier "piVar4") (= "=") (cast_expression "(int *)(*(code *)PTR___errno_location_00049518)()" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___errno_location_00049518)()" (parenthesized_expression "(*(code *)PTR___errno_location_00049518)" (( "(") (pointer_expression "*(code *)PTR___errno_location_00049518" (* "*") (cast_expression "(code *)PTR___errno_location_00049518" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___errno_location_00049518"))) () ")")) (argument_list "()" (( "(") () ")"))))) (, ",") (binary_expression "*piVar4 != 0x22" (pointer_expression "*piVar4" (* "*") (identifier "piVar4")) (!= "!=") (number_literal "0x22"))) () ")"))) () ")")) (break_statement "break;" (break "break") (; ";"))) (if_statement "if (uVar3 < param_2) {\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }" (if "if") (parenthesized_expression "(uVar3 < param_2)" (( "(") (binary_expression "uVar3 < param_2" (identifier "uVar3") (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n      *(undefined1 *)(iVar2 + uVar3) = 0;\n      return iVar2;\n    }" ({ "{") (expression_statement "*(undefined1 *)(iVar2 + uVar3) = 0;" (assignment_expression "*(undefined1 *)(iVar2 + uVar3) = 0" (pointer_expression "*(undefined1 *)(iVar2 + uVar3)" (* "*") (cast_expression "(undefined1 *)(iVar2 + uVar3)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + uVar3)" (( "(") (binary_expression "iVar2 + uVar3" (identifier "iVar2") (+ "+") (identifier "uVar3")) () ")")))) (= "=") (number_literal "0")) (; ";")) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (expression_statement "(*(code *)PTR_free_00049608)(iVar2);" (call_expression "(*(code *)PTR_free_00049608)(iVar2)" (parenthesized_expression "(*(code *)PTR_free_00049608)" (( "(") (pointer_expression "*(code *)PTR_free_00049608" (* "*") (cast_expression "(code *)PTR_free_00049608" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_free_00049608"))) () ")")) (argument_list "(iVar2)" (( "(") (identifier "iVar2") () ")"))) (; ";")) (expression_statement "bVar1 = 0x7ffffffe < param_2;" (assignment_expression "bVar1 = 0x7ffffffe < param_2" (identifier "bVar1") (= "=") (binary_expression "0x7ffffffe < param_2" (number_literal "0x7ffffffe") (< "<") (identifier "param_2"))) (; ";")) (if_statement "if (param_2 < 0x40000000) {\n      param_2 = param_2 << 1;\n    }\n    else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }" (if "if") (parenthesized_expression "(param_2 < 0x40000000)" (( "(") (binary_expression "param_2 < 0x40000000" (identifier "param_2") (< "<") (number_literal "0x40000000")) () ")")) (compound_statement "{\n      param_2 = param_2 << 1;\n    }" ({ "{") (expression_statement "param_2 = param_2 << 1;" (assignment_expression "param_2 = param_2 << 1" (identifier "param_2") (= "=") (binary_expression "param_2 << 1" (identifier "param_2") (<< "<<") (number_literal "1"))) (; ";")) (} "}")) (else_clause "else {\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }" (else "else") (compound_statement "{\n      param_2 = 0x7fffffff;\n      if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }\n    }" ({ "{") (expression_statement "param_2 = 0x7fffffff;" (assignment_expression "param_2 = 0x7fffffff" (identifier "param_2") (= "=") (number_literal "0x7fffffff")) (; ";")) (if_statement "if (bVar1) {\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }" (if "if") (parenthesized_expression "(bVar1)" (( "(") (identifier "bVar1") () ")")) (compound_statement "{\n        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();\n        *puVar5 = 0xc;\n        return 0;\n      }" ({ "{") (expression_statement "puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();" (assignment_expression "puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)()" (identifier "puVar5") (= "=") (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_00049518)()" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___errno_location_00049518)()" (parenthesized_expression "(*(code *)PTR___errno_location_00049518)" (( "(") (pointer_expression "*(code *)PTR___errno_location_00049518" (* "*") (cast_expression "(code *)PTR___errno_location_00049518" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___errno_location_00049518"))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "*puVar5 = 0xc;" (assignment_expression "*puVar5 = 0xc" (pointer_expression "*puVar5" (* "*") (identifier "puVar5")) (= "=") (number_literal "0xc")) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (} "}")))) (} "}"))) (expression_statement "(*(code *)PTR_free_00049608)(iVar2);" (call_expression "(*(code *)PTR_free_00049608)(iVar2)" (parenthesized_expression "(*(code *)PTR_free_00049608)" (( "(") (pointer_expression "*(code *)PTR_free_00049608" (* "*") (cast_expression "(code *)PTR_free_00049608" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_free_00049608"))) () ")")) (argument_list "(iVar2)" (( "(") (identifier "iVar2") () ")"))) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

char * function_1(char *file,size_t var_1)

{
  bool bVar1;
  char *var_2;
  type_1 var_3;
  int *piVar4;
  type_2 *puVar5;
  type_1 var_4;
  
  if (var_1 < 0x401) {
    var_4 = var_1 + 1;
  }
  else {
    var_4 = 0x401;
  }
  while( true ) {
    var_2 = (char *)(*(type_3 *)PTR_malloc_00049560)(var_4);
    if (var_2 == (char *)0x0) {
      return (char *)0x0;
    }
    var_3 = (*(type_3 *)PTR_readlink_000495b4)(file,var_2,var_4);
    if (((int)var_3 < 0) &&
       (piVar4 = (int *)(*(type_3 *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;
    if (var_3 < var_4) {
      var_2[var_3] = '\0';
      return var_2;
    }
    (*(type_3 *)PTR_free_00049608)(var_2);
    bVar1 = 0x7ffffffe < var_4;
    if (var_4 < 0x40000000) {
      var_4 = var_4 << 1;
    }
    else {
      var_4 = 0x7fffffff;
      if (bVar1) {
        puVar5 = (type_2 *)(*(type_3 *)PTR___errno_location_00049518)();
        *puVar5 = 0xc;
        return (char *)0x0;
      }
    }
  }
  (*(type_3 *)PTR_free_00049608)(var_2);
  return (char *)0x0;
}


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

int MASKED(undefined4 param_1,uint param_2)

{
  bool bVar1;
  int iVar2;
  uint uVar3;
  int *piVar4;
  undefined4 *puVar5;
  
  if (param_2 < 0x401) {
    param_2 = param_2 + 1;
  }
  else {
    param_2 = 0x401;
  }
  while( true ) {
    iVar2 = (*(code *)PTR_malloc_00049560)(param_2);
    if (iVar2 == 0) {
      return 0;
    }
    uVar3 = (*(code *)PTR_readlink_000495b4)(param_1,iVar2,param_2);
    if (((int)uVar3 < 0) &&
       (piVar4 = (int *)(*(code *)PTR___errno_location_00049518)(), *piVar4 != 0x22)) break;
    if (uVar3 < param_2) {
      *(undefined1 *)(iVar2 + uVar3) = 0;
      return iVar2;
    }
    (*(code *)PTR_free_00049608)(iVar2);
    bVar1 = 0x7ffffffe < param_2;
    if (param_2 < 0x40000000) {
      param_2 = param_2 << 1;
    }
    else {
      param_2 = 0x7fffffff;
      if (bVar1) {
        puVar5 = (undefined4 *)(*(code *)PTR___errno_location_00049518)();
        *puVar5 = 0xc;
        return 0;
      }
    }
  }
  (*(code *)PTR_free_00049608)(iVar2);
  return 0;
}

