
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void __regparm3 sftp_pkt_addstring(sftp_packet *pkt,char *data)

{
  int iVar1;
  size_t __n;
  char *pcVar2;
  uint uVar3;
  uint uVar4;
  int in_GS_OFFSET;
  
  uVar3 = pkt->length;
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  pcVar2 = pkt->data;
  pkt->length = uVar3 + 4;
  if ((int)pkt->maxlen < (int)(uVar3 + 4)) {
    pkt->maxlen = uVar3 + 0x104;
    pcVar2 = (char *)saferealloc(pcVar2,uVar3 + 0x104,1);
    pkt->data = pcVar2;
    uVar3 = pkt->length - 4;
  }
  pcVar2 = pcVar2 + uVar3;
  pcVar2[0] = '\0';
  pcVar2[1] = '\0';
  pcVar2[2] = '\0';
  pcVar2[3] = '\0';
  uVar4 = pkt->length;
  pkt->savedpos = uVar4;
  __n = strlen(data);
  uVar3 = uVar4 + __n;
  pkt->length = uVar3;
  if ((int)pkt->maxlen < (int)uVar3) {
    pkt->maxlen = uVar3 + 0x100;
    pcVar2 = (char *)saferealloc(pkt->data,uVar3 + 0x100,1);
    pkt->data = pcVar2;
    uVar4 = pkt->length - __n;
  }
  else {
    pcVar2 = pkt->data;
  }
  memcpy(pcVar2 + uVar4,data,__n);
  pkt->data[pkt->savedpos - 4] = (char)(pkt->length - pkt->savedpos >> 0x18);
  pkt->data[pkt->savedpos - 3] = (char)(pkt->length - pkt->savedpos >> 0x10);
  pkt->data[pkt->savedpos - 2] = (char)(pkt->length - pkt->savedpos >> 8);
  pkt->data[pkt->savedpos - 1] = (char)pkt->length - (char)pkt->savedpos;
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void __regparm3 FUN_0002e4c0(int *param_1,char *param_2)

{
  int iVar1;
  size_t __n;
  int iVar2;
  int iVar3;
  int in_GS_OFFSET;
  
  iVar2 = param_1[1];
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  iVar3 = *param_1;
  param_1[1] = iVar2 + 4;
  if (param_1[2] < iVar2 + 4) {
    param_1[2] = iVar2 + 0x104;
    iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);
    *param_1 = iVar3;
    iVar2 = param_1[1] + -4;
  }
  *(undefined4 *)(iVar3 + iVar2) = 0;
  iVar3 = param_1[1];
  param_1[3] = iVar3;
  __n = strlen(param_2);
  iVar2 = iVar3 + __n;
  param_1[1] = iVar2;
  if (param_1[2] < iVar2) {
    param_1[2] = iVar2 + 0x100;
    iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);
    *param_1 = iVar2;
    iVar3 = param_1[1] - __n;
  }
  else {
    iVar2 = *param_1;
  }
  memcpy((void *)(iVar2 + iVar3),param_2,__n);
  *(char *)(*param_1 + -4 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x18);
  *(char *)(*param_1 + -3 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x10);
  *(char *)(*param_1 + -2 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 8);
  *(char *)(*param_1 + -1 + param_1[3]) = (char)param_1[1] - (char)param_1[3];
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0008d800();
}


