
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

void defer_packet(Ssh_conflict ssh,int pkttype,...)

{
  Packet *pkt;
  int iVar1;
  uchar *puVar2;
  int iVar3;
  size_t n;
  va_list in_a2;
  undefined4 in_a3;
  va_list local_res8;
  undefined4 local_resc;
  va_list ap;
  int offset;
  undefined4 local_1c;
  
  local_1c = *(undefined4 *)PTR___stack_chk_guard_00112630;
  local_res8 = in_a2;
  local_resc = in_a3;
  pkt = construct_packet((Ssh_conflict)pkttype,(int)&local_res8,in_a2);
  iVar1 = s_wrpkt_prepare(ssh,pkt,&offset);
  iVar3 = ssh->deferred_len;
  if (ssh->deferred_size < iVar1 + iVar3) {
    n = iVar1 + iVar3 + 0x80;
    ssh->deferred_size = n;
    puVar2 = (uchar *)saferealloc(ssh->deferred_send_data,n,1);
    iVar3 = ssh->deferred_len;
    ssh->deferred_send_data = puVar2;
  }
  else {
    puVar2 = ssh->deferred_send_data;
  }
  (*(code *)PTR_memcpy_0011256c)(puVar2 + iVar3,pkt->data + offset,iVar1);
  puVar2 = pkt->data;
                    /* WARNING: Subroutine does not return */
  ssh->deferred_len = ssh->deferred_len + iVar1;
  safefree(puVar2);
}



