
/* WARNING: Unknown calling convention */

sftp_packet * sftp_recv(void)

{
  byte bVar1;
  int iVar2;
  int iVar3;
  sftp_packet *pkt;
  char *buf;
  uint uVar4;
  sftp_packet *psVar5;
  undefined *puVar6;
  char x [4];
  
  puVar6 = PTR___stack_chk_guard_000b0c9c;
  iVar2 = *(int *)PTR___stack_chk_guard_000b0c9c;
  iVar3 = sftp_recvdata(x,4);
  if (iVar3 == 0) {
    psVar5 = (sftp_packet *)0x0;
  }
  else {
    pkt = (sftp_packet *)safemalloc(1,0x14);
    pkt->savedpos = 0;
    pkt->maxlen = (uint)x;
    pkt->length = (uint)x;
    buf = (char *)safemalloc((size_t)x,1);
    pkt->data = buf;
    iVar3 = sftp_recvdata(buf,pkt->length);
    if (iVar3 != 0) {
      uVar4 = pkt->savedpos;
      if (pkt->length != uVar4) {
        bVar1 = pkt->data[uVar4];
        pkt->savedpos = uVar4 + 1;
        pkt->type = (uint)bVar1;
        psVar5 = pkt;
        goto LAB_000337c4;
      }
    }
    psVar5 = (sftp_packet *)0x0;
    sftp_pkt_free(pkt);
  }
LAB_000337c4:
  if (iVar2 == *(int *)puVar6) {
    return psVar5;
  }
  puVar6 = PTR___stack_chk_fail_000b0c70;
  psVar5 = (sftp_packet *)(*(code *)PTR___stack_chk_fail_000b0c70)();
  iVar2 = *(int *)(puVar6 + 0x7c960);
  if (*(int *)(iVar2 + 0xe00) != 0) {
    psVar5 = (sftp_packet *)(**(code **)(puVar6 + 0x7ca88))();
    *(undefined4 *)(iVar2 + 0xe00) = 0;
  }
  return psVar5;
}



int * sftp_recv(void)

{
  byte bVar1;
  int iVar2;
  int *piVar3;
  int *piVar4;
  undefined *puVar5;
  int local_18;
  int local_14;
  
  puVar5 = PTR___stack_chk_guard_000b0c9c;
  local_14 = *(int *)PTR___stack_chk_guard_000b0c9c;
  iVar2 = sftp_recvdata(&local_18,4);
  if (iVar2 == 0) {
    piVar4 = (int *)0x0;
  }
  else {
    piVar3 = (int *)safemalloc(1,0x14);
    piVar3[3] = 0;
    piVar3[2] = local_18;
    piVar3[1] = local_18;
    iVar2 = safemalloc(local_18,1);
    *piVar3 = iVar2;
    iVar2 = sftp_recvdata(iVar2,piVar3[1]);
    if (iVar2 != 0) {
      iVar2 = piVar3[3];
      if (piVar3[1] != iVar2) {
        bVar1 = *(byte *)(*piVar3 + iVar2);
        piVar3[3] = iVar2 + 1;
        piVar3[4] = (uint)bVar1;
        piVar4 = piVar3;
        goto LAB_000337c4;
      }
    }
    piVar4 = (int *)0x0;
    FUN_00032a08(piVar3);
  }
LAB_000337c4:
  if (local_14 == *(int *)puVar5) {
    return piVar4;
  }
  puVar5 = PTR___stack_chk_fail_000b0c70;
  piVar4 = (int *)(*(code *)PTR___stack_chk_fail_000b0c70)();
  iVar2 = *(int *)(puVar5 + 0x7c960);
  if (*(int *)(iVar2 + 0xe00) != 0) {
    piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();
    *(undefined4 *)(iVar2 + 0xe00) = 0;
  }
  return piVar4;
}


