
BUFFERED_STREAM * fd_to_buffered_stream(int fd)

{
  int iVar1;
  int iVar2;
  char *pcVar3;
  BUFFERED_STREAM *pBVar4;
  size_t sVar5;
  undefined *puVar6;
  stat sb;
  
  iVar1 = *(int *)PTR___stack_chk_guard_0015858c;
  iVar2 = (*(code *)PTR___fxstat64_001584e8)(3,fd,&sb);
  if (iVar2 < 0) {
    (*(code *)PTR_close_001582c0)(fd);
    pBVar4 = (BUFFERED_STREAM *)0x0;
    goto LAB_000919a8;
  }
  iVar2 = (*(code *)PTR_lseek64_001584c4)(fd);
  if (iVar2 < 0) {
LAB_00091930:
    sVar5 = 1;
  }
  else {
    if (sb.st_size._0_4_ < 1) {
      if ((sb.st_size._0_4_ == 0) && (0x2000 < sb.st_size._4_4_)) {
        sb.st_size._4_4_ = 0x2000;
      }
    }
    else {
      sb.st_size._4_4_ = 0x2000;
    }
    sVar5 = sb.st_size._4_4_;
    if (sb.st_size._4_4_ == 0) goto LAB_00091930;
  }
  pcVar3 = (char *)(*(code *)PTR_xmalloc_001565b8)(sVar5);
  pBVar4 = (BUFFERED_STREAM *)(*(code *)PTR_xmalloc_001565b8)(0x18);
  if (*(int *)(PTR_pidstat_table_3077__0015656c + -0x4d00) <= fd) {
    allocate_buffers(fd);
  }
  *(BUFFERED_STREAM **)(*(int *)(PTR_pidstat_table_3077__0015656c + -0x4cfc) + fd * 4) = pBVar4;
  pBVar4->b_fd = fd;
  pBVar4->b_buffer = pcVar3;
  pBVar4->b_size = sVar5;
  pBVar4->b_flag = 0;
  pBVar4->b_inputp = 0;
  pBVar4->b_used = 0;
  if (sVar5 == 1) {
    pBVar4->b_flag = 4;
  }
LAB_000919a8:
  if (iVar1 != *(int *)PTR___stack_chk_guard_0015858c) {
    puVar6 = PTR___stack_chk_fail_0015853c;
    (*(code *)PTR___stack_chk_fail_0015853c)();
    iVar1 = (**(code **)(puVar6 + 0xc6a20))();
    if (iVar1 < 0) {
      pBVar4 = (BUFFERED_STREAM *)0x0;
    }
    else {
      pBVar4 = fd_to_buffered_stream(iVar1);
    }
    return pBVar4;
  }
  return pBVar4;
}



int * fd_to_buffered_stream(int param_1)

{
  int iVar1;
  int *piVar2;
  uint uVar3;
  undefined *puVar4;
  undefined1 auStack_c0 [56];
  int local_88;
  uint local_84;
  int local_1c;
  
  local_1c = *(int *)PTR___stack_chk_guard_0015858c;
  iVar1 = (*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0);
  if (iVar1 < 0) {
    (*(code *)PTR_close_001582c0)(param_1);
    piVar2 = (int *)0x0;
    goto LAB_000919a8;
  }
  iVar1 = (*(code *)PTR_lseek64_001584c4)(param_1);
  if (iVar1 < 0) {
LAB_00091930:
    uVar3 = 1;
  }
  else {
    if (local_88 < 1) {
      if ((local_88 == 0) && (0x2000 < local_84)) {
        local_84 = 0x2000;
      }
    }
    else {
      local_84 = 0x2000;
    }
    uVar3 = local_84;
    if (local_84 == 0) goto LAB_00091930;
  }
  iVar1 = (*(code *)PTR_xmalloc_001565b8)(uVar3);
  piVar2 = (int *)(*(code *)PTR_xmalloc_001565b8)(0x18);
  if (*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1) {
    FUN_0009118c(param_1);
  }
  *(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4) = piVar2;
  *piVar2 = param_1;
  piVar2[1] = iVar1;
  piVar2[2] = uVar3;
  piVar2[4] = 0;
  piVar2[5] = 0;
  piVar2[3] = 0;
  if (uVar3 == 1) {
    piVar2[4] = 4;
  }
LAB_000919a8:
  if (local_1c != *(int *)PTR___stack_chk_guard_0015858c) {
    puVar4 = PTR___stack_chk_fail_0015853c;
    (*(code *)PTR___stack_chk_fail_0015853c)();
    iVar1 = (**(code **)(puVar4 + 0xc6a20))();
    if (iVar1 < 0) {
      piVar2 = (int *)0x0;
    }
    else {
      piVar2 = (int *)fd_to_buffered_stream(iVar1);
    }
    return piVar2;
  }
  return piVar2;
}