int FUN_0004cc84(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  undefined *puVar1;
  undefined4 *puVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  undefined4 uVar6;
  int *piVar7;
  int iVar8;
  int iVar9;
  undefined4 local_res8;
  undefined4 local_resc;
  int local_20;
  int local_1c;
  
  puVar1 = PTR___stack_chk_guard_00112630;
  local_1c = *(int *)PTR___stack_chk_guard_00112630;
  local_res8 = param_3;
  local_resc = param_4;
  puVar2 = (undefined4 *)FUN_0004ca88(param_2,&local_res8);
  iVar3 = FUN_0004b768(param_1,puVar2,&local_20);
  iVar5 = *(int *)(param_1 + 0x16c);
  if (*(int *)(param_1 + 0x170) < iVar3 + iVar5) {
    iVar5 = iVar3 + iVar5 + 0x80;
    *(int *)(param_1 + 0x170) = iVar5;
    iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);
    iVar5 = *(int *)(param_1 + 0x16c);
    *(int *)(param_1 + 0x168) = iVar4;
  }
  else {
    iVar4 = *(int *)(param_1 + 0x168);
  }
  iVar8 = puVar2[4] + local_20;
  iVar9 = iVar3;
  (*(code *)PTR_memcpy_0011256c)(iVar4 + iVar5);
  uVar6 = puVar2[4];
  *(int *)(param_1 + 0x16c) = *(int *)(param_1 + 0x16c) + iVar3;
  safefree(uVar6);
  safefree();
  if (local_1c == *(int *)puVar1) {
    return *(int *)puVar1;
  }
  (*(code *)PTR___stack_chk_fail_001122c8)();
  if (iVar8 != 0) {
    log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);
  }
  piVar7 = (int *)*puVar2;
  if (piVar7 != (int *)0x0) {
                    /* WARNING: Could not recover jumptable at 0x0004ce68. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);
    return iVar3;
  }
  return 0;
}


lui gp,0xd
addiu gp,gp,-0x39d4
addu gp,gp,t9
addiu sp,sp,-0x40
lw t9,-0x7b3c(gp)
or v1,a1,zero
addiu v0,sp,0x48
sw s3,0x38(sp)
addiu t9,t9,-0x3578
sw a2,0x48(sp)
or a1,v0,zero
sw a3,0x4c(sp)
sw v0,0x1c(sp)
lw s3,-0x6c80(gp)
sw gp,0x10(sp)
sw ra,0x3c(sp)
sw s2,0x34(sp)
sw s1,0x30(sp)
sw s0,0x2c(sp)
or s0,a0,zero
lw v0,0x0(s3)
or a0,v1,zero
sw v0,0x24(sp)
bal 0x0004ca88
_nop
addiu a2,sp,0x20
lw gp,0x10(sp)
or a1,v0,zero
or a0,s0,zero
lw t9,-0x7b3c(gp)
addiu t9,t9,-0x4898
bal 0x0004b768
_or s1,v0,zero
lw a0,0x16c(s0)
or s2,v0,zero
lw v0,0x170(s0)
addu a1,s2,a0
slt v0,v0,a1
bne v0,zero,0x0004cd9c
_lw gp,0x10(sp)
lw v0,0x168(s0)
addu a0,v0,a0
lw a1,0x10(s1)
lw v0,0x20(sp)
or a2,s2,zero
lw t9,-0x6d44(gp)
jalr t9
_addu a1,a1,v0
lw gp,0x10(sp)
lw v0,0x16c(s0)
lw a0,0x10(s1)
lw t9,-0x7fc0(gp)
addu v0,v0,s2
bal 0x0003a244
_sw v0,0x16c(s0)
lw gp,0x10(sp)
lw t9,-0x7fc0(gp)
bal 0x0003a244
_or a0,s1,zero
lw v1,0x24(sp)
lw v0,0x0(s3)
bne v1,v0,0x0004cdc4
_lw gp,0x10(sp)
lw ra,0x3c(sp)
lw s3,0x38(sp)
lw s2,0x34(sp)
lw s1,0x30(sp)
lw s0,0x2c(sp)
jr ra
_addiu sp,sp,0x40
lw t9,-0x7ec0(gp)
addiu a1,a1,0x80
lw a0,0x168(s0)
li a2,0x1
bal 0x00039b5c
_sw a1,0x170(s0)
lw gp,0x10(sp)
lw a0,0x16c(s0)
b 0x0004cd28
_sw v0,0x168(s0)
lw t9,-0x6fe8(gp)
jalr t9
_nop
(translation_unit "int FUN_0004cc84(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  undefined *puVar1;\n  undefined4 *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  int *piVar7;\n  int iVar8;\n  int iVar9;\n  undefined4 local_res8;\n  undefined4 local_resc;\n  int local_20;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_00112630;\n  local_1c = *(int *)PTR___stack_chk_guard_00112630;\n  local_res8 = param_3;\n  local_resc = param_4;\n  puVar2 = (undefined4 *)FUN_0004ca88(param_2,&local_res8);\n  iVar3 = FUN_0004b768(param_1,puVar2,&local_20);\n  iVar5 = *(int *)(param_1 + 0x16c);\n  if (*(int *)(param_1 + 0x170) < iVar3 + iVar5) {\n    iVar5 = iVar3 + iVar5 + 0x80;\n    *(int *)(param_1 + 0x170) = iVar5;\n    iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);\n    iVar5 = *(int *)(param_1 + 0x16c);\n    *(int *)(param_1 + 0x168) = iVar4;\n  }\n  else {\n    iVar4 = *(int *)(param_1 + 0x168);\n  }\n  iVar8 = puVar2[4] + local_20;\n  iVar9 = iVar3;\n  (*(code *)PTR_memcpy_0011256c)(iVar4 + iVar5);\n  uVar6 = puVar2[4];\n  *(int *)(param_1 + 0x16c) = *(int *)(param_1 + 0x16c) + iVar3;\n  safefree(uVar6);\n  safefree();\n  if (local_1c == *(int *)puVar1) {\n    return *(int *)puVar1;\n  }\n  (*(code *)PTR___stack_chk_fail_001122c8)();\n  if (iVar8 != 0) {\n    log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);\n  }\n  piVar7 = (int *)*puVar2;\n  if (piVar7 != (int *)0x0) {\n                    /* WARNING: Could not recover jumptable at 0x0004ce68. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);\n    return iVar3;\n  }\n  return 0;\n}\n\n" (function_definition "int FUN_0004cc84(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  undefined *puVar1;\n  undefined4 *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  int *piVar7;\n  int iVar8;\n  int iVar9;\n  undefined4 local_res8;\n  undefined4 local_resc;\n  int local_20;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_00112630;\n  local_1c = *(int *)PTR___stack_chk_guard_00112630;\n  local_res8 = param_3;\n  local_resc = param_4;\n  puVar2 = (undefined4 *)FUN_0004ca88(param_2,&local_res8);\n  iVar3 = FUN_0004b768(param_1,puVar2,&local_20);\n  iVar5 = *(int *)(param_1 + 0x16c);\n  if (*(int *)(param_1 + 0x170) < iVar3 + iVar5) {\n    iVar5 = iVar3 + iVar5 + 0x80;\n    *(int *)(param_1 + 0x170) = iVar5;\n    iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);\n    iVar5 = *(int *)(param_1 + 0x16c);\n    *(int *)(param_1 + 0x168) = iVar4;\n  }\n  else {\n    iVar4 = *(int *)(param_1 + 0x168);\n  }\n  iVar8 = puVar2[4] + local_20;\n  iVar9 = iVar3;\n  (*(code *)PTR_memcpy_0011256c)(iVar4 + iVar5);\n  uVar6 = puVar2[4];\n  *(int *)(param_1 + 0x16c) = *(int *)(param_1 + 0x16c) + iVar3;\n  safefree(uVar6);\n  safefree();\n  if (local_1c == *(int *)puVar1) {\n    return *(int *)puVar1;\n  }\n  (*(code *)PTR___stack_chk_fail_001122c8)();\n  if (iVar8 != 0) {\n    log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);\n  }\n  piVar7 = (int *)*puVar2;\n  if (piVar7 != (int *)0x0) {\n                    /* WARNING: Could not recover jumptable at 0x0004ce68. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);\n    return iVar3;\n  }\n  return 0;\n}" primitive_type (function_declarator "FUN_0004cc84(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" identifier (parameter_list "(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  undefined4 *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  int *piVar7;\n  int iVar8;\n  int iVar9;\n  undefined4 local_res8;\n  undefined4 local_resc;\n  int local_20;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_00112630;\n  local_1c = *(int *)PTR___stack_chk_guard_00112630;\n  local_res8 = param_3;\n  local_resc = param_4;\n  puVar2 = (undefined4 *)FUN_0004ca88(param_2,&local_res8);\n  iVar3 = FUN_0004b768(param_1,puVar2,&local_20);\n  iVar5 = *(int *)(param_1 + 0x16c);\n  if (*(int *)(param_1 + 0x170) < iVar3 + iVar5) {\n    iVar5 = iVar3 + iVar5 + 0x80;\n    *(int *)(param_1 + 0x170) = iVar5;\n    iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);\n    iVar5 = *(int *)(param_1 + 0x16c);\n    *(int *)(param_1 + 0x168) = iVar4;\n  }\n  else {\n    iVar4 = *(int *)(param_1 + 0x168);\n  }\n  iVar8 = puVar2[4] + local_20;\n  iVar9 = iVar3;\n  (*(code *)PTR_memcpy_0011256c)(iVar4 + iVar5);\n  uVar6 = puVar2[4];\n  *(int *)(param_1 + 0x16c) = *(int *)(param_1 + 0x16c) + iVar3;\n  safefree(uVar6);\n  safefree();\n  if (local_1c == *(int *)puVar1) {\n    return *(int *)puVar1;\n  }\n  (*(code *)PTR___stack_chk_fail_001122c8)();\n  if (iVar8 != 0) {\n    log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);\n  }\n  piVar7 = (int *)*puVar2;\n  if (piVar7 != (int *)0x0) {\n                    /* WARNING: Could not recover jumptable at 0x0004ce68. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);\n    return iVar3;\n  }\n  return 0;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "undefined4 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "undefined4 uVar6;" type_identifier identifier ;) (declaration "int *piVar7;" primitive_type (pointer_declarator "*piVar7" * identifier) ;) (declaration "int iVar8;" primitive_type identifier ;) (declaration "int iVar9;" primitive_type identifier ;) (declaration "undefined4 local_res8;" type_identifier identifier ;) (declaration "undefined4 local_resc;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "int local_1c;" primitive_type identifier ;) (expression_statement "puVar1 = PTR___stack_chk_guard_00112630;" (assignment_expression "puVar1 = PTR___stack_chk_guard_00112630" identifier = identifier) ;) (expression_statement "local_1c = *(int *)PTR___stack_chk_guard_00112630;" (assignment_expression "local_1c = *(int *)PTR___stack_chk_guard_00112630" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_00112630" * (cast_expression "(int *)PTR___stack_chk_guard_00112630" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "local_res8 = param_3;" (assignment_expression "local_res8 = param_3" identifier = identifier) ;) (expression_statement "local_resc = param_4;" (assignment_expression "local_resc = param_4" identifier = identifier) ;) (expression_statement "puVar2 = (undefined4 *)FUN_0004ca88(param_2,&local_res8);" (assignment_expression "puVar2 = (undefined4 *)FUN_0004ca88(param_2,&local_res8)" identifier = (cast_expression "(undefined4 *)FUN_0004ca88(param_2,&local_res8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0004ca88(param_2,&local_res8)" identifier (argument_list "(param_2,&local_res8)" ( identifier , (pointer_expression "&local_res8" & identifier) ))))) ;) (expression_statement "iVar3 = FUN_0004b768(param_1,puVar2,&local_20);" (assignment_expression "iVar3 = FUN_0004b768(param_1,puVar2,&local_20)" identifier = (call_expression "FUN_0004b768(param_1,puVar2,&local_20)" identifier (argument_list "(param_1,puVar2,&local_20)" ( identifier , identifier , (pointer_expression "&local_20" & identifier) )))) ;) (expression_statement "iVar5 = *(int *)(param_1 + 0x16c);" (assignment_expression "iVar5 = *(int *)(param_1 + 0x16c)" identifier = (pointer_expression "*(int *)(param_1 + 0x16c)" * (cast_expression "(int *)(param_1 + 0x16c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x16c)" ( (binary_expression "param_1 + 0x16c" identifier + number_literal) ))))) ;) (if_statement "if (*(int *)(param_1 + 0x170) < iVar3 + iVar5) {\n    iVar5 = iVar3 + iVar5 + 0x80;\n    *(int *)(param_1 + 0x170) = iVar5;\n    iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);\n    iVar5 = *(int *)(param_1 + 0x16c);\n    *(int *)(param_1 + 0x168) = iVar4;\n  }\n  else {\n    iVar4 = *(int *)(param_1 + 0x168);\n  }" if (parenthesized_expression "(*(int *)(param_1 + 0x170) < iVar3 + iVar5)" ( (binary_expression "*(int *)(param_1 + 0x170) < iVar3 + iVar5" (pointer_expression "*(int *)(param_1 + 0x170)" * (cast_expression "(int *)(param_1 + 0x170)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x170)" ( (binary_expression "param_1 + 0x170" identifier + number_literal) )))) < (binary_expression "iVar3 + iVar5" identifier + identifier)) )) (compound_statement "{\n    iVar5 = iVar3 + iVar5 + 0x80;\n    *(int *)(param_1 + 0x170) = iVar5;\n    iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);\n    iVar5 = *(int *)(param_1 + 0x16c);\n    *(int *)(param_1 + 0x168) = iVar4;\n  }" { (expression_statement "iVar5 = iVar3 + iVar5 + 0x80;" (assignment_expression "iVar5 = iVar3 + iVar5 + 0x80" identifier = (binary_expression "iVar3 + iVar5 + 0x80" (binary_expression "iVar3 + iVar5" identifier + identifier) + number_literal)) ;) (expression_statement "*(int *)(param_1 + 0x170) = iVar5;" (assignment_expression "*(int *)(param_1 + 0x170) = iVar5" (pointer_expression "*(int *)(param_1 + 0x170)" * (cast_expression "(int *)(param_1 + 0x170)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x170)" ( (binary_expression "param_1 + 0x170" identifier + number_literal) )))) = identifier) ;) (expression_statement "iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);" (assignment_expression "iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1)" identifier = (call_expression "saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1)" identifier (argument_list "(*(undefined4 *)(param_1 + 0x168),iVar5,1)" ( (pointer_expression "*(undefined4 *)(param_1 + 0x168)" * (cast_expression "(undefined4 *)(param_1 + 0x168)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x168)" ( (binary_expression "param_1 + 0x168" identifier + number_literal) )))) , identifier , number_literal )))) ;) (expression_statement "iVar5 = *(int *)(param_1 + 0x16c);" (assignment_expression "iVar5 = *(int *)(param_1 + 0x16c)" identifier = (pointer_expression "*(int *)(param_1 + 0x16c)" * (cast_expression "(int *)(param_1 + 0x16c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x16c)" ( (binary_expression "param_1 + 0x16c" identifier + number_literal) ))))) ;) (expression_statement "*(int *)(param_1 + 0x168) = iVar4;" (assignment_expression "*(int *)(param_1 + 0x168) = iVar4" (pointer_expression "*(int *)(param_1 + 0x168)" * (cast_expression "(int *)(param_1 + 0x168)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x168)" ( (binary_expression "param_1 + 0x168" identifier + number_literal) )))) = identifier) ;) }) (else_clause "else {\n    iVar4 = *(int *)(param_1 + 0x168);\n  }" else (compound_statement "{\n    iVar4 = *(int *)(param_1 + 0x168);\n  }" { (expression_statement "iVar4 = *(int *)(param_1 + 0x168);" (assignment_expression "iVar4 = *(int *)(param_1 + 0x168)" identifier = (pointer_expression "*(int *)(param_1 + 0x168)" * (cast_expression "(int *)(param_1 + 0x168)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x168)" ( (binary_expression "param_1 + 0x168" identifier + number_literal) ))))) ;) }))) (expression_statement "iVar8 = puVar2[4] + local_20;" (assignment_expression "iVar8 = puVar2[4] + local_20" identifier = (binary_expression "puVar2[4] + local_20" (subscript_expression "puVar2[4]" identifier [ number_literal ]) + identifier)) ;) (expression_statement "iVar9 = iVar3;" (assignment_expression "iVar9 = iVar3" identifier = identifier) ;) (expression_statement "(*(code *)PTR_memcpy_0011256c)(iVar4 + iVar5);" (call_expression "(*(code *)PTR_memcpy_0011256c)(iVar4 + iVar5)" (parenthesized_expression "(*(code *)PTR_memcpy_0011256c)" ( (pointer_expression "*(code *)PTR_memcpy_0011256c" * (cast_expression "(code *)PTR_memcpy_0011256c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar4 + iVar5)" ( (binary_expression "iVar4 + iVar5" identifier + identifier) ))) ;) (expression_statement "uVar6 = puVar2[4];" (assignment_expression "uVar6 = puVar2[4]" identifier = (subscript_expression "puVar2[4]" identifier [ number_literal ])) ;) (expression_statement "*(int *)(param_1 + 0x16c) = *(int *)(param_1 + 0x16c) + iVar3;" (assignment_expression "*(int *)(param_1 + 0x16c) = *(int *)(param_1 + 0x16c) + iVar3" (pointer_expression "*(int *)(param_1 + 0x16c)" * (cast_expression "(int *)(param_1 + 0x16c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x16c)" ( (binary_expression "param_1 + 0x16c" identifier + number_literal) )))) = (binary_expression "*(int *)(param_1 + 0x16c) + iVar3" (pointer_expression "*(int *)(param_1 + 0x16c)" * (cast_expression "(int *)(param_1 + 0x16c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x16c)" ( (binary_expression "param_1 + 0x16c" identifier + number_literal) )))) + identifier)) ;) (expression_statement "safefree(uVar6);" (call_expression "safefree(uVar6)" identifier (argument_list "(uVar6)" ( identifier ))) ;) (expression_statement "safefree();" (call_expression "safefree()" identifier (argument_list "()" ( ))) ;) (if_statement "if (local_1c == *(int *)puVar1) {\n    return *(int *)puVar1;\n  }" if (parenthesized_expression "(local_1c == *(int *)puVar1)" ( (binary_expression "local_1c == *(int *)puVar1" identifier == (pointer_expression "*(int *)puVar1" * (cast_expression "(int *)puVar1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    return *(int *)puVar1;\n  }" { (return_statement "return *(int *)puVar1;" return (pointer_expression "*(int *)puVar1" * (cast_expression "(int *)puVar1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) ;) })) (expression_statement "(*(code *)PTR___stack_chk_fail_001122c8)();" (call_expression "(*(code *)PTR___stack_chk_fail_001122c8)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_001122c8)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_001122c8" * (cast_expression "(code *)PTR___stack_chk_fail_001122c8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (if_statement "if (iVar8 != 0) {\n    log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);\n  }" if (parenthesized_expression "(iVar8 != 0)" ( (binary_expression "iVar8 != 0" identifier != number_literal) )) (compound_statement "{\n    log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);\n  }" { (expression_statement "log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);" (call_expression "log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0)" identifier (argument_list "(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0)" ( identifier , number_literal , number_literal , number_literal , identifier , identifier , number_literal , number_literal , number_literal , number_literal , number_literal ))) ;) })) (expression_statement "piVar7 = (int *)*puVar2;" (assignment_expression "piVar7 = (int *)*puVar2" identifier = (cast_expression "(int *)*puVar2" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*puVar2" * identifier))) ;) (if_statement "if (piVar7 != (int *)0x0) {\n                    /* WARNING: Could not recover jumptable at 0x0004ce68. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);\n    return iVar3;\n  }" if (parenthesized_expression "(piVar7 != (int *)0x0)" ( (binary_expression "piVar7 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Could not recover jumptable at 0x0004ce68. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);\n    return iVar3;\n  }" { comment comment (expression_statement "iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);" (assignment_expression "iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4)" identifier = (call_expression "(**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4)" (parenthesized_expression "(**(code **)(*piVar7 + 8))" ( (pointer_expression "**(code **)(*piVar7 + 8)" * (pointer_expression "*(code **)(*piVar7 + 8)" * (cast_expression "(code **)(*piVar7 + 8)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*piVar7 + 8)" ( (binary_expression "*piVar7 + 8" (pointer_expression "*piVar7" * identifier) + number_literal) ))))) )) (argument_list "(piVar7,iVar9,param_4)" ( identifier , identifier , identifier )))) ;) (return_statement "return iVar3;" return identifier ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "/* WARNING: Enum "anon_enum_32": Some values do not have unique names */\n\nvoid defer_packet(Ssh_conflict ssh,int pkttype,...)\n\n{\n  Packet *pkt;\n  int iVar1;\n  uchar *puVar2;\n  int iVar3;\n  size_t n;\n  va_list in_a2;\n  undefined4 in_a3;\n  va_list local_res8;\n  undefined4 local_resc;\n  va_list ap;\n  int offset;\n  undefined4 local_1c;\n  \n  local_1c = *(undefined4 *)PTR___stack_chk_guard_00112630;\n  local_res8 = in_a2;\n  local_resc = in_a3;\n  pkt = construct_packet((Ssh_conflict)pkttype,(int)&local_res8,in_a2);\n  iVar1 = s_wrpkt_prepare(ssh,pkt,&offset);\n  iVar3 = ssh->deferred_len;\n  if (ssh->deferred_size < iVar1 + iVar3) {\n    n = iVar1 + iVar3 + 0x80;\n    ssh->deferred_size = n;\n    puVar2 = (uchar *)saferealloc(ssh->deferred_send_data,n,1);\n    iVar3 = ssh->deferred_len;\n    ssh->deferred_send_data = puVar2;\n  }\n  else {\n    puVar2 = ssh->deferred_send_data;\n  }\n  (*(code *)PTR_memcpy_0011256c)(puVar2 + iVar3,pkt->data + offset,iVar1);\n  puVar2 = pkt->data;\n                    /* WARNING: Subroutine does not return */\n  ssh->deferred_len = ssh->deferred_len + iVar1;\n  safefree(puVar2);\n}\n\n" comment (function_definition "void defer_packet(Ssh_conflict ssh,int pkttype,...)\n\n{\n  Packet *pkt;\n  int iVar1;\n  uchar *puVar2;\n  int iVar3;\n  size_t n;\n  va_list in_a2;\n  undefined4 in_a3;\n  va_list local_res8;\n  undefined4 local_resc;\n  va_list ap;\n  int offset;\n  undefined4 local_1c;\n  \n  local_1c = *(undefined4 *)PTR___stack_chk_guard_00112630;\n  local_res8 = in_a2;\n  local_resc = in_a3;\n  pkt = construct_packet((Ssh_conflict)pkttype,(int)&local_res8,in_a2);\n  iVar1 = s_wrpkt_prepare(ssh,pkt,&offset);\n  iVar3 = ssh->deferred_len;\n  if (ssh->deferred_size < iVar1 + iVar3) {\n    n = iVar1 + iVar3 + 0x80;\n    ssh->deferred_size = n;\n    puVar2 = (uchar *)saferealloc(ssh->deferred_send_data,n,1);\n    iVar3 = ssh->deferred_len;\n    ssh->deferred_send_data = puVar2;\n  }\n  else {\n    puVar2 = ssh->deferred_send_data;\n  }\n  (*(code *)PTR_memcpy_0011256c)(puVar2 + iVar3,pkt->data + offset,iVar1);\n  puVar2 = pkt->data;\n                    /* WARNING: Subroutine does not return */\n  ssh->deferred_len = ssh->deferred_len + iVar1;\n  safefree(puVar2);\n}" primitive_type (function_declarator "defer_packet(Ssh_conflict ssh,int pkttype,...)" identifier (parameter_list "(Ssh_conflict ssh,int pkttype,...)" ( (parameter_declaration "Ssh_conflict ssh" type_identifier identifier) , (parameter_declaration "int pkttype" primitive_type identifier) , (variadic_parameter "..." ...) ))) (compound_statement "{\n  Packet *pkt;\n  int iVar1;\n  uchar *puVar2;\n  int iVar3;\n  size_t n;\n  va_list in_a2;\n  undefined4 in_a3;\n  va_list local_res8;\n  undefined4 local_resc;\n  va_list ap;\n  int offset;\n  undefined4 local_1c;\n  \n  local_1c = *(undefined4 *)PTR___stack_chk_guard_00112630;\n  local_res8 = in_a2;\n  local_resc = in_a3;\n  pkt = construct_packet((Ssh_conflict)pkttype,(int)&local_res8,in_a2);\n  iVar1 = s_wrpkt_prepare(ssh,pkt,&offset);\n  iVar3 = ssh->deferred_len;\n  if (ssh->deferred_size < iVar1 + iVar3) {\n    n = iVar1 + iVar3 + 0x80;\n    ssh->deferred_size = n;\n    puVar2 = (uchar *)saferealloc(ssh->deferred_send_data,n,1);\n    iVar3 = ssh->deferred_len;\n    ssh->deferred_send_data = puVar2;\n  }\n  else {\n    puVar2 = ssh->deferred_send_data;\n  }\n  (*(code *)PTR_memcpy_0011256c)(puVar2 + iVar3,pkt->data + offset,iVar1);\n  puVar2 = pkt->data;\n                    /* WARNING: Subroutine does not return */\n  ssh->deferred_len = ssh->deferred_len + iVar1;\n  safefree(puVar2);\n}" { (declaration "Packet *pkt;" type_identifier (pointer_declarator "*pkt" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "uchar *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "size_t n;" primitive_type identifier ;) (declaration "va_list in_a2;" type_identifier identifier ;) (declaration "undefined4 in_a3;" type_identifier identifier ;) (declaration "va_list local_res8;" type_identifier identifier ;) (declaration "undefined4 local_resc;" type_identifier identifier ;) (declaration "va_list ap;" type_identifier identifier ;) (declaration "int offset;" primitive_type identifier ;) (declaration "undefined4 local_1c;" type_identifier identifier ;) (expression_statement "local_1c = *(undefined4 *)PTR___stack_chk_guard_00112630;" (assignment_expression "local_1c = *(undefined4 *)PTR___stack_chk_guard_00112630" identifier = (pointer_expression "*(undefined4 *)PTR___stack_chk_guard_00112630" * (cast_expression "(undefined4 *)PTR___stack_chk_guard_00112630" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "local_res8 = in_a2;" (assignment_expression "local_res8 = in_a2" identifier = identifier) ;) (expression_statement "local_resc = in_a3;" (assignment_expression "local_resc = in_a3" identifier = identifier) ;) (expression_statement "pkt = construct_packet((Ssh_conflict)pkttype,(int)&local_res8,in_a2);" (assignment_expression "pkt = construct_packet((Ssh_conflict)pkttype,(int)&local_res8,in_a2)" identifier = (call_expression "construct_packet((Ssh_conflict)pkttype,(int)&local_res8,in_a2)" identifier (argument_list "((Ssh_conflict)pkttype,(int)&local_res8,in_a2)" ( (cast_expression "(Ssh_conflict)pkttype" ( (type_descriptor "Ssh_conflict" type_identifier) ) identifier) , (cast_expression "(int)&local_res8" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&local_res8" & identifier)) , identifier )))) ;) (expression_statement "iVar1 = s_wrpkt_prepare(ssh,pkt,&offset);" (assignment_expression "iVar1 = s_wrpkt_prepare(ssh,pkt,&offset)" identifier = (call_expression "s_wrpkt_prepare(ssh,pkt,&offset)" identifier (argument_list "(ssh,pkt,&offset)" ( identifier , identifier , (pointer_expression "&offset" & identifier) )))) ;) (expression_statement "iVar3 = ssh->deferred_len;" (assignment_expression "iVar3 = ssh->deferred_len" identifier = (field_expression "ssh->deferred_len" identifier -> field_identifier)) ;) (if_statement "if (ssh->deferred_size < iVar1 + iVar3) {\n    n = iVar1 + iVar3 + 0x80;\n    ssh->deferred_size = n;\n    puVar2 = (uchar *)saferealloc(ssh->deferred_send_data,n,1);\n    iVar3 = ssh->deferred_len;\n    ssh->deferred_send_data = puVar2;\n  }\n  else {\n    puVar2 = ssh->deferred_send_data;\n  }" if (parenthesized_expression "(ssh->deferred_size < iVar1 + iVar3)" ( (binary_expression "ssh->deferred_size < iVar1 + iVar3" (field_expression "ssh->deferred_size" identifier -> field_identifier) < (binary_expression "iVar1 + iVar3" identifier + identifier)) )) (compound_statement "{\n    n = iVar1 + iVar3 + 0x80;\n    ssh->deferred_size = n;\n    puVar2 = (uchar *)saferealloc(ssh->deferred_send_data,n,1);\n    iVar3 = ssh->deferred_len;\n    ssh->deferred_send_data = puVar2;\n  }" { (expression_statement "n = iVar1 + iVar3 + 0x80;" (assignment_expression "n = iVar1 + iVar3 + 0x80" identifier = (binary_expression "iVar1 + iVar3 + 0x80" (binary_expression "iVar1 + iVar3" identifier + identifier) + number_literal)) ;) (expression_statement "ssh->deferred_size = n;" (assignment_expression "ssh->deferred_size = n" (field_expression "ssh->deferred_size" identifier -> field_identifier) = identifier) ;) (expression_statement "puVar2 = (uchar *)saferealloc(ssh->deferred_send_data,n,1);" (assignment_expression "puVar2 = (uchar *)saferealloc(ssh->deferred_send_data,n,1)" identifier = (cast_expression "(uchar *)saferealloc(ssh->deferred_send_data,n,1)" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "saferealloc(ssh->deferred_send_data,n,1)" identifier (argument_list "(ssh->deferred_send_data,n,1)" ( (field_expression "ssh->deferred_send_data" identifier -> field_identifier) , identifier , number_literal ))))) ;) (expression_statement "iVar3 = ssh->deferred_len;" (assignment_expression "iVar3 = ssh->deferred_len" identifier = (field_expression "ssh->deferred_len" identifier -> field_identifier)) ;) (expression_statement "ssh->deferred_send_data = puVar2;" (assignment_expression "ssh->deferred_send_data = puVar2" (field_expression "ssh->deferred_send_data" identifier -> field_identifier) = identifier) ;) }) (else_clause "else {\n    puVar2 = ssh->deferred_send_data;\n  }" else (compound_statement "{\n    puVar2 = ssh->deferred_send_data;\n  }" { (expression_statement "puVar2 = ssh->deferred_send_data;" (assignment_expression "puVar2 = ssh->deferred_send_data" identifier = (field_expression "ssh->deferred_send_data" identifier -> field_identifier)) ;) }))) (expression_statement "(*(code *)PTR_memcpy_0011256c)(puVar2 + iVar3,pkt->data + offset,iVar1);" (call_expression "(*(code *)PTR_memcpy_0011256c)(puVar2 + iVar3,pkt->data + offset,iVar1)" (parenthesized_expression "(*(code *)PTR_memcpy_0011256c)" ( (pointer_expression "*(code *)PTR_memcpy_0011256c" * (cast_expression "(code *)PTR_memcpy_0011256c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(puVar2 + iVar3,pkt->data + offset,iVar1)" ( (binary_expression "puVar2 + iVar3" identifier + identifier) , (binary_expression "pkt->data + offset" (field_expression "pkt->data" identifier -> field_identifier) + identifier) , identifier ))) ;) (expression_statement "puVar2 = pkt->data;" (assignment_expression "puVar2 = pkt->data" identifier = (field_expression "pkt->data" identifier -> field_identifier)) ;) comment (expression_statement "ssh->deferred_len = ssh->deferred_len + iVar1;" (assignment_expression "ssh->deferred_len = ssh->deferred_len + iVar1" (field_expression "ssh->deferred_len" identifier -> field_identifier) = (binary_expression "ssh->deferred_len + iVar1" (field_expression "ssh->deferred_len" identifier -> field_identifier) + identifier)) ;) (expression_statement "safefree(puVar2);" (call_expression "safefree(puVar2)" identifier (argument_list "(puVar2)" ( identifier ))) ;) })))
(translation_unit "int FUN_0004cc84(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  undefined *puVar1;\n  undefined4 *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  int *piVar7;\n  int iVar8;\n  int iVar9;\n  undefined4 local_res8;\n  undefined4 local_resc;\n  int local_20;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_00112630;\n  local_1c = *(int *)PTR___stack_chk_guard_00112630;\n  local_res8 = param_3;\n  local_resc = param_4;\n  puVar2 = (undefined4 *)FUN_0004ca88(param_2,&local_res8);\n  iVar3 = FUN_0004b768(param_1,puVar2,&local_20);\n  iVar5 = *(int *)(param_1 + 0x16c);\n  if (*(int *)(param_1 + 0x170) < iVar3 + iVar5) {\n    iVar5 = iVar3 + iVar5 + 0x80;\n    *(int *)(param_1 + 0x170) = iVar5;\n    iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);\n    iVar5 = *(int *)(param_1 + 0x16c);\n    *(int *)(param_1 + 0x168) = iVar4;\n  }\n  else {\n    iVar4 = *(int *)(param_1 + 0x168);\n  }\n  iVar8 = puVar2[4] + local_20;\n  iVar9 = iVar3;\n  (*(code *)PTR_memcpy_0011256c)(iVar4 + iVar5);\n  uVar6 = puVar2[4];\n  *(int *)(param_1 + 0x16c) = *(int *)(param_1 + 0x16c) + iVar3;\n  safefree(uVar6);\n  safefree();\n  if (local_1c == *(int *)puVar1) {\n    return *(int *)puVar1;\n  }\n  (*(code *)PTR___stack_chk_fail_001122c8)();\n  if (iVar8 != 0) {\n    log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);\n  }\n  piVar7 = (int *)*puVar2;\n  if (piVar7 != (int *)0x0) {\n                    \n                    \n    iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);\n    return iVar3;\n  }\n  return 0;\n}\n\n" (function_definition "int FUN_0004cc84(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  undefined *puVar1;\n  undefined4 *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  int *piVar7;\n  int iVar8;\n  int iVar9;\n  undefined4 local_res8;\n  undefined4 local_resc;\n  int local_20;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_00112630;\n  local_1c = *(int *)PTR___stack_chk_guard_00112630;\n  local_res8 = param_3;\n  local_resc = param_4;\n  puVar2 = (undefined4 *)FUN_0004ca88(param_2,&local_res8);\n  iVar3 = FUN_0004b768(param_1,puVar2,&local_20);\n  iVar5 = *(int *)(param_1 + 0x16c);\n  if (*(int *)(param_1 + 0x170) < iVar3 + iVar5) {\n    iVar5 = iVar3 + iVar5 + 0x80;\n    *(int *)(param_1 + 0x170) = iVar5;\n    iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);\n    iVar5 = *(int *)(param_1 + 0x16c);\n    *(int *)(param_1 + 0x168) = iVar4;\n  }\n  else {\n    iVar4 = *(int *)(param_1 + 0x168);\n  }\n  iVar8 = puVar2[4] + local_20;\n  iVar9 = iVar3;\n  (*(code *)PTR_memcpy_0011256c)(iVar4 + iVar5);\n  uVar6 = puVar2[4];\n  *(int *)(param_1 + 0x16c) = *(int *)(param_1 + 0x16c) + iVar3;\n  safefree(uVar6);\n  safefree();\n  if (local_1c == *(int *)puVar1) {\n    return *(int *)puVar1;\n  }\n  (*(code *)PTR___stack_chk_fail_001122c8)();\n  if (iVar8 != 0) {\n    log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);\n  }\n  piVar7 = (int *)*puVar2;\n  if (piVar7 != (int *)0x0) {\n                    \n                    \n    iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);\n    return iVar3;\n  }\n  return 0;\n}" primitive_type (function_declarator "FUN_0004cc84(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" identifier (parameter_list "(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  undefined4 *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  int *piVar7;\n  int iVar8;\n  int iVar9;\n  undefined4 local_res8;\n  undefined4 local_resc;\n  int local_20;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_00112630;\n  local_1c = *(int *)PTR___stack_chk_guard_00112630;\n  local_res8 = param_3;\n  local_resc = param_4;\n  puVar2 = (undefined4 *)FUN_0004ca88(param_2,&local_res8);\n  iVar3 = FUN_0004b768(param_1,puVar2,&local_20);\n  iVar5 = *(int *)(param_1 + 0x16c);\n  if (*(int *)(param_1 + 0x170) < iVar3 + iVar5) {\n    iVar5 = iVar3 + iVar5 + 0x80;\n    *(int *)(param_1 + 0x170) = iVar5;\n    iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);\n    iVar5 = *(int *)(param_1 + 0x16c);\n    *(int *)(param_1 + 0x168) = iVar4;\n  }\n  else {\n    iVar4 = *(int *)(param_1 + 0x168);\n  }\n  iVar8 = puVar2[4] + local_20;\n  iVar9 = iVar3;\n  (*(code *)PTR_memcpy_0011256c)(iVar4 + iVar5);\n  uVar6 = puVar2[4];\n  *(int *)(param_1 + 0x16c) = *(int *)(param_1 + 0x16c) + iVar3;\n  safefree(uVar6);\n  safefree();\n  if (local_1c == *(int *)puVar1) {\n    return *(int *)puVar1;\n  }\n  (*(code *)PTR___stack_chk_fail_001122c8)();\n  if (iVar8 != 0) {\n    log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);\n  }\n  piVar7 = (int *)*puVar2;\n  if (piVar7 != (int *)0x0) {\n                    \n                    \n    iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);\n    return iVar3;\n  }\n  return 0;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "undefined4 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "undefined4 uVar6;" type_identifier identifier ;) (declaration "int *piVar7;" primitive_type (pointer_declarator "*piVar7" * identifier) ;) (declaration "int iVar8;" primitive_type identifier ;) (declaration "int iVar9;" primitive_type identifier ;) (declaration "undefined4 local_res8;" type_identifier identifier ;) (declaration "undefined4 local_resc;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "int local_1c;" primitive_type identifier ;) (expression_statement "puVar1 = PTR___stack_chk_guard_00112630;" (assignment_expression "puVar1 = PTR___stack_chk_guard_00112630" identifier = identifier) ;) (expression_statement "local_1c = *(int *)PTR___stack_chk_guard_00112630;" (assignment_expression "local_1c = *(int *)PTR___stack_chk_guard_00112630" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_00112630" * (cast_expression "(int *)PTR___stack_chk_guard_00112630" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "local_res8 = param_3;" (assignment_expression "local_res8 = param_3" identifier = identifier) ;) (expression_statement "local_resc = param_4;" (assignment_expression "local_resc = param_4" identifier = identifier) ;) (expression_statement "puVar2 = (undefined4 *)FUN_0004ca88(param_2,&local_res8);" (assignment_expression "puVar2 = (undefined4 *)FUN_0004ca88(param_2,&local_res8)" identifier = (cast_expression "(undefined4 *)FUN_0004ca88(param_2,&local_res8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0004ca88(param_2,&local_res8)" identifier (argument_list "(param_2,&local_res8)" ( identifier , (pointer_expression "&local_res8" & identifier) ))))) ;) (expression_statement "iVar3 = FUN_0004b768(param_1,puVar2,&local_20);" (assignment_expression "iVar3 = FUN_0004b768(param_1,puVar2,&local_20)" identifier = (call_expression "FUN_0004b768(param_1,puVar2,&local_20)" identifier (argument_list "(param_1,puVar2,&local_20)" ( identifier , identifier , (pointer_expression "&local_20" & identifier) )))) ;) (expression_statement "iVar5 = *(int *)(param_1 + 0x16c);" (assignment_expression "iVar5 = *(int *)(param_1 + 0x16c)" identifier = (pointer_expression "*(int *)(param_1 + 0x16c)" * (cast_expression "(int *)(param_1 + 0x16c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x16c)" ( (binary_expression "param_1 + 0x16c" identifier + number_literal) ))))) ;) (if_statement "if (*(int *)(param_1 + 0x170) < iVar3 + iVar5) {\n    iVar5 = iVar3 + iVar5 + 0x80;\n    *(int *)(param_1 + 0x170) = iVar5;\n    iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);\n    iVar5 = *(int *)(param_1 + 0x16c);\n    *(int *)(param_1 + 0x168) = iVar4;\n  }\n  else {\n    iVar4 = *(int *)(param_1 + 0x168);\n  }" if (parenthesized_expression "(*(int *)(param_1 + 0x170) < iVar3 + iVar5)" ( (binary_expression "*(int *)(param_1 + 0x170) < iVar3 + iVar5" (pointer_expression "*(int *)(param_1 + 0x170)" * (cast_expression "(int *)(param_1 + 0x170)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x170)" ( (binary_expression "param_1 + 0x170" identifier + number_literal) )))) < (binary_expression "iVar3 + iVar5" identifier + identifier)) )) (compound_statement "{\n    iVar5 = iVar3 + iVar5 + 0x80;\n    *(int *)(param_1 + 0x170) = iVar5;\n    iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);\n    iVar5 = *(int *)(param_1 + 0x16c);\n    *(int *)(param_1 + 0x168) = iVar4;\n  }" { (expression_statement "iVar5 = iVar3 + iVar5 + 0x80;" (assignment_expression "iVar5 = iVar3 + iVar5 + 0x80" identifier = (binary_expression "iVar3 + iVar5 + 0x80" (binary_expression "iVar3 + iVar5" identifier + identifier) + number_literal)) ;) (expression_statement "*(int *)(param_1 + 0x170) = iVar5;" (assignment_expression "*(int *)(param_1 + 0x170) = iVar5" (pointer_expression "*(int *)(param_1 + 0x170)" * (cast_expression "(int *)(param_1 + 0x170)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x170)" ( (binary_expression "param_1 + 0x170" identifier + number_literal) )))) = identifier) ;) (expression_statement "iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);" (assignment_expression "iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1)" identifier = (call_expression "saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1)" identifier (argument_list "(*(undefined4 *)(param_1 + 0x168),iVar5,1)" ( (pointer_expression "*(undefined4 *)(param_1 + 0x168)" * (cast_expression "(undefined4 *)(param_1 + 0x168)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x168)" ( (binary_expression "param_1 + 0x168" identifier + number_literal) )))) , identifier , number_literal )))) ;) (expression_statement "iVar5 = *(int *)(param_1 + 0x16c);" (assignment_expression "iVar5 = *(int *)(param_1 + 0x16c)" identifier = (pointer_expression "*(int *)(param_1 + 0x16c)" * (cast_expression "(int *)(param_1 + 0x16c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x16c)" ( (binary_expression "param_1 + 0x16c" identifier + number_literal) ))))) ;) (expression_statement "*(int *)(param_1 + 0x168) = iVar4;" (assignment_expression "*(int *)(param_1 + 0x168) = iVar4" (pointer_expression "*(int *)(param_1 + 0x168)" * (cast_expression "(int *)(param_1 + 0x168)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x168)" ( (binary_expression "param_1 + 0x168" identifier + number_literal) )))) = identifier) ;) }) (else_clause "else {\n    iVar4 = *(int *)(param_1 + 0x168);\n  }" else (compound_statement "{\n    iVar4 = *(int *)(param_1 + 0x168);\n  }" { (expression_statement "iVar4 = *(int *)(param_1 + 0x168);" (assignment_expression "iVar4 = *(int *)(param_1 + 0x168)" identifier = (pointer_expression "*(int *)(param_1 + 0x168)" * (cast_expression "(int *)(param_1 + 0x168)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x168)" ( (binary_expression "param_1 + 0x168" identifier + number_literal) ))))) ;) }))) (expression_statement "iVar8 = puVar2[4] + local_20;" (assignment_expression "iVar8 = puVar2[4] + local_20" identifier = (binary_expression "puVar2[4] + local_20" (subscript_expression "puVar2[4]" identifier [ number_literal ]) + identifier)) ;) (expression_statement "iVar9 = iVar3;" (assignment_expression "iVar9 = iVar3" identifier = identifier) ;) (expression_statement "(*(code *)PTR_memcpy_0011256c)(iVar4 + iVar5);" (call_expression "(*(code *)PTR_memcpy_0011256c)(iVar4 + iVar5)" (parenthesized_expression "(*(code *)PTR_memcpy_0011256c)" ( (pointer_expression "*(code *)PTR_memcpy_0011256c" * (cast_expression "(code *)PTR_memcpy_0011256c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar4 + iVar5)" ( (binary_expression "iVar4 + iVar5" identifier + identifier) ))) ;) (expression_statement "uVar6 = puVar2[4];" (assignment_expression "uVar6 = puVar2[4]" identifier = (subscript_expression "puVar2[4]" identifier [ number_literal ])) ;) (expression_statement "*(int *)(param_1 + 0x16c) = *(int *)(param_1 + 0x16c) + iVar3;" (assignment_expression "*(int *)(param_1 + 0x16c) = *(int *)(param_1 + 0x16c) + iVar3" (pointer_expression "*(int *)(param_1 + 0x16c)" * (cast_expression "(int *)(param_1 + 0x16c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x16c)" ( (binary_expression "param_1 + 0x16c" identifier + number_literal) )))) = (binary_expression "*(int *)(param_1 + 0x16c) + iVar3" (pointer_expression "*(int *)(param_1 + 0x16c)" * (cast_expression "(int *)(param_1 + 0x16c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x16c)" ( (binary_expression "param_1 + 0x16c" identifier + number_literal) )))) + identifier)) ;) (expression_statement "safefree(uVar6);" (call_expression "safefree(uVar6)" identifier (argument_list "(uVar6)" ( identifier ))) ;) (expression_statement "safefree();" (call_expression "safefree()" identifier (argument_list "()" ( ))) ;) (if_statement "if (local_1c == *(int *)puVar1) {\n    return *(int *)puVar1;\n  }" if (parenthesized_expression "(local_1c == *(int *)puVar1)" ( (binary_expression "local_1c == *(int *)puVar1" identifier == (pointer_expression "*(int *)puVar1" * (cast_expression "(int *)puVar1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    return *(int *)puVar1;\n  }" { (return_statement "return *(int *)puVar1;" return (pointer_expression "*(int *)puVar1" * (cast_expression "(int *)puVar1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) ;) })) (expression_statement "(*(code *)PTR___stack_chk_fail_001122c8)();" (call_expression "(*(code *)PTR___stack_chk_fail_001122c8)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_001122c8)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_001122c8" * (cast_expression "(code *)PTR___stack_chk_fail_001122c8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (if_statement "if (iVar8 != 0) {\n    log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);\n  }" if (parenthesized_expression "(iVar8 != 0)" ( (binary_expression "iVar8 != 0" identifier != number_literal) )) (compound_statement "{\n    log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);\n  }" { (expression_statement "log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);" (call_expression "log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0)" identifier (argument_list "(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0)" ( identifier , number_literal , number_literal , number_literal , identifier , identifier , number_literal , number_literal , number_literal , number_literal , number_literal ))) ;) })) (expression_statement "piVar7 = (int *)*puVar2;" (assignment_expression "piVar7 = (int *)*puVar2" identifier = (cast_expression "(int *)*puVar2" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*puVar2" * identifier))) ;) (if_statement "if (piVar7 != (int *)0x0) {\n                    \n                    \n    iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);\n    return iVar3;\n  }" if (parenthesized_expression "(piVar7 != (int *)0x0)" ( (binary_expression "piVar7 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    \n                    \n    iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);\n    return iVar3;\n  }" { (expression_statement "iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);" (assignment_expression "iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4)" identifier = (call_expression "(**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4)" (parenthesized_expression "(**(code **)(*piVar7 + 8))" ( (pointer_expression "**(code **)(*piVar7 + 8)" * (pointer_expression "*(code **)(*piVar7 + 8)" * (cast_expression "(code **)(*piVar7 + 8)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*piVar7 + 8)" ( (binary_expression "*piVar7 + 8" (pointer_expression "*piVar7" * identifier) + number_literal) ))))) )) (argument_list "(piVar7,iVar9,param_4)" ( identifier , identifier , identifier )))) ;) (return_statement "return iVar3;" return identifier ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE 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 = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , (pointer_expression & IDENT) ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , (pointer_expression & IDENT) )))) ;) (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) )))) < (binary_expression IDENT + IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT + IDENT) + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , IDENT , LIT )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) }))) (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) + IDENT)) ;) (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 ( (binary_expression IDENT + IDENT) ))) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + IDENT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( ))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) )) (compound_statement { (return_statement return (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) ;) })) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT , LIT , LIT , IDENT , IDENT , LIT , LIT , LIT , LIT , LIT ))) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (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 (pointer_expression * IDENT) + LIT) ))))) )) (argument_list ( IDENT , IDENT , IDENT )))) ;) (return_statement return IDENT ;) })) (return_statement return LIT ;) })))
(function_definition "int FUN_0004cc84(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  undefined *puVar1;\n  undefined4 *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  int *piVar7;\n  int iVar8;\n  int iVar9;\n  undefined4 local_res8;\n  undefined4 local_resc;\n  int local_20;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_00112630;\n  local_1c = *(int *)PTR___stack_chk_guard_00112630;\n  local_res8 = param_3;\n  local_resc = param_4;\n  puVar2 = (undefined4 *)FUN_0004ca88(param_2,&local_res8);\n  iVar3 = FUN_0004b768(param_1,puVar2,&local_20);\n  iVar5 = *(int *)(param_1 + 0x16c);\n  if (*(int *)(param_1 + 0x170) < iVar3 + iVar5) {\n    iVar5 = iVar3 + iVar5 + 0x80;\n    *(int *)(param_1 + 0x170) = iVar5;\n    iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);\n    iVar5 = *(int *)(param_1 + 0x16c);\n    *(int *)(param_1 + 0x168) = iVar4;\n  }\n  else {\n    iVar4 = *(int *)(param_1 + 0x168);\n  }\n  iVar8 = puVar2[4] + local_20;\n  iVar9 = iVar3;\n  (*(code *)PTR_memcpy_0011256c)(iVar4 + iVar5);\n  uVar6 = puVar2[4];\n  *(int *)(param_1 + 0x16c) = *(int *)(param_1 + 0x16c) + iVar3;\n  safefree(uVar6);\n  safefree();\n  if (local_1c == *(int *)puVar1) {\n    return *(int *)puVar1;\n  }\n  (*(code *)PTR___stack_chk_fail_001122c8)();\n  if (iVar8 != 0) {\n    log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);\n  }\n  piVar7 = (int *)*puVar2;\n  if (piVar7 != (int *)0x0) {\n                    \n                    \n    iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);\n    return iVar3;\n  }\n  return 0;\n}" (primitive_type "int") (function_declarator "FUN_0004cc84(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" (identifier "FUN_0004cc84") (parameter_list "(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) (, ",") (parameter_declaration "undefined4 param_4" (type_identifier "undefined4") (identifier "param_4")) () ")"))) (compound_statement "{\n  undefined *puVar1;\n  undefined4 *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  undefined4 uVar6;\n  int *piVar7;\n  int iVar8;\n  int iVar9;\n  undefined4 local_res8;\n  undefined4 local_resc;\n  int local_20;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_00112630;\n  local_1c = *(int *)PTR___stack_chk_guard_00112630;\n  local_res8 = param_3;\n  local_resc = param_4;\n  puVar2 = (undefined4 *)FUN_0004ca88(param_2,&local_res8);\n  iVar3 = FUN_0004b768(param_1,puVar2,&local_20);\n  iVar5 = *(int *)(param_1 + 0x16c);\n  if (*(int *)(param_1 + 0x170) < iVar3 + iVar5) {\n    iVar5 = iVar3 + iVar5 + 0x80;\n    *(int *)(param_1 + 0x170) = iVar5;\n    iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);\n    iVar5 = *(int *)(param_1 + 0x16c);\n    *(int *)(param_1 + 0x168) = iVar4;\n  }\n  else {\n    iVar4 = *(int *)(param_1 + 0x168);\n  }\n  iVar8 = puVar2[4] + local_20;\n  iVar9 = iVar3;\n  (*(code *)PTR_memcpy_0011256c)(iVar4 + iVar5);\n  uVar6 = puVar2[4];\n  *(int *)(param_1 + 0x16c) = *(int *)(param_1 + 0x16c) + iVar3;\n  safefree(uVar6);\n  safefree();\n  if (local_1c == *(int *)puVar1) {\n    return *(int *)puVar1;\n  }\n  (*(code *)PTR___stack_chk_fail_001122c8)();\n  if (iVar8 != 0) {\n    log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);\n  }\n  piVar7 = (int *)*puVar2;\n  if (piVar7 != (int *)0x0) {\n                    \n                    \n    iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);\n    return iVar3;\n  }\n  return 0;\n}" ({ "{") (declaration "undefined *puVar1;" (type_identifier "undefined") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "undefined4 *puVar2;" (type_identifier "undefined4") (pointer_declarator "*puVar2" (* "*") (identifier "puVar2")) (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (declaration "undefined4 uVar6;" (type_identifier "undefined4") (identifier "uVar6") (; ";")) (declaration "int *piVar7;" (primitive_type "int") (pointer_declarator "*piVar7" (* "*") (identifier "piVar7")) (; ";")) (declaration "int iVar8;" (primitive_type "int") (identifier "iVar8") (; ";")) (declaration "int iVar9;" (primitive_type "int") (identifier "iVar9") (; ";")) (declaration "undefined4 local_res8;" (type_identifier "undefined4") (identifier "local_res8") (; ";")) (declaration "undefined4 local_resc;" (type_identifier "undefined4") (identifier "local_resc") (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "int local_1c;" (primitive_type "int") (identifier "local_1c") (; ";")) (expression_statement "puVar1 = PTR___stack_chk_guard_00112630;" (assignment_expression "puVar1 = PTR___stack_chk_guard_00112630" (identifier "puVar1") (= "=") (identifier "PTR___stack_chk_guard_00112630")) (; ";")) (expression_statement "local_1c = *(int *)PTR___stack_chk_guard_00112630;" (assignment_expression "local_1c = *(int *)PTR___stack_chk_guard_00112630" (identifier "local_1c") (= "=") (pointer_expression "*(int *)PTR___stack_chk_guard_00112630" (* "*") (cast_expression "(int *)PTR___stack_chk_guard_00112630" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_guard_00112630")))) (; ";")) (expression_statement "local_res8 = param_3;" (assignment_expression "local_res8 = param_3" (identifier "local_res8") (= "=") (identifier "param_3")) (; ";")) (expression_statement "local_resc = param_4;" (assignment_expression "local_resc = param_4" (identifier "local_resc") (= "=") (identifier "param_4")) (; ";")) (expression_statement "puVar2 = (undefined4 *)FUN_0004ca88(param_2,&local_res8);" (assignment_expression "puVar2 = (undefined4 *)FUN_0004ca88(param_2,&local_res8)" (identifier "puVar2") (= "=") (cast_expression "(undefined4 *)FUN_0004ca88(param_2,&local_res8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0004ca88(param_2,&local_res8)" (identifier "FUN_0004ca88") (argument_list "(param_2,&local_res8)" (( "(") (identifier "param_2") (, ",") (pointer_expression "&local_res8" (& "&") (identifier "local_res8")) () ")"))))) (; ";")) (expression_statement "iVar3 = FUN_0004b768(param_1,puVar2,&local_20);" (assignment_expression "iVar3 = FUN_0004b768(param_1,puVar2,&local_20)" (identifier "iVar3") (= "=") (call_expression "FUN_0004b768(param_1,puVar2,&local_20)" (identifier "FUN_0004b768") (argument_list "(param_1,puVar2,&local_20)" (( "(") (identifier "param_1") (, ",") (identifier "puVar2") (, ",") (pointer_expression "&local_20" (& "&") (identifier "local_20")) () ")")))) (; ";")) (expression_statement "iVar5 = *(int *)(param_1 + 0x16c);" (assignment_expression "iVar5 = *(int *)(param_1 + 0x16c)" (identifier "iVar5") (= "=") (pointer_expression "*(int *)(param_1 + 0x16c)" (* "*") (cast_expression "(int *)(param_1 + 0x16c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x16c)" (( "(") (binary_expression "param_1 + 0x16c" (identifier "param_1") (+ "+") (number_literal "0x16c")) () ")"))))) (; ";")) (if_statement "if (*(int *)(param_1 + 0x170) < iVar3 + iVar5) {\n    iVar5 = iVar3 + iVar5 + 0x80;\n    *(int *)(param_1 + 0x170) = iVar5;\n    iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);\n    iVar5 = *(int *)(param_1 + 0x16c);\n    *(int *)(param_1 + 0x168) = iVar4;\n  }\n  else {\n    iVar4 = *(int *)(param_1 + 0x168);\n  }" (if "if") (parenthesized_expression "(*(int *)(param_1 + 0x170) < iVar3 + iVar5)" (( "(") (binary_expression "*(int *)(param_1 + 0x170) < iVar3 + iVar5" (pointer_expression "*(int *)(param_1 + 0x170)" (* "*") (cast_expression "(int *)(param_1 + 0x170)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x170)" (( "(") (binary_expression "param_1 + 0x170" (identifier "param_1") (+ "+") (number_literal "0x170")) () ")")))) (< "<") (binary_expression "iVar3 + iVar5" (identifier "iVar3") (+ "+") (identifier "iVar5"))) () ")")) (compound_statement "{\n    iVar5 = iVar3 + iVar5 + 0x80;\n    *(int *)(param_1 + 0x170) = iVar5;\n    iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);\n    iVar5 = *(int *)(param_1 + 0x16c);\n    *(int *)(param_1 + 0x168) = iVar4;\n  }" ({ "{") (expression_statement "iVar5 = iVar3 + iVar5 + 0x80;" (assignment_expression "iVar5 = iVar3 + iVar5 + 0x80" (identifier "iVar5") (= "=") (binary_expression "iVar3 + iVar5 + 0x80" (binary_expression "iVar3 + iVar5" (identifier "iVar3") (+ "+") (identifier "iVar5")) (+ "+") (number_literal "0x80"))) (; ";")) (expression_statement "*(int *)(param_1 + 0x170) = iVar5;" (assignment_expression "*(int *)(param_1 + 0x170) = iVar5" (pointer_expression "*(int *)(param_1 + 0x170)" (* "*") (cast_expression "(int *)(param_1 + 0x170)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x170)" (( "(") (binary_expression "param_1 + 0x170" (identifier "param_1") (+ "+") (number_literal "0x170")) () ")")))) (= "=") (identifier "iVar5")) (; ";")) (expression_statement "iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);" (assignment_expression "iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1)" (identifier "iVar4") (= "=") (call_expression "saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1)" (identifier "saferealloc") (argument_list "(*(undefined4 *)(param_1 + 0x168),iVar5,1)" (( "(") (pointer_expression "*(undefined4 *)(param_1 + 0x168)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x168)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x168)" (( "(") (binary_expression "param_1 + 0x168" (identifier "param_1") (+ "+") (number_literal "0x168")) () ")")))) (, ",") (identifier "iVar5") (, ",") (number_literal "1") () ")")))) (; ";")) (expression_statement "iVar5 = *(int *)(param_1 + 0x16c);" (assignment_expression "iVar5 = *(int *)(param_1 + 0x16c)" (identifier "iVar5") (= "=") (pointer_expression "*(int *)(param_1 + 0x16c)" (* "*") (cast_expression "(int *)(param_1 + 0x16c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x16c)" (( "(") (binary_expression "param_1 + 0x16c" (identifier "param_1") (+ "+") (number_literal "0x16c")) () ")"))))) (; ";")) (expression_statement "*(int *)(param_1 + 0x168) = iVar4;" (assignment_expression "*(int *)(param_1 + 0x168) = iVar4" (pointer_expression "*(int *)(param_1 + 0x168)" (* "*") (cast_expression "(int *)(param_1 + 0x168)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x168)" (( "(") (binary_expression "param_1 + 0x168" (identifier "param_1") (+ "+") (number_literal "0x168")) () ")")))) (= "=") (identifier "iVar4")) (; ";")) (} "}")) (else_clause "else {\n    iVar4 = *(int *)(param_1 + 0x168);\n  }" (else "else") (compound_statement "{\n    iVar4 = *(int *)(param_1 + 0x168);\n  }" ({ "{") (expression_statement "iVar4 = *(int *)(param_1 + 0x168);" (assignment_expression "iVar4 = *(int *)(param_1 + 0x168)" (identifier "iVar4") (= "=") (pointer_expression "*(int *)(param_1 + 0x168)" (* "*") (cast_expression "(int *)(param_1 + 0x168)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x168)" (( "(") (binary_expression "param_1 + 0x168" (identifier "param_1") (+ "+") (number_literal "0x168")) () ")"))))) (; ";")) (} "}")))) (expression_statement "iVar8 = puVar2[4] + local_20;" (assignment_expression "iVar8 = puVar2[4] + local_20" (identifier "iVar8") (= "=") (binary_expression "puVar2[4] + local_20" (subscript_expression "puVar2[4]" (identifier "puVar2") ([ "[") (number_literal "4") (] "]")) (+ "+") (identifier "local_20"))) (; ";")) (expression_statement "iVar9 = iVar3;" (assignment_expression "iVar9 = iVar3" (identifier "iVar9") (= "=") (identifier "iVar3")) (; ";")) (expression_statement "(*(code *)PTR_memcpy_0011256c)(iVar4 + iVar5);" (call_expression "(*(code *)PTR_memcpy_0011256c)(iVar4 + iVar5)" (parenthesized_expression "(*(code *)PTR_memcpy_0011256c)" (( "(") (pointer_expression "*(code *)PTR_memcpy_0011256c" (* "*") (cast_expression "(code *)PTR_memcpy_0011256c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_memcpy_0011256c"))) () ")")) (argument_list "(iVar4 + iVar5)" (( "(") (binary_expression "iVar4 + iVar5" (identifier "iVar4") (+ "+") (identifier "iVar5")) () ")"))) (; ";")) (expression_statement "uVar6 = puVar2[4];" (assignment_expression "uVar6 = puVar2[4]" (identifier "uVar6") (= "=") (subscript_expression "puVar2[4]" (identifier "puVar2") ([ "[") (number_literal "4") (] "]"))) (; ";")) (expression_statement "*(int *)(param_1 + 0x16c) = *(int *)(param_1 + 0x16c) + iVar3;" (assignment_expression "*(int *)(param_1 + 0x16c) = *(int *)(param_1 + 0x16c) + iVar3" (pointer_expression "*(int *)(param_1 + 0x16c)" (* "*") (cast_expression "(int *)(param_1 + 0x16c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x16c)" (( "(") (binary_expression "param_1 + 0x16c" (identifier "param_1") (+ "+") (number_literal "0x16c")) () ")")))) (= "=") (binary_expression "*(int *)(param_1 + 0x16c) + iVar3" (pointer_expression "*(int *)(param_1 + 0x16c)" (* "*") (cast_expression "(int *)(param_1 + 0x16c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x16c)" (( "(") (binary_expression "param_1 + 0x16c" (identifier "param_1") (+ "+") (number_literal "0x16c")) () ")")))) (+ "+") (identifier "iVar3"))) (; ";")) (expression_statement "safefree(uVar6);" (call_expression "safefree(uVar6)" (identifier "safefree") (argument_list "(uVar6)" (( "(") (identifier "uVar6") () ")"))) (; ";")) (expression_statement "safefree();" (call_expression "safefree()" (identifier "safefree") (argument_list "()" (( "(") () ")"))) (; ";")) (if_statement "if (local_1c == *(int *)puVar1) {\n    return *(int *)puVar1;\n  }" (if "if") (parenthesized_expression "(local_1c == *(int *)puVar1)" (( "(") (binary_expression "local_1c == *(int *)puVar1" (identifier "local_1c") (== "==") (pointer_expression "*(int *)puVar1" (* "*") (cast_expression "(int *)puVar1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar1")))) () ")")) (compound_statement "{\n    return *(int *)puVar1;\n  }" ({ "{") (return_statement "return *(int *)puVar1;" (return "return") (pointer_expression "*(int *)puVar1" (* "*") (cast_expression "(int *)puVar1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar1"))) (; ";")) (} "}"))) (expression_statement "(*(code *)PTR___stack_chk_fail_001122c8)();" (call_expression "(*(code *)PTR___stack_chk_fail_001122c8)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_001122c8)" (( "(") (pointer_expression "*(code *)PTR___stack_chk_fail_001122c8" (* "*") (cast_expression "(code *)PTR___stack_chk_fail_001122c8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_fail_001122c8"))) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (if_statement "if (iVar8 != 0) {\n    log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);\n  }" (if "if") (parenthesized_expression "(iVar8 != 0)" (( "(") (binary_expression "iVar8 != 0" (identifier "iVar8") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);\n  }" ({ "{") (expression_statement "log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);" (call_expression "log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0)" (identifier "log_packet") (argument_list "(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0)" (( "(") (identifier "iVar8") (, ",") (number_literal "1") (, ",") (number_literal "0xffffffff") (, ",") (number_literal "0") (, ",") (identifier "iVar9") (, ",") (identifier "param_4") (, ",") (number_literal "0") (, ",") (number_literal "0") (, ",") (number_literal "0") (, ",") (number_literal "0") (, ",") (number_literal "0") () ")"))) (; ";")) (} "}"))) (expression_statement "piVar7 = (int *)*puVar2;" (assignment_expression "piVar7 = (int *)*puVar2" (identifier "piVar7") (= "=") (cast_expression "(int *)*puVar2" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*puVar2" (* "*") (identifier "puVar2")))) (; ";")) (if_statement "if (piVar7 != (int *)0x0) {\n                    \n                    \n    iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);\n    return iVar3;\n  }" (if "if") (parenthesized_expression "(piVar7 != (int *)0x0)" (( "(") (binary_expression "piVar7 != (int *)0x0" (identifier "piVar7") (!= "!=") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n                    \n                    \n    iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);\n    return iVar3;\n  }" ({ "{") (expression_statement "iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);" (assignment_expression "iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4)" (identifier "iVar3") (= "=") (call_expression "(**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4)" (parenthesized_expression "(**(code **)(*piVar7 + 8))" (( "(") (pointer_expression "**(code **)(*piVar7 + 8)" (* "*") (pointer_expression "*(code **)(*piVar7 + 8)" (* "*") (cast_expression "(code **)(*piVar7 + 8)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*piVar7 + 8)" (( "(") (binary_expression "*piVar7 + 8" (pointer_expression "*piVar7" (* "*") (identifier "piVar7")) (+ "+") (number_literal "8")) () ")"))))) () ")")) (argument_list "(piVar7,iVar9,param_4)" (( "(") (identifier "piVar7") (, ",") (identifier "iVar9") (, ",") (identifier "param_4") () ")")))) (; ";")) (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}"))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

