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

void __regparm3 ssh_pkt_getstring(Packet *pkt,char **p,int *length)

{
  int iVar1;
  uchar *puVar2;
  int iVar3;
  int iVar4;
  
  iVar4 = pkt->savedpos;
  iVar1 = pkt->length;
  *p = (char *)0x0;
  *length = 0;
  if (3 < iVar1 - iVar4) {
    puVar2 = pkt->body;
    iVar4 = toint((uint)puVar2[iVar4 + 1] << 0x10 |
                  (uint)puVar2[iVar4] << 0x18 | (uint)puVar2[iVar4 + 3] |
                  (uint)puVar2[iVar4 + 2] << 8);
    if (-1 < iVar4) {
      iVar1 = pkt->savedpos;
      iVar3 = pkt->length;
      *length = iVar4;
      iVar1 = iVar1 + 4;
      pkt->savedpos = iVar1;
      if (iVar4 <= iVar3 - iVar1) {
        *p = (char *)(pkt->body + iVar1);
        pkt->savedpos = iVar1 + iVar4;
        return;
      }
    }
  }
  return;
}



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

void __regparm3 FUN_00039940(int *param_1,int *param_2,int *param_3)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  iVar3 = param_1[6];
  iVar1 = *param_1;
  *param_2 = 0;
  *param_3 = 0;
  if (3 < iVar1 - iVar3) {
    iVar1 = param_1[5];
    iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |
                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)
                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);
    if (-1 < iVar3) {
      iVar1 = param_1[6];
      iVar2 = *param_1;
      *param_3 = iVar3;
      iVar1 = iVar1 + 4;
      param_1[6] = iVar1;
      if (iVar3 <= iVar2 - iVar1) {
        *param_2 = param_1[5] + iVar1;
        param_1[6] = iVar1 + iVar3;
        return;
      }
    }
  }
  return;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x0001c4f0