lui gp,0x8
addiu gp,gp,0x4a50
addu gp,gp,t9
addiu sp,sp,-0x30
lw t9,-0x7b64(gp)
li a1,0x4
addiu a0,sp,0x18
sw s1,0x28(sp)
lw s1,-0x74b4(gp)
sw gp,0x10(sp)
sw ra,0x2c(sp)
sw s0,0x24(sp)
lw v0,0x0(s1)
sw v0,0x1c(sp)
bal 0x00028258
_nop
beq v0,zero,0x000337e8
_lw gp,0x10(sp)
lw t9,-0x7f68(gp)
li a1,0x14
bal 0x00020374
_li a0,0x1
li a1,0x1
lw gp,0x10(sp)
or s0,v0,zero
lw v1,0x18(sp)
sw zero,0xc(v0)
sw v1,0x8(v0)
or a0,v1,zero
lw t9,-0x7f68(gp)
bal 0x00020374
_sw v1,0x4(v0)
lw gp,0x10(sp)
or a0,v0,zero
lw a1,0x4(s0)
lw t9,-0x7b64(gp)
bal 0x00028258
_sw v0,0x0(s0)
beq v0,zero,0x000337f0
_lw gp,0x10(sp)
lw v0,0xc(s0)
lw v1,0x4(s0)
beq v1,v0,0x000337f0
_addiu a0,v0,0x1
lw v1,0x0(s0)
addu v0,v1,v0
lbu v0,0x0(v0)
sw a0,0xc(s0)
sw v0,0x10(s0)
lw a0,0x1c(sp)
or v0,s0,zero
lw v1,0x0(s1)
bne a0,v1,0x0003380c
_lw ra,0x2c(sp)
lw s1,0x28(sp)
lw s0,0x24(sp)
jr ra
_addiu sp,sp,0x30
b 0x000337c4
_or s0,zero,zero
lw t9,-0x7c8c(gp)
or a0,s0,zero
addiu t9,t9,0x2a08
bal 0x00032a08
_or s0,zero,zero
b 0x000337c4
_lw gp,0x10(sp)
lw t9,-0x74e0(gp)
jalr t9
_nop
lui gp,0x8
addiu gp,gp,0x4938
addu gp,gp,t9
addiu sp,sp,-0x20
sw s0,0x18(sp)
lw s0,-0x7fd8(gp)
sw gp,0x10(sp)
sw ra,0x1c(sp)
lw a0,0xe00(s0)
beq a0,zero,0x00033850
_lw t9,-0x7eb0(gp)
jalr t9
_nop
sw zero,0xe00(s0)
lw ra,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x20
(translation_unit "int * sftp_recv(void)\n\n{\n  byte bVar1;\n  int iVar2;\n  int *piVar3;\n  int *piVar4;\n  undefined *puVar5;\n  int local_18;\n  int local_14;\n  \n  puVar5 = PTR___stack_chk_guard_000b0c9c;\n  local_14 = *(int *)PTR___stack_chk_guard_000b0c9c;\n  iVar2 = sftp_recvdata(&local_18,4);\n  if (iVar2 == 0) {\n    piVar4 = (int *)0x0;\n  }\n  else {\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }\nLAB_000337c4:\n  if (local_14 == *(int *)puVar5) {\n    return piVar4;\n  }\n  puVar5 = PTR___stack_chk_fail_000b0c70;\n  piVar4 = (int *)(*(code *)PTR___stack_chk_fail_000b0c70)();\n  iVar2 = *(int *)(puVar5 + 0x7c960);\n  if (*(int *)(iVar2 + 0xe00) != 0) {\n    piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }\n  return piVar4;\n}\n\n" (function_definition "int * sftp_recv(void)\n\n{\n  byte bVar1;\n  int iVar2;\n  int *piVar3;\n  int *piVar4;\n  undefined *puVar5;\n  int local_18;\n  int local_14;\n  \n  puVar5 = PTR___stack_chk_guard_000b0c9c;\n  local_14 = *(int *)PTR___stack_chk_guard_000b0c9c;\n  iVar2 = sftp_recvdata(&local_18,4);\n  if (iVar2 == 0) {\n    piVar4 = (int *)0x0;\n  }\n  else {\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }\nLAB_000337c4:\n  if (local_14 == *(int *)puVar5) {\n    return piVar4;\n  }\n  puVar5 = PTR___stack_chk_fail_000b0c70;\n  piVar4 = (int *)(*(code *)PTR___stack_chk_fail_000b0c70)();\n  iVar2 = *(int *)(puVar5 + 0x7c960);\n  if (*(int *)(iVar2 + 0xe00) != 0) {\n    piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }\n  return piVar4;\n}" primitive_type (pointer_declarator "* sftp_recv(void)" * (function_declarator "sftp_recv(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) )))) (compound_statement "{\n  byte bVar1;\n  int iVar2;\n  int *piVar3;\n  int *piVar4;\n  undefined *puVar5;\n  int local_18;\n  int local_14;\n  \n  puVar5 = PTR___stack_chk_guard_000b0c9c;\n  local_14 = *(int *)PTR___stack_chk_guard_000b0c9c;\n  iVar2 = sftp_recvdata(&local_18,4);\n  if (iVar2 == 0) {\n    piVar4 = (int *)0x0;\n  }\n  else {\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }\nLAB_000337c4:\n  if (local_14 == *(int *)puVar5) {\n    return piVar4;\n  }\n  puVar5 = PTR___stack_chk_fail_000b0c70;\n  piVar4 = (int *)(*(code *)PTR___stack_chk_fail_000b0c70)();\n  iVar2 = *(int *)(puVar5 + 0x7c960);\n  if (*(int *)(iVar2 + 0xe00) != 0) {\n    piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }\n  return piVar4;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "undefined *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "int local_18;" primitive_type identifier ;) (declaration "int local_14;" primitive_type identifier ;) (expression_statement "puVar5 = PTR___stack_chk_guard_000b0c9c;" (assignment_expression "puVar5 = PTR___stack_chk_guard_000b0c9c" identifier = identifier) ;) (expression_statement "local_14 = *(int *)PTR___stack_chk_guard_000b0c9c;" (assignment_expression "local_14 = *(int *)PTR___stack_chk_guard_000b0c9c" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_000b0c9c" * (cast_expression "(int *)PTR___stack_chk_guard_000b0c9c" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar2 = sftp_recvdata(&local_18,4);" (assignment_expression "iVar2 = sftp_recvdata(&local_18,4)" identifier = (call_expression "sftp_recvdata(&local_18,4)" identifier (argument_list "(&local_18,4)" ( (pointer_expression "&local_18" & identifier) , number_literal )))) ;) (if_statement "if (iVar2 == 0) {\n    piVar4 = (int *)0x0;\n  }\n  else {\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    piVar4 = (int *)0x0;\n  }" { (expression_statement "piVar4 = (int *)0x0;" (assignment_expression "piVar4 = (int *)0x0" identifier = (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }) (else_clause "else {\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }" else (compound_statement "{\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }" { (expression_statement "piVar3 = (int *)safemalloc(1,0x14);" (assignment_expression "piVar3 = (int *)safemalloc(1,0x14)" identifier = (cast_expression "(int *)safemalloc(1,0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc(1,0x14)" identifier (argument_list "(1,0x14)" ( number_literal , number_literal ))))) ;) (expression_statement "piVar3[3] = 0;" (assignment_expression "piVar3[3] = 0" (subscript_expression "piVar3[3]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar3[2] = local_18;" (assignment_expression "piVar3[2] = local_18" (subscript_expression "piVar3[2]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar3[1] = local_18;" (assignment_expression "piVar3[1] = local_18" (subscript_expression "piVar3[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "iVar2 = safemalloc(local_18,1);" (assignment_expression "iVar2 = safemalloc(local_18,1)" identifier = (call_expression "safemalloc(local_18,1)" identifier (argument_list "(local_18,1)" ( identifier , number_literal )))) ;) (expression_statement "*piVar3 = iVar2;" (assignment_expression "*piVar3 = iVar2" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "iVar2 = sftp_recvdata(iVar2,piVar3[1]);" (assignment_expression "iVar2 = sftp_recvdata(iVar2,piVar3[1])" identifier = (call_expression "sftp_recvdata(iVar2,piVar3[1])" identifier (argument_list "(iVar2,piVar3[1])" ( identifier , (subscript_expression "piVar3[1]" identifier [ number_literal ]) )))) ;) (if_statement "if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }" { (expression_statement "iVar2 = piVar3[3];" (assignment_expression "iVar2 = piVar3[3]" identifier = (subscript_expression "piVar3[3]" identifier [ number_literal ])) ;) (if_statement "if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }" if (parenthesized_expression "(piVar3[1] != iVar2)" ( (binary_expression "piVar3[1] != iVar2" (subscript_expression "piVar3[1]" identifier [ number_literal ]) != identifier) )) (compound_statement "{\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }" { (expression_statement "bVar1 = *(byte *)(*piVar3 + iVar2);" (assignment_expression "bVar1 = *(byte *)(*piVar3 + iVar2)" identifier = (pointer_expression "*(byte *)(*piVar3 + iVar2)" * (cast_expression "(byte *)(*piVar3 + iVar2)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*piVar3 + iVar2)" ( (binary_expression "*piVar3 + iVar2" (pointer_expression "*piVar3" * identifier) + identifier) ))))) ;) (expression_statement "piVar3[3] = iVar2 + 1;" (assignment_expression "piVar3[3] = iVar2 + 1" (subscript_expression "piVar3[3]" identifier [ number_literal ]) = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (expression_statement "piVar3[4] = (uint)bVar1;" (assignment_expression "piVar3[4] = (uint)bVar1" (subscript_expression "piVar3[4]" identifier [ number_literal ]) = (cast_expression "(uint)bVar1" ( (type_descriptor "uint" type_identifier) ) identifier)) ;) (expression_statement "piVar4 = piVar3;" (assignment_expression "piVar4 = piVar3" identifier = identifier) ;) (goto_statement "goto LAB_000337c4;" goto statement_identifier ;) })) })) (expression_statement "piVar4 = (int *)0x0;" (assignment_expression "piVar4 = (int *)0x0" identifier = (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "FUN_00032a08(piVar3);" (call_expression "FUN_00032a08(piVar3)" identifier (argument_list "(piVar3)" ( identifier ))) ;) }))) (labeled_statement "LAB_000337c4:\n  if (local_14 == *(int *)puVar5) {\n    return piVar4;\n  }" statement_identifier : (if_statement "if (local_14 == *(int *)puVar5) {\n    return piVar4;\n  }" if (parenthesized_expression "(local_14 == *(int *)puVar5)" ( (binary_expression "local_14 == *(int *)puVar5" identifier == (pointer_expression "*(int *)puVar5" * (cast_expression "(int *)puVar5" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    return piVar4;\n  }" { (return_statement "return piVar4;" return identifier ;) }))) (expression_statement "puVar5 = PTR___stack_chk_fail_000b0c70;" (assignment_expression "puVar5 = PTR___stack_chk_fail_000b0c70" identifier = identifier) ;) (expression_statement "piVar4 = (int *)(*(code *)PTR___stack_chk_fail_000b0c70)();" (assignment_expression "piVar4 = (int *)(*(code *)PTR___stack_chk_fail_000b0c70)()" identifier = (cast_expression "(int *)(*(code *)PTR___stack_chk_fail_000b0c70)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___stack_chk_fail_000b0c70)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_000b0c70)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_000b0c70" * (cast_expression "(code *)PTR___stack_chk_fail_000b0c70" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "iVar2 = *(int *)(puVar5 + 0x7c960);" (assignment_expression "iVar2 = *(int *)(puVar5 + 0x7c960)" identifier = (pointer_expression "*(int *)(puVar5 + 0x7c960)" * (cast_expression "(int *)(puVar5 + 0x7c960)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar5 + 0x7c960)" ( (binary_expression "puVar5 + 0x7c960" identifier + number_literal) ))))) ;) (if_statement "if (*(int *)(iVar2 + 0xe00) != 0) {\n    piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }" if (parenthesized_expression "(*(int *)(iVar2 + 0xe00) != 0)" ( (binary_expression "*(int *)(iVar2 + 0xe00) != 0" (pointer_expression "*(int *)(iVar2 + 0xe00)" * (cast_expression "(int *)(iVar2 + 0xe00)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 0xe00)" ( (binary_expression "iVar2 + 0xe00" identifier + number_literal) )))) != number_literal) )) (compound_statement "{\n    piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }" { (expression_statement "piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();" (assignment_expression "piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))()" identifier = (cast_expression "(int *)(**(code **)(puVar5 + 0x7ca88))()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(**(code **)(puVar5 + 0x7ca88))()" (parenthesized_expression "(**(code **)(puVar5 + 0x7ca88))" ( (pointer_expression "**(code **)(puVar5 + 0x7ca88)" * (pointer_expression "*(code **)(puVar5 + 0x7ca88)" * (cast_expression "(code **)(puVar5 + 0x7ca88)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar5 + 0x7ca88)" ( (binary_expression "puVar5 + 0x7ca88" identifier + number_literal) ))))) )) (argument_list "()" ( ))))) ;) (expression_statement "*(undefined4 *)(iVar2 + 0xe00) = 0;" (assignment_expression "*(undefined4 *)(iVar2 + 0xe00) = 0" (pointer_expression "*(undefined4 *)(iVar2 + 0xe00)" * (cast_expression "(undefined4 *)(iVar2 + 0xe00)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 0xe00)" ( (binary_expression "iVar2 + 0xe00" identifier + number_literal) )))) = number_literal) ;) })) (return_statement "return piVar4;" return identifier ;) })))
(translation_unit "/* WARNING: Unknown calling convention */\n\nsftp_packet * sftp_recv(void)\n\n{\n  byte bVar1;\n  int iVar2;\n  int iVar3;\n  sftp_packet *pkt;\n  char *buf;\n  uint uVar4;\n  sftp_packet *psVar5;\n  undefined *puVar6;\n  char x [4];\n  \n  puVar6 = PTR___stack_chk_guard_000b0c9c;\n  iVar2 = *(int *)PTR___stack_chk_guard_000b0c9c;\n  iVar3 = sftp_recvdata(x,4);\n  if (iVar3 == 0) {\n    psVar5 = (sftp_packet *)0x0;\n  }\n  else {\n    pkt = (sftp_packet *)safemalloc(1,0x14);\n    pkt->savedpos = 0;\n    pkt->maxlen = (uint)x;\n    pkt->length = (uint)x;\n    buf = (char *)safemalloc((size_t)x,1);\n    pkt->data = buf;\n    iVar3 = sftp_recvdata(buf,pkt->length);\n    if (iVar3 != 0) {\n      uVar4 = pkt->savedpos;\n      if (pkt->length != uVar4) {\n        bVar1 = pkt->data[uVar4];\n        pkt->savedpos = uVar4 + 1;\n        pkt->type = (uint)bVar1;\n        psVar5 = pkt;\n        goto LAB_000337c4;\n      }\n    }\n    psVar5 = (sftp_packet *)0x0;\n    sftp_pkt_free(pkt);\n  }\nLAB_000337c4:\n  if (iVar2 == *(int *)puVar6) {\n    return psVar5;\n  }\n  puVar6 = PTR___stack_chk_fail_000b0c70;\n  psVar5 = (sftp_packet *)(*(code *)PTR___stack_chk_fail_000b0c70)();\n  iVar2 = *(int *)(puVar6 + 0x7c960);\n  if (*(int *)(iVar2 + 0xe00) != 0) {\n    psVar5 = (sftp_packet *)(**(code **)(puVar6 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }\n  return psVar5;\n}\n\n" comment (function_definition "sftp_packet * sftp_recv(void)\n\n{\n  byte bVar1;\n  int iVar2;\n  int iVar3;\n  sftp_packet *pkt;\n  char *buf;\n  uint uVar4;\n  sftp_packet *psVar5;\n  undefined *puVar6;\n  char x [4];\n  \n  puVar6 = PTR___stack_chk_guard_000b0c9c;\n  iVar2 = *(int *)PTR___stack_chk_guard_000b0c9c;\n  iVar3 = sftp_recvdata(x,4);\n  if (iVar3 == 0) {\n    psVar5 = (sftp_packet *)0x0;\n  }\n  else {\n    pkt = (sftp_packet *)safemalloc(1,0x14);\n    pkt->savedpos = 0;\n    pkt->maxlen = (uint)x;\n    pkt->length = (uint)x;\n    buf = (char *)safemalloc((size_t)x,1);\n    pkt->data = buf;\n    iVar3 = sftp_recvdata(buf,pkt->length);\n    if (iVar3 != 0) {\n      uVar4 = pkt->savedpos;\n      if (pkt->length != uVar4) {\n        bVar1 = pkt->data[uVar4];\n        pkt->savedpos = uVar4 + 1;\n        pkt->type = (uint)bVar1;\n        psVar5 = pkt;\n        goto LAB_000337c4;\n      }\n    }\n    psVar5 = (sftp_packet *)0x0;\n    sftp_pkt_free(pkt);\n  }\nLAB_000337c4:\n  if (iVar2 == *(int *)puVar6) {\n    return psVar5;\n  }\n  puVar6 = PTR___stack_chk_fail_000b0c70;\n  psVar5 = (sftp_packet *)(*(code *)PTR___stack_chk_fail_000b0c70)();\n  iVar2 = *(int *)(puVar6 + 0x7c960);\n  if (*(int *)(iVar2 + 0xe00) != 0) {\n    psVar5 = (sftp_packet *)(**(code **)(puVar6 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }\n  return psVar5;\n}" type_identifier (pointer_declarator "* sftp_recv(void)" * (function_declarator "sftp_recv(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) )))) (compound_statement "{\n  byte bVar1;\n  int iVar2;\n  int iVar3;\n  sftp_packet *pkt;\n  char *buf;\n  uint uVar4;\n  sftp_packet *psVar5;\n  undefined *puVar6;\n  char x [4];\n  \n  puVar6 = PTR___stack_chk_guard_000b0c9c;\n  iVar2 = *(int *)PTR___stack_chk_guard_000b0c9c;\n  iVar3 = sftp_recvdata(x,4);\n  if (iVar3 == 0) {\n    psVar5 = (sftp_packet *)0x0;\n  }\n  else {\n    pkt = (sftp_packet *)safemalloc(1,0x14);\n    pkt->savedpos = 0;\n    pkt->maxlen = (uint)x;\n    pkt->length = (uint)x;\n    buf = (char *)safemalloc((size_t)x,1);\n    pkt->data = buf;\n    iVar3 = sftp_recvdata(buf,pkt->length);\n    if (iVar3 != 0) {\n      uVar4 = pkt->savedpos;\n      if (pkt->length != uVar4) {\n        bVar1 = pkt->data[uVar4];\n        pkt->savedpos = uVar4 + 1;\n        pkt->type = (uint)bVar1;\n        psVar5 = pkt;\n        goto LAB_000337c4;\n      }\n    }\n    psVar5 = (sftp_packet *)0x0;\n    sftp_pkt_free(pkt);\n  }\nLAB_000337c4:\n  if (iVar2 == *(int *)puVar6) {\n    return psVar5;\n  }\n  puVar6 = PTR___stack_chk_fail_000b0c70;\n  psVar5 = (sftp_packet *)(*(code *)PTR___stack_chk_fail_000b0c70)();\n  iVar2 = *(int *)(puVar6 + 0x7c960);\n  if (*(int *)(iVar2 + 0xe00) != 0) {\n    psVar5 = (sftp_packet *)(**(code **)(puVar6 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }\n  return psVar5;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "sftp_packet *pkt;" type_identifier (pointer_declarator "*pkt" * identifier) ;) (declaration "char *buf;" primitive_type (pointer_declarator "*buf" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "sftp_packet *psVar5;" type_identifier (pointer_declarator "*psVar5" * identifier) ;) (declaration "undefined *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "char x [4];" primitive_type (array_declarator "x [4]" identifier [ number_literal ]) ;) (expression_statement "puVar6 = PTR___stack_chk_guard_000b0c9c;" (assignment_expression "puVar6 = PTR___stack_chk_guard_000b0c9c" identifier = identifier) ;) (expression_statement "iVar2 = *(int *)PTR___stack_chk_guard_000b0c9c;" (assignment_expression "iVar2 = *(int *)PTR___stack_chk_guard_000b0c9c" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_000b0c9c" * (cast_expression "(int *)PTR___stack_chk_guard_000b0c9c" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar3 = sftp_recvdata(x,4);" (assignment_expression "iVar3 = sftp_recvdata(x,4)" identifier = (call_expression "sftp_recvdata(x,4)" identifier (argument_list "(x,4)" ( identifier , number_literal )))) ;) (if_statement "if (iVar3 == 0) {\n    psVar5 = (sftp_packet *)0x0;\n  }\n  else {\n    pkt = (sftp_packet *)safemalloc(1,0x14);\n    pkt->savedpos = 0;\n    pkt->maxlen = (uint)x;\n    pkt->length = (uint)x;\n    buf = (char *)safemalloc((size_t)x,1);\n    pkt->data = buf;\n    iVar3 = sftp_recvdata(buf,pkt->length);\n    if (iVar3 != 0) {\n      uVar4 = pkt->savedpos;\n      if (pkt->length != uVar4) {\n        bVar1 = pkt->data[uVar4];\n        pkt->savedpos = uVar4 + 1;\n        pkt->type = (uint)bVar1;\n        psVar5 = pkt;\n        goto LAB_000337c4;\n      }\n    }\n    psVar5 = (sftp_packet *)0x0;\n    sftp_pkt_free(pkt);\n  }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n    psVar5 = (sftp_packet *)0x0;\n  }" { (expression_statement "psVar5 = (sftp_packet *)0x0;" (assignment_expression "psVar5 = (sftp_packet *)0x0" identifier = (cast_expression "(sftp_packet *)0x0" ( (type_descriptor "sftp_packet *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }) (else_clause "else {\n    pkt = (sftp_packet *)safemalloc(1,0x14);\n    pkt->savedpos = 0;\n    pkt->maxlen = (uint)x;\n    pkt->length = (uint)x;\n    buf = (char *)safemalloc((size_t)x,1);\n    pkt->data = buf;\n    iVar3 = sftp_recvdata(buf,pkt->length);\n    if (iVar3 != 0) {\n      uVar4 = pkt->savedpos;\n      if (pkt->length != uVar4) {\n        bVar1 = pkt->data[uVar4];\n        pkt->savedpos = uVar4 + 1;\n        pkt->type = (uint)bVar1;\n        psVar5 = pkt;\n        goto LAB_000337c4;\n      }\n    }\n    psVar5 = (sftp_packet *)0x0;\n    sftp_pkt_free(pkt);\n  }" else (compound_statement "{\n    pkt = (sftp_packet *)safemalloc(1,0x14);\n    pkt->savedpos = 0;\n    pkt->maxlen = (uint)x;\n    pkt->length = (uint)x;\n    buf = (char *)safemalloc((size_t)x,1);\n    pkt->data = buf;\n    iVar3 = sftp_recvdata(buf,pkt->length);\n    if (iVar3 != 0) {\n      uVar4 = pkt->savedpos;\n      if (pkt->length != uVar4) {\n        bVar1 = pkt->data[uVar4];\n        pkt->savedpos = uVar4 + 1;\n        pkt->type = (uint)bVar1;\n        psVar5 = pkt;\n        goto LAB_000337c4;\n      }\n    }\n    psVar5 = (sftp_packet *)0x0;\n    sftp_pkt_free(pkt);\n  }" { (expression_statement "pkt = (sftp_packet *)safemalloc(1,0x14);" (assignment_expression "pkt = (sftp_packet *)safemalloc(1,0x14)" identifier = (cast_expression "(sftp_packet *)safemalloc(1,0x14)" ( (type_descriptor "sftp_packet *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc(1,0x14)" identifier (argument_list "(1,0x14)" ( number_literal , number_literal ))))) ;) (expression_statement "pkt->savedpos = 0;" (assignment_expression "pkt->savedpos = 0" (field_expression "pkt->savedpos" identifier -> field_identifier) = number_literal) ;) (expression_statement "pkt->maxlen = (uint)x;" (assignment_expression "pkt->maxlen = (uint)x" (field_expression "pkt->maxlen" identifier -> field_identifier) = (cast_expression "(uint)x" ( (type_descriptor "uint" type_identifier) ) identifier)) ;) (expression_statement "pkt->length = (uint)x;" (assignment_expression "pkt->length = (uint)x" (field_expression "pkt->length" identifier -> field_identifier) = (cast_expression "(uint)x" ( (type_descriptor "uint" type_identifier) ) identifier)) ;) (expression_statement "buf = (char *)safemalloc((size_t)x,1);" (assignment_expression "buf = (char *)safemalloc((size_t)x,1)" identifier = (cast_expression "(char *)safemalloc((size_t)x,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc((size_t)x,1)" identifier (argument_list "((size_t)x,1)" ( (cast_expression "(size_t)x" ( (type_descriptor "size_t" primitive_type) ) identifier) , number_literal ))))) ;) (expression_statement "pkt->data = buf;" (assignment_expression "pkt->data = buf" (field_expression "pkt->data" identifier -> field_identifier) = identifier) ;) (expression_statement "iVar3 = sftp_recvdata(buf,pkt->length);" (assignment_expression "iVar3 = sftp_recvdata(buf,pkt->length)" identifier = (call_expression "sftp_recvdata(buf,pkt->length)" identifier (argument_list "(buf,pkt->length)" ( identifier , (field_expression "pkt->length" identifier -> field_identifier) )))) ;) (if_statement "if (iVar3 != 0) {\n      uVar4 = pkt->savedpos;\n      if (pkt->length != uVar4) {\n        bVar1 = pkt->data[uVar4];\n        pkt->savedpos = uVar4 + 1;\n        pkt->type = (uint)bVar1;\n        psVar5 = pkt;\n        goto LAB_000337c4;\n      }\n    }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n      uVar4 = pkt->savedpos;\n      if (pkt->length != uVar4) {\n        bVar1 = pkt->data[uVar4];\n        pkt->savedpos = uVar4 + 1;\n        pkt->type = (uint)bVar1;\n        psVar5 = pkt;\n        goto LAB_000337c4;\n      }\n    }" { (expression_statement "uVar4 = pkt->savedpos;" (assignment_expression "uVar4 = pkt->savedpos" identifier = (field_expression "pkt->savedpos" identifier -> field_identifier)) ;) (if_statement "if (pkt->length != uVar4) {\n        bVar1 = pkt->data[uVar4];\n        pkt->savedpos = uVar4 + 1;\n        pkt->type = (uint)bVar1;\n        psVar5 = pkt;\n        goto LAB_000337c4;\n      }" if (parenthesized_expression "(pkt->length != uVar4)" ( (binary_expression "pkt->length != uVar4" (field_expression "pkt->length" identifier -> field_identifier) != identifier) )) (compound_statement "{\n        bVar1 = pkt->data[uVar4];\n        pkt->savedpos = uVar4 + 1;\n        pkt->type = (uint)bVar1;\n        psVar5 = pkt;\n        goto LAB_000337c4;\n      }" { (expression_statement "bVar1 = pkt->data[uVar4];" (assignment_expression "bVar1 = pkt->data[uVar4]" identifier = (subscript_expression "pkt->data[uVar4]" (field_expression "pkt->data" identifier -> field_identifier) [ identifier ])) ;) (expression_statement "pkt->savedpos = uVar4 + 1;" (assignment_expression "pkt->savedpos = uVar4 + 1" (field_expression "pkt->savedpos" identifier -> field_identifier) = (binary_expression "uVar4 + 1" identifier + number_literal)) ;) (expression_statement "pkt->type = (uint)bVar1;" (assignment_expression "pkt->type = (uint)bVar1" (field_expression "pkt->type" identifier -> field_identifier) = (cast_expression "(uint)bVar1" ( (type_descriptor "uint" type_identifier) ) identifier)) ;) (expression_statement "psVar5 = pkt;" (assignment_expression "psVar5 = pkt" identifier = identifier) ;) (goto_statement "goto LAB_000337c4;" goto statement_identifier ;) })) })) (expression_statement "psVar5 = (sftp_packet *)0x0;" (assignment_expression "psVar5 = (sftp_packet *)0x0" identifier = (cast_expression "(sftp_packet *)0x0" ( (type_descriptor "sftp_packet *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "sftp_pkt_free(pkt);" (call_expression "sftp_pkt_free(pkt)" identifier (argument_list "(pkt)" ( identifier ))) ;) }))) (labeled_statement "LAB_000337c4:\n  if (iVar2 == *(int *)puVar6) {\n    return psVar5;\n  }" statement_identifier : (if_statement "if (iVar2 == *(int *)puVar6) {\n    return psVar5;\n  }" if (parenthesized_expression "(iVar2 == *(int *)puVar6)" ( (binary_expression "iVar2 == *(int *)puVar6" identifier == (pointer_expression "*(int *)puVar6" * (cast_expression "(int *)puVar6" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    return psVar5;\n  }" { (return_statement "return psVar5;" return identifier ;) }))) (expression_statement "puVar6 = PTR___stack_chk_fail_000b0c70;" (assignment_expression "puVar6 = PTR___stack_chk_fail_000b0c70" identifier = identifier) ;) (expression_statement "psVar5 = (sftp_packet *)(*(code *)PTR___stack_chk_fail_000b0c70)();" (assignment_expression "psVar5 = (sftp_packet *)(*(code *)PTR___stack_chk_fail_000b0c70)()" identifier = (cast_expression "(sftp_packet *)(*(code *)PTR___stack_chk_fail_000b0c70)()" ( (type_descriptor "sftp_packet *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___stack_chk_fail_000b0c70)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_000b0c70)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_000b0c70" * (cast_expression "(code *)PTR___stack_chk_fail_000b0c70" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "iVar2 = *(int *)(puVar6 + 0x7c960);" (assignment_expression "iVar2 = *(int *)(puVar6 + 0x7c960)" identifier = (pointer_expression "*(int *)(puVar6 + 0x7c960)" * (cast_expression "(int *)(puVar6 + 0x7c960)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar6 + 0x7c960)" ( (binary_expression "puVar6 + 0x7c960" identifier + number_literal) ))))) ;) (if_statement "if (*(int *)(iVar2 + 0xe00) != 0) {\n    psVar5 = (sftp_packet *)(**(code **)(puVar6 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }" if (parenthesized_expression "(*(int *)(iVar2 + 0xe00) != 0)" ( (binary_expression "*(int *)(iVar2 + 0xe00) != 0" (pointer_expression "*(int *)(iVar2 + 0xe00)" * (cast_expression "(int *)(iVar2 + 0xe00)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 0xe00)" ( (binary_expression "iVar2 + 0xe00" identifier + number_literal) )))) != number_literal) )) (compound_statement "{\n    psVar5 = (sftp_packet *)(**(code **)(puVar6 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }" { (expression_statement "psVar5 = (sftp_packet *)(**(code **)(puVar6 + 0x7ca88))();" (assignment_expression "psVar5 = (sftp_packet *)(**(code **)(puVar6 + 0x7ca88))()" identifier = (cast_expression "(sftp_packet *)(**(code **)(puVar6 + 0x7ca88))()" ( (type_descriptor "sftp_packet *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(**(code **)(puVar6 + 0x7ca88))()" (parenthesized_expression "(**(code **)(puVar6 + 0x7ca88))" ( (pointer_expression "**(code **)(puVar6 + 0x7ca88)" * (pointer_expression "*(code **)(puVar6 + 0x7ca88)" * (cast_expression "(code **)(puVar6 + 0x7ca88)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar6 + 0x7ca88)" ( (binary_expression "puVar6 + 0x7ca88" identifier + number_literal) ))))) )) (argument_list "()" ( ))))) ;) (expression_statement "*(undefined4 *)(iVar2 + 0xe00) = 0;" (assignment_expression "*(undefined4 *)(iVar2 + 0xe00) = 0" (pointer_expression "*(undefined4 *)(iVar2 + 0xe00)" * (cast_expression "(undefined4 *)(iVar2 + 0xe00)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 0xe00)" ( (binary_expression "iVar2 + 0xe00" identifier + number_literal) )))) = number_literal) ;) })) (return_statement "return psVar5;" return identifier ;) })))
(translation_unit "int * sftp_recv(void)\n\n{\n  byte bVar1;\n  int iVar2;\n  int *piVar3;\n  int *piVar4;\n  undefined *puVar5;\n  int local_18;\n  int local_14;\n  \n  puVar5 = PTR___stack_chk_guard_000b0c9c;\n  local_14 = *(int *)PTR___stack_chk_guard_000b0c9c;\n  iVar2 = sftp_recvdata(&local_18,4);\n  if (iVar2 == 0) {\n    piVar4 = (int *)0x0;\n  }\n  else {\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }\nLAB_000337c4:\n  if (local_14 == *(int *)puVar5) {\n    return piVar4;\n  }\n  puVar5 = PTR___stack_chk_fail_000b0c70;\n  piVar4 = (int *)(*(code *)PTR___stack_chk_fail_000b0c70)();\n  iVar2 = *(int *)(puVar5 + 0x7c960);\n  if (*(int *)(iVar2 + 0xe00) != 0) {\n    piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }\n  return piVar4;\n}\n\n" (function_definition "int * sftp_recv(void)\n\n{\n  byte bVar1;\n  int iVar2;\n  int *piVar3;\n  int *piVar4;\n  undefined *puVar5;\n  int local_18;\n  int local_14;\n  \n  puVar5 = PTR___stack_chk_guard_000b0c9c;\n  local_14 = *(int *)PTR___stack_chk_guard_000b0c9c;\n  iVar2 = sftp_recvdata(&local_18,4);\n  if (iVar2 == 0) {\n    piVar4 = (int *)0x0;\n  }\n  else {\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }\nLAB_000337c4:\n  if (local_14 == *(int *)puVar5) {\n    return piVar4;\n  }\n  puVar5 = PTR___stack_chk_fail_000b0c70;\n  piVar4 = (int *)(*(code *)PTR___stack_chk_fail_000b0c70)();\n  iVar2 = *(int *)(puVar5 + 0x7c960);\n  if (*(int *)(iVar2 + 0xe00) != 0) {\n    piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }\n  return piVar4;\n}" primitive_type (pointer_declarator "* sftp_recv(void)" * (function_declarator "sftp_recv(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) )))) (compound_statement "{\n  byte bVar1;\n  int iVar2;\n  int *piVar3;\n  int *piVar4;\n  undefined *puVar5;\n  int local_18;\n  int local_14;\n  \n  puVar5 = PTR___stack_chk_guard_000b0c9c;\n  local_14 = *(int *)PTR___stack_chk_guard_000b0c9c;\n  iVar2 = sftp_recvdata(&local_18,4);\n  if (iVar2 == 0) {\n    piVar4 = (int *)0x0;\n  }\n  else {\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }\nLAB_000337c4:\n  if (local_14 == *(int *)puVar5) {\n    return piVar4;\n  }\n  puVar5 = PTR___stack_chk_fail_000b0c70;\n  piVar4 = (int *)(*(code *)PTR___stack_chk_fail_000b0c70)();\n  iVar2 = *(int *)(puVar5 + 0x7c960);\n  if (*(int *)(iVar2 + 0xe00) != 0) {\n    piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }\n  return piVar4;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "undefined *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "int local_18;" primitive_type identifier ;) (declaration "int local_14;" primitive_type identifier ;) (expression_statement "puVar5 = PTR___stack_chk_guard_000b0c9c;" (assignment_expression "puVar5 = PTR___stack_chk_guard_000b0c9c" identifier = identifier) ;) (expression_statement "local_14 = *(int *)PTR___stack_chk_guard_000b0c9c;" (assignment_expression "local_14 = *(int *)PTR___stack_chk_guard_000b0c9c" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_000b0c9c" * (cast_expression "(int *)PTR___stack_chk_guard_000b0c9c" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar2 = sftp_recvdata(&local_18,4);" (assignment_expression "iVar2 = sftp_recvdata(&local_18,4)" identifier = (call_expression "sftp_recvdata(&local_18,4)" identifier (argument_list "(&local_18,4)" ( (pointer_expression "&local_18" & identifier) , number_literal )))) ;) (if_statement "if (iVar2 == 0) {\n    piVar4 = (int *)0x0;\n  }\n  else {\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    piVar4 = (int *)0x0;\n  }" { (expression_statement "piVar4 = (int *)0x0;" (assignment_expression "piVar4 = (int *)0x0" identifier = (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }) (else_clause "else {\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }" else (compound_statement "{\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }" { (expression_statement "piVar3 = (int *)safemalloc(1,0x14);" (assignment_expression "piVar3 = (int *)safemalloc(1,0x14)" identifier = (cast_expression "(int *)safemalloc(1,0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc(1,0x14)" identifier (argument_list "(1,0x14)" ( number_literal , number_literal ))))) ;) (expression_statement "piVar3[3] = 0;" (assignment_expression "piVar3[3] = 0" (subscript_expression "piVar3[3]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar3[2] = local_18;" (assignment_expression "piVar3[2] = local_18" (subscript_expression "piVar3[2]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar3[1] = local_18;" (assignment_expression "piVar3[1] = local_18" (subscript_expression "piVar3[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "iVar2 = safemalloc(local_18,1);" (assignment_expression "iVar2 = safemalloc(local_18,1)" identifier = (call_expression "safemalloc(local_18,1)" identifier (argument_list "(local_18,1)" ( identifier , number_literal )))) ;) (expression_statement "*piVar3 = iVar2;" (assignment_expression "*piVar3 = iVar2" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "iVar2 = sftp_recvdata(iVar2,piVar3[1]);" (assignment_expression "iVar2 = sftp_recvdata(iVar2,piVar3[1])" identifier = (call_expression "sftp_recvdata(iVar2,piVar3[1])" identifier (argument_list "(iVar2,piVar3[1])" ( identifier , (subscript_expression "piVar3[1]" identifier [ number_literal ]) )))) ;) (if_statement "if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }" { (expression_statement "iVar2 = piVar3[3];" (assignment_expression "iVar2 = piVar3[3]" identifier = (subscript_expression "piVar3[3]" identifier [ number_literal ])) ;) (if_statement "if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }" if (parenthesized_expression "(piVar3[1] != iVar2)" ( (binary_expression "piVar3[1] != iVar2" (subscript_expression "piVar3[1]" identifier [ number_literal ]) != identifier) )) (compound_statement "{\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }" { (expression_statement "bVar1 = *(byte *)(*piVar3 + iVar2);" (assignment_expression "bVar1 = *(byte *)(*piVar3 + iVar2)" identifier = (pointer_expression "*(byte *)(*piVar3 + iVar2)" * (cast_expression "(byte *)(*piVar3 + iVar2)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*piVar3 + iVar2)" ( (binary_expression "*piVar3 + iVar2" (pointer_expression "*piVar3" * identifier) + identifier) ))))) ;) (expression_statement "piVar3[3] = iVar2 + 1;" (assignment_expression "piVar3[3] = iVar2 + 1" (subscript_expression "piVar3[3]" identifier [ number_literal ]) = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (expression_statement "piVar3[4] = (uint)bVar1;" (assignment_expression "piVar3[4] = (uint)bVar1" (subscript_expression "piVar3[4]" identifier [ number_literal ]) = (cast_expression "(uint)bVar1" ( (type_descriptor "uint" type_identifier) ) identifier)) ;) (expression_statement "piVar4 = piVar3;" (assignment_expression "piVar4 = piVar3" identifier = identifier) ;) (goto_statement "goto LAB_000337c4;" goto statement_identifier ;) })) })) (expression_statement "piVar4 = (int *)0x0;" (assignment_expression "piVar4 = (int *)0x0" identifier = (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "FUN_00032a08(piVar3);" (call_expression "FUN_00032a08(piVar3)" identifier (argument_list "(piVar3)" ( identifier ))) ;) }))) (labeled_statement "LAB_000337c4:\n  if (local_14 == *(int *)puVar5) {\n    return piVar4;\n  }" statement_identifier : (if_statement "if (local_14 == *(int *)puVar5) {\n    return piVar4;\n  }" if (parenthesized_expression "(local_14 == *(int *)puVar5)" ( (binary_expression "local_14 == *(int *)puVar5" identifier == (pointer_expression "*(int *)puVar5" * (cast_expression "(int *)puVar5" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    return piVar4;\n  }" { (return_statement "return piVar4;" return identifier ;) }))) (expression_statement "puVar5 = PTR___stack_chk_fail_000b0c70;" (assignment_expression "puVar5 = PTR___stack_chk_fail_000b0c70" identifier = identifier) ;) (expression_statement "piVar4 = (int *)(*(code *)PTR___stack_chk_fail_000b0c70)();" (assignment_expression "piVar4 = (int *)(*(code *)PTR___stack_chk_fail_000b0c70)()" identifier = (cast_expression "(int *)(*(code *)PTR___stack_chk_fail_000b0c70)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___stack_chk_fail_000b0c70)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_000b0c70)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_000b0c70" * (cast_expression "(code *)PTR___stack_chk_fail_000b0c70" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "iVar2 = *(int *)(puVar5 + 0x7c960);" (assignment_expression "iVar2 = *(int *)(puVar5 + 0x7c960)" identifier = (pointer_expression "*(int *)(puVar5 + 0x7c960)" * (cast_expression "(int *)(puVar5 + 0x7c960)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar5 + 0x7c960)" ( (binary_expression "puVar5 + 0x7c960" identifier + number_literal) ))))) ;) (if_statement "if (*(int *)(iVar2 + 0xe00) != 0) {\n    piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }" if (parenthesized_expression "(*(int *)(iVar2 + 0xe00) != 0)" ( (binary_expression "*(int *)(iVar2 + 0xe00) != 0" (pointer_expression "*(int *)(iVar2 + 0xe00)" * (cast_expression "(int *)(iVar2 + 0xe00)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 0xe00)" ( (binary_expression "iVar2 + 0xe00" identifier + number_literal) )))) != number_literal) )) (compound_statement "{\n    piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }" { (expression_statement "piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();" (assignment_expression "piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))()" identifier = (cast_expression "(int *)(**(code **)(puVar5 + 0x7ca88))()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(**(code **)(puVar5 + 0x7ca88))()" (parenthesized_expression "(**(code **)(puVar5 + 0x7ca88))" ( (pointer_expression "**(code **)(puVar5 + 0x7ca88)" * (pointer_expression "*(code **)(puVar5 + 0x7ca88)" * (cast_expression "(code **)(puVar5 + 0x7ca88)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar5 + 0x7ca88)" ( (binary_expression "puVar5 + 0x7ca88" identifier + number_literal) ))))) )) (argument_list "()" ( ))))) ;) (expression_statement "*(undefined4 *)(iVar2 + 0xe00) = 0;" (assignment_expression "*(undefined4 *)(iVar2 + 0xe00) = 0" (pointer_expression "*(undefined4 *)(iVar2 + 0xe00)" * (cast_expression "(undefined4 *)(iVar2 + 0xe00)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 0xe00)" ( (binary_expression "iVar2 + 0xe00" identifier + number_literal) )))) = number_literal) ;) })) (return_statement "return piVar4;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression & IDENT) , LIT )))) ;) (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 ( LIT , LIT ))))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (subscript_expression IDENT [ LIT ]) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) != IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + IDENT) ))))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (goto_statement goto statement_identifier ;) })) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }))) (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 { (return_statement return IDENT ;) }))) (expression_statement (assignment_expression IDENT = 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 ( ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (argument_list ( ))))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) })) (return_statement return IDENT ;) })))
(function_definition "int * sftp_recv(void)\n\n{\n  byte bVar1;\n  int iVar2;\n  int *piVar3;\n  int *piVar4;\n  undefined *puVar5;\n  int local_18;\n  int local_14;\n  \n  puVar5 = PTR___stack_chk_guard_000b0c9c;\n  local_14 = *(int *)PTR___stack_chk_guard_000b0c9c;\n  iVar2 = sftp_recvdata(&local_18,4);\n  if (iVar2 == 0) {\n    piVar4 = (int *)0x0;\n  }\n  else {\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }\nLAB_000337c4:\n  if (local_14 == *(int *)puVar5) {\n    return piVar4;\n  }\n  puVar5 = PTR___stack_chk_fail_000b0c70;\n  piVar4 = (int *)(*(code *)PTR___stack_chk_fail_000b0c70)();\n  iVar2 = *(int *)(puVar5 + 0x7c960);\n  if (*(int *)(iVar2 + 0xe00) != 0) {\n    piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }\n  return piVar4;\n}" (primitive_type "int") (pointer_declarator "* sftp_recv(void)" (* "*") (function_declarator "sftp_recv(void)" (identifier "sftp_recv") (parameter_list "(void)" (( "(") (parameter_declaration "void" (primitive_type "void")) () ")")))) (compound_statement "{\n  byte bVar1;\n  int iVar2;\n  int *piVar3;\n  int *piVar4;\n  undefined *puVar5;\n  int local_18;\n  int local_14;\n  \n  puVar5 = PTR___stack_chk_guard_000b0c9c;\n  local_14 = *(int *)PTR___stack_chk_guard_000b0c9c;\n  iVar2 = sftp_recvdata(&local_18,4);\n  if (iVar2 == 0) {\n    piVar4 = (int *)0x0;\n  }\n  else {\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }\nLAB_000337c4:\n  if (local_14 == *(int *)puVar5) {\n    return piVar4;\n  }\n  puVar5 = PTR___stack_chk_fail_000b0c70;\n  piVar4 = (int *)(*(code *)PTR___stack_chk_fail_000b0c70)();\n  iVar2 = *(int *)(puVar5 + 0x7c960);\n  if (*(int *)(iVar2 + 0xe00) != 0) {\n    piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }\n  return piVar4;\n}" ({ "{") (declaration "byte bVar1;" (type_identifier "byte") (identifier "bVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (declaration "int *piVar4;" (primitive_type "int") (pointer_declarator "*piVar4" (* "*") (identifier "piVar4")) (; ";")) (declaration "undefined *puVar5;" (type_identifier "undefined") (pointer_declarator "*puVar5" (* "*") (identifier "puVar5")) (; ";")) (declaration "int local_18;" (primitive_type "int") (identifier "local_18") (; ";")) (declaration "int local_14;" (primitive_type "int") (identifier "local_14") (; ";")) (expression_statement "puVar5 = PTR___stack_chk_guard_000b0c9c;" (assignment_expression "puVar5 = PTR___stack_chk_guard_000b0c9c" (identifier "puVar5") (= "=") (identifier "PTR___stack_chk_guard_000b0c9c")) (; ";")) (expression_statement "local_14 = *(int *)PTR___stack_chk_guard_000b0c9c;" (assignment_expression "local_14 = *(int *)PTR___stack_chk_guard_000b0c9c" (identifier "local_14") (= "=") (pointer_expression "*(int *)PTR___stack_chk_guard_000b0c9c" (* "*") (cast_expression "(int *)PTR___stack_chk_guard_000b0c9c" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_guard_000b0c9c")))) (; ";")) (expression_statement "iVar2 = sftp_recvdata(&local_18,4);" (assignment_expression "iVar2 = sftp_recvdata(&local_18,4)" (identifier "iVar2") (= "=") (call_expression "sftp_recvdata(&local_18,4)" (identifier "sftp_recvdata") (argument_list "(&local_18,4)" (( "(") (pointer_expression "&local_18" (& "&") (identifier "local_18")) (, ",") (number_literal "4") () ")")))) (; ";")) (if_statement "if (iVar2 == 0) {\n    piVar4 = (int *)0x0;\n  }\n  else {\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    piVar4 = (int *)0x0;\n  }" ({ "{") (expression_statement "piVar4 = (int *)0x0;" (assignment_expression "piVar4 = (int *)0x0" (identifier "piVar4") (= "=") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (} "}")) (else_clause "else {\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }" (else "else") (compound_statement "{\n    piVar3 = (int *)safemalloc(1,0x14);\n    piVar3[3] = 0;\n    piVar3[2] = local_18;\n    piVar3[1] = local_18;\n    iVar2 = safemalloc(local_18,1);\n    *piVar3 = iVar2;\n    iVar2 = sftp_recvdata(iVar2,piVar3[1]);\n    if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }\n    piVar4 = (int *)0x0;\n    FUN_00032a08(piVar3);\n  }" ({ "{") (expression_statement "piVar3 = (int *)safemalloc(1,0x14);" (assignment_expression "piVar3 = (int *)safemalloc(1,0x14)" (identifier "piVar3") (= "=") (cast_expression "(int *)safemalloc(1,0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "safemalloc(1,0x14)" (identifier "safemalloc") (argument_list "(1,0x14)" (( "(") (number_literal "1") (, ",") (number_literal "0x14") () ")"))))) (; ";")) (expression_statement "piVar3[3] = 0;" (assignment_expression "piVar3[3] = 0" (subscript_expression "piVar3[3]" (identifier "piVar3") ([ "[") (number_literal "3") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "piVar3[2] = local_18;" (assignment_expression "piVar3[2] = local_18" (subscript_expression "piVar3[2]" (identifier "piVar3") ([ "[") (number_literal "2") (] "]")) (= "=") (identifier "local_18")) (; ";")) (expression_statement "piVar3[1] = local_18;" (assignment_expression "piVar3[1] = local_18" (subscript_expression "piVar3[1]" (identifier "piVar3") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "local_18")) (; ";")) (expression_statement "iVar2 = safemalloc(local_18,1);" (assignment_expression "iVar2 = safemalloc(local_18,1)" (identifier "iVar2") (= "=") (call_expression "safemalloc(local_18,1)" (identifier "safemalloc") (argument_list "(local_18,1)" (( "(") (identifier "local_18") (, ",") (number_literal "1") () ")")))) (; ";")) (expression_statement "*piVar3 = iVar2;" (assignment_expression "*piVar3 = iVar2" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (= "=") (identifier "iVar2")) (; ";")) (expression_statement "iVar2 = sftp_recvdata(iVar2,piVar3[1]);" (assignment_expression "iVar2 = sftp_recvdata(iVar2,piVar3[1])" (identifier "iVar2") (= "=") (call_expression "sftp_recvdata(iVar2,piVar3[1])" (identifier "sftp_recvdata") (argument_list "(iVar2,piVar3[1])" (( "(") (identifier "iVar2") (, ",") (subscript_expression "piVar3[1]" (identifier "piVar3") ([ "[") (number_literal "1") (] "]")) () ")")))) (; ";")) (if_statement "if (iVar2 != 0) {\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }" (if "if") (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      iVar2 = piVar3[3];\n      if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }\n    }" ({ "{") (expression_statement "iVar2 = piVar3[3];" (assignment_expression "iVar2 = piVar3[3]" (identifier "iVar2") (= "=") (subscript_expression "piVar3[3]" (identifier "piVar3") ([ "[") (number_literal "3") (] "]"))) (; ";")) (if_statement "if (piVar3[1] != iVar2) {\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }" (if "if") (parenthesized_expression "(piVar3[1] != iVar2)" (( "(") (binary_expression "piVar3[1] != iVar2" (subscript_expression "piVar3[1]" (identifier "piVar3") ([ "[") (number_literal "1") (] "]")) (!= "!=") (identifier "iVar2")) () ")")) (compound_statement "{\n        bVar1 = *(byte *)(*piVar3 + iVar2);\n        piVar3[3] = iVar2 + 1;\n        piVar3[4] = (uint)bVar1;\n        piVar4 = piVar3;\n        goto LAB_000337c4;\n      }" ({ "{") (expression_statement "bVar1 = *(byte *)(*piVar3 + iVar2);" (assignment_expression "bVar1 = *(byte *)(*piVar3 + iVar2)" (identifier "bVar1") (= "=") (pointer_expression "*(byte *)(*piVar3 + iVar2)" (* "*") (cast_expression "(byte *)(*piVar3 + iVar2)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*piVar3 + iVar2)" (( "(") (binary_expression "*piVar3 + iVar2" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (+ "+") (identifier "iVar2")) () ")"))))) (; ";")) (expression_statement "piVar3[3] = iVar2 + 1;" (assignment_expression "piVar3[3] = iVar2 + 1" (subscript_expression "piVar3[3]" (identifier "piVar3") ([ "[") (number_literal "3") (] "]")) (= "=") (binary_expression "iVar2 + 1" (identifier "iVar2") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "piVar3[4] = (uint)bVar1;" (assignment_expression "piVar3[4] = (uint)bVar1" (subscript_expression "piVar3[4]" (identifier "piVar3") ([ "[") (number_literal "4") (] "]")) (= "=") (cast_expression "(uint)bVar1" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "bVar1"))) (; ";")) (expression_statement "piVar4 = piVar3;" (assignment_expression "piVar4 = piVar3" (identifier "piVar4") (= "=") (identifier "piVar3")) (; ";")) (goto_statement "goto LAB_000337c4;" (goto "goto") (statement_identifier "LAB_000337c4") (; ";")) (} "}"))) (} "}"))) (expression_statement "piVar4 = (int *)0x0;" (assignment_expression "piVar4 = (int *)0x0" (identifier "piVar4") (= "=") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (expression_statement "FUN_00032a08(piVar3);" (call_expression "FUN_00032a08(piVar3)" (identifier "FUN_00032a08") (argument_list "(piVar3)" (( "(") (identifier "piVar3") () ")"))) (; ";")) (} "}")))) (labeled_statement "LAB_000337c4:\n  if (local_14 == *(int *)puVar5) {\n    return piVar4;\n  }" (statement_identifier "LAB_000337c4") (: ":") (if_statement "if (local_14 == *(int *)puVar5) {\n    return piVar4;\n  }" (if "if") (parenthesized_expression "(local_14 == *(int *)puVar5)" (( "(") (binary_expression "local_14 == *(int *)puVar5" (identifier "local_14") (== "==") (pointer_expression "*(int *)puVar5" (* "*") (cast_expression "(int *)puVar5" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar5")))) () ")")) (compound_statement "{\n    return piVar4;\n  }" ({ "{") (return_statement "return piVar4;" (return "return") (identifier "piVar4") (; ";")) (} "}")))) (expression_statement "puVar5 = PTR___stack_chk_fail_000b0c70;" (assignment_expression "puVar5 = PTR___stack_chk_fail_000b0c70" (identifier "puVar5") (= "=") (identifier "PTR___stack_chk_fail_000b0c70")) (; ";")) (expression_statement "piVar4 = (int *)(*(code *)PTR___stack_chk_fail_000b0c70)();" (assignment_expression "piVar4 = (int *)(*(code *)PTR___stack_chk_fail_000b0c70)()" (identifier "piVar4") (= "=") (cast_expression "(int *)(*(code *)PTR___stack_chk_fail_000b0c70)()" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___stack_chk_fail_000b0c70)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_000b0c70)" (( "(") (pointer_expression "*(code *)PTR___stack_chk_fail_000b0c70" (* "*") (cast_expression "(code *)PTR___stack_chk_fail_000b0c70" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_fail_000b0c70"))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "iVar2 = *(int *)(puVar5 + 0x7c960);" (assignment_expression "iVar2 = *(int *)(puVar5 + 0x7c960)" (identifier "iVar2") (= "=") (pointer_expression "*(int *)(puVar5 + 0x7c960)" (* "*") (cast_expression "(int *)(puVar5 + 0x7c960)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar5 + 0x7c960)" (( "(") (binary_expression "puVar5 + 0x7c960" (identifier "puVar5") (+ "+") (number_literal "0x7c960")) () ")"))))) (; ";")) (if_statement "if (*(int *)(iVar2 + 0xe00) != 0) {\n    piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }" (if "if") (parenthesized_expression "(*(int *)(iVar2 + 0xe00) != 0)" (( "(") (binary_expression "*(int *)(iVar2 + 0xe00) != 0" (pointer_expression "*(int *)(iVar2 + 0xe00)" (* "*") (cast_expression "(int *)(iVar2 + 0xe00)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + 0xe00)" (( "(") (binary_expression "iVar2 + 0xe00" (identifier "iVar2") (+ "+") (number_literal "0xe00")) () ")")))) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();\n    *(undefined4 *)(iVar2 + 0xe00) = 0;\n  }" ({ "{") (expression_statement "piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();" (assignment_expression "piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))()" (identifier "piVar4") (= "=") (cast_expression "(int *)(**(code **)(puVar5 + 0x7ca88))()" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(**(code **)(puVar5 + 0x7ca88))()" (parenthesized_expression "(**(code **)(puVar5 + 0x7ca88))" (( "(") (pointer_expression "**(code **)(puVar5 + 0x7ca88)" (* "*") (pointer_expression "*(code **)(puVar5 + 0x7ca88)" (* "*") (cast_expression "(code **)(puVar5 + 0x7ca88)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(puVar5 + 0x7ca88)" (( "(") (binary_expression "puVar5 + 0x7ca88" (identifier "puVar5") (+ "+") (number_literal "0x7ca88")) () ")"))))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "*(undefined4 *)(iVar2 + 0xe00) = 0;" (assignment_expression "*(undefined4 *)(iVar2 + 0xe00) = 0" (pointer_expression "*(undefined4 *)(iVar2 + 0xe00)" (* "*") (cast_expression "(undefined4 *)(iVar2 + 0xe00)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + 0xe00)" (( "(") (binary_expression "iVar2 + 0xe00" (identifier "iVar2") (+ "+") (number_literal "0xe00")) () ")")))) (= "=") (number_literal "0")) (; ";")) (} "}"))) (return_statement "return piVar4;" (return "return") (identifier "piVar4") (; ";")) (} "}")))

/* WARNING: Unknown calling convention */

type_1 * function_1(void)

{
  type_2 bVar1;
  int var_6;
  int var_2;
  type_1 *pkt;
  char *buf;
  type_3 var_4;
  type_1 *psVar5;
  type_4 *var_7;
  char x [4];
  
  var_7 = PTR___stack_chk_guard_000b0c9c;
  var_6 = *(int *)PTR___stack_chk_guard_000b0c9c;
  var_2 = var_1(x,4);
  if (var_2 == 0) {
    psVar5 = (type_1 *)0x0;
  }
  else {
    pkt = (type_1 *)var_3(1,0x14);
    pkt->savedpos = 0;
    pkt->maxlen = (type_3)x;
    pkt->length = (type_3)x;
    buf = (char *)var_3((size_t)x,1);
    pkt->data = buf;
    var_2 = var_1(buf,pkt->length);
    if (var_2 != 0) {
      var_4 = pkt->savedpos;
      if (pkt->length != var_4) {
        bVar1 = pkt->data[var_4];
        pkt->savedpos = var_4 + 1;
        pkt->type = (type_3)bVar1;
        psVar5 = pkt;
        goto LAB_000337c4;
      }
    }
    psVar5 = (type_1 *)0x0;
    var_5(pkt);
  }
LAB_000337c4:
  if (var_6 == *(int *)var_7) {
    return psVar5;
  }
  var_7 = PTR___stack_chk_fail_000b0c70;
  psVar5 = (type_1 *)(*(type_5 *)PTR___stack_chk_fail_000b0c70)();
  var_6 = *(int *)(var_7 + 0x7c960);
  if (*(int *)(var_6 + 0xe00) != 0) {
    psVar5 = (type_1 *)(**(type_5 **)(var_7 + 0x7ca88))();
    *(type_6 *)(var_6 + 0xe00) = 0;
  }
  return psVar5;
}


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

int * MASKED(void)

{
  byte bVar1;
  int iVar2;
  int *piVar3;
  int *piVar4;
  undefined *puVar5;
  int local_18;
  int local_14;
  
  puVar5 = PTR___stack_chk_guard_000b0c9c;
  local_14 = *(int *)PTR___stack_chk_guard_000b0c9c;
  iVar2 = MASKEDdata(&local_18,4);
  if (iVar2 == 0) {
    piVar4 = (int *)0x0;
  }
  else {
    piVar3 = (int *)safemalloc(1,0x14);
    piVar3[3] = 0;
    piVar3[2] = local_18;
    piVar3[1] = local_18;
    iVar2 = safemalloc(local_18,1);
    *piVar3 = iVar2;
    iVar2 = MASKEDdata(iVar2,piVar3[1]);
    if (iVar2 != 0) {
      iVar2 = piVar3[3];
      if (piVar3[1] != iVar2) {
        bVar1 = *(byte *)(*piVar3 + iVar2);
        piVar3[3] = iVar2 + 1;
        piVar3[4] = (uint)bVar1;
        piVar4 = piVar3;
        goto LAB_000337c4;
      }
    }
    piVar4 = (int *)0x0;
    FUN_00032a08(piVar3);
  }
LAB_000337c4:
  if (local_14 == *(int *)puVar5) {
    return piVar4;
  }
  puVar5 = PTR___stack_chk_fail_000b0c70;
  piVar4 = (int *)(*(code *)PTR___stack_chk_fail_000b0c70)();
  iVar2 = *(int *)(puVar5 + 0x7c960);
  if (*(int *)(iVar2 + 0xe00) != 0) {
    piVar4 = (int *)(**(code **)(puVar5 + 0x7ca88))();
    *(undefined4 *)(iVar2 + 0xe00) = 0;
  }
  return piVar4;
}