void function_1(type_1 ssh,int pkttype,...)

{
  type_2 *pkt;
  int var_3;
  type_3 *var_6;
  int var_4;
  size_t n;
  type_4 in_a2;
  type_5 in_a3;
  type_4 local_res8;
  type_5 local_resc;
  type_4 ap;
  int var_7;
  type_5 local_1c;
  
  local_1c = *(type_5 *)PTR___stack_chk_guard_00112630;
  local_res8 = in_a2;
  local_resc = in_a3;
  pkt = var_1((type_1)pkttype,(int)&local_res8,in_a2);
  var_3 = var_2(ssh,pkt,&var_7);
  var_4 = ssh->deferred_len;
  if (ssh->deferred_size < var_3 + var_4) {
    n = var_3 + var_4 + 0x80;
    ssh->deferred_size = n;
    var_6 = (type_3 *)var_5(ssh->deferred_send_data,n,1);
    var_4 = ssh->deferred_len;
    ssh->deferred_send_data = var_6;
  }
  else {
    var_6 = ssh->deferred_send_data;
  }
  (*(type_6 *)PTR_memcpy_0011256c)(var_6 + var_4,pkt->data + var_7,var_3);
  var_6 = pkt->data;
                    /* WARNING: Subroutine does not return */
  ssh->deferred_len = ssh->deferred_len + var_3;
  var_8(var_6);
}


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