PUSH EBP
PUSH EDI
MOV EDI,EDX
PUSH ESI
MOV ESI,EAX
PUSH EBX
CALL 0x000149a0
ADD EBX,0x9e8a3
SUB ESP,0x2c
MOV ECX,dword ptr [ESI + 0x4]
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x1c],EAX
XOR EAX,EAX
MOV EAX,dword ptr [ESI]
LEA EDX,[ECX + 0x4]
MOV dword ptr [ESI + 0x4],EDX
CMP EDX,dword ptr [ESI + 0x8]
JG 0x0002e590
MOV dword ptr [EAX + ECX*0x1],0x0
MOV EBP,dword ptr [ESI + 0x4]
SUB ESP,0xc
PUSH EDI
MOV dword ptr [ESI + 0xc],EBP
CALL 0x00014460
ADD ESP,0x10
MOV EDX,EAX
LEA EAX,[EBP + EAX*0x1]
MOV dword ptr [ESI + 0x4],EAX
CMP EAX,dword ptr [ESI + 0x8]
JG 0x0002e5b8
MOV EAX,dword ptr [ESI]
SUB ESP,0x4
ADD EAX,EBP
PUSH EDX
PUSH EDI
PUSH EAX
CALL 0x00014130
MOV EDX,dword ptr [ESI + 0xc]
MOV EAX,dword ptr [ESI + 0x4]
ADD ESP,0x10
MOV ECX,dword ptr [ESI]
SUB EAX,EDX
SHR EAX,0x18
MOV byte ptr [ECX + EDX*0x1 + -0x4],AL
MOV EDX,dword ptr [ESI + 0xc]
MOV EAX,dword ptr [ESI + 0x4]
MOV ECX,dword ptr [ESI]
SUB EAX,EDX
SHR EAX,0x10
MOV byte ptr [ECX + EDX*0x1 + -0x3],AL
MOV EDX,dword ptr [ESI + 0xc]
MOV EAX,dword ptr [ESI + 0x4]
MOV ECX,dword ptr [ESI]
SUB EAX,EDX
MOV byte ptr [ECX + EDX*0x1 + -0x2],AH
MOV EDX,dword ptr [ESI + 0xc]
MOV EAX,dword ptr [ESI + 0x4]
MOV ECX,dword ptr [ESI]
SUB EAX,EDX
MOV byte ptr [ECX + EDX*0x1 + -0x1],AL
MOV EAX,dword ptr [ESP + 0x1c]
XOR EAX,dword ptr GS:[0x14]
JNZ 0x0002e5e4
ADD ESP,0x2c
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0x4
ADD ECX,0x104
PUSH 0x1
MOV dword ptr [ESI + 0x8],ECX
PUSH ECX
PUSH EAX
CALL 0x0001dc50
MOV ECX,dword ptr [ESI + 0x4]
ADD ESP,0x10
MOV dword ptr [ESI],EAX
SUB ECX,0x4
JMP 0x0002e4f6
MOV dword ptr [ESP + 0xc],EDX
ADD EAX,0x100
SUB ESP,0x4
PUSH 0x1
MOV dword ptr [ESI + 0x8],EAX
PUSH EAX
PUSH dword ptr [ESI]
CALL 0x0001dc50
MOV EDX,dword ptr [ESP + 0x1c]
MOV EBP,dword ptr [ESI + 0x4]
ADD ESP,0x10
MOV dword ptr [ESI],EAX
SUB EBP,EDX
JMP 0x0002e523
CALL 0x0008d800
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid __regparm3 FUN_0002e4c0(int *param_1,char *param_2)\n\n{\n  int iVar1;\n  size_t __n;\n  int iVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  \n  iVar2 = param_1[1];\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = *param_1;\n  param_1[1] = iVar2 + 4;\n  if (param_1[2] < iVar2 + 4) {\n    param_1[2] = iVar2 + 0x104;\n    iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);\n    *param_1 = iVar3;\n    iVar2 = param_1[1] + -4;\n  }\n  *(undefined4 *)(iVar3 + iVar2) = 0;\n  iVar3 = param_1[1];\n  param_1[3] = iVar3;\n  __n = strlen(param_2);\n  iVar2 = iVar3 + __n;\n  param_1[1] = iVar2;\n  if (param_1[2] < iVar2) {\n    param_1[2] = iVar2 + 0x100;\n    iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);\n    *param_1 = iVar2;\n    iVar3 = param_1[1] - __n;\n  }\n  else {\n    iVar2 = *param_1;\n  }\n  memcpy((void *)(iVar2 + iVar3),param_2,__n);\n  *(char *)(*param_1 + -4 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x18);\n  *(char *)(*param_1 + -3 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x10);\n  *(char *)(*param_1 + -2 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 8);\n  *(char *)(*param_1 + -1 + param_1[3]) = (char)param_1[1] - (char)param_1[3];\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0008d800();\n}\n\n" comment (function_definition "void __regparm3 FUN_0002e4c0(int *param_1,char *param_2)\n\n{\n  int iVar1;\n  size_t __n;\n  int iVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  \n  iVar2 = param_1[1];\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = *param_1;\n  param_1[1] = iVar2 + 4;\n  if (param_1[2] < iVar2 + 4) {\n    param_1[2] = iVar2 + 0x104;\n    iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);\n    *param_1 = iVar3;\n    iVar2 = param_1[1] + -4;\n  }\n  *(undefined4 *)(iVar3 + iVar2) = 0;\n  iVar3 = param_1[1];\n  param_1[3] = iVar3;\n  __n = strlen(param_2);\n  iVar2 = iVar3 + __n;\n  param_1[1] = iVar2;\n  if (param_1[2] < iVar2) {\n    param_1[2] = iVar2 + 0x100;\n    iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);\n    *param_1 = iVar2;\n    iVar3 = param_1[1] - __n;\n  }\n  else {\n    iVar2 = *param_1;\n  }\n  memcpy((void *)(iVar2 + iVar3),param_2,__n);\n  *(char *)(*param_1 + -4 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x18);\n  *(char *)(*param_1 + -3 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x10);\n  *(char *)(*param_1 + -2 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 8);\n  *(char *)(*param_1 + -1 + param_1[3]) = (char)param_1[1] - (char)param_1[3];\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0008d800();\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_0002e4c0(int *param_1,char *param_2)" identifier (parameter_list "(int *param_1,char *param_2)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  size_t __n;\n  int iVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  \n  iVar2 = param_1[1];\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = *param_1;\n  param_1[1] = iVar2 + 4;\n  if (param_1[2] < iVar2 + 4) {\n    param_1[2] = iVar2 + 0x104;\n    iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);\n    *param_1 = iVar3;\n    iVar2 = param_1[1] + -4;\n  }\n  *(undefined4 *)(iVar3 + iVar2) = 0;\n  iVar3 = param_1[1];\n  param_1[3] = iVar3;\n  __n = strlen(param_2);\n  iVar2 = iVar3 + __n;\n  param_1[1] = iVar2;\n  if (param_1[2] < iVar2) {\n    param_1[2] = iVar2 + 0x100;\n    iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);\n    *param_1 = iVar2;\n    iVar3 = param_1[1] - __n;\n  }\n  else {\n    iVar2 = *param_1;\n  }\n  memcpy((void *)(iVar2 + iVar3),param_2,__n);\n  *(char *)(*param_1 + -4 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x18);\n  *(char *)(*param_1 + -3 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x10);\n  *(char *)(*param_1 + -2 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 8);\n  *(char *)(*param_1 + -1 + param_1[3]) = (char)param_1[1] - (char)param_1[3];\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0008d800();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (expression_statement "iVar2 = param_1[1];" (assignment_expression "iVar2 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar3 = *param_1;" (assignment_expression "iVar3 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "param_1[1] = iVar2 + 4;" (assignment_expression "param_1[1] = iVar2 + 4" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (binary_expression "iVar2 + 4" identifier + number_literal)) ;) (if_statement "if (param_1[2] < iVar2 + 4) {\n    param_1[2] = iVar2 + 0x104;\n    iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);\n    *param_1 = iVar3;\n    iVar2 = param_1[1] + -4;\n  }" if (parenthesized_expression "(param_1[2] < iVar2 + 4)" ( (binary_expression "param_1[2] < iVar2 + 4" (subscript_expression "param_1[2]" identifier [ number_literal ]) < (binary_expression "iVar2 + 4" identifier + number_literal)) )) (compound_statement "{\n    param_1[2] = iVar2 + 0x104;\n    iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);\n    *param_1 = iVar3;\n    iVar2 = param_1[1] + -4;\n  }" { (expression_statement "param_1[2] = iVar2 + 0x104;" (assignment_expression "param_1[2] = iVar2 + 0x104" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "iVar2 + 0x104" identifier + number_literal)) ;) (expression_statement "iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);" (assignment_expression "iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1)" identifier = (call_expression "FUN_0001dc50(iVar3,iVar2 + 0x104,1)" identifier (argument_list "(iVar3,iVar2 + 0x104,1)" ( identifier , (binary_expression "iVar2 + 0x104" identifier + number_literal) , number_literal )))) ;) (expression_statement "*param_1 = iVar3;" (assignment_expression "*param_1 = iVar3" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "iVar2 = param_1[1] + -4;" (assignment_expression "iVar2 = param_1[1] + -4" identifier = (binary_expression "param_1[1] + -4" (subscript_expression "param_1[1]" identifier [ number_literal ]) + number_literal)) ;) })) (expression_statement "*(undefined4 *)(iVar3 + iVar2) = 0;" (assignment_expression "*(undefined4 *)(iVar3 + iVar2) = 0" (pointer_expression "*(undefined4 *)(iVar3 + iVar2)" * (cast_expression "(undefined4 *)(iVar3 + iVar2)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + iVar2)" ( (binary_expression "iVar3 + iVar2" identifier + identifier) )))) = number_literal) ;) (expression_statement "iVar3 = param_1[1];" (assignment_expression "iVar3 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "param_1[3] = iVar3;" (assignment_expression "param_1[3] = iVar3" (subscript_expression "param_1[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "__n = strlen(param_2);" (assignment_expression "__n = strlen(param_2)" identifier = (call_expression "strlen(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (expression_statement "iVar2 = iVar3 + __n;" (assignment_expression "iVar2 = iVar3 + __n" identifier = (binary_expression "iVar3 + __n" identifier + identifier)) ;) (expression_statement "param_1[1] = iVar2;" (assignment_expression "param_1[1] = iVar2" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (param_1[2] < iVar2) {\n    param_1[2] = iVar2 + 0x100;\n    iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);\n    *param_1 = iVar2;\n    iVar3 = param_1[1] - __n;\n  }\n  else {\n    iVar2 = *param_1;\n  }" if (parenthesized_expression "(param_1[2] < iVar2)" ( (binary_expression "param_1[2] < iVar2" (subscript_expression "param_1[2]" identifier [ number_literal ]) < identifier) )) (compound_statement "{\n    param_1[2] = iVar2 + 0x100;\n    iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);\n    *param_1 = iVar2;\n    iVar3 = param_1[1] - __n;\n  }" { (expression_statement "param_1[2] = iVar2 + 0x100;" (assignment_expression "param_1[2] = iVar2 + 0x100" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "iVar2 + 0x100" identifier + number_literal)) ;) (expression_statement "iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);" (assignment_expression "iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1)" identifier = (call_expression "FUN_0001dc50(*param_1,iVar2 + 0x100,1)" identifier (argument_list "(*param_1,iVar2 + 0x100,1)" ( (pointer_expression "*param_1" * identifier) , (binary_expression "iVar2 + 0x100" identifier + number_literal) , number_literal )))) ;) (expression_statement "*param_1 = iVar2;" (assignment_expression "*param_1 = iVar2" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "iVar3 = param_1[1] - __n;" (assignment_expression "iVar3 = param_1[1] - __n" identifier = (binary_expression "param_1[1] - __n" (subscript_expression "param_1[1]" identifier [ number_literal ]) - identifier)) ;) }) (else_clause "else {\n    iVar2 = *param_1;\n  }" else (compound_statement "{\n    iVar2 = *param_1;\n  }" { (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) }))) (expression_statement "memcpy((void *)(iVar2 + iVar3),param_2,__n);" (call_expression "memcpy((void *)(iVar2 + iVar3),param_2,__n)" identifier (argument_list "((void *)(iVar2 + iVar3),param_2,__n)" ( (cast_expression "(void *)(iVar2 + iVar3)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + iVar3)" ( (binary_expression "iVar2 + iVar3" identifier + identifier) ))) , identifier , identifier ))) ;) (expression_statement "*(char *)(*param_1 + -4 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x18);" (assignment_expression "*(char *)(*param_1 + -4 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x18)" (pointer_expression "*(char *)(*param_1 + -4 + param_1[3])" * (cast_expression "(char *)(*param_1 + -4 + param_1[3])" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -4 + param_1[3])" ( (binary_expression "*param_1 + -4 + param_1[3]" (binary_expression "*param_1 + -4" (pointer_expression "*param_1" * identifier) + number_literal) + (subscript_expression "param_1[3]" identifier [ number_literal ])) )))) = (cast_expression "(char)((uint)(param_1[1] - param_1[3]) >> 0x18)" ( (type_descriptor "char" primitive_type) ) (parenthesized_expression "((uint)(param_1[1] - param_1[3]) >> 0x18)" ( (binary_expression "(uint)(param_1[1] - param_1[3]) >> 0x18" (call_expression "(uint)(param_1[1] - param_1[3])" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(param_1[1] - param_1[3])" ( (binary_expression "param_1[1] - param_1[3]" (subscript_expression "param_1[1]" identifier [ number_literal ]) - (subscript_expression "param_1[3]" identifier [ number_literal ])) ))) >> number_literal) )))) ;) (expression_statement "*(char *)(*param_1 + -3 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x10);" (assignment_expression "*(char *)(*param_1 + -3 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x10)" (pointer_expression "*(char *)(*param_1 + -3 + param_1[3])" * (cast_expression "(char *)(*param_1 + -3 + param_1[3])" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -3 + param_1[3])" ( (binary_expression "*param_1 + -3 + param_1[3]" (binary_expression "*param_1 + -3" (pointer_expression "*param_1" * identifier) + number_literal) + (subscript_expression "param_1[3]" identifier [ number_literal ])) )))) = (cast_expression "(char)((uint)(param_1[1] - param_1[3]) >> 0x10)" ( (type_descriptor "char" primitive_type) ) (parenthesized_expression "((uint)(param_1[1] - param_1[3]) >> 0x10)" ( (binary_expression "(uint)(param_1[1] - param_1[3]) >> 0x10" (call_expression "(uint)(param_1[1] - param_1[3])" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(param_1[1] - param_1[3])" ( (binary_expression "param_1[1] - param_1[3]" (subscript_expression "param_1[1]" identifier [ number_literal ]) - (subscript_expression "param_1[3]" identifier [ number_literal ])) ))) >> number_literal) )))) ;) (expression_statement "*(char *)(*param_1 + -2 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 8);" (assignment_expression "*(char *)(*param_1 + -2 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 8)" (pointer_expression "*(char *)(*param_1 + -2 + param_1[3])" * (cast_expression "(char *)(*param_1 + -2 + param_1[3])" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -2 + param_1[3])" ( (binary_expression "*param_1 + -2 + param_1[3]" (binary_expression "*param_1 + -2" (pointer_expression "*param_1" * identifier) + number_literal) + (subscript_expression "param_1[3]" identifier [ number_literal ])) )))) = (cast_expression "(char)((uint)(param_1[1] - param_1[3]) >> 8)" ( (type_descriptor "char" primitive_type) ) (parenthesized_expression "((uint)(param_1[1] - param_1[3]) >> 8)" ( (binary_expression "(uint)(param_1[1] - param_1[3]) >> 8" (call_expression "(uint)(param_1[1] - param_1[3])" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(param_1[1] - param_1[3])" ( (binary_expression "param_1[1] - param_1[3]" (subscript_expression "param_1[1]" identifier [ number_literal ]) - (subscript_expression "param_1[3]" identifier [ number_literal ])) ))) >> number_literal) )))) ;) (expression_statement "*(char *)(*param_1 + -1 + param_1[3]) = (char)param_1[1] - (char)param_1[3];" (assignment_expression "*(char *)(*param_1 + -1 + param_1[3]) = (char)param_1[1] - (char)param_1[3]" (pointer_expression "*(char *)(*param_1 + -1 + param_1[3])" * (cast_expression "(char *)(*param_1 + -1 + param_1[3])" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -1 + param_1[3])" ( (binary_expression "*param_1 + -1 + param_1[3]" (binary_expression "*param_1 + -1" (pointer_expression "*param_1" * identifier) + number_literal) + (subscript_expression "param_1[3]" identifier [ number_literal ])) )))) = (binary_expression "(char)param_1[1] - (char)param_1[3]" (cast_expression "(char)param_1[1]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) - (cast_expression "(char)param_1[3]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "param_1[3]" identifier [ number_literal ])))) ;) (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) comment (expression_statement "FUN_0008d800();" (call_expression "FUN_0008d800()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid __regparm3 sftp_pkt_addstring(sftp_packet *pkt,char *data)\n\n{\n  int iVar1;\n  size_t __n;\n  char *pcVar2;\n  uint uVar3;\n  uint uVar4;\n  int in_GS_OFFSET;\n  \n  uVar3 = pkt->length;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  pcVar2 = pkt->data;\n  pkt->length = uVar3 + 4;\n  if ((int)pkt->maxlen < (int)(uVar3 + 4)) {\n    pkt->maxlen = uVar3 + 0x104;\n    pcVar2 = (char *)saferealloc(pcVar2,uVar3 + 0x104,1);\n    pkt->data = pcVar2;\n    uVar3 = pkt->length - 4;\n  }\n  pcVar2 = pcVar2 + uVar3;\n  pcVar2[0] = '\0';\n  pcVar2[1] = '\0';\n  pcVar2[2] = '\0';\n  pcVar2[3] = '\0';\n  uVar4 = pkt->length;\n  pkt->savedpos = uVar4;\n  __n = strlen(data);\n  uVar3 = uVar4 + __n;\n  pkt->length = uVar3;\n  if ((int)pkt->maxlen < (int)uVar3) {\n    pkt->maxlen = uVar3 + 0x100;\n    pcVar2 = (char *)saferealloc(pkt->data,uVar3 + 0x100,1);\n    pkt->data = pcVar2;\n    uVar4 = pkt->length - __n;\n  }\n  else {\n    pcVar2 = pkt->data;\n  }\n  memcpy(pcVar2 + uVar4,data,__n);\n  pkt->data[pkt->savedpos - 4] = (char)(pkt->length - pkt->savedpos >> 0x18);\n  pkt->data[pkt->savedpos - 3] = (char)(pkt->length - pkt->savedpos >> 0x10);\n  pkt->data[pkt->savedpos - 2] = (char)(pkt->length - pkt->savedpos >> 8);\n  pkt->data[pkt->savedpos - 1] = (char)pkt->length - (char)pkt->savedpos;\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment (function_definition "void __regparm3 sftp_pkt_addstring(sftp_packet *pkt,char *data)\n\n{\n  int iVar1;\n  size_t __n;\n  char *pcVar2;\n  uint uVar3;\n  uint uVar4;\n  int in_GS_OFFSET;\n  \n  uVar3 = pkt->length;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  pcVar2 = pkt->data;\n  pkt->length = uVar3 + 4;\n  if ((int)pkt->maxlen < (int)(uVar3 + 4)) {\n    pkt->maxlen = uVar3 + 0x104;\n    pcVar2 = (char *)saferealloc(pcVar2,uVar3 + 0x104,1);\n    pkt->data = pcVar2;\n    uVar3 = pkt->length - 4;\n  }\n  pcVar2 = pcVar2 + uVar3;\n  pcVar2[0] = '\0';\n  pcVar2[1] = '\0';\n  pcVar2[2] = '\0';\n  pcVar2[3] = '\0';\n  uVar4 = pkt->length;\n  pkt->savedpos = uVar4;\n  __n = strlen(data);\n  uVar3 = uVar4 + __n;\n  pkt->length = uVar3;\n  if ((int)pkt->maxlen < (int)uVar3) {\n    pkt->maxlen = uVar3 + 0x100;\n    pcVar2 = (char *)saferealloc(pkt->data,uVar3 + 0x100,1);\n    pkt->data = pcVar2;\n    uVar4 = pkt->length - __n;\n  }\n  else {\n    pcVar2 = pkt->data;\n  }\n  memcpy(pcVar2 + uVar4,data,__n);\n  pkt->data[pkt->savedpos - 4] = (char)(pkt->length - pkt->savedpos >> 0x18);\n  pkt->data[pkt->savedpos - 3] = (char)(pkt->length - pkt->savedpos >> 0x10);\n  pkt->data[pkt->savedpos - 2] = (char)(pkt->length - pkt->savedpos >> 8);\n  pkt->data[pkt->savedpos - 1] = (char)pkt->length - (char)pkt->savedpos;\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "sftp_pkt_addstring(sftp_packet *pkt,char *data)" identifier (parameter_list "(sftp_packet *pkt,char *data)" ( (parameter_declaration "sftp_packet *pkt" type_identifier (pointer_declarator "*pkt" * identifier)) , (parameter_declaration "char *data" primitive_type (pointer_declarator "*data" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  size_t __n;\n  char *pcVar2;\n  uint uVar3;\n  uint uVar4;\n  int in_GS_OFFSET;\n  \n  uVar3 = pkt->length;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  pcVar2 = pkt->data;\n  pkt->length = uVar3 + 4;\n  if ((int)pkt->maxlen < (int)(uVar3 + 4)) {\n    pkt->maxlen = uVar3 + 0x104;\n    pcVar2 = (char *)saferealloc(pcVar2,uVar3 + 0x104,1);\n    pkt->data = pcVar2;\n    uVar3 = pkt->length - 4;\n  }\n  pcVar2 = pcVar2 + uVar3;\n  pcVar2[0] = '\0';\n  pcVar2[1] = '\0';\n  pcVar2[2] = '\0';\n  pcVar2[3] = '\0';\n  uVar4 = pkt->length;\n  pkt->savedpos = uVar4;\n  __n = strlen(data);\n  uVar3 = uVar4 + __n;\n  pkt->length = uVar3;\n  if ((int)pkt->maxlen < (int)uVar3) {\n    pkt->maxlen = uVar3 + 0x100;\n    pcVar2 = (char *)saferealloc(pkt->data,uVar3 + 0x100,1);\n    pkt->data = pcVar2;\n    uVar4 = pkt->length - __n;\n  }\n  else {\n    pcVar2 = pkt->data;\n  }\n  memcpy(pcVar2 + uVar4,data,__n);\n  pkt->data[pkt->savedpos - 4] = (char)(pkt->length - pkt->savedpos >> 0x18);\n  pkt->data[pkt->savedpos - 3] = (char)(pkt->length - pkt->savedpos >> 0x10);\n  pkt->data[pkt->savedpos - 2] = (char)(pkt->length - pkt->savedpos >> 8);\n  pkt->data[pkt->savedpos - 1] = (char)pkt->length - (char)pkt->savedpos;\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (expression_statement "uVar3 = pkt->length;" (assignment_expression "uVar3 = pkt->length" identifier = (field_expression "pkt->length" identifier -> field_identifier)) ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "pcVar2 = pkt->data;" (assignment_expression "pcVar2 = pkt->data" identifier = (field_expression "pkt->data" identifier -> field_identifier)) ;) (expression_statement "pkt->length = uVar3 + 4;" (assignment_expression "pkt->length = uVar3 + 4" (field_expression "pkt->length" identifier -> field_identifier) = (binary_expression "uVar3 + 4" identifier + number_literal)) ;) (if_statement "if ((int)pkt->maxlen < (int)(uVar3 + 4)) {\n    pkt->maxlen = uVar3 + 0x104;\n    pcVar2 = (char *)saferealloc(pcVar2,uVar3 + 0x104,1);\n    pkt->data = pcVar2;\n    uVar3 = pkt->length - 4;\n  }" if (parenthesized_expression "((int)pkt->maxlen < (int)(uVar3 + 4))" ( (binary_expression "(int)pkt->maxlen < (int)(uVar3 + 4)" (cast_expression "(int)pkt->maxlen" ( (type_descriptor "int" primitive_type) ) (field_expression "pkt->maxlen" identifier -> field_identifier)) < (cast_expression "(int)(uVar3 + 4)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(uVar3 + 4)" ( (binary_expression "uVar3 + 4" identifier + number_literal) )))) )) (compound_statement "{\n    pkt->maxlen = uVar3 + 0x104;\n    pcVar2 = (char *)saferealloc(pcVar2,uVar3 + 0x104,1);\n    pkt->data = pcVar2;\n    uVar3 = pkt->length - 4;\n  }" { (expression_statement "pkt->maxlen = uVar3 + 0x104;" (assignment_expression "pkt->maxlen = uVar3 + 0x104" (field_expression "pkt->maxlen" identifier -> field_identifier) = (binary_expression "uVar3 + 0x104" identifier + number_literal)) ;) (expression_statement "pcVar2 = (char *)saferealloc(pcVar2,uVar3 + 0x104,1);" (assignment_expression "pcVar2 = (char *)saferealloc(pcVar2,uVar3 + 0x104,1)" identifier = (cast_expression "(char *)saferealloc(pcVar2,uVar3 + 0x104,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "saferealloc(pcVar2,uVar3 + 0x104,1)" identifier (argument_list "(pcVar2,uVar3 + 0x104,1)" ( identifier , (binary_expression "uVar3 + 0x104" identifier + number_literal) , number_literal ))))) ;) (expression_statement "pkt->data = pcVar2;" (assignment_expression "pkt->data = pcVar2" (field_expression "pkt->data" identifier -> field_identifier) = identifier) ;) (expression_statement "uVar3 = pkt->length - 4;" (assignment_expression "uVar3 = pkt->length - 4" identifier = (binary_expression "pkt->length - 4" (field_expression "pkt->length" identifier -> field_identifier) - number_literal)) ;) })) (expression_statement "pcVar2 = pcVar2 + uVar3;" (assignment_expression "pcVar2 = pcVar2 + uVar3" identifier = (binary_expression "pcVar2 + uVar3" identifier + identifier)) ;) (expression_statement "pcVar2[0] = '\0';" (assignment_expression "pcVar2[0] = '\0'" (subscript_expression "pcVar2[0]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "pcVar2[1] = '\0';" (assignment_expression "pcVar2[1] = '\0'" (subscript_expression "pcVar2[1]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "pcVar2[2] = '\0';" (assignment_expression "pcVar2[2] = '\0'" (subscript_expression "pcVar2[2]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "pcVar2[3] = '\0';" (assignment_expression "pcVar2[3] = '\0'" (subscript_expression "pcVar2[3]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "uVar4 = pkt->length;" (assignment_expression "uVar4 = pkt->length" identifier = (field_expression "pkt->length" identifier -> field_identifier)) ;) (expression_statement "pkt->savedpos = uVar4;" (assignment_expression "pkt->savedpos = uVar4" (field_expression "pkt->savedpos" identifier -> field_identifier) = identifier) ;) (expression_statement "__n = strlen(data);" (assignment_expression "__n = strlen(data)" identifier = (call_expression "strlen(data)" identifier (argument_list "(data)" ( identifier )))) ;) (expression_statement "uVar3 = uVar4 + __n;" (assignment_expression "uVar3 = uVar4 + __n" identifier = (binary_expression "uVar4 + __n" identifier + identifier)) ;) (expression_statement "pkt->length = uVar3;" (assignment_expression "pkt->length = uVar3" (field_expression "pkt->length" identifier -> field_identifier) = identifier) ;) (if_statement "if ((int)pkt->maxlen < (int)uVar3) {\n    pkt->maxlen = uVar3 + 0x100;\n    pcVar2 = (char *)saferealloc(pkt->data,uVar3 + 0x100,1);\n    pkt->data = pcVar2;\n    uVar4 = pkt->length - __n;\n  }\n  else {\n    pcVar2 = pkt->data;\n  }" if (parenthesized_expression "((int)pkt->maxlen < (int)uVar3)" ( (binary_expression "(int)pkt->maxlen < (int)uVar3" (cast_expression "(int)pkt->maxlen" ( (type_descriptor "int" primitive_type) ) (field_expression "pkt->maxlen" identifier -> field_identifier)) < (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n    pkt->maxlen = uVar3 + 0x100;\n    pcVar2 = (char *)saferealloc(pkt->data,uVar3 + 0x100,1);\n    pkt->data = pcVar2;\n    uVar4 = pkt->length - __n;\n  }" { (expression_statement "pkt->maxlen = uVar3 + 0x100;" (assignment_expression "pkt->maxlen = uVar3 + 0x100" (field_expression "pkt->maxlen" identifier -> field_identifier) = (binary_expression "uVar3 + 0x100" identifier + number_literal)) ;) (expression_statement "pcVar2 = (char *)saferealloc(pkt->data,uVar3 + 0x100,1);" (assignment_expression "pcVar2 = (char *)saferealloc(pkt->data,uVar3 + 0x100,1)" identifier = (cast_expression "(char *)saferealloc(pkt->data,uVar3 + 0x100,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "saferealloc(pkt->data,uVar3 + 0x100,1)" identifier (argument_list "(pkt->data,uVar3 + 0x100,1)" ( (field_expression "pkt->data" identifier -> field_identifier) , (binary_expression "uVar3 + 0x100" identifier + number_literal) , number_literal ))))) ;) (expression_statement "pkt->data = pcVar2;" (assignment_expression "pkt->data = pcVar2" (field_expression "pkt->data" identifier -> field_identifier) = identifier) ;) (expression_statement "uVar4 = pkt->length - __n;" (assignment_expression "uVar4 = pkt->length - __n" identifier = (binary_expression "pkt->length - __n" (field_expression "pkt->length" identifier -> field_identifier) - identifier)) ;) }) (else_clause "else {\n    pcVar2 = pkt->data;\n  }" else (compound_statement "{\n    pcVar2 = pkt->data;\n  }" { (expression_statement "pcVar2 = pkt->data;" (assignment_expression "pcVar2 = pkt->data" identifier = (field_expression "pkt->data" identifier -> field_identifier)) ;) }))) (expression_statement "memcpy(pcVar2 + uVar4,data,__n);" (call_expression "memcpy(pcVar2 + uVar4,data,__n)" identifier (argument_list "(pcVar2 + uVar4,data,__n)" ( (binary_expression "pcVar2 + uVar4" identifier + identifier) , identifier , identifier ))) ;) (expression_statement "pkt->data[pkt->savedpos - 4] = (char)(pkt->length - pkt->savedpos >> 0x18);" (assignment_expression "pkt->data[pkt->savedpos - 4] = (char)(pkt->length - pkt->savedpos >> 0x18)" (subscript_expression "pkt->data[pkt->savedpos - 4]" (field_expression "pkt->data" identifier -> field_identifier) [ (binary_expression "pkt->savedpos - 4" (field_expression "pkt->savedpos" identifier -> field_identifier) - number_literal) ]) = (cast_expression "(char)(pkt->length - pkt->savedpos >> 0x18)" ( (type_descriptor "char" primitive_type) ) (parenthesized_expression "(pkt->length - pkt->savedpos >> 0x18)" ( (binary_expression "pkt->length - pkt->savedpos >> 0x18" (binary_expression "pkt->length - pkt->savedpos" (field_expression "pkt->length" identifier -> field_identifier) - (field_expression "pkt->savedpos" identifier -> field_identifier)) >> number_literal) )))) ;) (expression_statement "pkt->data[pkt->savedpos - 3] = (char)(pkt->length - pkt->savedpos >> 0x10);" (assignment_expression "pkt->data[pkt->savedpos - 3] = (char)(pkt->length - pkt->savedpos >> 0x10)" (subscript_expression "pkt->data[pkt->savedpos - 3]" (field_expression "pkt->data" identifier -> field_identifier) [ (binary_expression "pkt->savedpos - 3" (field_expression "pkt->savedpos" identifier -> field_identifier) - number_literal) ]) = (cast_expression "(char)(pkt->length - pkt->savedpos >> 0x10)" ( (type_descriptor "char" primitive_type) ) (parenthesized_expression "(pkt->length - pkt->savedpos >> 0x10)" ( (binary_expression "pkt->length - pkt->savedpos >> 0x10" (binary_expression "pkt->length - pkt->savedpos" (field_expression "pkt->length" identifier -> field_identifier) - (field_expression "pkt->savedpos" identifier -> field_identifier)) >> number_literal) )))) ;) (expression_statement "pkt->data[pkt->savedpos - 2] = (char)(pkt->length - pkt->savedpos >> 8);" (assignment_expression "pkt->data[pkt->savedpos - 2] = (char)(pkt->length - pkt->savedpos >> 8)" (subscript_expression "pkt->data[pkt->savedpos - 2]" (field_expression "pkt->data" identifier -> field_identifier) [ (binary_expression "pkt->savedpos - 2" (field_expression "pkt->savedpos" identifier -> field_identifier) - number_literal) ]) = (cast_expression "(char)(pkt->length - pkt->savedpos >> 8)" ( (type_descriptor "char" primitive_type) ) (parenthesized_expression "(pkt->length - pkt->savedpos >> 8)" ( (binary_expression "pkt->length - pkt->savedpos >> 8" (binary_expression "pkt->length - pkt->savedpos" (field_expression "pkt->length" identifier -> field_identifier) - (field_expression "pkt->savedpos" identifier -> field_identifier)) >> number_literal) )))) ;) (expression_statement "pkt->data[pkt->savedpos - 1] = (char)pkt->length - (char)pkt->savedpos;" (assignment_expression "pkt->data[pkt->savedpos - 1] = (char)pkt->length - (char)pkt->savedpos" (subscript_expression "pkt->data[pkt->savedpos - 1]" (field_expression "pkt->data" identifier -> field_identifier) [ (binary_expression "pkt->savedpos - 1" (field_expression "pkt->savedpos" identifier -> field_identifier) - number_literal) ]) = (binary_expression "(char)pkt->length - (char)pkt->savedpos" (cast_expression "(char)pkt->length" ( (type_descriptor "char" primitive_type) ) (field_expression "pkt->length" identifier -> field_identifier)) - (cast_expression "(char)pkt->savedpos" ( (type_descriptor "char" primitive_type) ) (field_expression "pkt->savedpos" identifier -> field_identifier)))) ;) (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "void __regparm3 FUN_0002e4c0(int *param_1,char *param_2)\n\n{\n  int iVar1;\n  size_t __n;\n  int iVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  \n  iVar2 = param_1[1];\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = *param_1;\n  param_1[1] = iVar2 + 4;\n  if (param_1[2] < iVar2 + 4) {\n    param_1[2] = iVar2 + 0x104;\n    iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);\n    *param_1 = iVar3;\n    iVar2 = param_1[1] + -4;\n  }\n  *(undefined4 *)(iVar3 + iVar2) = 0;\n  iVar3 = param_1[1];\n  param_1[3] = iVar3;\n  __n = strlen(param_2);\n  iVar2 = iVar3 + __n;\n  param_1[1] = iVar2;\n  if (param_1[2] < iVar2) {\n    param_1[2] = iVar2 + 0x100;\n    iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);\n    *param_1 = iVar2;\n    iVar3 = param_1[1] - __n;\n  }\n  else {\n    iVar2 = *param_1;\n  }\n  memcpy((void *)(iVar2 + iVar3),param_2,__n);\n  *(char *)(*param_1 + -4 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x18);\n  *(char *)(*param_1 + -3 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x10);\n  *(char *)(*param_1 + -2 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 8);\n  *(char *)(*param_1 + -1 + param_1[3]) = (char)param_1[1] - (char)param_1[3];\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0008d800();\n}\n\n" (function_definition "void __regparm3 FUN_0002e4c0(int *param_1,char *param_2)\n\n{\n  int iVar1;\n  size_t __n;\n  int iVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  \n  iVar2 = param_1[1];\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = *param_1;\n  param_1[1] = iVar2 + 4;\n  if (param_1[2] < iVar2 + 4) {\n    param_1[2] = iVar2 + 0x104;\n    iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);\n    *param_1 = iVar3;\n    iVar2 = param_1[1] + -4;\n  }\n  *(undefined4 *)(iVar3 + iVar2) = 0;\n  iVar3 = param_1[1];\n  param_1[3] = iVar3;\n  __n = strlen(param_2);\n  iVar2 = iVar3 + __n;\n  param_1[1] = iVar2;\n  if (param_1[2] < iVar2) {\n    param_1[2] = iVar2 + 0x100;\n    iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);\n    *param_1 = iVar2;\n    iVar3 = param_1[1] - __n;\n  }\n  else {\n    iVar2 = *param_1;\n  }\n  memcpy((void *)(iVar2 + iVar3),param_2,__n);\n  *(char *)(*param_1 + -4 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x18);\n  *(char *)(*param_1 + -3 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x10);\n  *(char *)(*param_1 + -2 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 8);\n  *(char *)(*param_1 + -1 + param_1[3]) = (char)param_1[1] - (char)param_1[3];\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0008d800();\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_0002e4c0(int *param_1,char *param_2)" identifier (parameter_list "(int *param_1,char *param_2)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  size_t __n;\n  int iVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  \n  iVar2 = param_1[1];\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = *param_1;\n  param_1[1] = iVar2 + 4;\n  if (param_1[2] < iVar2 + 4) {\n    param_1[2] = iVar2 + 0x104;\n    iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);\n    *param_1 = iVar3;\n    iVar2 = param_1[1] + -4;\n  }\n  *(undefined4 *)(iVar3 + iVar2) = 0;\n  iVar3 = param_1[1];\n  param_1[3] = iVar3;\n  __n = strlen(param_2);\n  iVar2 = iVar3 + __n;\n  param_1[1] = iVar2;\n  if (param_1[2] < iVar2) {\n    param_1[2] = iVar2 + 0x100;\n    iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);\n    *param_1 = iVar2;\n    iVar3 = param_1[1] - __n;\n  }\n  else {\n    iVar2 = *param_1;\n  }\n  memcpy((void *)(iVar2 + iVar3),param_2,__n);\n  *(char *)(*param_1 + -4 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x18);\n  *(char *)(*param_1 + -3 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x10);\n  *(char *)(*param_1 + -2 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 8);\n  *(char *)(*param_1 + -1 + param_1[3]) = (char)param_1[1] - (char)param_1[3];\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0008d800();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (expression_statement "iVar2 = param_1[1];" (assignment_expression "iVar2 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar3 = *param_1;" (assignment_expression "iVar3 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "param_1[1] = iVar2 + 4;" (assignment_expression "param_1[1] = iVar2 + 4" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (binary_expression "iVar2 + 4" identifier + number_literal)) ;) (if_statement "if (param_1[2] < iVar2 + 4) {\n    param_1[2] = iVar2 + 0x104;\n    iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);\n    *param_1 = iVar3;\n    iVar2 = param_1[1] + -4;\n  }" if (parenthesized_expression "(param_1[2] < iVar2 + 4)" ( (binary_expression "param_1[2] < iVar2 + 4" (subscript_expression "param_1[2]" identifier [ number_literal ]) < (binary_expression "iVar2 + 4" identifier + number_literal)) )) (compound_statement "{\n    param_1[2] = iVar2 + 0x104;\n    iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);\n    *param_1 = iVar3;\n    iVar2 = param_1[1] + -4;\n  }" { (expression_statement "param_1[2] = iVar2 + 0x104;" (assignment_expression "param_1[2] = iVar2 + 0x104" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "iVar2 + 0x104" identifier + number_literal)) ;) (expression_statement "iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);" (assignment_expression "iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1)" identifier = (call_expression "FUN_0001dc50(iVar3,iVar2 + 0x104,1)" identifier (argument_list "(iVar3,iVar2 + 0x104,1)" ( identifier , (binary_expression "iVar2 + 0x104" identifier + number_literal) , number_literal )))) ;) (expression_statement "*param_1 = iVar3;" (assignment_expression "*param_1 = iVar3" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "iVar2 = param_1[1] + -4;" (assignment_expression "iVar2 = param_1[1] + -4" identifier = (binary_expression "param_1[1] + -4" (subscript_expression "param_1[1]" identifier [ number_literal ]) + number_literal)) ;) })) (expression_statement "*(undefined4 *)(iVar3 + iVar2) = 0;" (assignment_expression "*(undefined4 *)(iVar3 + iVar2) = 0" (pointer_expression "*(undefined4 *)(iVar3 + iVar2)" * (cast_expression "(undefined4 *)(iVar3 + iVar2)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + iVar2)" ( (binary_expression "iVar3 + iVar2" identifier + identifier) )))) = number_literal) ;) (expression_statement "iVar3 = param_1[1];" (assignment_expression "iVar3 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "param_1[3] = iVar3;" (assignment_expression "param_1[3] = iVar3" (subscript_expression "param_1[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "__n = strlen(param_2);" (assignment_expression "__n = strlen(param_2)" identifier = (call_expression "strlen(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (expression_statement "iVar2 = iVar3 + __n;" (assignment_expression "iVar2 = iVar3 + __n" identifier = (binary_expression "iVar3 + __n" identifier + identifier)) ;) (expression_statement "param_1[1] = iVar2;" (assignment_expression "param_1[1] = iVar2" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (param_1[2] < iVar2) {\n    param_1[2] = iVar2 + 0x100;\n    iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);\n    *param_1 = iVar2;\n    iVar3 = param_1[1] - __n;\n  }\n  else {\n    iVar2 = *param_1;\n  }" if (parenthesized_expression "(param_1[2] < iVar2)" ( (binary_expression "param_1[2] < iVar2" (subscript_expression "param_1[2]" identifier [ number_literal ]) < identifier) )) (compound_statement "{\n    param_1[2] = iVar2 + 0x100;\n    iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);\n    *param_1 = iVar2;\n    iVar3 = param_1[1] - __n;\n  }" { (expression_statement "param_1[2] = iVar2 + 0x100;" (assignment_expression "param_1[2] = iVar2 + 0x100" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "iVar2 + 0x100" identifier + number_literal)) ;) (expression_statement "iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);" (assignment_expression "iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1)" identifier = (call_expression "FUN_0001dc50(*param_1,iVar2 + 0x100,1)" identifier (argument_list "(*param_1,iVar2 + 0x100,1)" ( (pointer_expression "*param_1" * identifier) , (binary_expression "iVar2 + 0x100" identifier + number_literal) , number_literal )))) ;) (expression_statement "*param_1 = iVar2;" (assignment_expression "*param_1 = iVar2" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "iVar3 = param_1[1] - __n;" (assignment_expression "iVar3 = param_1[1] - __n" identifier = (binary_expression "param_1[1] - __n" (subscript_expression "param_1[1]" identifier [ number_literal ]) - identifier)) ;) }) (else_clause "else {\n    iVar2 = *param_1;\n  }" else (compound_statement "{\n    iVar2 = *param_1;\n  }" { (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) }))) (expression_statement "memcpy((void *)(iVar2 + iVar3),param_2,__n);" (call_expression "memcpy((void *)(iVar2 + iVar3),param_2,__n)" identifier (argument_list "((void *)(iVar2 + iVar3),param_2,__n)" ( (cast_expression "(void *)(iVar2 + iVar3)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + iVar3)" ( (binary_expression "iVar2 + iVar3" identifier + identifier) ))) , identifier , identifier ))) ;) (expression_statement "*(char *)(*param_1 + -4 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x18);" (assignment_expression "*(char *)(*param_1 + -4 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x18)" (pointer_expression "*(char *)(*param_1 + -4 + param_1[3])" * (cast_expression "(char *)(*param_1 + -4 + param_1[3])" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -4 + param_1[3])" ( (binary_expression "*param_1 + -4 + param_1[3]" (binary_expression "*param_1 + -4" (pointer_expression "*param_1" * identifier) + number_literal) + (subscript_expression "param_1[3]" identifier [ number_literal ])) )))) = (cast_expression "(char)((uint)(param_1[1] - param_1[3]) >> 0x18)" ( (type_descriptor "char" primitive_type) ) (parenthesized_expression "((uint)(param_1[1] - param_1[3]) >> 0x18)" ( (binary_expression "(uint)(param_1[1] - param_1[3]) >> 0x18" (call_expression "(uint)(param_1[1] - param_1[3])" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(param_1[1] - param_1[3])" ( (binary_expression "param_1[1] - param_1[3]" (subscript_expression "param_1[1]" identifier [ number_literal ]) - (subscript_expression "param_1[3]" identifier [ number_literal ])) ))) >> number_literal) )))) ;) (expression_statement "*(char *)(*param_1 + -3 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x10);" (assignment_expression "*(char *)(*param_1 + -3 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x10)" (pointer_expression "*(char *)(*param_1 + -3 + param_1[3])" * (cast_expression "(char *)(*param_1 + -3 + param_1[3])" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -3 + param_1[3])" ( (binary_expression "*param_1 + -3 + param_1[3]" (binary_expression "*param_1 + -3" (pointer_expression "*param_1" * identifier) + number_literal) + (subscript_expression "param_1[3]" identifier [ number_literal ])) )))) = (cast_expression "(char)((uint)(param_1[1] - param_1[3]) >> 0x10)" ( (type_descriptor "char" primitive_type) ) (parenthesized_expression "((uint)(param_1[1] - param_1[3]) >> 0x10)" ( (binary_expression "(uint)(param_1[1] - param_1[3]) >> 0x10" (call_expression "(uint)(param_1[1] - param_1[3])" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(param_1[1] - param_1[3])" ( (binary_expression "param_1[1] - param_1[3]" (subscript_expression "param_1[1]" identifier [ number_literal ]) - (subscript_expression "param_1[3]" identifier [ number_literal ])) ))) >> number_literal) )))) ;) (expression_statement "*(char *)(*param_1 + -2 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 8);" (assignment_expression "*(char *)(*param_1 + -2 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 8)" (pointer_expression "*(char *)(*param_1 + -2 + param_1[3])" * (cast_expression "(char *)(*param_1 + -2 + param_1[3])" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -2 + param_1[3])" ( (binary_expression "*param_1 + -2 + param_1[3]" (binary_expression "*param_1 + -2" (pointer_expression "*param_1" * identifier) + number_literal) + (subscript_expression "param_1[3]" identifier [ number_literal ])) )))) = (cast_expression "(char)((uint)(param_1[1] - param_1[3]) >> 8)" ( (type_descriptor "char" primitive_type) ) (parenthesized_expression "((uint)(param_1[1] - param_1[3]) >> 8)" ( (binary_expression "(uint)(param_1[1] - param_1[3]) >> 8" (call_expression "(uint)(param_1[1] - param_1[3])" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(param_1[1] - param_1[3])" ( (binary_expression "param_1[1] - param_1[3]" (subscript_expression "param_1[1]" identifier [ number_literal ]) - (subscript_expression "param_1[3]" identifier [ number_literal ])) ))) >> number_literal) )))) ;) (expression_statement "*(char *)(*param_1 + -1 + param_1[3]) = (char)param_1[1] - (char)param_1[3];" (assignment_expression "*(char *)(*param_1 + -1 + param_1[3]) = (char)param_1[1] - (char)param_1[3]" (pointer_expression "*(char *)(*param_1 + -1 + param_1[3])" * (cast_expression "(char *)(*param_1 + -1 + param_1[3])" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -1 + param_1[3])" ( (binary_expression "*param_1 + -1 + param_1[3]" (binary_expression "*param_1 + -1" (pointer_expression "*param_1" * identifier) + number_literal) + (subscript_expression "param_1[3]" identifier [ number_literal ])) )))) = (binary_expression "(char)param_1[1] - (char)param_1[3]" (cast_expression "(char)param_1[1]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) - (cast_expression "(char)param_1[3]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "param_1[3]" identifier [ number_literal ])))) ;) (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "FUN_0008d800();" (call_expression "FUN_0008d800()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (subscript_expression 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 IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) < (binary_expression IDENT + LIT)) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (binary_expression IDENT + LIT) , LIT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) + LIT)) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) = LIT) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) < IDENT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) , (binary_expression IDENT + LIT) , LIT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) - IDENT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) }))) (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))) , IDENT , IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (pointer_expression * IDENT) + LIT) + (subscript_expression IDENT [ LIT ])) )))) = (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (subscript_expression IDENT [ LIT ]) - (subscript_expression IDENT [ LIT ])) ))) >> LIT) )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (pointer_expression * IDENT) + LIT) + (subscript_expression IDENT [ LIT ])) )))) = (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (subscript_expression IDENT [ LIT ]) - (subscript_expression IDENT [ LIT ])) ))) >> LIT) )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (pointer_expression * IDENT) + LIT) + (subscript_expression IDENT [ LIT ])) )))) = (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (subscript_expression IDENT [ LIT ]) - (subscript_expression IDENT [ LIT ])) ))) >> LIT) )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (pointer_expression * IDENT) + LIT) + (subscript_expression IDENT [ LIT ])) )))) = (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) - (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "void __regparm3 FUN_0002e4c0(int *param_1,char *param_2)\n\n{\n  int iVar1;\n  size_t __n;\n  int iVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  \n  iVar2 = param_1[1];\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = *param_1;\n  param_1[1] = iVar2 + 4;\n  if (param_1[2] < iVar2 + 4) {\n    param_1[2] = iVar2 + 0x104;\n    iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);\n    *param_1 = iVar3;\n    iVar2 = param_1[1] + -4;\n  }\n  *(undefined4 *)(iVar3 + iVar2) = 0;\n  iVar3 = param_1[1];\n  param_1[3] = iVar3;\n  __n = strlen(param_2);\n  iVar2 = iVar3 + __n;\n  param_1[1] = iVar2;\n  if (param_1[2] < iVar2) {\n    param_1[2] = iVar2 + 0x100;\n    iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);\n    *param_1 = iVar2;\n    iVar3 = param_1[1] - __n;\n  }\n  else {\n    iVar2 = *param_1;\n  }\n  memcpy((void *)(iVar2 + iVar3),param_2,__n);\n  *(char *)(*param_1 + -4 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x18);\n  *(char *)(*param_1 + -3 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x10);\n  *(char *)(*param_1 + -2 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 8);\n  *(char *)(*param_1 + -1 + param_1[3]) = (char)param_1[1] - (char)param_1[3];\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0008d800();\n}" (primitive_type "void") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_0002e4c0(int *param_1,char *param_2)" (identifier "FUN_0002e4c0") (parameter_list "(int *param_1,char *param_2)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "char *param_2" (primitive_type "char") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")"))) (compound_statement "{\n  int iVar1;\n  size_t __n;\n  int iVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  \n  iVar2 = param_1[1];\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = *param_1;\n  param_1[1] = iVar2 + 4;\n  if (param_1[2] < iVar2 + 4) {\n    param_1[2] = iVar2 + 0x104;\n    iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);\n    *param_1 = iVar3;\n    iVar2 = param_1[1] + -4;\n  }\n  *(undefined4 *)(iVar3 + iVar2) = 0;\n  iVar3 = param_1[1];\n  param_1[3] = iVar3;\n  __n = strlen(param_2);\n  iVar2 = iVar3 + __n;\n  param_1[1] = iVar2;\n  if (param_1[2] < iVar2) {\n    param_1[2] = iVar2 + 0x100;\n    iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);\n    *param_1 = iVar2;\n    iVar3 = param_1[1] - __n;\n  }\n  else {\n    iVar2 = *param_1;\n  }\n  memcpy((void *)(iVar2 + iVar3),param_2,__n);\n  *(char *)(*param_1 + -4 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x18);\n  *(char *)(*param_1 + -3 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x10);\n  *(char *)(*param_1 + -2 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 8);\n  *(char *)(*param_1 + -1 + param_1[3]) = (char)param_1[1] - (char)param_1[3];\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0008d800();\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (expression_statement "iVar2 = param_1[1];" (assignment_expression "iVar2 = param_1[1]" (identifier "iVar2") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "iVar1") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (expression_statement "iVar3 = *param_1;" (assignment_expression "iVar3 = *param_1" (identifier "iVar3") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "param_1[1] = iVar2 + 4;" (assignment_expression "param_1[1] = iVar2 + 4" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (binary_expression "iVar2 + 4" (identifier "iVar2") (+ "+") (number_literal "4"))) (; ";")) (if_statement "if (param_1[2] < iVar2 + 4) {\n    param_1[2] = iVar2 + 0x104;\n    iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);\n    *param_1 = iVar3;\n    iVar2 = param_1[1] + -4;\n  }" (if "if") (parenthesized_expression "(param_1[2] < iVar2 + 4)" (( "(") (binary_expression "param_1[2] < iVar2 + 4" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (< "<") (binary_expression "iVar2 + 4" (identifier "iVar2") (+ "+") (number_literal "4"))) () ")")) (compound_statement "{\n    param_1[2] = iVar2 + 0x104;\n    iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);\n    *param_1 = iVar3;\n    iVar2 = param_1[1] + -4;\n  }" ({ "{") (expression_statement "param_1[2] = iVar2 + 0x104;" (assignment_expression "param_1[2] = iVar2 + 0x104" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (binary_expression "iVar2 + 0x104" (identifier "iVar2") (+ "+") (number_literal "0x104"))) (; ";")) (expression_statement "iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);" (assignment_expression "iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1)" (identifier "iVar3") (= "=") (call_expression "FUN_0001dc50(iVar3,iVar2 + 0x104,1)" (identifier "FUN_0001dc50") (argument_list "(iVar3,iVar2 + 0x104,1)" (( "(") (identifier "iVar3") (, ",") (binary_expression "iVar2 + 0x104" (identifier "iVar2") (+ "+") (number_literal "0x104")) (, ",") (number_literal "1") () ")")))) (; ";")) (expression_statement "*param_1 = iVar3;" (assignment_expression "*param_1 = iVar3" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "iVar3")) (; ";")) (expression_statement "iVar2 = param_1[1] + -4;" (assignment_expression "iVar2 = param_1[1] + -4" (identifier "iVar2") (= "=") (binary_expression "param_1[1] + -4" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (+ "+") (number_literal "-4"))) (; ";")) (} "}"))) (expression_statement "*(undefined4 *)(iVar3 + iVar2) = 0;" (assignment_expression "*(undefined4 *)(iVar3 + iVar2) = 0" (pointer_expression "*(undefined4 *)(iVar3 + iVar2)" (* "*") (cast_expression "(undefined4 *)(iVar3 + iVar2)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + iVar2)" (( "(") (binary_expression "iVar3 + iVar2" (identifier "iVar3") (+ "+") (identifier "iVar2")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar3 = param_1[1];" (assignment_expression "iVar3 = param_1[1]" (identifier "iVar3") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "param_1[3] = iVar3;" (assignment_expression "param_1[3] = iVar3" (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]")) (= "=") (identifier "iVar3")) (; ";")) (expression_statement "__n = strlen(param_2);" (assignment_expression "__n = strlen(param_2)" (identifier "__n") (= "=") (call_expression "strlen(param_2)" (identifier "strlen") (argument_list "(param_2)" (( "(") (identifier "param_2") () ")")))) (; ";")) (expression_statement "iVar2 = iVar3 + __n;" (assignment_expression "iVar2 = iVar3 + __n" (identifier "iVar2") (= "=") (binary_expression "iVar3 + __n" (identifier "iVar3") (+ "+") (identifier "__n"))) (; ";")) (expression_statement "param_1[1] = iVar2;" (assignment_expression "param_1[1] = iVar2" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "iVar2")) (; ";")) (if_statement "if (param_1[2] < iVar2) {\n    param_1[2] = iVar2 + 0x100;\n    iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);\n    *param_1 = iVar2;\n    iVar3 = param_1[1] - __n;\n  }\n  else {\n    iVar2 = *param_1;\n  }" (if "if") (parenthesized_expression "(param_1[2] < iVar2)" (( "(") (binary_expression "param_1[2] < iVar2" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (< "<") (identifier "iVar2")) () ")")) (compound_statement "{\n    param_1[2] = iVar2 + 0x100;\n    iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);\n    *param_1 = iVar2;\n    iVar3 = param_1[1] - __n;\n  }" ({ "{") (expression_statement "param_1[2] = iVar2 + 0x100;" (assignment_expression "param_1[2] = iVar2 + 0x100" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (binary_expression "iVar2 + 0x100" (identifier "iVar2") (+ "+") (number_literal "0x100"))) (; ";")) (expression_statement "iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);" (assignment_expression "iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1)" (identifier "iVar2") (= "=") (call_expression "FUN_0001dc50(*param_1,iVar2 + 0x100,1)" (identifier "FUN_0001dc50") (argument_list "(*param_1,iVar2 + 0x100,1)" (( "(") (pointer_expression "*param_1" (* "*") (identifier "param_1")) (, ",") (binary_expression "iVar2 + 0x100" (identifier "iVar2") (+ "+") (number_literal "0x100")) (, ",") (number_literal "1") () ")")))) (; ";")) (expression_statement "*param_1 = iVar2;" (assignment_expression "*param_1 = iVar2" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "iVar2")) (; ";")) (expression_statement "iVar3 = param_1[1] - __n;" (assignment_expression "iVar3 = param_1[1] - __n" (identifier "iVar3") (= "=") (binary_expression "param_1[1] - __n" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (- "-") (identifier "__n"))) (; ";")) (} "}")) (else_clause "else {\n    iVar2 = *param_1;\n  }" (else "else") (compound_statement "{\n    iVar2 = *param_1;\n  }" ({ "{") (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" (identifier "iVar2") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (} "}")))) (expression_statement "memcpy((void *)(iVar2 + iVar3),param_2,__n);" (call_expression "memcpy((void *)(iVar2 + iVar3),param_2,__n)" (identifier "memcpy") (argument_list "((void *)(iVar2 + iVar3),param_2,__n)" (( "(") (cast_expression "(void *)(iVar2 + iVar3)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + iVar3)" (( "(") (binary_expression "iVar2 + iVar3" (identifier "iVar2") (+ "+") (identifier "iVar3")) () ")"))) (, ",") (identifier "param_2") (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "*(char *)(*param_1 + -4 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x18);" (assignment_expression "*(char *)(*param_1 + -4 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x18)" (pointer_expression "*(char *)(*param_1 + -4 + param_1[3])" (* "*") (cast_expression "(char *)(*param_1 + -4 + param_1[3])" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -4 + param_1[3])" (( "(") (binary_expression "*param_1 + -4 + param_1[3]" (binary_expression "*param_1 + -4" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-4")) (+ "+") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) () ")")))) (= "=") (cast_expression "(char)((uint)(param_1[1] - param_1[3]) >> 0x18)" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (parenthesized_expression "((uint)(param_1[1] - param_1[3]) >> 0x18)" (( "(") (binary_expression "(uint)(param_1[1] - param_1[3]) >> 0x18" (call_expression "(uint)(param_1[1] - param_1[3])" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(param_1[1] - param_1[3])" (( "(") (binary_expression "param_1[1] - param_1[3]" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (- "-") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) () ")"))) (>> ">>") (number_literal "0x18")) () ")")))) (; ";")) (expression_statement "*(char *)(*param_1 + -3 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x10);" (assignment_expression "*(char *)(*param_1 + -3 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x10)" (pointer_expression "*(char *)(*param_1 + -3 + param_1[3])" (* "*") (cast_expression "(char *)(*param_1 + -3 + param_1[3])" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -3 + param_1[3])" (( "(") (binary_expression "*param_1 + -3 + param_1[3]" (binary_expression "*param_1 + -3" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-3")) (+ "+") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) () ")")))) (= "=") (cast_expression "(char)((uint)(param_1[1] - param_1[3]) >> 0x10)" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (parenthesized_expression "((uint)(param_1[1] - param_1[3]) >> 0x10)" (( "(") (binary_expression "(uint)(param_1[1] - param_1[3]) >> 0x10" (call_expression "(uint)(param_1[1] - param_1[3])" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(param_1[1] - param_1[3])" (( "(") (binary_expression "param_1[1] - param_1[3]" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (- "-") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) () ")"))) (>> ">>") (number_literal "0x10")) () ")")))) (; ";")) (expression_statement "*(char *)(*param_1 + -2 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 8);" (assignment_expression "*(char *)(*param_1 + -2 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 8)" (pointer_expression "*(char *)(*param_1 + -2 + param_1[3])" (* "*") (cast_expression "(char *)(*param_1 + -2 + param_1[3])" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -2 + param_1[3])" (( "(") (binary_expression "*param_1 + -2 + param_1[3]" (binary_expression "*param_1 + -2" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-2")) (+ "+") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) () ")")))) (= "=") (cast_expression "(char)((uint)(param_1[1] - param_1[3]) >> 8)" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (parenthesized_expression "((uint)(param_1[1] - param_1[3]) >> 8)" (( "(") (binary_expression "(uint)(param_1[1] - param_1[3]) >> 8" (call_expression "(uint)(param_1[1] - param_1[3])" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(param_1[1] - param_1[3])" (( "(") (binary_expression "param_1[1] - param_1[3]" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (- "-") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) () ")"))) (>> ">>") (number_literal "8")) () ")")))) (; ";")) (expression_statement "*(char *)(*param_1 + -1 + param_1[3]) = (char)param_1[1] - (char)param_1[3];" (assignment_expression "*(char *)(*param_1 + -1 + param_1[3]) = (char)param_1[1] - (char)param_1[3]" (pointer_expression "*(char *)(*param_1 + -1 + param_1[3])" (* "*") (cast_expression "(char *)(*param_1 + -1 + param_1[3])" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -1 + param_1[3])" (( "(") (binary_expression "*param_1 + -1 + param_1[3]" (binary_expression "*param_1 + -1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-1")) (+ "+") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) () ")")))) (= "=") (binary_expression "(char)param_1[1] - (char)param_1[3]" (cast_expression "(char)param_1[1]" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (- "-") (cast_expression "(char)param_1[3]" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))))) (; ";")) (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" (if "if") (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "iVar1") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return;\n  }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "FUN_0008d800();" (call_expression "FUN_0008d800()" (identifier "FUN_0008d800") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void __regparm3 function_1(type_1 *pkt,char *data)

{
  int var_9;
  size_t var_7;
  char *var_4;
  type_2 var_2;
  type_2 var_6;
  int var_1;
  
  var_2 = pkt->length;
  var_9 = *(int *)(var_1 + 0x14);
  var_4 = pkt->data;
  pkt->length = var_2 + 4;
  if ((int)pkt->maxlen < (int)(var_2 + 4)) {
    pkt->maxlen = var_2 + 0x104;
    var_4 = (char *)var_3(var_4,var_2 + 0x104,1);
    pkt->data = var_4;
    var_2 = pkt->length - 4;
  }
  var_4 = var_4 + var_2;
  var_4[0] = '\0';
  var_4[1] = '\0';
  var_4[2] = '\0';
  var_4[3] = '\0';
  var_6 = pkt->length;
  pkt->savedpos = var_6;
  var_7 = var_5(data);
  var_2 = var_6 + var_7;
  pkt->length = var_2;
  if ((int)pkt->maxlen < (int)var_2) {
    pkt->maxlen = var_2 + 0x100;
    var_4 = (char *)var_3(pkt->data,var_2 + 0x100,1);
    pkt->data = var_4;
    var_6 = pkt->length - var_7;
  }
  else {
    var_4 = pkt->data;
  }
  var_8(var_4 + var_6,data,var_7);
  pkt->data[pkt->savedpos - 4] = (char)(pkt->length - pkt->savedpos >> 0x18);
  pkt->data[pkt->savedpos - 3] = (char)(pkt->length - pkt->savedpos >> 0x10);
  pkt->data[pkt->savedpos - 2] = (char)(pkt->length - pkt->savedpos >> 8);
  pkt->data[pkt->savedpos - 1] = (char)pkt->length - (char)pkt->savedpos;
  if (var_9 == *(int *)(var_1 + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  var_10();
}


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

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void __regparm3 MASKED(int *param_1,char *param_2)

{
  int iVar1;
  size_t __n;
  int iVar2;
  int iVar3;
  int in_GS_OFFSET;
  
  iVar2 = param_1[1];
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  iVar3 = *param_1;
  param_1[1] = iVar2 + 4;
  if (param_1[2] < iVar2 + 4) {
    param_1[2] = iVar2 + 0x104;
    iVar3 = FUN_0001dc50(iVar3,iVar2 + 0x104,1);
    *param_1 = iVar3;
    iVar2 = param_1[1] + -4;
  }
  *(undefined4 *)(iVar3 + iVar2) = 0;
  iVar3 = param_1[1];
  param_1[3] = iVar3;
  __n = strlen(param_2);
  iVar2 = iVar3 + __n;
  param_1[1] = iVar2;
  if (param_1[2] < iVar2) {
    param_1[2] = iVar2 + 0x100;
    iVar2 = FUN_0001dc50(*param_1,iVar2 + 0x100,1);
    *param_1 = iVar2;
    iVar3 = param_1[1] - __n;
  }
  else {
    iVar2 = *param_1;
  }
  memcpy((void *)(iVar2 + iVar3),param_2,__n);
  *(char *)(*param_1 + -4 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x18);
  *(char *)(*param_1 + -3 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 0x10);
  *(char *)(*param_1 + -2 + param_1[3]) = (char)((uint)(param_1[1] - param_1[3]) >> 8);
  *(char *)(*param_1 + -1 + param_1[3]) = (char)param_1[1] - (char)param_1[3];
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0008d800();
}