ADD EBX,0xd6e07
SUB ESP,0x1c
MOV EDI,dword ptr [EAX + 0x18]
MOV ESI,dword ptr [EAX]
MOV dword ptr [EDX],0x0
MOV dword ptr [ECX],0x0
SUB ESI,EDI
CMP ESI,0x3
JG 0x00039978
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EBP,ECX
MOV ECX,dword ptr [EAX + 0x14]
MOV dword ptr [ESP + 0xc],EDX
MOV ESI,EAX
SUB ESP,0xc
MOVZX EDX,byte ptr [ECX + EDI*0x1]
MOVZX EAX,byte ptr [ECX + EDI*0x1 + 0x3]
SHL EDX,0x18
OR EDX,EAX
MOVZX EAX,byte ptr [ECX + EDI*0x1 + 0x1]
SHL EAX,0x10
OR EAX,EDX
MOVZX EDX,byte ptr [ECX + EDI*0x1 + 0x2]
SHL EDX,0x8
OR EAX,EDX
PUSH EAX
CALL 0x0002e1f0
ADD ESP,0x10
TEST EAX,EAX
JS 0x0003996a
MOV EDI,dword ptr [ESI + 0x18]
MOV ECX,dword ptr [ESI]
MOV dword ptr [EBP],EAX
LEA EDX,[EDI + 0x4]
SUB ECX,EDX
MOV dword ptr [ESI + 0x18],EDX
CMP ECX,EAX
JL 0x0003996a
MOV ECX,dword ptr [ESI + 0x14]
MOV EBX,dword ptr [ESP + 0xc]
ADD ECX,EDX
ADD EDX,EAX
MOV dword ptr [EBX],ECX
MOV dword ptr [ESI + 0x18],EDX
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid __regparm3 FUN_00039940(int *param_1,int *param_2,int *param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = param_1[6];\n  iVar1 = *param_1;\n  *param_2 = 0;\n  *param_3 = 0;\n  if (3 < iVar1 - iVar3) {\n    iVar1 = param_1[5];\n    iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);\n    if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }\n  }\n  return;\n}\n\n" comment (function_definition "void __regparm3 FUN_00039940(int *param_1,int *param_2,int *param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = param_1[6];\n  iVar1 = *param_1;\n  *param_2 = 0;\n  *param_3 = 0;\n  if (3 < iVar1 - iVar3) {\n    iVar1 = param_1[5];\n    iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);\n    if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }\n  }\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_00039940(int *param_1,int *param_2,int *param_3)" identifier (parameter_list "(int *param_1,int *param_2,int *param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int *param_3" primitive_type (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = param_1[6];\n  iVar1 = *param_1;\n  *param_2 = 0;\n  *param_3 = 0;\n  if (3 < iVar1 - iVar3) {\n    iVar1 = param_1[5];\n    iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);\n    if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "iVar3 = param_1[6];" (assignment_expression "iVar3 = param_1[6]" identifier = (subscript_expression "param_1[6]" identifier [ number_literal ])) ;) (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "*param_2 = 0;" (assignment_expression "*param_2 = 0" (pointer_expression "*param_2" * identifier) = number_literal) ;) (expression_statement "*param_3 = 0;" (assignment_expression "*param_3 = 0" (pointer_expression "*param_3" * identifier) = number_literal) ;) (if_statement "if (3 < iVar1 - iVar3) {\n    iVar1 = param_1[5];\n    iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);\n    if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }\n  }" if (parenthesized_expression "(3 < iVar1 - iVar3)" ( (binary_expression "3 < iVar1 - iVar3" number_literal < (binary_expression "iVar1 - iVar3" identifier - identifier)) )) (compound_statement "{\n    iVar1 = param_1[5];\n    iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);\n    if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }\n  }" { (expression_statement "iVar1 = param_1[5];" (assignment_expression "iVar1 = param_1[5]" identifier = (subscript_expression "param_1[5]" identifier [ number_literal ])) ;) (expression_statement "iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);" (assignment_expression "iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8)" identifier = (call_expression "FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8)" identifier (argument_list "((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8)" ( (binary_expression "(uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8" (binary_expression "(uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)" (binary_expression "(uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18" (binary_expression "(uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10" (binary_expression "(uint)*(byte *)(iVar1 + 1 + iVar3)" (parenthesized_expression "(uint)" ( identifier )) * (cast_expression "(byte *)(iVar1 + 1 + iVar3)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 1 + iVar3)" ( (binary_expression "iVar1 + 1 + iVar3" (binary_expression "iVar1 + 1" identifier + number_literal) + identifier) )))) << number_literal) | (binary_expression "(uint)*(byte *)(iVar1 + iVar3) << 0x18" (binary_expression "(uint)*(byte *)(iVar1 + iVar3)" (parenthesized_expression "(uint)" ( identifier )) * (cast_expression "(byte *)(iVar1 + iVar3)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + iVar3)" ( (binary_expression "iVar1 + iVar3" identifier + identifier) )))) << number_literal)) | (binary_expression "(uint)*(byte *)(iVar1 + 3 + iVar3)" (parenthesized_expression "(uint)" ( identifier )) * (cast_expression "(byte *)(iVar1 + 3 + iVar3)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 3 + iVar3)" ( (binary_expression "iVar1 + 3 + iVar3" (binary_expression "iVar1 + 3" identifier + number_literal) + identifier) ))))) | (binary_expression "(uint)*(byte *)(iVar1 + 2 + iVar3) << 8" (binary_expression "(uint)*(byte *)(iVar1 + 2 + iVar3)" (parenthesized_expression "(uint)" ( identifier )) * (cast_expression "(byte *)(iVar1 + 2 + iVar3)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 2 + iVar3)" ( (binary_expression "iVar1 + 2 + iVar3" (binary_expression "iVar1 + 2" identifier + number_literal) + identifier) )))) << number_literal)) )))) ;) (if_statement "if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }" if (parenthesized_expression "(-1 < iVar3)" ( (binary_expression "-1 < iVar3" number_literal < identifier) )) (compound_statement "{\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }" { (expression_statement "iVar1 = param_1[6];" (assignment_expression "iVar1 = param_1[6]" identifier = (subscript_expression "param_1[6]" identifier [ number_literal ])) ;) (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "*param_3 = iVar3;" (assignment_expression "*param_3 = iVar3" (pointer_expression "*param_3" * identifier) = identifier) ;) (expression_statement "iVar1 = iVar1 + 4;" (assignment_expression "iVar1 = iVar1 + 4" identifier = (binary_expression "iVar1 + 4" identifier + number_literal)) ;) (expression_statement "param_1[6] = iVar1;" (assignment_expression "param_1[6] = iVar1" (subscript_expression "param_1[6]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }" if (parenthesized_expression "(iVar3 <= iVar2 - iVar1)" ( (binary_expression "iVar3 <= iVar2 - iVar1" identifier <= (binary_expression "iVar2 - iVar1" identifier - identifier)) )) (compound_statement "{\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }" { (expression_statement "*param_2 = param_1[5] + iVar1;" (assignment_expression "*param_2 = param_1[5] + iVar1" (pointer_expression "*param_2" * identifier) = (binary_expression "param_1[5] + iVar1" (subscript_expression "param_1[5]" identifier [ number_literal ]) + identifier)) ;) (expression_statement "param_1[6] = iVar1 + iVar3;" (assignment_expression "param_1[6] = iVar1 + iVar3" (subscript_expression "param_1[6]" identifier [ number_literal ]) = (binary_expression "iVar1 + iVar3" identifier + identifier)) ;) (return_statement "return;" return ;) })) })) })) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid __regparm3 ssh_pkt_getstring(Packet *pkt,char **p,int *length)\n\n{\n  int iVar1;\n  uchar *puVar2;\n  int iVar3;\n  int iVar4;\n  \n  iVar4 = pkt->savedpos;\n  iVar1 = pkt->length;\n  *p = (char *)0x0;\n  *length = 0;\n  if (3 < iVar1 - iVar4) {\n    puVar2 = pkt->body;\n    iVar4 = toint((uint)puVar2[iVar4 + 1] << 0x10 |\n                  (uint)puVar2[iVar4] << 0x18 | (uint)puVar2[iVar4 + 3] |\n                  (uint)puVar2[iVar4 + 2] << 8);\n    if (-1 < iVar4) {\n      iVar1 = pkt->savedpos;\n      iVar3 = pkt->length;\n      *length = iVar4;\n      iVar1 = iVar1 + 4;\n      pkt->savedpos = iVar1;\n      if (iVar4 <= iVar3 - iVar1) {\n        *p = (char *)(pkt->body + iVar1);\n        pkt->savedpos = iVar1 + iVar4;\n        return;\n      }\n    }\n  }\n  return;\n}\n\n" comment (function_definition "void __regparm3 ssh_pkt_getstring(Packet *pkt,char **p,int *length)\n\n{\n  int iVar1;\n  uchar *puVar2;\n  int iVar3;\n  int iVar4;\n  \n  iVar4 = pkt->savedpos;\n  iVar1 = pkt->length;\n  *p = (char *)0x0;\n  *length = 0;\n  if (3 < iVar1 - iVar4) {\n    puVar2 = pkt->body;\n    iVar4 = toint((uint)puVar2[iVar4 + 1] << 0x10 |\n                  (uint)puVar2[iVar4] << 0x18 | (uint)puVar2[iVar4 + 3] |\n                  (uint)puVar2[iVar4 + 2] << 8);\n    if (-1 < iVar4) {\n      iVar1 = pkt->savedpos;\n      iVar3 = pkt->length;\n      *length = iVar4;\n      iVar1 = iVar1 + 4;\n      pkt->savedpos = iVar1;\n      if (iVar4 <= iVar3 - iVar1) {\n        *p = (char *)(pkt->body + iVar1);\n        pkt->savedpos = iVar1 + iVar4;\n        return;\n      }\n    }\n  }\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "ssh_pkt_getstring(Packet *pkt,char **p,int *length)" identifier (parameter_list "(Packet *pkt,char **p,int *length)" ( (parameter_declaration "Packet *pkt" type_identifier (pointer_declarator "*pkt" * identifier)) , (parameter_declaration "char **p" primitive_type (pointer_declarator "**p" * (pointer_declarator "*p" * identifier))) , (parameter_declaration "int *length" primitive_type (pointer_declarator "*length" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  uchar *puVar2;\n  int iVar3;\n  int iVar4;\n  \n  iVar4 = pkt->savedpos;\n  iVar1 = pkt->length;\n  *p = (char *)0x0;\n  *length = 0;\n  if (3 < iVar1 - iVar4) {\n    puVar2 = pkt->body;\n    iVar4 = toint((uint)puVar2[iVar4 + 1] << 0x10 |\n                  (uint)puVar2[iVar4] << 0x18 | (uint)puVar2[iVar4 + 3] |\n                  (uint)puVar2[iVar4 + 2] << 8);\n    if (-1 < iVar4) {\n      iVar1 = pkt->savedpos;\n      iVar3 = pkt->length;\n      *length = iVar4;\n      iVar1 = iVar1 + 4;\n      pkt->savedpos = iVar1;\n      if (iVar4 <= iVar3 - iVar1) {\n        *p = (char *)(pkt->body + iVar1);\n        pkt->savedpos = iVar1 + iVar4;\n        return;\n      }\n    }\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uchar *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (expression_statement "iVar4 = pkt->savedpos;" (assignment_expression "iVar4 = pkt->savedpos" identifier = (field_expression "pkt->savedpos" identifier -> field_identifier)) ;) (expression_statement "iVar1 = pkt->length;" (assignment_expression "iVar1 = pkt->length" identifier = (field_expression "pkt->length" identifier -> field_identifier)) ;) (expression_statement "*p = (char *)0x0;" (assignment_expression "*p = (char *)0x0" (pointer_expression "*p" * identifier) = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "*length = 0;" (assignment_expression "*length = 0" (pointer_expression "*length" * identifier) = number_literal) ;) (if_statement "if (3 < iVar1 - iVar4) {\n    puVar2 = pkt->body;\n    iVar4 = toint((uint)puVar2[iVar4 + 1] << 0x10 |\n                  (uint)puVar2[iVar4] << 0x18 | (uint)puVar2[iVar4 + 3] |\n                  (uint)puVar2[iVar4 + 2] << 8);\n    if (-1 < iVar4) {\n      iVar1 = pkt->savedpos;\n      iVar3 = pkt->length;\n      *length = iVar4;\n      iVar1 = iVar1 + 4;\n      pkt->savedpos = iVar1;\n      if (iVar4 <= iVar3 - iVar1) {\n        *p = (char *)(pkt->body + iVar1);\n        pkt->savedpos = iVar1 + iVar4;\n        return;\n      }\n    }\n  }" if (parenthesized_expression "(3 < iVar1 - iVar4)" ( (binary_expression "3 < iVar1 - iVar4" number_literal < (binary_expression "iVar1 - iVar4" identifier - identifier)) )) (compound_statement "{\n    puVar2 = pkt->body;\n    iVar4 = toint((uint)puVar2[iVar4 + 1] << 0x10 |\n                  (uint)puVar2[iVar4] << 0x18 | (uint)puVar2[iVar4 + 3] |\n                  (uint)puVar2[iVar4 + 2] << 8);\n    if (-1 < iVar4) {\n      iVar1 = pkt->savedpos;\n      iVar3 = pkt->length;\n      *length = iVar4;\n      iVar1 = iVar1 + 4;\n      pkt->savedpos = iVar1;\n      if (iVar4 <= iVar3 - iVar1) {\n        *p = (char *)(pkt->body + iVar1);\n        pkt->savedpos = iVar1 + iVar4;\n        return;\n      }\n    }\n  }" { (expression_statement "puVar2 = pkt->body;" (assignment_expression "puVar2 = pkt->body" identifier = (field_expression "pkt->body" identifier -> field_identifier)) ;) (expression_statement "iVar4 = toint((uint)puVar2[iVar4 + 1] << 0x10 |\n                  (uint)puVar2[iVar4] << 0x18 | (uint)puVar2[iVar4 + 3] |\n                  (uint)puVar2[iVar4 + 2] << 8);" (assignment_expression "iVar4 = toint((uint)puVar2[iVar4 + 1] << 0x10 |\n                  (uint)puVar2[iVar4] << 0x18 | (uint)puVar2[iVar4 + 3] |\n                  (uint)puVar2[iVar4 + 2] << 8)" identifier = (call_expression "toint((uint)puVar2[iVar4 + 1] << 0x10 |\n                  (uint)puVar2[iVar4] << 0x18 | (uint)puVar2[iVar4 + 3] |\n                  (uint)puVar2[iVar4 + 2] << 8)" identifier (argument_list "((uint)puVar2[iVar4 + 1] << 0x10 |\n                  (uint)puVar2[iVar4] << 0x18 | (uint)puVar2[iVar4 + 3] |\n                  (uint)puVar2[iVar4 + 2] << 8)" ( (binary_expression "(uint)puVar2[iVar4 + 1] << 0x10 |\n                  (uint)puVar2[iVar4] << 0x18 | (uint)puVar2[iVar4 + 3] |\n                  (uint)puVar2[iVar4 + 2] << 8" (binary_expression "(uint)puVar2[iVar4 + 1] << 0x10 |\n                  (uint)puVar2[iVar4] << 0x18 | (uint)puVar2[iVar4 + 3]" (binary_expression "(uint)puVar2[iVar4 + 1] << 0x10 |\n                  (uint)puVar2[iVar4] << 0x18" (binary_expression "(uint)puVar2[iVar4 + 1] << 0x10" (cast_expression "(uint)puVar2[iVar4 + 1]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "puVar2[iVar4 + 1]" identifier [ (binary_expression "iVar4 + 1" identifier + number_literal) ])) << number_literal) | (binary_expression "(uint)puVar2[iVar4] << 0x18" (cast_expression "(uint)puVar2[iVar4]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "puVar2[iVar4]" identifier [ identifier ])) << number_literal)) | (cast_expression "(uint)puVar2[iVar4 + 3]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "puVar2[iVar4 + 3]" identifier [ (binary_expression "iVar4 + 3" identifier + number_literal) ]))) | (binary_expression "(uint)puVar2[iVar4 + 2] << 8" (cast_expression "(uint)puVar2[iVar4 + 2]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "puVar2[iVar4 + 2]" identifier [ (binary_expression "iVar4 + 2" identifier + number_literal) ])) << number_literal)) )))) ;) (if_statement "if (-1 < iVar4) {\n      iVar1 = pkt->savedpos;\n      iVar3 = pkt->length;\n      *length = iVar4;\n      iVar1 = iVar1 + 4;\n      pkt->savedpos = iVar1;\n      if (iVar4 <= iVar3 - iVar1) {\n        *p = (char *)(pkt->body + iVar1);\n        pkt->savedpos = iVar1 + iVar4;\n        return;\n      }\n    }" if (parenthesized_expression "(-1 < iVar4)" ( (binary_expression "-1 < iVar4" number_literal < identifier) )) (compound_statement "{\n      iVar1 = pkt->savedpos;\n      iVar3 = pkt->length;\n      *length = iVar4;\n      iVar1 = iVar1 + 4;\n      pkt->savedpos = iVar1;\n      if (iVar4 <= iVar3 - iVar1) {\n        *p = (char *)(pkt->body + iVar1);\n        pkt->savedpos = iVar1 + iVar4;\n        return;\n      }\n    }" { (expression_statement "iVar1 = pkt->savedpos;" (assignment_expression "iVar1 = pkt->savedpos" identifier = (field_expression "pkt->savedpos" identifier -> field_identifier)) ;) (expression_statement "iVar3 = pkt->length;" (assignment_expression "iVar3 = pkt->length" identifier = (field_expression "pkt->length" identifier -> field_identifier)) ;) (expression_statement "*length = iVar4;" (assignment_expression "*length = iVar4" (pointer_expression "*length" * identifier) = identifier) ;) (expression_statement "iVar1 = iVar1 + 4;" (assignment_expression "iVar1 = iVar1 + 4" identifier = (binary_expression "iVar1 + 4" identifier + number_literal)) ;) (expression_statement "pkt->savedpos = iVar1;" (assignment_expression "pkt->savedpos = iVar1" (field_expression "pkt->savedpos" identifier -> field_identifier) = identifier) ;) (if_statement "if (iVar4 <= iVar3 - iVar1) {\n        *p = (char *)(pkt->body + iVar1);\n        pkt->savedpos = iVar1 + iVar4;\n        return;\n      }" if (parenthesized_expression "(iVar4 <= iVar3 - iVar1)" ( (binary_expression "iVar4 <= iVar3 - iVar1" identifier <= (binary_expression "iVar3 - iVar1" identifier - identifier)) )) (compound_statement "{\n        *p = (char *)(pkt->body + iVar1);\n        pkt->savedpos = iVar1 + iVar4;\n        return;\n      }" { (expression_statement "*p = (char *)(pkt->body + iVar1);" (assignment_expression "*p = (char *)(pkt->body + iVar1)" (pointer_expression "*p" * identifier) = (cast_expression "(char *)(pkt->body + iVar1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pkt->body + iVar1)" ( (binary_expression "pkt->body + iVar1" (field_expression "pkt->body" identifier -> field_identifier) + identifier) )))) ;) (expression_statement "pkt->savedpos = iVar1 + iVar4;" (assignment_expression "pkt->savedpos = iVar1 + iVar4" (field_expression "pkt->savedpos" identifier -> field_identifier) = (binary_expression "iVar1 + iVar4" identifier + identifier)) ;) (return_statement "return;" return ;) })) })) })) (return_statement "return;" return ;) })))
(translation_unit "void __regparm3 FUN_00039940(int *param_1,int *param_2,int *param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = param_1[6];\n  iVar1 = *param_1;\n  *param_2 = 0;\n  *param_3 = 0;\n  if (3 < iVar1 - iVar3) {\n    iVar1 = param_1[5];\n    iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);\n    if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }\n  }\n  return;\n}\n\n" (function_definition "void __regparm3 FUN_00039940(int *param_1,int *param_2,int *param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = param_1[6];\n  iVar1 = *param_1;\n  *param_2 = 0;\n  *param_3 = 0;\n  if (3 < iVar1 - iVar3) {\n    iVar1 = param_1[5];\n    iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);\n    if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }\n  }\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_00039940(int *param_1,int *param_2,int *param_3)" identifier (parameter_list "(int *param_1,int *param_2,int *param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int *param_3" primitive_type (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = param_1[6];\n  iVar1 = *param_1;\n  *param_2 = 0;\n  *param_3 = 0;\n  if (3 < iVar1 - iVar3) {\n    iVar1 = param_1[5];\n    iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);\n    if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "iVar3 = param_1[6];" (assignment_expression "iVar3 = param_1[6]" identifier = (subscript_expression "param_1[6]" identifier [ number_literal ])) ;) (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "*param_2 = 0;" (assignment_expression "*param_2 = 0" (pointer_expression "*param_2" * identifier) = number_literal) ;) (expression_statement "*param_3 = 0;" (assignment_expression "*param_3 = 0" (pointer_expression "*param_3" * identifier) = number_literal) ;) (if_statement "if (3 < iVar1 - iVar3) {\n    iVar1 = param_1[5];\n    iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);\n    if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }\n  }" if (parenthesized_expression "(3 < iVar1 - iVar3)" ( (binary_expression "3 < iVar1 - iVar3" number_literal < (binary_expression "iVar1 - iVar3" identifier - identifier)) )) (compound_statement "{\n    iVar1 = param_1[5];\n    iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);\n    if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }\n  }" { (expression_statement "iVar1 = param_1[5];" (assignment_expression "iVar1 = param_1[5]" identifier = (subscript_expression "param_1[5]" identifier [ number_literal ])) ;) (expression_statement "iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);" (assignment_expression "iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8)" identifier = (call_expression "FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8)" identifier (argument_list "((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8)" ( (binary_expression "(uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8" (binary_expression "(uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)" (binary_expression "(uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18" (binary_expression "(uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10" (binary_expression "(uint)*(byte *)(iVar1 + 1 + iVar3)" (parenthesized_expression "(uint)" ( identifier )) * (cast_expression "(byte *)(iVar1 + 1 + iVar3)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 1 + iVar3)" ( (binary_expression "iVar1 + 1 + iVar3" (binary_expression "iVar1 + 1" identifier + number_literal) + identifier) )))) << number_literal) | (binary_expression "(uint)*(byte *)(iVar1 + iVar3) << 0x18" (binary_expression "(uint)*(byte *)(iVar1 + iVar3)" (parenthesized_expression "(uint)" ( identifier )) * (cast_expression "(byte *)(iVar1 + iVar3)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + iVar3)" ( (binary_expression "iVar1 + iVar3" identifier + identifier) )))) << number_literal)) | (binary_expression "(uint)*(byte *)(iVar1 + 3 + iVar3)" (parenthesized_expression "(uint)" ( identifier )) * (cast_expression "(byte *)(iVar1 + 3 + iVar3)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 3 + iVar3)" ( (binary_expression "iVar1 + 3 + iVar3" (binary_expression "iVar1 + 3" identifier + number_literal) + identifier) ))))) | (binary_expression "(uint)*(byte *)(iVar1 + 2 + iVar3) << 8" (binary_expression "(uint)*(byte *)(iVar1 + 2 + iVar3)" (parenthesized_expression "(uint)" ( identifier )) * (cast_expression "(byte *)(iVar1 + 2 + iVar3)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 2 + iVar3)" ( (binary_expression "iVar1 + 2 + iVar3" (binary_expression "iVar1 + 2" identifier + number_literal) + identifier) )))) << number_literal)) )))) ;) (if_statement "if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }" if (parenthesized_expression "(-1 < iVar3)" ( (binary_expression "-1 < iVar3" number_literal < identifier) )) (compound_statement "{\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }" { (expression_statement "iVar1 = param_1[6];" (assignment_expression "iVar1 = param_1[6]" identifier = (subscript_expression "param_1[6]" identifier [ number_literal ])) ;) (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "*param_3 = iVar3;" (assignment_expression "*param_3 = iVar3" (pointer_expression "*param_3" * identifier) = identifier) ;) (expression_statement "iVar1 = iVar1 + 4;" (assignment_expression "iVar1 = iVar1 + 4" identifier = (binary_expression "iVar1 + 4" identifier + number_literal)) ;) (expression_statement "param_1[6] = iVar1;" (assignment_expression "param_1[6] = iVar1" (subscript_expression "param_1[6]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }" if (parenthesized_expression "(iVar3 <= iVar2 - iVar1)" ( (binary_expression "iVar3 <= iVar2 - iVar1" identifier <= (binary_expression "iVar2 - iVar1" identifier - identifier)) )) (compound_statement "{\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }" { (expression_statement "*param_2 = param_1[5] + iVar1;" (assignment_expression "*param_2 = param_1[5] + iVar1" (pointer_expression "*param_2" * identifier) = (binary_expression "param_1[5] + iVar1" (subscript_expression "param_1[5]" identifier [ number_literal ]) + identifier)) ;) (expression_statement "param_1[6] = iVar1 + iVar3;" (assignment_expression "param_1[6] = iVar1 + iVar3" (subscript_expression "param_1[6]" identifier [ number_literal ]) = (binary_expression "iVar1 + iVar3" identifier + identifier)) ;) (return_statement "return;" return ;) })) })) })) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (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 * IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < (binary_expression IDENT - IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (binary_expression (binary_expression (binary_expression (binary_expression (binary_expression (parenthesized_expression ( IDENT )) * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) + IDENT) )))) << LIT) | (binary_expression (binary_expression (parenthesized_expression ( IDENT )) * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) << LIT)) | (binary_expression (parenthesized_expression ( IDENT )) * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) + IDENT) ))))) | (binary_expression (binary_expression (parenthesized_expression ( IDENT )) * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) + IDENT) )))) << LIT)) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= (binary_expression IDENT - IDENT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression (subscript_expression IDENT [ LIT ]) + IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + IDENT)) ;) (return_statement return ;) })) })) })) (return_statement return ;) })))
(function_definition "void __regparm3 FUN_00039940(int *param_1,int *param_2,int *param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = param_1[6];\n  iVar1 = *param_1;\n  *param_2 = 0;\n  *param_3 = 0;\n  if (3 < iVar1 - iVar3) {\n    iVar1 = param_1[5];\n    iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);\n    if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }\n  }\n  return;\n}" (primitive_type "void") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_00039940(int *param_1,int *param_2,int *param_3)" (identifier "FUN_00039940") (parameter_list "(int *param_1,int *param_2,int *param_3)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int *param_2" (primitive_type "int") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "int *param_3" (primitive_type "int") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = param_1[6];\n  iVar1 = *param_1;\n  *param_2 = 0;\n  *param_3 = 0;\n  if (3 < iVar1 - iVar3) {\n    iVar1 = param_1[5];\n    iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);\n    if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }\n  }\n  return;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (expression_statement "iVar3 = param_1[6];" (assignment_expression "iVar3 = param_1[6]" (identifier "iVar3") (= "=") (subscript_expression "param_1[6]" (identifier "param_1") ([ "[") (number_literal "6") (] "]"))) (; ";")) (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" (identifier "iVar1") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "*param_2 = 0;" (assignment_expression "*param_2 = 0" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (number_literal "0")) (; ";")) (expression_statement "*param_3 = 0;" (assignment_expression "*param_3 = 0" (pointer_expression "*param_3" (* "*") (identifier "param_3")) (= "=") (number_literal "0")) (; ";")) (if_statement "if (3 < iVar1 - iVar3) {\n    iVar1 = param_1[5];\n    iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);\n    if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }\n  }" (if "if") (parenthesized_expression "(3 < iVar1 - iVar3)" (( "(") (binary_expression "3 < iVar1 - iVar3" (number_literal "3") (< "<") (binary_expression "iVar1 - iVar3" (identifier "iVar1") (- "-") (identifier "iVar3"))) () ")")) (compound_statement "{\n    iVar1 = param_1[5];\n    iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);\n    if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }\n  }" ({ "{") (expression_statement "iVar1 = param_1[5];" (assignment_expression "iVar1 = param_1[5]" (identifier "iVar1") (= "=") (subscript_expression "param_1[5]" (identifier "param_1") ([ "[") (number_literal "5") (] "]"))) (; ";")) (expression_statement "iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);" (assignment_expression "iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8)" (identifier "iVar3") (= "=") (call_expression "FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8)" (identifier "FUN_0002e1f0") (argument_list "((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8)" (( "(") (binary_expression "(uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)\n                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8" (binary_expression "(uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)" (binary_expression "(uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |\n                         (uint)*(byte *)(iVar1 + iVar3) << 0x18" (binary_expression "(uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10" (binary_expression "(uint)*(byte *)(iVar1 + 1 + iVar3)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (* "*") (cast_expression "(byte *)(iVar1 + 1 + iVar3)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 1 + iVar3)" (( "(") (binary_expression "iVar1 + 1 + iVar3" (binary_expression "iVar1 + 1" (identifier "iVar1") (+ "+") (number_literal "1")) (+ "+") (identifier "iVar3")) () ")")))) (<< "<<") (number_literal "0x10")) (| "|") (binary_expression "(uint)*(byte *)(iVar1 + iVar3) << 0x18" (binary_expression "(uint)*(byte *)(iVar1 + iVar3)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (* "*") (cast_expression "(byte *)(iVar1 + iVar3)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + iVar3)" (( "(") (binary_expression "iVar1 + iVar3" (identifier "iVar1") (+ "+") (identifier "iVar3")) () ")")))) (<< "<<") (number_literal "0x18"))) (| "|") (binary_expression "(uint)*(byte *)(iVar1 + 3 + iVar3)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (* "*") (cast_expression "(byte *)(iVar1 + 3 + iVar3)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 3 + iVar3)" (( "(") (binary_expression "iVar1 + 3 + iVar3" (binary_expression "iVar1 + 3" (identifier "iVar1") (+ "+") (number_literal "3")) (+ "+") (identifier "iVar3")) () ")"))))) (| "|") (binary_expression "(uint)*(byte *)(iVar1 + 2 + iVar3) << 8" (binary_expression "(uint)*(byte *)(iVar1 + 2 + iVar3)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (* "*") (cast_expression "(byte *)(iVar1 + 2 + iVar3)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 2 + iVar3)" (( "(") (binary_expression "iVar1 + 2 + iVar3" (binary_expression "iVar1 + 2" (identifier "iVar1") (+ "+") (number_literal "2")) (+ "+") (identifier "iVar3")) () ")")))) (<< "<<") (number_literal "8"))) () ")")))) (; ";")) (if_statement "if (-1 < iVar3) {\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }" (if "if") (parenthesized_expression "(-1 < iVar3)" (( "(") (binary_expression "-1 < iVar3" (number_literal "-1") (< "<") (identifier "iVar3")) () ")")) (compound_statement "{\n      iVar1 = param_1[6];\n      iVar2 = *param_1;\n      *param_3 = iVar3;\n      iVar1 = iVar1 + 4;\n      param_1[6] = iVar1;\n      if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }\n    }" ({ "{") (expression_statement "iVar1 = param_1[6];" (assignment_expression "iVar1 = param_1[6]" (identifier "iVar1") (= "=") (subscript_expression "param_1[6]" (identifier "param_1") ([ "[") (number_literal "6") (] "]"))) (; ";")) (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" (identifier "iVar2") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "*param_3 = iVar3;" (assignment_expression "*param_3 = iVar3" (pointer_expression "*param_3" (* "*") (identifier "param_3")) (= "=") (identifier "iVar3")) (; ";")) (expression_statement "iVar1 = iVar1 + 4;" (assignment_expression "iVar1 = iVar1 + 4" (identifier "iVar1") (= "=") (binary_expression "iVar1 + 4" (identifier "iVar1") (+ "+") (number_literal "4"))) (; ";")) (expression_statement "param_1[6] = iVar1;" (assignment_expression "param_1[6] = iVar1" (subscript_expression "param_1[6]" (identifier "param_1") ([ "[") (number_literal "6") (] "]")) (= "=") (identifier "iVar1")) (; ";")) (if_statement "if (iVar3 <= iVar2 - iVar1) {\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }" (if "if") (parenthesized_expression "(iVar3 <= iVar2 - iVar1)" (( "(") (binary_expression "iVar3 <= iVar2 - iVar1" (identifier "iVar3") (<= "<=") (binary_expression "iVar2 - iVar1" (identifier "iVar2") (- "-") (identifier "iVar1"))) () ")")) (compound_statement "{\n        *param_2 = param_1[5] + iVar1;\n        param_1[6] = iVar1 + iVar3;\n        return;\n      }" ({ "{") (expression_statement "*param_2 = param_1[5] + iVar1;" (assignment_expression "*param_2 = param_1[5] + iVar1" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (binary_expression "param_1[5] + iVar1" (subscript_expression "param_1[5]" (identifier "param_1") ([ "[") (number_literal "5") (] "]")) (+ "+") (identifier "iVar1"))) (; ";")) (expression_statement "param_1[6] = iVar1 + iVar3;" (assignment_expression "param_1[6] = iVar1 + iVar3" (subscript_expression "param_1[6]" (identifier "param_1") ([ "[") (number_literal "6") (] "]")) (= "=") (binary_expression "iVar1 + iVar3" (identifier "iVar1") (+ "+") (identifier "iVar3"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (} "}"))) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

void __regparm3 function_1(type_1 *pkt,char **p,int *length)

{
  int var_1;
  type_2 *puVar2;
  int var_4;
  int var_2;
  
  var_2 = pkt->savedpos;
  var_1 = pkt->length;
  *p = (char *)0x0;
  *length = 0;
  if (3 < var_1 - var_2) {
    puVar2 = pkt->body;
    var_2 = var_3((type_3)puVar2[var_2 + 1] << 0x10 |
                  (type_3)puVar2[var_2] << 0x18 | (type_3)puVar2[var_2 + 3] |
                  (type_3)puVar2[var_2 + 2] << 8);
    if (-1 < var_2) {
      var_1 = pkt->savedpos;
      var_4 = pkt->length;
      *length = var_2;
      var_1 = var_1 + 4;
      pkt->savedpos = var_1;
      if (var_2 <= var_4 - var_1) {
        *p = (char *)(pkt->body + var_1);
        pkt->savedpos = var_1 + var_2;
        return;
      }
    }
  }
  return;
}


(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))) (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)) (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (parenthesized_expression (identifier)) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (identifier))))) right: (number_literal)) right: (binary_expression left: (binary_expression left: (parenthesized_expression (identifier)) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))) right: (number_literal))) right: (binary_expression left: (parenthesized_expression (identifier)) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (identifier)))))) right: (binary_expression left: (binary_expression left: (parenthesized_expression (identifier)) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (identifier))))) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (binary_expression left: (identifier) right: (identifier)))) (return_statement))))))) (return_statement))))

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

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

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  iVar3 = param_1[6];
  iVar1 = *param_1;
  *param_2 = 0;
  *param_3 = 0;
  if (3 < iVar1 - iVar3) {
    iVar1 = param_1[5];
    iVar3 = FUN_0002e1f0((uint)*(byte *)(iVar1 + 1 + iVar3) << 0x10 |
                         (uint)*(byte *)(iVar1 + iVar3) << 0x18 | (uint)*(byte *)(iVar1 + 3 + iVar3)
                         | (uint)*(byte *)(iVar1 + 2 + iVar3) << 8);
    if (-1 < iVar3) {
      iVar1 = param_1[6];
      iVar2 = *param_1;
      *param_3 = iVar3;
      iVar1 = iVar1 + 4;
      param_1[6] = iVar1;
      if (iVar3 <= iVar2 - iVar1) {
        *param_2 = param_1[5] + iVar1;
        param_1[6] = iVar1 + iVar3;
        return;
      }
    }
  }
  return;
}