lui gp,0xd
addiu gp,gp,-0x3318
addu gp,gp,t9
addiu sp,sp,-0xe0
sw ra,0xdc(sp)
sw s3,0xd8(sp)
sw s2,0xd4(sp)
sw s1,0xd0(sp)
sw s0,0xcc(sp)
sw gp,0x18(sp)
or s1,a0,zero
lw v0,-0x5fb4(gp)
lw v0,0x0(v0)
sw v0,0xc4(sp)
addiu a2,sp,0x20
or a1,a0,zero
li a0,0x3
lw t9,-0x6058(gp)
jalr t9
_nop
lw gp,0x18(sp)
bltz v0,0x000918f8
_li v0,0x1
sw v0,0x10(sp)
or a3,zero,zero
or a2,zero,zero
or a0,s1,zero
lw t9,-0x607c(gp)
jalr t9
_nop
lw gp,0x18(sp)
bltz v0,0x0009192c
_lw v0,0x58(sp)
blez v0,0x00091914
_lw s2,0x5c(sp)
li s2,0x2000
bne s2,zero,0x00091934
_or a0,s2,zero
b 0x00091930
_li s2,0x1
or a0,s1,zero
lw t9,-0x6280(gp)
jalr t9
_nop
lw gp,0x18(sp)
b 0x000919a8
_or s0,zero,zero
bne v0,zero,0x000918e8
_sltiu v0,s2,0x2001
bne v0,zero,0x000918e8
_nop
b 0x000918e8
_li s2,0x2000
li s2,0x1
or a0,s2,zero
lw t9,-0x7f88(gp)
jalr t9
_nop
lw gp,0x18(sp)
or s3,v0,zero
li a0,0x18
lw t9,-0x7f88(gp)
jalr t9
_nop
lw gp,0x18(sp)
or s0,v0,zero
lw v0,-0x7fd4(gp)
lw v0,-0x4d00(v0)
slt v0,s1,v0
beq v0,zero,0x000919d8
_or a0,s1,zero
lw v0,-0x7fd4(gp)
lw v0,-0x4cfc(v0)
sll v1,s1,0x2
addu v0,v0,v1
sw s0,0x0(v0)
sw s1,0x0(s0)
sw s3,0x4(s0)
sw s2,0x8(s0)
sw zero,0x10(s0)
sw zero,0x14(s0)
li v0,0x1
beq s2,v0,0x000919f4
_sw zero,0xc(s0)
or v0,s0,zero
lw a0,0xc4(sp)
lw v1,-0x5fb4(gp)
lw v1,0x0(v1)
bne a0,v1,0x00091a00
_lw ra,0xdc(sp)
lw s3,0xd8(sp)
lw s2,0xd4(sp)
lw s1,0xd0(sp)
lw s0,0xcc(sp)
jr ra
_addiu sp,sp,0xe0
lw t9,-0x71ec(gp)
addiu t9,t9,0x118c
bal 0x0009118c
_nop
lw gp,0x18(sp)
b 0x00091978
_lw v0,-0x7fd4(gp)
li v0,0x4
b 0x000919a8
_sw v0,0x10(s0)
lw t9,-0x6004(gp)
jalr t9
_nop
(translation_unit "int * fd_to_buffered_stream(int param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  undefined *puVar4;\n  undefined1 auStack_c0 [56];\n  int local_88;\n  uint local_84;\n  int local_1c;\n  \n  local_1c = *(int *)PTR___stack_chk_guard_0015858c;\n  iVar1 = (*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0);\n  if (iVar1 < 0) {\n    (*(code *)PTR_close_001582c0)(param_1);\n    piVar2 = (int *)0x0;\n    goto LAB_000919a8;\n  }\n  iVar1 = (*(code *)PTR_lseek64_001584c4)(param_1);\n  if (iVar1 < 0) {\nLAB_00091930:\n    uVar3 = 1;\n  }\n  else {\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }\n  iVar1 = (*(code *)PTR_xmalloc_001565b8)(uVar3);\n  piVar2 = (int *)(*(code *)PTR_xmalloc_001565b8)(0x18);\n  if (*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1) {\n    FUN_0009118c(param_1);\n  }\n  *(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4) = piVar2;\n  *piVar2 = param_1;\n  piVar2[1] = iVar1;\n  piVar2[2] = uVar3;\n  piVar2[4] = 0;\n  piVar2[5] = 0;\n  piVar2[3] = 0;\n  if (uVar3 == 1) {\n    piVar2[4] = 4;\n  }\nLAB_000919a8:\n  if (local_1c != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }\n  return piVar2;\n}\n\n" (function_definition "int * fd_to_buffered_stream(int param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  undefined *puVar4;\n  undefined1 auStack_c0 [56];\n  int local_88;\n  uint local_84;\n  int local_1c;\n  \n  local_1c = *(int *)PTR___stack_chk_guard_0015858c;\n  iVar1 = (*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0);\n  if (iVar1 < 0) {\n    (*(code *)PTR_close_001582c0)(param_1);\n    piVar2 = (int *)0x0;\n    goto LAB_000919a8;\n  }\n  iVar1 = (*(code *)PTR_lseek64_001584c4)(param_1);\n  if (iVar1 < 0) {\nLAB_00091930:\n    uVar3 = 1;\n  }\n  else {\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }\n  iVar1 = (*(code *)PTR_xmalloc_001565b8)(uVar3);\n  piVar2 = (int *)(*(code *)PTR_xmalloc_001565b8)(0x18);\n  if (*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1) {\n    FUN_0009118c(param_1);\n  }\n  *(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4) = piVar2;\n  *piVar2 = param_1;\n  piVar2[1] = iVar1;\n  piVar2[2] = uVar3;\n  piVar2[4] = 0;\n  piVar2[5] = 0;\n  piVar2[3] = 0;\n  if (uVar3 == 1) {\n    piVar2[4] = 4;\n  }\nLAB_000919a8:\n  if (local_1c != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }\n  return piVar2;\n}" primitive_type (pointer_declarator "* fd_to_buffered_stream(int param_1)" * (function_declarator "fd_to_buffered_stream(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) )))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  undefined *puVar4;\n  undefined1 auStack_c0 [56];\n  int local_88;\n  uint local_84;\n  int local_1c;\n  \n  local_1c = *(int *)PTR___stack_chk_guard_0015858c;\n  iVar1 = (*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0);\n  if (iVar1 < 0) {\n    (*(code *)PTR_close_001582c0)(param_1);\n    piVar2 = (int *)0x0;\n    goto LAB_000919a8;\n  }\n  iVar1 = (*(code *)PTR_lseek64_001584c4)(param_1);\n  if (iVar1 < 0) {\nLAB_00091930:\n    uVar3 = 1;\n  }\n  else {\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }\n  iVar1 = (*(code *)PTR_xmalloc_001565b8)(uVar3);\n  piVar2 = (int *)(*(code *)PTR_xmalloc_001565b8)(0x18);\n  if (*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1) {\n    FUN_0009118c(param_1);\n  }\n  *(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4) = piVar2;\n  *piVar2 = param_1;\n  piVar2[1] = iVar1;\n  piVar2[2] = uVar3;\n  piVar2[4] = 0;\n  piVar2[5] = 0;\n  piVar2[3] = 0;\n  if (uVar3 == 1) {\n    piVar2[4] = 4;\n  }\nLAB_000919a8:\n  if (local_1c != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }\n  return piVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "undefined *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "undefined1 auStack_c0 [56];" type_identifier (array_declarator "auStack_c0 [56]" identifier [ number_literal ]) ;) (declaration "int local_88;" primitive_type identifier ;) (declaration "uint local_84;" type_identifier identifier ;) (declaration "int local_1c;" primitive_type identifier ;) (expression_statement "local_1c = *(int *)PTR___stack_chk_guard_0015858c;" (assignment_expression "local_1c = *(int *)PTR___stack_chk_guard_0015858c" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_0015858c" * (cast_expression "(int *)PTR___stack_chk_guard_0015858c" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar1 = (*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0);" (assignment_expression "iVar1 = (*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0)" identifier = (call_expression "(*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0)" (parenthesized_expression "(*(code *)PTR___fxstat64_001584e8)" ( (pointer_expression "*(code *)PTR___fxstat64_001584e8" * (cast_expression "(code *)PTR___fxstat64_001584e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(3,param_1,auStack_c0)" ( number_literal , identifier , identifier )))) ;) (if_statement "if (iVar1 < 0) {\n    (*(code *)PTR_close_001582c0)(param_1);\n    piVar2 = (int *)0x0;\n    goto LAB_000919a8;\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    (*(code *)PTR_close_001582c0)(param_1);\n    piVar2 = (int *)0x0;\n    goto LAB_000919a8;\n  }" { (expression_statement "(*(code *)PTR_close_001582c0)(param_1);" (call_expression "(*(code *)PTR_close_001582c0)(param_1)" (parenthesized_expression "(*(code *)PTR_close_001582c0)" ( (pointer_expression "*(code *)PTR_close_001582c0" * (cast_expression "(code *)PTR_close_001582c0" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1)" ( identifier ))) ;) (expression_statement "piVar2 = (int *)0x0;" (assignment_expression "piVar2 = (int *)0x0" identifier = (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (goto_statement "goto LAB_000919a8;" goto statement_identifier ;) })) (expression_statement "iVar1 = (*(code *)PTR_lseek64_001584c4)(param_1);" (assignment_expression "iVar1 = (*(code *)PTR_lseek64_001584c4)(param_1)" identifier = (call_expression "(*(code *)PTR_lseek64_001584c4)(param_1)" (parenthesized_expression "(*(code *)PTR_lseek64_001584c4)" ( (pointer_expression "*(code *)PTR_lseek64_001584c4" * (cast_expression "(code *)PTR_lseek64_001584c4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 < 0) {\nLAB_00091930:\n    uVar3 = 1;\n  }\n  else {\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\nLAB_00091930:\n    uVar3 = 1;\n  }" { (labeled_statement "LAB_00091930:\n    uVar3 = 1;" statement_identifier : (expression_statement "uVar3 = 1;" (assignment_expression "uVar3 = 1" identifier = number_literal) ;)) }) (else_clause "else {\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }" else (compound_statement "{\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }" { (if_statement "if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }" if (parenthesized_expression "(local_88 < 1)" ( (binary_expression "local_88 < 1" identifier < number_literal) )) (compound_statement "{\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }" { (if_statement "if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }" if (parenthesized_expression "((local_88 == 0) && (0x2000 < local_84))" ( (binary_expression "(local_88 == 0) && (0x2000 < local_84)" (parenthesized_expression "(local_88 == 0)" ( (binary_expression "local_88 == 0" identifier == number_literal) )) && (parenthesized_expression "(0x2000 < local_84)" ( (binary_expression "0x2000 < local_84" number_literal < identifier) ))) )) (compound_statement "{\n        local_84 = 0x2000;\n      }" { (expression_statement "local_84 = 0x2000;" (assignment_expression "local_84 = 0x2000" identifier = number_literal) ;) })) }) (else_clause "else {\n      local_84 = 0x2000;\n    }" else (compound_statement "{\n      local_84 = 0x2000;\n    }" { (expression_statement "local_84 = 0x2000;" (assignment_expression "local_84 = 0x2000" identifier = number_literal) ;) }))) (expression_statement "uVar3 = local_84;" (assignment_expression "uVar3 = local_84" identifier = identifier) ;) (if_statement "if (local_84 == 0) goto LAB_00091930;" if (parenthesized_expression "(local_84 == 0)" ( (binary_expression "local_84 == 0" identifier == number_literal) )) (goto_statement "goto LAB_00091930;" goto statement_identifier ;)) }))) (expression_statement "iVar1 = (*(code *)PTR_xmalloc_001565b8)(uVar3);" (assignment_expression "iVar1 = (*(code *)PTR_xmalloc_001565b8)(uVar3)" identifier = (call_expression "(*(code *)PTR_xmalloc_001565b8)(uVar3)" (parenthesized_expression "(*(code *)PTR_xmalloc_001565b8)" ( (pointer_expression "*(code *)PTR_xmalloc_001565b8" * (cast_expression "(code *)PTR_xmalloc_001565b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(uVar3)" ( identifier )))) ;) (expression_statement "piVar2 = (int *)(*(code *)PTR_xmalloc_001565b8)(0x18);" (assignment_expression "piVar2 = (int *)(*(code *)PTR_xmalloc_001565b8)(0x18)" identifier = (cast_expression "(int *)(*(code *)PTR_xmalloc_001565b8)(0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_xmalloc_001565b8)(0x18)" (parenthesized_expression "(*(code *)PTR_xmalloc_001565b8)" ( (pointer_expression "*(code *)PTR_xmalloc_001565b8" * (cast_expression "(code *)PTR_xmalloc_001565b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0x18)" ( number_literal ))))) ;) (if_statement "if (*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1) {\n    FUN_0009118c(param_1);\n  }" if (parenthesized_expression "(*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1)" ( (binary_expression "*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1" (pointer_expression "*(int *)(PTR_DAT_0015656c + -0x4d00)" * (cast_expression "(int *)(PTR_DAT_0015656c + -0x4d00)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_DAT_0015656c + -0x4d00)" ( (binary_expression "PTR_DAT_0015656c + -0x4d00" identifier + number_literal) )))) <= identifier) )) (compound_statement "{\n    FUN_0009118c(param_1);\n  }" { (expression_statement "FUN_0009118c(param_1);" (call_expression "FUN_0009118c(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) })) (expression_statement "*(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4) = piVar2;" (assignment_expression "*(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4) = piVar2" (pointer_expression "*(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4)" * (cast_expression "(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4)" ( (binary_expression "*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4" (pointer_expression "*(int *)(PTR_DAT_0015656c + -0x4cfc)" * (cast_expression "(int *)(PTR_DAT_0015656c + -0x4cfc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_DAT_0015656c + -0x4cfc)" ( (binary_expression "PTR_DAT_0015656c + -0x4cfc" identifier + number_literal) )))) + (binary_expression "param_1 * 4" identifier * number_literal)) )))) = identifier) ;) (expression_statement "*piVar2 = param_1;" (assignment_expression "*piVar2 = param_1" (pointer_expression "*piVar2" * identifier) = identifier) ;) (expression_statement "piVar2[1] = iVar1;" (assignment_expression "piVar2[1] = iVar1" (subscript_expression "piVar2[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar2[2] = uVar3;" (assignment_expression "piVar2[2] = uVar3" (subscript_expression "piVar2[2]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar2[4] = 0;" (assignment_expression "piVar2[4] = 0" (subscript_expression "piVar2[4]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar2[5] = 0;" (assignment_expression "piVar2[5] = 0" (subscript_expression "piVar2[5]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar2[3] = 0;" (assignment_expression "piVar2[3] = 0" (subscript_expression "piVar2[3]" identifier [ number_literal ]) = number_literal) ;) (if_statement "if (uVar3 == 1) {\n    piVar2[4] = 4;\n  }" if (parenthesized_expression "(uVar3 == 1)" ( (binary_expression "uVar3 == 1" identifier == number_literal) )) (compound_statement "{\n    piVar2[4] = 4;\n  }" { (expression_statement "piVar2[4] = 4;" (assignment_expression "piVar2[4] = 4" (subscript_expression "piVar2[4]" identifier [ number_literal ]) = number_literal) ;) })) (labeled_statement "LAB_000919a8:\n  if (local_1c != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }" statement_identifier : (if_statement "if (local_1c != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }" if (parenthesized_expression "(local_1c != *(int *)PTR___stack_chk_guard_0015858c)" ( (binary_expression "local_1c != *(int *)PTR___stack_chk_guard_0015858c" identifier != (pointer_expression "*(int *)PTR___stack_chk_guard_0015858c" * (cast_expression "(int *)PTR___stack_chk_guard_0015858c" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }" { (expression_statement "puVar4 = PTR___stack_chk_fail_0015853c;" (assignment_expression "puVar4 = PTR___stack_chk_fail_0015853c" identifier = identifier) ;) (expression_statement "(*(code *)PTR___stack_chk_fail_0015853c)();" (call_expression "(*(code *)PTR___stack_chk_fail_0015853c)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0015853c)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_0015853c" * (cast_expression "(code *)PTR___stack_chk_fail_0015853c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "iVar1 = (**(code **)(puVar4 + 0xc6a20))();" (assignment_expression "iVar1 = (**(code **)(puVar4 + 0xc6a20))()" identifier = (call_expression "(**(code **)(puVar4 + 0xc6a20))()" (parenthesized_expression "(**(code **)(puVar4 + 0xc6a20))" ( (pointer_expression "**(code **)(puVar4 + 0xc6a20)" * (pointer_expression "*(code **)(puVar4 + 0xc6a20)" * (cast_expression "(code **)(puVar4 + 0xc6a20)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar4 + 0xc6a20)" ( (binary_expression "puVar4 + 0xc6a20" identifier + number_literal) ))))) )) (argument_list "()" ( )))) ;) (if_statement "if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      piVar2 = (int *)0x0;\n    }" { (expression_statement "piVar2 = (int *)0x0;" (assignment_expression "piVar2 = (int *)0x0" identifier = (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }) (else_clause "else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }" else (compound_statement "{\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }" { (expression_statement "piVar2 = (int *)fd_to_buffered_stream(iVar1);" (assignment_expression "piVar2 = (int *)fd_to_buffered_stream(iVar1)" identifier = (cast_expression "(int *)fd_to_buffered_stream(iVar1)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "fd_to_buffered_stream(iVar1)" identifier (argument_list "(iVar1)" ( identifier ))))) ;) }))) (return_statement "return piVar2;" return identifier ;) }))) (return_statement "return piVar2;" return identifier ;) })))
(translation_unit "BUFFERED_STREAM * fd_to_buffered_stream(int fd)\n\n{\n  int iVar1;\n  int iVar2;\n  char *pcVar3;\n  BUFFERED_STREAM *pBVar4;\n  size_t sVar5;\n  undefined *puVar6;\n  stat sb;\n  \n  iVar1 = *(int *)PTR___stack_chk_guard_0015858c;\n  iVar2 = (*(code *)PTR___fxstat64_001584e8)(3,fd,&sb);\n  if (iVar2 < 0) {\n    (*(code *)PTR_close_001582c0)(fd);\n    pBVar4 = (BUFFERED_STREAM *)0x0;\n    goto LAB_000919a8;\n  }\n  iVar2 = (*(code *)PTR_lseek64_001584c4)(fd);\n  if (iVar2 < 0) {\nLAB_00091930:\n    sVar5 = 1;\n  }\n  else {\n    if (sb.st_size._0_4_ < 1) {\n      if ((sb.st_size._0_4_ == 0) && (0x2000 < sb.st_size._4_4_)) {\n        sb.st_size._4_4_ = 0x2000;\n      }\n    }\n    else {\n      sb.st_size._4_4_ = 0x2000;\n    }\n    sVar5 = sb.st_size._4_4_;\n    if (sb.st_size._4_4_ == 0) goto LAB_00091930;\n  }\n  pcVar3 = (char *)(*(code *)PTR_xmalloc_001565b8)(sVar5);\n  pBVar4 = (BUFFERED_STREAM *)(*(code *)PTR_xmalloc_001565b8)(0x18);\n  if (*(int *)(PTR_pidstat_table_3077__0015656c + -0x4d00) <= fd) {\n    allocate_buffers(fd);\n  }\n  *(BUFFERED_STREAM **)(*(int *)(PTR_pidstat_table_3077__0015656c + -0x4cfc) + fd * 4) = pBVar4;\n  pBVar4->b_fd = fd;\n  pBVar4->b_buffer = pcVar3;\n  pBVar4->b_size = sVar5;\n  pBVar4->b_flag = 0;\n  pBVar4->b_inputp = 0;\n  pBVar4->b_used = 0;\n  if (sVar5 == 1) {\n    pBVar4->b_flag = 4;\n  }\nLAB_000919a8:\n  if (iVar1 != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar6 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar6 + 0xc6a20))();\n    if (iVar1 < 0) {\n      pBVar4 = (BUFFERED_STREAM *)0x0;\n    }\n    else {\n      pBVar4 = fd_to_buffered_stream(iVar1);\n    }\n    return pBVar4;\n  }\n  return pBVar4;\n}\n\n" (function_definition "BUFFERED_STREAM * fd_to_buffered_stream(int fd)\n\n{\n  int iVar1;\n  int iVar2;\n  char *pcVar3;\n  BUFFERED_STREAM *pBVar4;\n  size_t sVar5;\n  undefined *puVar6;\n  stat sb;\n  \n  iVar1 = *(int *)PTR___stack_chk_guard_0015858c;\n  iVar2 = (*(code *)PTR___fxstat64_001584e8)(3,fd,&sb);\n  if (iVar2 < 0) {\n    (*(code *)PTR_close_001582c0)(fd);\n    pBVar4 = (BUFFERED_STREAM *)0x0;\n    goto LAB_000919a8;\n  }\n  iVar2 = (*(code *)PTR_lseek64_001584c4)(fd);\n  if (iVar2 < 0) {\nLAB_00091930:\n    sVar5 = 1;\n  }\n  else {\n    if (sb.st_size._0_4_ < 1) {\n      if ((sb.st_size._0_4_ == 0) && (0x2000 < sb.st_size._4_4_)) {\n        sb.st_size._4_4_ = 0x2000;\n      }\n    }\n    else {\n      sb.st_size._4_4_ = 0x2000;\n    }\n    sVar5 = sb.st_size._4_4_;\n    if (sb.st_size._4_4_ == 0) goto LAB_00091930;\n  }\n  pcVar3 = (char *)(*(code *)PTR_xmalloc_001565b8)(sVar5);\n  pBVar4 = (BUFFERED_STREAM *)(*(code *)PTR_xmalloc_001565b8)(0x18);\n  if (*(int *)(PTR_pidstat_table_3077__0015656c + -0x4d00) <= fd) {\n    allocate_buffers(fd);\n  }\n  *(BUFFERED_STREAM **)(*(int *)(PTR_pidstat_table_3077__0015656c + -0x4cfc) + fd * 4) = pBVar4;\n  pBVar4->b_fd = fd;\n  pBVar4->b_buffer = pcVar3;\n  pBVar4->b_size = sVar5;\n  pBVar4->b_flag = 0;\n  pBVar4->b_inputp = 0;\n  pBVar4->b_used = 0;\n  if (sVar5 == 1) {\n    pBVar4->b_flag = 4;\n  }\nLAB_000919a8:\n  if (iVar1 != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar6 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar6 + 0xc6a20))();\n    if (iVar1 < 0) {\n      pBVar4 = (BUFFERED_STREAM *)0x0;\n    }\n    else {\n      pBVar4 = fd_to_buffered_stream(iVar1);\n    }\n    return pBVar4;\n  }\n  return pBVar4;\n}" type_identifier (pointer_declarator "* fd_to_buffered_stream(int fd)" * (function_declarator "fd_to_buffered_stream(int fd)" identifier (parameter_list "(int fd)" ( (parameter_declaration "int fd" primitive_type identifier) )))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  char *pcVar3;\n  BUFFERED_STREAM *pBVar4;\n  size_t sVar5;\n  undefined *puVar6;\n  stat sb;\n  \n  iVar1 = *(int *)PTR___stack_chk_guard_0015858c;\n  iVar2 = (*(code *)PTR___fxstat64_001584e8)(3,fd,&sb);\n  if (iVar2 < 0) {\n    (*(code *)PTR_close_001582c0)(fd);\n    pBVar4 = (BUFFERED_STREAM *)0x0;\n    goto LAB_000919a8;\n  }\n  iVar2 = (*(code *)PTR_lseek64_001584c4)(fd);\n  if (iVar2 < 0) {\nLAB_00091930:\n    sVar5 = 1;\n  }\n  else {\n    if (sb.st_size._0_4_ < 1) {\n      if ((sb.st_size._0_4_ == 0) && (0x2000 < sb.st_size._4_4_)) {\n        sb.st_size._4_4_ = 0x2000;\n      }\n    }\n    else {\n      sb.st_size._4_4_ = 0x2000;\n    }\n    sVar5 = sb.st_size._4_4_;\n    if (sb.st_size._4_4_ == 0) goto LAB_00091930;\n  }\n  pcVar3 = (char *)(*(code *)PTR_xmalloc_001565b8)(sVar5);\n  pBVar4 = (BUFFERED_STREAM *)(*(code *)PTR_xmalloc_001565b8)(0x18);\n  if (*(int *)(PTR_pidstat_table_3077__0015656c + -0x4d00) <= fd) {\n    allocate_buffers(fd);\n  }\n  *(BUFFERED_STREAM **)(*(int *)(PTR_pidstat_table_3077__0015656c + -0x4cfc) + fd * 4) = pBVar4;\n  pBVar4->b_fd = fd;\n  pBVar4->b_buffer = pcVar3;\n  pBVar4->b_size = sVar5;\n  pBVar4->b_flag = 0;\n  pBVar4->b_inputp = 0;\n  pBVar4->b_used = 0;\n  if (sVar5 == 1) {\n    pBVar4->b_flag = 4;\n  }\nLAB_000919a8:\n  if (iVar1 != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar6 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar6 + 0xc6a20))();\n    if (iVar1 < 0) {\n      pBVar4 = (BUFFERED_STREAM *)0x0;\n    }\n    else {\n      pBVar4 = fd_to_buffered_stream(iVar1);\n    }\n    return pBVar4;\n  }\n  return pBVar4;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "BUFFERED_STREAM *pBVar4;" type_identifier (pointer_declarator "*pBVar4" * identifier) ;) (declaration "size_t sVar5;" primitive_type identifier ;) (declaration "undefined *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "stat sb;" type_identifier identifier ;) (expression_statement "iVar1 = *(int *)PTR___stack_chk_guard_0015858c;" (assignment_expression "iVar1 = *(int *)PTR___stack_chk_guard_0015858c" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_0015858c" * (cast_expression "(int *)PTR___stack_chk_guard_0015858c" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar2 = (*(code *)PTR___fxstat64_001584e8)(3,fd,&sb);" (assignment_expression "iVar2 = (*(code *)PTR___fxstat64_001584e8)(3,fd,&sb)" identifier = (call_expression "(*(code *)PTR___fxstat64_001584e8)(3,fd,&sb)" (parenthesized_expression "(*(code *)PTR___fxstat64_001584e8)" ( (pointer_expression "*(code *)PTR___fxstat64_001584e8" * (cast_expression "(code *)PTR___fxstat64_001584e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(3,fd,&sb)" ( number_literal , identifier , (pointer_expression "&sb" & identifier) )))) ;) (if_statement "if (iVar2 < 0) {\n    (*(code *)PTR_close_001582c0)(fd);\n    pBVar4 = (BUFFERED_STREAM *)0x0;\n    goto LAB_000919a8;\n  }" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (compound_statement "{\n    (*(code *)PTR_close_001582c0)(fd);\n    pBVar4 = (BUFFERED_STREAM *)0x0;\n    goto LAB_000919a8;\n  }" { (expression_statement "(*(code *)PTR_close_001582c0)(fd);" (call_expression "(*(code *)PTR_close_001582c0)(fd)" (parenthesized_expression "(*(code *)PTR_close_001582c0)" ( (pointer_expression "*(code *)PTR_close_001582c0" * (cast_expression "(code *)PTR_close_001582c0" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(fd)" ( identifier ))) ;) (expression_statement "pBVar4 = (BUFFERED_STREAM *)0x0;" (assignment_expression "pBVar4 = (BUFFERED_STREAM *)0x0" identifier = (cast_expression "(BUFFERED_STREAM *)0x0" ( (type_descriptor "BUFFERED_STREAM *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (goto_statement "goto LAB_000919a8;" goto statement_identifier ;) })) (expression_statement "iVar2 = (*(code *)PTR_lseek64_001584c4)(fd);" (assignment_expression "iVar2 = (*(code *)PTR_lseek64_001584c4)(fd)" identifier = (call_expression "(*(code *)PTR_lseek64_001584c4)(fd)" (parenthesized_expression "(*(code *)PTR_lseek64_001584c4)" ( (pointer_expression "*(code *)PTR_lseek64_001584c4" * (cast_expression "(code *)PTR_lseek64_001584c4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(fd)" ( identifier )))) ;) (if_statement "if (iVar2 < 0) {\nLAB_00091930:\n    sVar5 = 1;\n  }\n  else {\n    if (sb.st_size._0_4_ < 1) {\n      if ((sb.st_size._0_4_ == 0) && (0x2000 < sb.st_size._4_4_)) {\n        sb.st_size._4_4_ = 0x2000;\n      }\n    }\n    else {\n      sb.st_size._4_4_ = 0x2000;\n    }\n    sVar5 = sb.st_size._4_4_;\n    if (sb.st_size._4_4_ == 0) goto LAB_00091930;\n  }" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (compound_statement "{\nLAB_00091930:\n    sVar5 = 1;\n  }" { (labeled_statement "LAB_00091930:\n    sVar5 = 1;" statement_identifier : (expression_statement "sVar5 = 1;" (assignment_expression "sVar5 = 1" identifier = number_literal) ;)) }) (else_clause "else {\n    if (sb.st_size._0_4_ < 1) {\n      if ((sb.st_size._0_4_ == 0) && (0x2000 < sb.st_size._4_4_)) {\n        sb.st_size._4_4_ = 0x2000;\n      }\n    }\n    else {\n      sb.st_size._4_4_ = 0x2000;\n    }\n    sVar5 = sb.st_size._4_4_;\n    if (sb.st_size._4_4_ == 0) goto LAB_00091930;\n  }" else (compound_statement "{\n    if (sb.st_size._0_4_ < 1) {\n      if ((sb.st_size._0_4_ == 0) && (0x2000 < sb.st_size._4_4_)) {\n        sb.st_size._4_4_ = 0x2000;\n      }\n    }\n    else {\n      sb.st_size._4_4_ = 0x2000;\n    }\n    sVar5 = sb.st_size._4_4_;\n    if (sb.st_size._4_4_ == 0) goto LAB_00091930;\n  }" { (if_statement "if (sb.st_size._0_4_ < 1) {\n      if ((sb.st_size._0_4_ == 0) && (0x2000 < sb.st_size._4_4_)) {\n        sb.st_size._4_4_ = 0x2000;\n      }\n    }\n    else {\n      sb.st_size._4_4_ = 0x2000;\n    }" if (parenthesized_expression "(sb.st_size._0_4_ < 1)" ( (binary_expression "sb.st_size._0_4_ < 1" (field_expression "sb.st_size._0_4_" (field_expression "sb.st_size" identifier . field_identifier) . field_identifier) < number_literal) )) (compound_statement "{\n      if ((sb.st_size._0_4_ == 0) && (0x2000 < sb.st_size._4_4_)) {\n        sb.st_size._4_4_ = 0x2000;\n      }\n    }" { (if_statement "if ((sb.st_size._0_4_ == 0) && (0x2000 < sb.st_size._4_4_)) {\n        sb.st_size._4_4_ = 0x2000;\n      }" if (parenthesized_expression "((sb.st_size._0_4_ == 0) && (0x2000 < sb.st_size._4_4_))" ( (binary_expression "(sb.st_size._0_4_ == 0) && (0x2000 < sb.st_size._4_4_)" (parenthesized_expression "(sb.st_size._0_4_ == 0)" ( (binary_expression "sb.st_size._0_4_ == 0" (field_expression "sb.st_size._0_4_" (field_expression "sb.st_size" identifier . field_identifier) . field_identifier) == number_literal) )) && (parenthesized_expression "(0x2000 < sb.st_size._4_4_)" ( (binary_expression "0x2000 < sb.st_size._4_4_" number_literal < (field_expression "sb.st_size._4_4_" (field_expression "sb.st_size" identifier . field_identifier) . field_identifier)) ))) )) (compound_statement "{\n        sb.st_size._4_4_ = 0x2000;\n      }" { (expression_statement "sb.st_size._4_4_ = 0x2000;" (assignment_expression "sb.st_size._4_4_ = 0x2000" (field_expression "sb.st_size._4_4_" (field_expression "sb.st_size" identifier . field_identifier) . field_identifier) = number_literal) ;) })) }) (else_clause "else {\n      sb.st_size._4_4_ = 0x2000;\n    }" else (compound_statement "{\n      sb.st_size._4_4_ = 0x2000;\n    }" { (expression_statement "sb.st_size._4_4_ = 0x2000;" (assignment_expression "sb.st_size._4_4_ = 0x2000" (field_expression "sb.st_size._4_4_" (field_expression "sb.st_size" identifier . field_identifier) . field_identifier) = number_literal) ;) }))) (expression_statement "sVar5 = sb.st_size._4_4_;" (assignment_expression "sVar5 = sb.st_size._4_4_" identifier = (field_expression "sb.st_size._4_4_" (field_expression "sb.st_size" identifier . field_identifier) . field_identifier)) ;) (if_statement "if (sb.st_size._4_4_ == 0) goto LAB_00091930;" if (parenthesized_expression "(sb.st_size._4_4_ == 0)" ( (binary_expression "sb.st_size._4_4_ == 0" (field_expression "sb.st_size._4_4_" (field_expression "sb.st_size" identifier . field_identifier) . field_identifier) == number_literal) )) (goto_statement "goto LAB_00091930;" goto statement_identifier ;)) }))) (expression_statement "pcVar3 = (char *)(*(code *)PTR_xmalloc_001565b8)(sVar5);" (assignment_expression "pcVar3 = (char *)(*(code *)PTR_xmalloc_001565b8)(sVar5)" identifier = (cast_expression "(char *)(*(code *)PTR_xmalloc_001565b8)(sVar5)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_xmalloc_001565b8)(sVar5)" (parenthesized_expression "(*(code *)PTR_xmalloc_001565b8)" ( (pointer_expression "*(code *)PTR_xmalloc_001565b8" * (cast_expression "(code *)PTR_xmalloc_001565b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(sVar5)" ( identifier ))))) ;) (expression_statement "pBVar4 = (BUFFERED_STREAM *)(*(code *)PTR_xmalloc_001565b8)(0x18);" (assignment_expression "pBVar4 = (BUFFERED_STREAM *)(*(code *)PTR_xmalloc_001565b8)(0x18)" identifier = (cast_expression "(BUFFERED_STREAM *)(*(code *)PTR_xmalloc_001565b8)(0x18)" ( (type_descriptor "BUFFERED_STREAM *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_xmalloc_001565b8)(0x18)" (parenthesized_expression "(*(code *)PTR_xmalloc_001565b8)" ( (pointer_expression "*(code *)PTR_xmalloc_001565b8" * (cast_expression "(code *)PTR_xmalloc_001565b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0x18)" ( number_literal ))))) ;) (if_statement "if (*(int *)(PTR_pidstat_table_3077__0015656c + -0x4d00) <= fd) {\n    allocate_buffers(fd);\n  }" if (parenthesized_expression "(*(int *)(PTR_pidstat_table_3077__0015656c + -0x4d00) <= fd)" ( (binary_expression "*(int *)(PTR_pidstat_table_3077__0015656c + -0x4d00) <= fd" (pointer_expression "*(int *)(PTR_pidstat_table_3077__0015656c + -0x4d00)" * (cast_expression "(int *)(PTR_pidstat_table_3077__0015656c + -0x4d00)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_pidstat_table_3077__0015656c + -0x4d00)" ( (binary_expression "PTR_pidstat_table_3077__0015656c + -0x4d00" identifier + number_literal) )))) <= identifier) )) (compound_statement "{\n    allocate_buffers(fd);\n  }" { (expression_statement "allocate_buffers(fd);" (call_expression "allocate_buffers(fd)" identifier (argument_list "(fd)" ( identifier ))) ;) })) (expression_statement "*(BUFFERED_STREAM **)(*(int *)(PTR_pidstat_table_3077__0015656c + -0x4cfc) + fd * 4) = pBVar4;" (assignment_expression "*(BUFFERED_STREAM **)(*(int *)(PTR_pidstat_table_3077__0015656c + -0x4cfc) + fd * 4) = pBVar4" (pointer_expression "*(BUFFERED_STREAM **)(*(int *)(PTR_pidstat_table_3077__0015656c + -0x4cfc) + fd * 4)" * (cast_expression "(BUFFERED_STREAM **)(*(int *)(PTR_pidstat_table_3077__0015656c + -0x4cfc) + fd * 4)" ( (type_descriptor "BUFFERED_STREAM **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)(PTR_pidstat_table_3077__0015656c + -0x4cfc) + fd * 4)" ( (binary_expression "*(int *)(PTR_pidstat_table_3077__0015656c + -0x4cfc) + fd * 4" (pointer_expression "*(int *)(PTR_pidstat_table_3077__0015656c + -0x4cfc)" * (cast_expression "(int *)(PTR_pidstat_table_3077__0015656c + -0x4cfc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_pidstat_table_3077__0015656c + -0x4cfc)" ( (binary_expression "PTR_pidstat_table_3077__0015656c + -0x4cfc" identifier + number_literal) )))) + (binary_expression "fd * 4" identifier * number_literal)) )))) = identifier) ;) (expression_statement "pBVar4->b_fd = fd;" (assignment_expression "pBVar4->b_fd = fd" (field_expression "pBVar4->b_fd" identifier -> field_identifier) = identifier) ;) (expression_statement "pBVar4->b_buffer = pcVar3;" (assignment_expression "pBVar4->b_buffer = pcVar3" (field_expression "pBVar4->b_buffer" identifier -> field_identifier) = identifier) ;) (expression_statement "pBVar4->b_size = sVar5;" (assignment_expression "pBVar4->b_size = sVar5" (field_expression "pBVar4->b_size" identifier -> field_identifier) = identifier) ;) (expression_statement "pBVar4->b_flag = 0;" (assignment_expression "pBVar4->b_flag = 0" (field_expression "pBVar4->b_flag" identifier -> field_identifier) = number_literal) ;) (expression_statement "pBVar4->b_inputp = 0;" (assignment_expression "pBVar4->b_inputp = 0" (field_expression "pBVar4->b_inputp" identifier -> field_identifier) = number_literal) ;) (expression_statement "pBVar4->b_used = 0;" (assignment_expression "pBVar4->b_used = 0" (field_expression "pBVar4->b_used" identifier -> field_identifier) = number_literal) ;) (if_statement "if (sVar5 == 1) {\n    pBVar4->b_flag = 4;\n  }" if (parenthesized_expression "(sVar5 == 1)" ( (binary_expression "sVar5 == 1" identifier == number_literal) )) (compound_statement "{\n    pBVar4->b_flag = 4;\n  }" { (expression_statement "pBVar4->b_flag = 4;" (assignment_expression "pBVar4->b_flag = 4" (field_expression "pBVar4->b_flag" identifier -> field_identifier) = number_literal) ;) })) (labeled_statement "LAB_000919a8:\n  if (iVar1 != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar6 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar6 + 0xc6a20))();\n    if (iVar1 < 0) {\n      pBVar4 = (BUFFERED_STREAM *)0x0;\n    }\n    else {\n      pBVar4 = fd_to_buffered_stream(iVar1);\n    }\n    return pBVar4;\n  }" statement_identifier : (if_statement "if (iVar1 != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar6 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar6 + 0xc6a20))();\n    if (iVar1 < 0) {\n      pBVar4 = (BUFFERED_STREAM *)0x0;\n    }\n    else {\n      pBVar4 = fd_to_buffered_stream(iVar1);\n    }\n    return pBVar4;\n  }" if (parenthesized_expression "(iVar1 != *(int *)PTR___stack_chk_guard_0015858c)" ( (binary_expression "iVar1 != *(int *)PTR___stack_chk_guard_0015858c" identifier != (pointer_expression "*(int *)PTR___stack_chk_guard_0015858c" * (cast_expression "(int *)PTR___stack_chk_guard_0015858c" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    puVar6 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar6 + 0xc6a20))();\n    if (iVar1 < 0) {\n      pBVar4 = (BUFFERED_STREAM *)0x0;\n    }\n    else {\n      pBVar4 = fd_to_buffered_stream(iVar1);\n    }\n    return pBVar4;\n  }" { (expression_statement "puVar6 = PTR___stack_chk_fail_0015853c;" (assignment_expression "puVar6 = PTR___stack_chk_fail_0015853c" identifier = identifier) ;) (expression_statement "(*(code *)PTR___stack_chk_fail_0015853c)();" (call_expression "(*(code *)PTR___stack_chk_fail_0015853c)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0015853c)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_0015853c" * (cast_expression "(code *)PTR___stack_chk_fail_0015853c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "iVar1 = (**(code **)(puVar6 + 0xc6a20))();" (assignment_expression "iVar1 = (**(code **)(puVar6 + 0xc6a20))()" identifier = (call_expression "(**(code **)(puVar6 + 0xc6a20))()" (parenthesized_expression "(**(code **)(puVar6 + 0xc6a20))" ( (pointer_expression "**(code **)(puVar6 + 0xc6a20)" * (pointer_expression "*(code **)(puVar6 + 0xc6a20)" * (cast_expression "(code **)(puVar6 + 0xc6a20)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar6 + 0xc6a20)" ( (binary_expression "puVar6 + 0xc6a20" identifier + number_literal) ))))) )) (argument_list "()" ( )))) ;) (if_statement "if (iVar1 < 0) {\n      pBVar4 = (BUFFERED_STREAM *)0x0;\n    }\n    else {\n      pBVar4 = fd_to_buffered_stream(iVar1);\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      pBVar4 = (BUFFERED_STREAM *)0x0;\n    }" { (expression_statement "pBVar4 = (BUFFERED_STREAM *)0x0;" (assignment_expression "pBVar4 = (BUFFERED_STREAM *)0x0" identifier = (cast_expression "(BUFFERED_STREAM *)0x0" ( (type_descriptor "BUFFERED_STREAM *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }) (else_clause "else {\n      pBVar4 = fd_to_buffered_stream(iVar1);\n    }" else (compound_statement "{\n      pBVar4 = fd_to_buffered_stream(iVar1);\n    }" { (expression_statement "pBVar4 = fd_to_buffered_stream(iVar1);" (assignment_expression "pBVar4 = fd_to_buffered_stream(iVar1)" identifier = (call_expression "fd_to_buffered_stream(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) }))) (return_statement "return pBVar4;" return identifier ;) }))) (return_statement "return pBVar4;" return identifier ;) })))
(translation_unit "int * fd_to_buffered_stream(int param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  undefined *puVar4;\n  undefined1 auStack_c0 [56];\n  int local_88;\n  uint local_84;\n  int local_1c;\n  \n  local_1c = *(int *)PTR___stack_chk_guard_0015858c;\n  iVar1 = (*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0);\n  if (iVar1 < 0) {\n    (*(code *)PTR_close_001582c0)(param_1);\n    piVar2 = (int *)0x0;\n    goto LAB_000919a8;\n  }\n  iVar1 = (*(code *)PTR_lseek64_001584c4)(param_1);\n  if (iVar1 < 0) {\nLAB_00091930:\n    uVar3 = 1;\n  }\n  else {\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }\n  iVar1 = (*(code *)PTR_xmalloc_001565b8)(uVar3);\n  piVar2 = (int *)(*(code *)PTR_xmalloc_001565b8)(0x18);\n  if (*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1) {\n    FUN_0009118c(param_1);\n  }\n  *(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4) = piVar2;\n  *piVar2 = param_1;\n  piVar2[1] = iVar1;\n  piVar2[2] = uVar3;\n  piVar2[4] = 0;\n  piVar2[5] = 0;\n  piVar2[3] = 0;\n  if (uVar3 == 1) {\n    piVar2[4] = 4;\n  }\nLAB_000919a8:\n  if (local_1c != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }\n  return piVar2;\n}\n\n" (function_definition "int * fd_to_buffered_stream(int param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  undefined *puVar4;\n  undefined1 auStack_c0 [56];\n  int local_88;\n  uint local_84;\n  int local_1c;\n  \n  local_1c = *(int *)PTR___stack_chk_guard_0015858c;\n  iVar1 = (*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0);\n  if (iVar1 < 0) {\n    (*(code *)PTR_close_001582c0)(param_1);\n    piVar2 = (int *)0x0;\n    goto LAB_000919a8;\n  }\n  iVar1 = (*(code *)PTR_lseek64_001584c4)(param_1);\n  if (iVar1 < 0) {\nLAB_00091930:\n    uVar3 = 1;\n  }\n  else {\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }\n  iVar1 = (*(code *)PTR_xmalloc_001565b8)(uVar3);\n  piVar2 = (int *)(*(code *)PTR_xmalloc_001565b8)(0x18);\n  if (*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1) {\n    FUN_0009118c(param_1);\n  }\n  *(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4) = piVar2;\n  *piVar2 = param_1;\n  piVar2[1] = iVar1;\n  piVar2[2] = uVar3;\n  piVar2[4] = 0;\n  piVar2[5] = 0;\n  piVar2[3] = 0;\n  if (uVar3 == 1) {\n    piVar2[4] = 4;\n  }\nLAB_000919a8:\n  if (local_1c != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }\n  return piVar2;\n}" primitive_type (pointer_declarator "* fd_to_buffered_stream(int param_1)" * (function_declarator "fd_to_buffered_stream(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) )))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  undefined *puVar4;\n  undefined1 auStack_c0 [56];\n  int local_88;\n  uint local_84;\n  int local_1c;\n  \n  local_1c = *(int *)PTR___stack_chk_guard_0015858c;\n  iVar1 = (*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0);\n  if (iVar1 < 0) {\n    (*(code *)PTR_close_001582c0)(param_1);\n    piVar2 = (int *)0x0;\n    goto LAB_000919a8;\n  }\n  iVar1 = (*(code *)PTR_lseek64_001584c4)(param_1);\n  if (iVar1 < 0) {\nLAB_00091930:\n    uVar3 = 1;\n  }\n  else {\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }\n  iVar1 = (*(code *)PTR_xmalloc_001565b8)(uVar3);\n  piVar2 = (int *)(*(code *)PTR_xmalloc_001565b8)(0x18);\n  if (*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1) {\n    FUN_0009118c(param_1);\n  }\n  *(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4) = piVar2;\n  *piVar2 = param_1;\n  piVar2[1] = iVar1;\n  piVar2[2] = uVar3;\n  piVar2[4] = 0;\n  piVar2[5] = 0;\n  piVar2[3] = 0;\n  if (uVar3 == 1) {\n    piVar2[4] = 4;\n  }\nLAB_000919a8:\n  if (local_1c != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }\n  return piVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "undefined *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "undefined1 auStack_c0 [56];" type_identifier (array_declarator "auStack_c0 [56]" identifier [ number_literal ]) ;) (declaration "int local_88;" primitive_type identifier ;) (declaration "uint local_84;" type_identifier identifier ;) (declaration "int local_1c;" primitive_type identifier ;) (expression_statement "local_1c = *(int *)PTR___stack_chk_guard_0015858c;" (assignment_expression "local_1c = *(int *)PTR___stack_chk_guard_0015858c" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_0015858c" * (cast_expression "(int *)PTR___stack_chk_guard_0015858c" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar1 = (*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0);" (assignment_expression "iVar1 = (*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0)" identifier = (call_expression "(*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0)" (parenthesized_expression "(*(code *)PTR___fxstat64_001584e8)" ( (pointer_expression "*(code *)PTR___fxstat64_001584e8" * (cast_expression "(code *)PTR___fxstat64_001584e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(3,param_1,auStack_c0)" ( number_literal , identifier , identifier )))) ;) (if_statement "if (iVar1 < 0) {\n    (*(code *)PTR_close_001582c0)(param_1);\n    piVar2 = (int *)0x0;\n    goto LAB_000919a8;\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    (*(code *)PTR_close_001582c0)(param_1);\n    piVar2 = (int *)0x0;\n    goto LAB_000919a8;\n  }" { (expression_statement "(*(code *)PTR_close_001582c0)(param_1);" (call_expression "(*(code *)PTR_close_001582c0)(param_1)" (parenthesized_expression "(*(code *)PTR_close_001582c0)" ( (pointer_expression "*(code *)PTR_close_001582c0" * (cast_expression "(code *)PTR_close_001582c0" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1)" ( identifier ))) ;) (expression_statement "piVar2 = (int *)0x0;" (assignment_expression "piVar2 = (int *)0x0" identifier = (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (goto_statement "goto LAB_000919a8;" goto statement_identifier ;) })) (expression_statement "iVar1 = (*(code *)PTR_lseek64_001584c4)(param_1);" (assignment_expression "iVar1 = (*(code *)PTR_lseek64_001584c4)(param_1)" identifier = (call_expression "(*(code *)PTR_lseek64_001584c4)(param_1)" (parenthesized_expression "(*(code *)PTR_lseek64_001584c4)" ( (pointer_expression "*(code *)PTR_lseek64_001584c4" * (cast_expression "(code *)PTR_lseek64_001584c4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 < 0) {\nLAB_00091930:\n    uVar3 = 1;\n  }\n  else {\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\nLAB_00091930:\n    uVar3 = 1;\n  }" { (labeled_statement "LAB_00091930:\n    uVar3 = 1;" statement_identifier : (expression_statement "uVar3 = 1;" (assignment_expression "uVar3 = 1" identifier = number_literal) ;)) }) (else_clause "else {\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }" else (compound_statement "{\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }" { (if_statement "if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }" if (parenthesized_expression "(local_88 < 1)" ( (binary_expression "local_88 < 1" identifier < number_literal) )) (compound_statement "{\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }" { (if_statement "if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }" if (parenthesized_expression "((local_88 == 0) && (0x2000 < local_84))" ( (binary_expression "(local_88 == 0) && (0x2000 < local_84)" (parenthesized_expression "(local_88 == 0)" ( (binary_expression "local_88 == 0" identifier == number_literal) )) && (parenthesized_expression "(0x2000 < local_84)" ( (binary_expression "0x2000 < local_84" number_literal < identifier) ))) )) (compound_statement "{\n        local_84 = 0x2000;\n      }" { (expression_statement "local_84 = 0x2000;" (assignment_expression "local_84 = 0x2000" identifier = number_literal) ;) })) }) (else_clause "else {\n      local_84 = 0x2000;\n    }" else (compound_statement "{\n      local_84 = 0x2000;\n    }" { (expression_statement "local_84 = 0x2000;" (assignment_expression "local_84 = 0x2000" identifier = number_literal) ;) }))) (expression_statement "uVar3 = local_84;" (assignment_expression "uVar3 = local_84" identifier = identifier) ;) (if_statement "if (local_84 == 0) goto LAB_00091930;" if (parenthesized_expression "(local_84 == 0)" ( (binary_expression "local_84 == 0" identifier == number_literal) )) (goto_statement "goto LAB_00091930;" goto statement_identifier ;)) }))) (expression_statement "iVar1 = (*(code *)PTR_xmalloc_001565b8)(uVar3);" (assignment_expression "iVar1 = (*(code *)PTR_xmalloc_001565b8)(uVar3)" identifier = (call_expression "(*(code *)PTR_xmalloc_001565b8)(uVar3)" (parenthesized_expression "(*(code *)PTR_xmalloc_001565b8)" ( (pointer_expression "*(code *)PTR_xmalloc_001565b8" * (cast_expression "(code *)PTR_xmalloc_001565b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(uVar3)" ( identifier )))) ;) (expression_statement "piVar2 = (int *)(*(code *)PTR_xmalloc_001565b8)(0x18);" (assignment_expression "piVar2 = (int *)(*(code *)PTR_xmalloc_001565b8)(0x18)" identifier = (cast_expression "(int *)(*(code *)PTR_xmalloc_001565b8)(0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_xmalloc_001565b8)(0x18)" (parenthesized_expression "(*(code *)PTR_xmalloc_001565b8)" ( (pointer_expression "*(code *)PTR_xmalloc_001565b8" * (cast_expression "(code *)PTR_xmalloc_001565b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0x18)" ( number_literal ))))) ;) (if_statement "if (*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1) {\n    FUN_0009118c(param_1);\n  }" if (parenthesized_expression "(*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1)" ( (binary_expression "*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1" (pointer_expression "*(int *)(PTR_DAT_0015656c + -0x4d00)" * (cast_expression "(int *)(PTR_DAT_0015656c + -0x4d00)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_DAT_0015656c + -0x4d00)" ( (binary_expression "PTR_DAT_0015656c + -0x4d00" identifier + number_literal) )))) <= identifier) )) (compound_statement "{\n    FUN_0009118c(param_1);\n  }" { (expression_statement "FUN_0009118c(param_1);" (call_expression "FUN_0009118c(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) })) (expression_statement "*(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4) = piVar2;" (assignment_expression "*(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4) = piVar2" (pointer_expression "*(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4)" * (cast_expression "(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4)" ( (binary_expression "*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4" (pointer_expression "*(int *)(PTR_DAT_0015656c + -0x4cfc)" * (cast_expression "(int *)(PTR_DAT_0015656c + -0x4cfc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_DAT_0015656c + -0x4cfc)" ( (binary_expression "PTR_DAT_0015656c + -0x4cfc" identifier + number_literal) )))) + (binary_expression "param_1 * 4" identifier * number_literal)) )))) = identifier) ;) (expression_statement "*piVar2 = param_1;" (assignment_expression "*piVar2 = param_1" (pointer_expression "*piVar2" * identifier) = identifier) ;) (expression_statement "piVar2[1] = iVar1;" (assignment_expression "piVar2[1] = iVar1" (subscript_expression "piVar2[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar2[2] = uVar3;" (assignment_expression "piVar2[2] = uVar3" (subscript_expression "piVar2[2]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar2[4] = 0;" (assignment_expression "piVar2[4] = 0" (subscript_expression "piVar2[4]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar2[5] = 0;" (assignment_expression "piVar2[5] = 0" (subscript_expression "piVar2[5]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar2[3] = 0;" (assignment_expression "piVar2[3] = 0" (subscript_expression "piVar2[3]" identifier [ number_literal ]) = number_literal) ;) (if_statement "if (uVar3 == 1) {\n    piVar2[4] = 4;\n  }" if (parenthesized_expression "(uVar3 == 1)" ( (binary_expression "uVar3 == 1" identifier == number_literal) )) (compound_statement "{\n    piVar2[4] = 4;\n  }" { (expression_statement "piVar2[4] = 4;" (assignment_expression "piVar2[4] = 4" (subscript_expression "piVar2[4]" identifier [ number_literal ]) = number_literal) ;) })) (labeled_statement "LAB_000919a8:\n  if (local_1c != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }" statement_identifier : (if_statement "if (local_1c != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }" if (parenthesized_expression "(local_1c != *(int *)PTR___stack_chk_guard_0015858c)" ( (binary_expression "local_1c != *(int *)PTR___stack_chk_guard_0015858c" identifier != (pointer_expression "*(int *)PTR___stack_chk_guard_0015858c" * (cast_expression "(int *)PTR___stack_chk_guard_0015858c" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }" { (expression_statement "puVar4 = PTR___stack_chk_fail_0015853c;" (assignment_expression "puVar4 = PTR___stack_chk_fail_0015853c" identifier = identifier) ;) (expression_statement "(*(code *)PTR___stack_chk_fail_0015853c)();" (call_expression "(*(code *)PTR___stack_chk_fail_0015853c)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0015853c)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_0015853c" * (cast_expression "(code *)PTR___stack_chk_fail_0015853c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "iVar1 = (**(code **)(puVar4 + 0xc6a20))();" (assignment_expression "iVar1 = (**(code **)(puVar4 + 0xc6a20))()" identifier = (call_expression "(**(code **)(puVar4 + 0xc6a20))()" (parenthesized_expression "(**(code **)(puVar4 + 0xc6a20))" ( (pointer_expression "**(code **)(puVar4 + 0xc6a20)" * (pointer_expression "*(code **)(puVar4 + 0xc6a20)" * (cast_expression "(code **)(puVar4 + 0xc6a20)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar4 + 0xc6a20)" ( (binary_expression "puVar4 + 0xc6a20" identifier + number_literal) ))))) )) (argument_list "()" ( )))) ;) (if_statement "if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      piVar2 = (int *)0x0;\n    }" { (expression_statement "piVar2 = (int *)0x0;" (assignment_expression "piVar2 = (int *)0x0" identifier = (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }) (else_clause "else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }" else (compound_statement "{\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }" { (expression_statement "piVar2 = (int *)fd_to_buffered_stream(iVar1);" (assignment_expression "piVar2 = (int *)fd_to_buffered_stream(iVar1)" identifier = (cast_expression "(int *)fd_to_buffered_stream(iVar1)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "fd_to_buffered_stream(iVar1)" identifier (argument_list "(iVar1)" ( identifier ))))) ;) }))) (return_statement "return piVar2;" return identifier ;) }))) (return_statement "return piVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( LIT , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (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 = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = LIT) ;)) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) && (parenthesized_expression ( (binary_expression LIT < IDENT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) })) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }))) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) }))) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT )))) ;) (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 ( LIT ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) <= IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + (binary_expression IDENT * LIT)) )))) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) })) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT != (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT ))))) ;) }))) (return_statement return IDENT ;) }))) (return_statement return IDENT ;) })))
(function_definition "int * fd_to_buffered_stream(int param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  undefined *puVar4;\n  undefined1 auStack_c0 [56];\n  int local_88;\n  uint local_84;\n  int local_1c;\n  \n  local_1c = *(int *)PTR___stack_chk_guard_0015858c;\n  iVar1 = (*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0);\n  if (iVar1 < 0) {\n    (*(code *)PTR_close_001582c0)(param_1);\n    piVar2 = (int *)0x0;\n    goto LAB_000919a8;\n  }\n  iVar1 = (*(code *)PTR_lseek64_001584c4)(param_1);\n  if (iVar1 < 0) {\nLAB_00091930:\n    uVar3 = 1;\n  }\n  else {\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }\n  iVar1 = (*(code *)PTR_xmalloc_001565b8)(uVar3);\n  piVar2 = (int *)(*(code *)PTR_xmalloc_001565b8)(0x18);\n  if (*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1) {\n    FUN_0009118c(param_1);\n  }\n  *(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4) = piVar2;\n  *piVar2 = param_1;\n  piVar2[1] = iVar1;\n  piVar2[2] = uVar3;\n  piVar2[4] = 0;\n  piVar2[5] = 0;\n  piVar2[3] = 0;\n  if (uVar3 == 1) {\n    piVar2[4] = 4;\n  }\nLAB_000919a8:\n  if (local_1c != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }\n  return piVar2;\n}" (primitive_type "int") (pointer_declarator "* fd_to_buffered_stream(int param_1)" (* "*") (function_declarator "fd_to_buffered_stream(int param_1)" (identifier "fd_to_buffered_stream") (parameter_list "(int param_1)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) () ")")))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  undefined *puVar4;\n  undefined1 auStack_c0 [56];\n  int local_88;\n  uint local_84;\n  int local_1c;\n  \n  local_1c = *(int *)PTR___stack_chk_guard_0015858c;\n  iVar1 = (*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0);\n  if (iVar1 < 0) {\n    (*(code *)PTR_close_001582c0)(param_1);\n    piVar2 = (int *)0x0;\n    goto LAB_000919a8;\n  }\n  iVar1 = (*(code *)PTR_lseek64_001584c4)(param_1);\n  if (iVar1 < 0) {\nLAB_00091930:\n    uVar3 = 1;\n  }\n  else {\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }\n  iVar1 = (*(code *)PTR_xmalloc_001565b8)(uVar3);\n  piVar2 = (int *)(*(code *)PTR_xmalloc_001565b8)(0x18);\n  if (*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1) {\n    FUN_0009118c(param_1);\n  }\n  *(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4) = piVar2;\n  *piVar2 = param_1;\n  piVar2[1] = iVar1;\n  piVar2[2] = uVar3;\n  piVar2[4] = 0;\n  piVar2[5] = 0;\n  piVar2[3] = 0;\n  if (uVar3 == 1) {\n    piVar2[4] = 4;\n  }\nLAB_000919a8:\n  if (local_1c != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }\n  return piVar2;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "undefined *puVar4;" (type_identifier "undefined") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (declaration "undefined1 auStack_c0 [56];" (type_identifier "undefined1") (array_declarator "auStack_c0 [56]" (identifier "auStack_c0") ([ "[") (number_literal "56") (] "]")) (; ";")) (declaration "int local_88;" (primitive_type "int") (identifier "local_88") (; ";")) (declaration "uint local_84;" (type_identifier "uint") (identifier "local_84") (; ";")) (declaration "int local_1c;" (primitive_type "int") (identifier "local_1c") (; ";")) (expression_statement "local_1c = *(int *)PTR___stack_chk_guard_0015858c;" (assignment_expression "local_1c = *(int *)PTR___stack_chk_guard_0015858c" (identifier "local_1c") (= "=") (pointer_expression "*(int *)PTR___stack_chk_guard_0015858c" (* "*") (cast_expression "(int *)PTR___stack_chk_guard_0015858c" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_guard_0015858c")))) (; ";")) (expression_statement "iVar1 = (*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0);" (assignment_expression "iVar1 = (*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0)" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0)" (parenthesized_expression "(*(code *)PTR___fxstat64_001584e8)" (( "(") (pointer_expression "*(code *)PTR___fxstat64_001584e8" (* "*") (cast_expression "(code *)PTR___fxstat64_001584e8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___fxstat64_001584e8"))) () ")")) (argument_list "(3,param_1,auStack_c0)" (( "(") (number_literal "3") (, ",") (identifier "param_1") (, ",") (identifier "auStack_c0") () ")")))) (; ";")) (if_statement "if (iVar1 < 0) {\n    (*(code *)PTR_close_001582c0)(param_1);\n    piVar2 = (int *)0x0;\n    goto LAB_000919a8;\n  }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n    (*(code *)PTR_close_001582c0)(param_1);\n    piVar2 = (int *)0x0;\n    goto LAB_000919a8;\n  }" ({ "{") (expression_statement "(*(code *)PTR_close_001582c0)(param_1);" (call_expression "(*(code *)PTR_close_001582c0)(param_1)" (parenthesized_expression "(*(code *)PTR_close_001582c0)" (( "(") (pointer_expression "*(code *)PTR_close_001582c0" (* "*") (cast_expression "(code *)PTR_close_001582c0" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_close_001582c0"))) () ")")) (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (expression_statement "piVar2 = (int *)0x0;" (assignment_expression "piVar2 = (int *)0x0" (identifier "piVar2") (= "=") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (goto_statement "goto LAB_000919a8;" (goto "goto") (statement_identifier "LAB_000919a8") (; ";")) (} "}"))) (expression_statement "iVar1 = (*(code *)PTR_lseek64_001584c4)(param_1);" (assignment_expression "iVar1 = (*(code *)PTR_lseek64_001584c4)(param_1)" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_lseek64_001584c4)(param_1)" (parenthesized_expression "(*(code *)PTR_lseek64_001584c4)" (( "(") (pointer_expression "*(code *)PTR_lseek64_001584c4" (* "*") (cast_expression "(code *)PTR_lseek64_001584c4" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_lseek64_001584c4"))) () ")")) (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar1 < 0) {\nLAB_00091930:\n    uVar3 = 1;\n  }\n  else {\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\nLAB_00091930:\n    uVar3 = 1;\n  }" ({ "{") (labeled_statement "LAB_00091930:\n    uVar3 = 1;" (statement_identifier "LAB_00091930") (: ":") (expression_statement "uVar3 = 1;" (assignment_expression "uVar3 = 1" (identifier "uVar3") (= "=") (number_literal "1")) (; ";"))) (} "}")) (else_clause "else {\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }" (else "else") (compound_statement "{\n    if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }\n    uVar3 = local_84;\n    if (local_84 == 0) goto LAB_00091930;\n  }" ({ "{") (if_statement "if (local_88 < 1) {\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }\n    else {\n      local_84 = 0x2000;\n    }" (if "if") (parenthesized_expression "(local_88 < 1)" (( "(") (binary_expression "local_88 < 1" (identifier "local_88") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n      if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }\n    }" ({ "{") (if_statement "if ((local_88 == 0) && (0x2000 < local_84)) {\n        local_84 = 0x2000;\n      }" (if "if") (parenthesized_expression "((local_88 == 0) && (0x2000 < local_84))" (( "(") (binary_expression "(local_88 == 0) && (0x2000 < local_84)" (parenthesized_expression "(local_88 == 0)" (( "(") (binary_expression "local_88 == 0" (identifier "local_88") (== "==") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(0x2000 < local_84)" (( "(") (binary_expression "0x2000 < local_84" (number_literal "0x2000") (< "<") (identifier "local_84")) () ")"))) () ")")) (compound_statement "{\n        local_84 = 0x2000;\n      }" ({ "{") (expression_statement "local_84 = 0x2000;" (assignment_expression "local_84 = 0x2000" (identifier "local_84") (= "=") (number_literal "0x2000")) (; ";")) (} "}"))) (} "}")) (else_clause "else {\n      local_84 = 0x2000;\n    }" (else "else") (compound_statement "{\n      local_84 = 0x2000;\n    }" ({ "{") (expression_statement "local_84 = 0x2000;" (assignment_expression "local_84 = 0x2000" (identifier "local_84") (= "=") (number_literal "0x2000")) (; ";")) (} "}")))) (expression_statement "uVar3 = local_84;" (assignment_expression "uVar3 = local_84" (identifier "uVar3") (= "=") (identifier "local_84")) (; ";")) (if_statement "if (local_84 == 0) goto LAB_00091930;" (if "if") (parenthesized_expression "(local_84 == 0)" (( "(") (binary_expression "local_84 == 0" (identifier "local_84") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_00091930;" (goto "goto") (statement_identifier "LAB_00091930") (; ";"))) (} "}")))) (expression_statement "iVar1 = (*(code *)PTR_xmalloc_001565b8)(uVar3);" (assignment_expression "iVar1 = (*(code *)PTR_xmalloc_001565b8)(uVar3)" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_xmalloc_001565b8)(uVar3)" (parenthesized_expression "(*(code *)PTR_xmalloc_001565b8)" (( "(") (pointer_expression "*(code *)PTR_xmalloc_001565b8" (* "*") (cast_expression "(code *)PTR_xmalloc_001565b8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_xmalloc_001565b8"))) () ")")) (argument_list "(uVar3)" (( "(") (identifier "uVar3") () ")")))) (; ";")) (expression_statement "piVar2 = (int *)(*(code *)PTR_xmalloc_001565b8)(0x18);" (assignment_expression "piVar2 = (int *)(*(code *)PTR_xmalloc_001565b8)(0x18)" (identifier "piVar2") (= "=") (cast_expression "(int *)(*(code *)PTR_xmalloc_001565b8)(0x18)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR_xmalloc_001565b8)(0x18)" (parenthesized_expression "(*(code *)PTR_xmalloc_001565b8)" (( "(") (pointer_expression "*(code *)PTR_xmalloc_001565b8" (* "*") (cast_expression "(code *)PTR_xmalloc_001565b8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_xmalloc_001565b8"))) () ")")) (argument_list "(0x18)" (( "(") (number_literal "0x18") () ")"))))) (; ";")) (if_statement "if (*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1) {\n    FUN_0009118c(param_1);\n  }" (if "if") (parenthesized_expression "(*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1)" (( "(") (binary_expression "*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1" (pointer_expression "*(int *)(PTR_DAT_0015656c + -0x4d00)" (* "*") (cast_expression "(int *)(PTR_DAT_0015656c + -0x4d00)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(PTR_DAT_0015656c + -0x4d00)" (( "(") (binary_expression "PTR_DAT_0015656c + -0x4d00" (identifier "PTR_DAT_0015656c") (+ "+") (number_literal "-0x4d00")) () ")")))) (<= "<=") (identifier "param_1")) () ")")) (compound_statement "{\n    FUN_0009118c(param_1);\n  }" ({ "{") (expression_statement "FUN_0009118c(param_1);" (call_expression "FUN_0009118c(param_1)" (identifier "FUN_0009118c") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (} "}"))) (expression_statement "*(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4) = piVar2;" (assignment_expression "*(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4) = piVar2" (pointer_expression "*(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4)" (* "*") (cast_expression "(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4)" (( "(") (binary_expression "*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4" (pointer_expression "*(int *)(PTR_DAT_0015656c + -0x4cfc)" (* "*") (cast_expression "(int *)(PTR_DAT_0015656c + -0x4cfc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(PTR_DAT_0015656c + -0x4cfc)" (( "(") (binary_expression "PTR_DAT_0015656c + -0x4cfc" (identifier "PTR_DAT_0015656c") (+ "+") (number_literal "-0x4cfc")) () ")")))) (+ "+") (binary_expression "param_1 * 4" (identifier "param_1") (* "*") (number_literal "4"))) () ")")))) (= "=") (identifier "piVar2")) (; ";")) (expression_statement "*piVar2 = param_1;" (assignment_expression "*piVar2 = param_1" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (identifier "param_1")) (; ";")) (expression_statement "piVar2[1] = iVar1;" (assignment_expression "piVar2[1] = iVar1" (subscript_expression "piVar2[1]" (identifier "piVar2") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "iVar1")) (; ";")) (expression_statement "piVar2[2] = uVar3;" (assignment_expression "piVar2[2] = uVar3" (subscript_expression "piVar2[2]" (identifier "piVar2") ([ "[") (number_literal "2") (] "]")) (= "=") (identifier "uVar3")) (; ";")) (expression_statement "piVar2[4] = 0;" (assignment_expression "piVar2[4] = 0" (subscript_expression "piVar2[4]" (identifier "piVar2") ([ "[") (number_literal "4") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "piVar2[5] = 0;" (assignment_expression "piVar2[5] = 0" (subscript_expression "piVar2[5]" (identifier "piVar2") ([ "[") (number_literal "5") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "piVar2[3] = 0;" (assignment_expression "piVar2[3] = 0" (subscript_expression "piVar2[3]" (identifier "piVar2") ([ "[") (number_literal "3") (] "]")) (= "=") (number_literal "0")) (; ";")) (if_statement "if (uVar3 == 1) {\n    piVar2[4] = 4;\n  }" (if "if") (parenthesized_expression "(uVar3 == 1)" (( "(") (binary_expression "uVar3 == 1" (identifier "uVar3") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n    piVar2[4] = 4;\n  }" ({ "{") (expression_statement "piVar2[4] = 4;" (assignment_expression "piVar2[4] = 4" (subscript_expression "piVar2[4]" (identifier "piVar2") ([ "[") (number_literal "4") (] "]")) (= "=") (number_literal "4")) (; ";")) (} "}"))) (labeled_statement "LAB_000919a8:\n  if (local_1c != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }" (statement_identifier "LAB_000919a8") (: ":") (if_statement "if (local_1c != *(int *)PTR___stack_chk_guard_0015858c) {\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }" (if "if") (parenthesized_expression "(local_1c != *(int *)PTR___stack_chk_guard_0015858c)" (( "(") (binary_expression "local_1c != *(int *)PTR___stack_chk_guard_0015858c" (identifier "local_1c") (!= "!=") (pointer_expression "*(int *)PTR___stack_chk_guard_0015858c" (* "*") (cast_expression "(int *)PTR___stack_chk_guard_0015858c" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_guard_0015858c")))) () ")")) (compound_statement "{\n    puVar4 = PTR___stack_chk_fail_0015853c;\n    (*(code *)PTR___stack_chk_fail_0015853c)();\n    iVar1 = (**(code **)(puVar4 + 0xc6a20))();\n    if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }\n    return piVar2;\n  }" ({ "{") (expression_statement "puVar4 = PTR___stack_chk_fail_0015853c;" (assignment_expression "puVar4 = PTR___stack_chk_fail_0015853c" (identifier "puVar4") (= "=") (identifier "PTR___stack_chk_fail_0015853c")) (; ";")) (expression_statement "(*(code *)PTR___stack_chk_fail_0015853c)();" (call_expression "(*(code *)PTR___stack_chk_fail_0015853c)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0015853c)" (( "(") (pointer_expression "*(code *)PTR___stack_chk_fail_0015853c" (* "*") (cast_expression "(code *)PTR___stack_chk_fail_0015853c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_fail_0015853c"))) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "iVar1 = (**(code **)(puVar4 + 0xc6a20))();" (assignment_expression "iVar1 = (**(code **)(puVar4 + 0xc6a20))()" (identifier "iVar1") (= "=") (call_expression "(**(code **)(puVar4 + 0xc6a20))()" (parenthesized_expression "(**(code **)(puVar4 + 0xc6a20))" (( "(") (pointer_expression "**(code **)(puVar4 + 0xc6a20)" (* "*") (pointer_expression "*(code **)(puVar4 + 0xc6a20)" (* "*") (cast_expression "(code **)(puVar4 + 0xc6a20)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(puVar4 + 0xc6a20)" (( "(") (binary_expression "puVar4 + 0xc6a20" (identifier "puVar4") (+ "+") (number_literal "0xc6a20")) () ")"))))) () ")")) (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (iVar1 < 0) {\n      piVar2 = (int *)0x0;\n    }\n    else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n      piVar2 = (int *)0x0;\n    }" ({ "{") (expression_statement "piVar2 = (int *)0x0;" (assignment_expression "piVar2 = (int *)0x0" (identifier "piVar2") (= "=") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (} "}")) (else_clause "else {\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }" (else "else") (compound_statement "{\n      piVar2 = (int *)fd_to_buffered_stream(iVar1);\n    }" ({ "{") (expression_statement "piVar2 = (int *)fd_to_buffered_stream(iVar1);" (assignment_expression "piVar2 = (int *)fd_to_buffered_stream(iVar1)" (identifier "piVar2") (= "=") (cast_expression "(int *)fd_to_buffered_stream(iVar1)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "fd_to_buffered_stream(iVar1)" (identifier "fd_to_buffered_stream") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))))) (; ";")) (} "}")))) (return_statement "return piVar2;" (return "return") (identifier "piVar2") (; ";")) (} "}")))) (return_statement "return piVar2;" (return "return") (identifier "piVar2") (; ";")) (} "}")))

type_1 * function_1(int var_3)

{
  int var_6;
  int var_1;
  char *pcVar3;
  type_1 *pBVar4;
  size_t var_5;
  type_2 *var_7;
  type_3 sb;
  
  var_6 = *(int *)PTR___stack_chk_guard_0015858c;
  var_1 = (*(type_4 *)PTR___fxstat64_001584e8)(3,var_3,&sb);
  if (var_1 < 0) {
    (*(type_4 *)PTR_close_001582c0)(var_3);
    pBVar4 = (type_1 *)0x0;
    goto LAB_000919a8;
  }
  var_1 = (*(type_4 *)PTR_lseek64_001584c4)(var_3);
  if (var_1 < 0) {
LAB_00091930:
    var_5 = 1;
  }
  else {
    if (sb.st_size._0_4_ < 1) {
      if ((sb.st_size._0_4_ == 0) && (0x2000 < sb.st_size._4_4_)) {
        sb.st_size._4_4_ = 0x2000;
      }
    }
    else {
      sb.st_size._4_4_ = 0x2000;
    }
    var_5 = sb.st_size._4_4_;
    if (sb.st_size._4_4_ == 0) goto LAB_00091930;
  }
  pcVar3 = (char *)(*(type_4 *)PTR_xmalloc_001565b8)(var_5);
  pBVar4 = (type_1 *)(*(type_4 *)PTR_xmalloc_001565b8)(0x18);
  if (*(int *)(var_2 + -0x4d00) <= var_3) {
    var_4(var_3);
  }
  *(type_1 **)(*(int *)(var_2 + -0x4cfc) + var_3 * 4) = pBVar4;
  pBVar4->b_fd = var_3;
  pBVar4->b_buffer = pcVar3;
  pBVar4->b_size = var_5;
  pBVar4->b_flag = 0;
  pBVar4->b_inputp = 0;
  pBVar4->b_used = 0;
  if (var_5 == 1) {
    pBVar4->b_flag = 4;
  }
LAB_000919a8:
  if (var_6 != *(int *)PTR___stack_chk_guard_0015858c) {
    var_7 = PTR___stack_chk_fail_0015853c;
    (*(type_4 *)PTR___stack_chk_fail_0015853c)();
    var_6 = (**(type_4 **)(var_7 + 0xc6a20))();
    if (var_6 < 0) {
      pBVar4 = (type_1 *)0x0;
    }
    else {
      pBVar4 = function_1(var_6);
    }
    return pBVar4;
  }
  return pBVar4;
}


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

int * MASKED(int param_1)

{
  int iVar1;
  int *piVar2;
  uint uVar3;
  undefined *puVar4;
  undefined1 auStack_c0 [56];
  int local_88;
  uint local_84;
  int local_1c;
  
  local_1c = *(int *)PTR___stack_chk_guard_0015858c;
  iVar1 = (*(code *)PTR___fxstat64_001584e8)(3,param_1,auStack_c0);
  if (iVar1 < 0) {
    (*(code *)PTR_close_001582c0)(param_1);
    piVar2 = (int *)0x0;
    goto LAB_000919a8;
  }
  iVar1 = (*(code *)PTR_lseek64_001584c4)(param_1);
  if (iVar1 < 0) {
LAB_00091930:
    uVar3 = 1;
  }
  else {
    if (local_88 < 1) {
      if ((local_88 == 0) && (0x2000 < local_84)) {
        local_84 = 0x2000;
      }
    }
    else {
      local_84 = 0x2000;
    }
    uVar3 = local_84;
    if (local_84 == 0) goto LAB_00091930;
  }
  iVar1 = (*(code *)PTR_xmalloc_001565b8)(uVar3);
  piVar2 = (int *)(*(code *)PTR_xmalloc_001565b8)(0x18);
  if (*(int *)(PTR_DAT_0015656c + -0x4d00) <= param_1) {
    FUN_0009118c(param_1);
  }
  *(int **)(*(int *)(PTR_DAT_0015656c + -0x4cfc) + param_1 * 4) = piVar2;
  *piVar2 = param_1;
  piVar2[1] = iVar1;
  piVar2[2] = uVar3;
  piVar2[4] = 0;
  piVar2[5] = 0;
  piVar2[3] = 0;
  if (uVar3 == 1) {
    piVar2[4] = 4;
  }
LAB_000919a8:
  if (local_1c != *(int *)PTR___stack_chk_guard_0015858c) {
    puVar4 = PTR___stack_chk_fail_0015853c;
    (*(code *)PTR___stack_chk_fail_0015853c)();
    iVar1 = (**(code **)(puVar4 + 0xc6a20))();
    if (iVar1 < 0) {
      piVar2 = (int *)0x0;
    }
    else {
      piVar2 = (int *)MASKED(iVar1);
    }
    return piVar2;
  }
  return piVar2;
}