int MASKED(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  undefined *puVar1;
  undefined4 *puVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  undefined4 uVar6;
  int *piVar7;
  int iVar8;
  int iVar9;
  undefined4 local_res8;
  undefined4 local_resc;
  int local_20;
  int local_1c;
  
  puVar1 = PTR___stack_chk_guard_00112630;
  local_1c = *(int *)PTR___stack_chk_guard_00112630;
  local_res8 = param_3;
  local_resc = param_4;
  puVar2 = (undefined4 *)FUN_0004ca88(param_2,&local_res8);
  iVar3 = FUN_0004b768(param_1,puVar2,&local_20);
  iVar5 = *(int *)(param_1 + 0x16c);
  if (*(int *)(param_1 + 0x170) < iVar3 + iVar5) {
    iVar5 = iVar3 + iVar5 + 0x80;
    *(int *)(param_1 + 0x170) = iVar5;
    iVar4 = saferealloc(*(undefined4 *)(param_1 + 0x168),iVar5,1);
    iVar5 = *(int *)(param_1 + 0x16c);
    *(int *)(param_1 + 0x168) = iVar4;
  }
  else {
    iVar4 = *(int *)(param_1 + 0x168);
  }
  iVar8 = puVar2[4] + local_20;
  iVar9 = iVar3;
  (*(code *)PTR_memcpy_0011256c)(iVar4 + iVar5);
  uVar6 = puVar2[4];
  *(int *)(param_1 + 0x16c) = *(int *)(param_1 + 0x16c) + iVar3;
  safefree(uVar6);
  safefree();
  if (local_1c == *(int *)puVar1) {
    return *(int *)puVar1;
  }
  (*(code *)PTR___stack_chk_fail_001122c8)();
  if (iVar8 != 0) {
    log_packet(iVar8,1,0xffffffff,0,iVar9,param_4,0,0,0,0,0);
  }
  piVar7 = (int *)*puVar2;
  if (piVar7 != (int *)0x0) {
                    /* WARNING: Could not recover jumptable at 0x0004ce68. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    iVar3 = (**(code **)(*piVar7 + 8))(piVar7,iVar9,param_4);
    return iVar3;
  }
  return 0;
}

