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

int objdump_sprintf(SFILE *f,char *format,...)

{
  size_t sVar1;
  char *pcVar2;
  uint uVar3;
  uint __maxlen;
  
  while( true ) {
    __maxlen = f->alloc - f->pos;
    uVar3 = vsnprintf(f->buffer + f->pos,__maxlen,format,&stack0x0000000c);
    if (uVar3 < __maxlen) break;
    sVar1 = (uVar3 + f->alloc) * 2;
    f->alloc = sVar1;
    pcVar2 = (char *)xrealloc(f->buffer,sVar1);
    f->buffer = pcVar2;
  }
  f->pos = f->pos + uVar3;
  return uVar3;
}



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

void FUN_00017130(int *param_1,char *param_2)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  
  while( true ) {
    iVar2 = param_1[2];
    iVar1 = param_1[1];
    uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);
    if (uVar3 < (uint)(iVar2 - iVar1)) break;
    iVar2 = (uVar3 + param_1[2]) * 2;
    param_1[2] = iVar2;
    iVar2 = xrealloc(*param_1,iVar2);
    *param_1 = iVar2;
  }
  param_1[1] = param_1[1] + uVar3;
  return;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x000153d0
ADD EBX,0x5bec7
SUB ESP,0xc
MOV ESI,dword ptr [ESP + 0x20]
LEA EDI,[ESP + 0x28]
JMP 0x00017168
ADD EAX,dword ptr [ESI + 0x8]
SUB ESP,0x8
ADD EAX,EAX
MOV dword ptr [ESI + 0x8],EAX
PUSH EAX
PUSH dword ptr [ESI]
CALL 0x00014220
ADD ESP,0x10
MOV dword ptr [ESI],EAX
MOV EDX,dword ptr [ESI + 0x8]
SUB EDX,dword ptr [ESI + 0x4]
PUSH EDI
PUSH dword ptr [ESP + 0x28]
MOV EBP,EDX
PUSH EDX
MOV EAX,dword ptr [ESI + 0x4]
ADD EAX,dword ptr [ESI]
PUSH EAX
CALL 0x00014700
ADD ESP,0x10
CMP EBP,EAX
JBE 0x00017150
ADD dword ptr [ESI + 0x4],EAX
ADD ESP,0xc
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 FUN_00017130(int *param_1,char *param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  uint uVar3;\n  \n  while( true ) {\n    iVar2 = param_1[2];\n    iVar1 = param_1[1];\n    uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);\n    if (uVar3 < (uint)(iVar2 - iVar1)) break;\n    iVar2 = (uVar3 + param_1[2]) * 2;\n    param_1[2] = iVar2;\n    iVar2 = xrealloc(*param_1,iVar2);\n    *param_1 = iVar2;\n  }\n  param_1[1] = param_1[1] + uVar3;\n  return;\n}\n\n" comment (function_definition "void FUN_00017130(int *param_1,char *param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  uint uVar3;\n  \n  while( true ) {\n    iVar2 = param_1[2];\n    iVar1 = param_1[1];\n    uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);\n    if (uVar3 < (uint)(iVar2 - iVar1)) break;\n    iVar2 = (uVar3 + param_1[2]) * 2;\n    param_1[2] = iVar2;\n    iVar2 = xrealloc(*param_1,iVar2);\n    *param_1 = iVar2;\n  }\n  param_1[1] = param_1[1] + uVar3;\n  return;\n}" primitive_type (function_declarator "FUN_00017130(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  int iVar2;\n  uint uVar3;\n  \n  while( true ) {\n    iVar2 = param_1[2];\n    iVar1 = param_1[1];\n    uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);\n    if (uVar3 < (uint)(iVar2 - iVar1)) break;\n    iVar2 = (uVar3 + param_1[2]) * 2;\n    param_1[2] = iVar2;\n    iVar2 = xrealloc(*param_1,iVar2);\n    *param_1 = iVar2;\n  }\n  param_1[1] = param_1[1] + uVar3;\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (while_statement "while( true ) {\n    iVar2 = param_1[2];\n    iVar1 = param_1[1];\n    uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);\n    if (uVar3 < (uint)(iVar2 - iVar1)) break;\n    iVar2 = (uVar3 + param_1[2]) * 2;\n    param_1[2] = iVar2;\n    iVar2 = xrealloc(*param_1,iVar2);\n    *param_1 = iVar2;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    iVar2 = param_1[2];\n    iVar1 = param_1[1];\n    uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);\n    if (uVar3 < (uint)(iVar2 - iVar1)) break;\n    iVar2 = (uVar3 + param_1[2]) * 2;\n    param_1[2] = iVar2;\n    iVar2 = xrealloc(*param_1,iVar2);\n    *param_1 = iVar2;\n  }" { (expression_statement "iVar2 = param_1[2];" (assignment_expression "iVar2 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) (expression_statement "iVar1 = param_1[1];" (assignment_expression "iVar1 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);" (assignment_expression "uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c)" identifier = (call_expression "vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c)" identifier (argument_list "((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c)" ( (cast_expression "(char *)(param_1[1] + *param_1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1[1] + *param_1)" ( (binary_expression "param_1[1] + *param_1" (subscript_expression "param_1[1]" identifier [ number_literal ]) + (pointer_expression "*param_1" * identifier)) ))) , (binary_expression "iVar2 - iVar1" identifier - identifier) , identifier , (pointer_expression "&stack0x0000000c" & identifier) )))) ;) (if_statement "if (uVar3 < (uint)(iVar2 - iVar1)) break;" if (parenthesized_expression "(uVar3 < (uint)(iVar2 - iVar1))" ( (binary_expression "uVar3 < (uint)(iVar2 - iVar1)" identifier < (call_expression "(uint)(iVar2 - iVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar2 - iVar1)" ( (binary_expression "iVar2 - iVar1" identifier - identifier) )))) )) (break_statement "break;" break ;)) (expression_statement "iVar2 = (uVar3 + param_1[2]) * 2;" (assignment_expression "iVar2 = (uVar3 + param_1[2]) * 2" identifier = (binary_expression "(uVar3 + param_1[2]) * 2" (parenthesized_expression "(uVar3 + param_1[2])" ( (binary_expression "uVar3 + param_1[2]" identifier + (subscript_expression "param_1[2]" identifier [ number_literal ])) )) * number_literal)) ;) (expression_statement "param_1[2] = iVar2;" (assignment_expression "param_1[2] = iVar2" (subscript_expression "param_1[2]" identifier [ number_literal ]) = identifier) ;) (expression_statement "iVar2 = xrealloc(*param_1,iVar2);" (assignment_expression "iVar2 = xrealloc(*param_1,iVar2)" identifier = (call_expression "xrealloc(*param_1,iVar2)" identifier (argument_list "(*param_1,iVar2)" ( (pointer_expression "*param_1" * identifier) , identifier )))) ;) (expression_statement "*param_1 = iVar2;" (assignment_expression "*param_1 = iVar2" (pointer_expression "*param_1" * identifier) = identifier) ;) })) (expression_statement "param_1[1] = param_1[1] + uVar3;" (assignment_expression "param_1[1] = param_1[1] + uVar3" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (binary_expression "param_1[1] + uVar3" (subscript_expression "param_1[1]" identifier [ number_literal ]) + identifier)) ;) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint objdump_sprintf(SFILE *f,char *format,...)\n\n{\n  size_t sVar1;\n  char *pcVar2;\n  uint uVar3;\n  uint __maxlen;\n  \n  while( true ) {\n    __maxlen = f->alloc - f->pos;\n    uVar3 = vsnprintf(f->buffer + f->pos,__maxlen,format,&stack0x0000000c);\n    if (uVar3 < __maxlen) break;\n    sVar1 = (uVar3 + f->alloc) * 2;\n    f->alloc = sVar1;\n    pcVar2 = (char *)xrealloc(f->buffer,sVar1);\n    f->buffer = pcVar2;\n  }\n  f->pos = f->pos + uVar3;\n  return uVar3;\n}\n\n" comment comment (function_definition "int objdump_sprintf(SFILE *f,char *format,...)\n\n{\n  size_t sVar1;\n  char *pcVar2;\n  uint uVar3;\n  uint __maxlen;\n  \n  while( true ) {\n    __maxlen = f->alloc - f->pos;\n    uVar3 = vsnprintf(f->buffer + f->pos,__maxlen,format,&stack0x0000000c);\n    if (uVar3 < __maxlen) break;\n    sVar1 = (uVar3 + f->alloc) * 2;\n    f->alloc = sVar1;\n    pcVar2 = (char *)xrealloc(f->buffer,sVar1);\n    f->buffer = pcVar2;\n  }\n  f->pos = f->pos + uVar3;\n  return uVar3;\n}" primitive_type (function_declarator "objdump_sprintf(SFILE *f,char *format,...)" identifier (parameter_list "(SFILE *f,char *format,...)" ( (parameter_declaration "SFILE *f" type_identifier (pointer_declarator "*f" * identifier)) , (parameter_declaration "char *format" primitive_type (pointer_declarator "*format" * identifier)) , (variadic_parameter "..." ...) ))) (compound_statement "{\n  size_t sVar1;\n  char *pcVar2;\n  uint uVar3;\n  uint __maxlen;\n  \n  while( true ) {\n    __maxlen = f->alloc - f->pos;\n    uVar3 = vsnprintf(f->buffer + f->pos,__maxlen,format,&stack0x0000000c);\n    if (uVar3 < __maxlen) break;\n    sVar1 = (uVar3 + f->alloc) * 2;\n    f->alloc = sVar1;\n    pcVar2 = (char *)xrealloc(f->buffer,sVar1);\n    f->buffer = pcVar2;\n  }\n  f->pos = f->pos + uVar3;\n  return uVar3;\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "uint __maxlen;" type_identifier identifier ;) (while_statement "while( true ) {\n    __maxlen = f->alloc - f->pos;\n    uVar3 = vsnprintf(f->buffer + f->pos,__maxlen,format,&stack0x0000000c);\n    if (uVar3 < __maxlen) break;\n    sVar1 = (uVar3 + f->alloc) * 2;\n    f->alloc = sVar1;\n    pcVar2 = (char *)xrealloc(f->buffer,sVar1);\n    f->buffer = pcVar2;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    __maxlen = f->alloc - f->pos;\n    uVar3 = vsnprintf(f->buffer + f->pos,__maxlen,format,&stack0x0000000c);\n    if (uVar3 < __maxlen) break;\n    sVar1 = (uVar3 + f->alloc) * 2;\n    f->alloc = sVar1;\n    pcVar2 = (char *)xrealloc(f->buffer,sVar1);\n    f->buffer = pcVar2;\n  }" { (expression_statement "__maxlen = f->alloc - f->pos;" (assignment_expression "__maxlen = f->alloc - f->pos" identifier = (binary_expression "f->alloc - f->pos" (field_expression "f->alloc" identifier -> field_identifier) - (field_expression "f->pos" identifier -> field_identifier))) ;) (expression_statement "uVar3 = vsnprintf(f->buffer + f->pos,__maxlen,format,&stack0x0000000c);" (assignment_expression "uVar3 = vsnprintf(f->buffer + f->pos,__maxlen,format,&stack0x0000000c)" identifier = (call_expression "vsnprintf(f->buffer + f->pos,__maxlen,format,&stack0x0000000c)" identifier (argument_list "(f->buffer + f->pos,__maxlen,format,&stack0x0000000c)" ( (binary_expression "f->buffer + f->pos" (field_expression "f->buffer" identifier -> field_identifier) + (field_expression "f->pos" identifier -> field_identifier)) , identifier , identifier , (pointer_expression "&stack0x0000000c" & identifier) )))) ;) (if_statement "if (uVar3 < __maxlen) break;" if (parenthesized_expression "(uVar3 < __maxlen)" ( (binary_expression "uVar3 < __maxlen" identifier < identifier) )) (break_statement "break;" break ;)) (expression_statement "sVar1 = (uVar3 + f->alloc) * 2;" (assignment_expression "sVar1 = (uVar3 + f->alloc) * 2" identifier = (binary_expression "(uVar3 + f->alloc) * 2" (parenthesized_expression "(uVar3 + f->alloc)" ( (binary_expression "uVar3 + f->alloc" identifier + (field_expression "f->alloc" identifier -> field_identifier)) )) * number_literal)) ;) (expression_statement "f->alloc = sVar1;" (assignment_expression "f->alloc = sVar1" (field_expression "f->alloc" identifier -> field_identifier) = identifier) ;) (expression_statement "pcVar2 = (char *)xrealloc(f->buffer,sVar1);" (assignment_expression "pcVar2 = (char *)xrealloc(f->buffer,sVar1)" identifier = (cast_expression "(char *)xrealloc(f->buffer,sVar1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xrealloc(f->buffer,sVar1)" identifier (argument_list "(f->buffer,sVar1)" ( (field_expression "f->buffer" identifier -> field_identifier) , identifier ))))) ;) (expression_statement "f->buffer = pcVar2;" (assignment_expression "f->buffer = pcVar2" (field_expression "f->buffer" identifier -> field_identifier) = identifier) ;) })) (expression_statement "f->pos = f->pos + uVar3;" (assignment_expression "f->pos = f->pos + uVar3" (field_expression "f->pos" identifier -> field_identifier) = (binary_expression "f->pos + uVar3" (field_expression "f->pos" identifier -> field_identifier) + identifier)) ;) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit "void FUN_00017130(int *param_1,char *param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  uint uVar3;\n  \n  while( true ) {\n    iVar2 = param_1[2];\n    iVar1 = param_1[1];\n    uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);\n    if (uVar3 < (uint)(iVar2 - iVar1)) break;\n    iVar2 = (uVar3 + param_1[2]) * 2;\n    param_1[2] = iVar2;\n    iVar2 = xrealloc(*param_1,iVar2);\n    *param_1 = iVar2;\n  }\n  param_1[1] = param_1[1] + uVar3;\n  return;\n}\n\n" (function_definition "void FUN_00017130(int *param_1,char *param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  uint uVar3;\n  \n  while( true ) {\n    iVar2 = param_1[2];\n    iVar1 = param_1[1];\n    uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);\n    if (uVar3 < (uint)(iVar2 - iVar1)) break;\n    iVar2 = (uVar3 + param_1[2]) * 2;\n    param_1[2] = iVar2;\n    iVar2 = xrealloc(*param_1,iVar2);\n    *param_1 = iVar2;\n  }\n  param_1[1] = param_1[1] + uVar3;\n  return;\n}" primitive_type (function_declarator "FUN_00017130(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  int iVar2;\n  uint uVar3;\n  \n  while( true ) {\n    iVar2 = param_1[2];\n    iVar1 = param_1[1];\n    uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);\n    if (uVar3 < (uint)(iVar2 - iVar1)) break;\n    iVar2 = (uVar3 + param_1[2]) * 2;\n    param_1[2] = iVar2;\n    iVar2 = xrealloc(*param_1,iVar2);\n    *param_1 = iVar2;\n  }\n  param_1[1] = param_1[1] + uVar3;\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (while_statement "while( true ) {\n    iVar2 = param_1[2];\n    iVar1 = param_1[1];\n    uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);\n    if (uVar3 < (uint)(iVar2 - iVar1)) break;\n    iVar2 = (uVar3 + param_1[2]) * 2;\n    param_1[2] = iVar2;\n    iVar2 = xrealloc(*param_1,iVar2);\n    *param_1 = iVar2;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    iVar2 = param_1[2];\n    iVar1 = param_1[1];\n    uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);\n    if (uVar3 < (uint)(iVar2 - iVar1)) break;\n    iVar2 = (uVar3 + param_1[2]) * 2;\n    param_1[2] = iVar2;\n    iVar2 = xrealloc(*param_1,iVar2);\n    *param_1 = iVar2;\n  }" { (expression_statement "iVar2 = param_1[2];" (assignment_expression "iVar2 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) (expression_statement "iVar1 = param_1[1];" (assignment_expression "iVar1 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);" (assignment_expression "uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c)" identifier = (call_expression "vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c)" identifier (argument_list "((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c)" ( (cast_expression "(char *)(param_1[1] + *param_1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1[1] + *param_1)" ( (binary_expression "param_1[1] + *param_1" (subscript_expression "param_1[1]" identifier [ number_literal ]) + (pointer_expression "*param_1" * identifier)) ))) , (binary_expression "iVar2 - iVar1" identifier - identifier) , identifier , (pointer_expression "&stack0x0000000c" & identifier) )))) ;) (if_statement "if (uVar3 < (uint)(iVar2 - iVar1)) break;" if (parenthesized_expression "(uVar3 < (uint)(iVar2 - iVar1))" ( (binary_expression "uVar3 < (uint)(iVar2 - iVar1)" identifier < (call_expression "(uint)(iVar2 - iVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar2 - iVar1)" ( (binary_expression "iVar2 - iVar1" identifier - identifier) )))) )) (break_statement "break;" break ;)) (expression_statement "iVar2 = (uVar3 + param_1[2]) * 2;" (assignment_expression "iVar2 = (uVar3 + param_1[2]) * 2" identifier = (binary_expression "(uVar3 + param_1[2]) * 2" (parenthesized_expression "(uVar3 + param_1[2])" ( (binary_expression "uVar3 + param_1[2]" identifier + (subscript_expression "param_1[2]" identifier [ number_literal ])) )) * number_literal)) ;) (expression_statement "param_1[2] = iVar2;" (assignment_expression "param_1[2] = iVar2" (subscript_expression "param_1[2]" identifier [ number_literal ]) = identifier) ;) (expression_statement "iVar2 = xrealloc(*param_1,iVar2);" (assignment_expression "iVar2 = xrealloc(*param_1,iVar2)" identifier = (call_expression "xrealloc(*param_1,iVar2)" identifier (argument_list "(*param_1,iVar2)" ( (pointer_expression "*param_1" * identifier) , identifier )))) ;) (expression_statement "*param_1 = iVar2;" (assignment_expression "*param_1 = iVar2" (pointer_expression "*param_1" * identifier) = identifier) ;) })) (expression_statement "param_1[1] = param_1[1] + uVar3;" (assignment_expression "param_1[1] = param_1[1] + uVar3" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (binary_expression "param_1[1] + uVar3" (subscript_expression "param_1[1]" identifier [ number_literal ]) + identifier)) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (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 ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) + (pointer_expression * IDENT)) ))) , (binary_expression IDENT - IDENT) , IDENT , (pointer_expression & IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT - IDENT) )))) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression IDENT + (subscript_expression IDENT [ LIT ])) )) * LIT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) , IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) })) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (subscript_expression IDENT [ LIT ]) + IDENT)) ;) (return_statement return ;) })))
(function_definition "void FUN_00017130(int *param_1,char *param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  uint uVar3;\n  \n  while( true ) {\n    iVar2 = param_1[2];\n    iVar1 = param_1[1];\n    uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);\n    if (uVar3 < (uint)(iVar2 - iVar1)) break;\n    iVar2 = (uVar3 + param_1[2]) * 2;\n    param_1[2] = iVar2;\n    iVar2 = xrealloc(*param_1,iVar2);\n    *param_1 = iVar2;\n  }\n  param_1[1] = param_1[1] + uVar3;\n  return;\n}" (primitive_type "void") (function_declarator "FUN_00017130(int *param_1,char *param_2)" (identifier "FUN_00017130") (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  int iVar2;\n  uint uVar3;\n  \n  while( true ) {\n    iVar2 = param_1[2];\n    iVar1 = param_1[1];\n    uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);\n    if (uVar3 < (uint)(iVar2 - iVar1)) break;\n    iVar2 = (uVar3 + param_1[2]) * 2;\n    param_1[2] = iVar2;\n    iVar2 = xrealloc(*param_1,iVar2);\n    *param_1 = iVar2;\n  }\n  param_1[1] = param_1[1] + uVar3;\n  return;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (while_statement "while( true ) {\n    iVar2 = param_1[2];\n    iVar1 = param_1[1];\n    uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);\n    if (uVar3 < (uint)(iVar2 - iVar1)) break;\n    iVar2 = (uVar3 + param_1[2]) * 2;\n    param_1[2] = iVar2;\n    iVar2 = xrealloc(*param_1,iVar2);\n    *param_1 = iVar2;\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    iVar2 = param_1[2];\n    iVar1 = param_1[1];\n    uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);\n    if (uVar3 < (uint)(iVar2 - iVar1)) break;\n    iVar2 = (uVar3 + param_1[2]) * 2;\n    param_1[2] = iVar2;\n    iVar2 = xrealloc(*param_1,iVar2);\n    *param_1 = iVar2;\n  }" ({ "{") (expression_statement "iVar2 = param_1[2];" (assignment_expression "iVar2 = param_1[2]" (identifier "iVar2") (= "=") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (expression_statement "iVar1 = param_1[1];" (assignment_expression "iVar1 = param_1[1]" (identifier "iVar1") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);" (assignment_expression "uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c)" (identifier "uVar3") (= "=") (call_expression "vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c)" (identifier "vsnprintf") (argument_list "((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c)" (( "(") (cast_expression "(char *)(param_1[1] + *param_1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1[1] + *param_1)" (( "(") (binary_expression "param_1[1] + *param_1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (+ "+") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) () ")"))) (, ",") (binary_expression "iVar2 - iVar1" (identifier "iVar2") (- "-") (identifier "iVar1")) (, ",") (identifier "param_2") (, ",") (pointer_expression "&stack0x0000000c" (& "&") (identifier "stack0x0000000c")) () ")")))) (; ";")) (if_statement "if (uVar3 < (uint)(iVar2 - iVar1)) break;" (if "if") (parenthesized_expression "(uVar3 < (uint)(iVar2 - iVar1))" (( "(") (binary_expression "uVar3 < (uint)(iVar2 - iVar1)" (identifier "uVar3") (< "<") (call_expression "(uint)(iVar2 - iVar1)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(iVar2 - iVar1)" (( "(") (binary_expression "iVar2 - iVar1" (identifier "iVar2") (- "-") (identifier "iVar1")) () ")")))) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "iVar2 = (uVar3 + param_1[2]) * 2;" (assignment_expression "iVar2 = (uVar3 + param_1[2]) * 2" (identifier "iVar2") (= "=") (binary_expression "(uVar3 + param_1[2]) * 2" (parenthesized_expression "(uVar3 + param_1[2])" (( "(") (binary_expression "uVar3 + param_1[2]" (identifier "uVar3") (+ "+") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) () ")")) (* "*") (number_literal "2"))) (; ";")) (expression_statement "param_1[2] = iVar2;" (assignment_expression "param_1[2] = iVar2" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (identifier "iVar2")) (; ";")) (expression_statement "iVar2 = xrealloc(*param_1,iVar2);" (assignment_expression "iVar2 = xrealloc(*param_1,iVar2)" (identifier "iVar2") (= "=") (call_expression "xrealloc(*param_1,iVar2)" (identifier "xrealloc") (argument_list "(*param_1,iVar2)" (( "(") (pointer_expression "*param_1" (* "*") (identifier "param_1")) (, ",") (identifier "iVar2") () ")")))) (; ";")) (expression_statement "*param_1 = iVar2;" (assignment_expression "*param_1 = iVar2" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "iVar2")) (; ";")) (} "}"))) (expression_statement "param_1[1] = param_1[1] + uVar3;" (assignment_expression "param_1[1] = param_1[1] + uVar3" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (binary_expression "param_1[1] + uVar3" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (+ "+") (identifier "uVar3"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

int function_1(type_1 *f,char *format,...)

{
  size_t sVar1;
  char *pcVar2;
  type_2 var_2;
  type_2 var_3;
  
  while( true ) {
    var_3 = f->alloc - f->pos;
    var_2 = var_1(f->buffer + f->pos,var_3,format,&stack0x0000000c);
    if (var_2 < var_3) break;
    sVar1 = (var_2 + f->alloc) * 2;
    f->alloc = sVar1;
    pcVar2 = (char *)var_4(f->buffer,sVar1);
    f->buffer = pcVar2;
  }
  f->pos = f->pos + var_2;
  return var_2;
}


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

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

void MASKED(int *param_1,char *param_2)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  
  while( true ) {
    iVar2 = param_1[2];
    iVar1 = param_1[1];
    uVar3 = vsnprintf((char *)(param_1[1] + *param_1),iVar2 - iVar1,param_2,&stack0x0000000c);
    if (uVar3 < (uint)(iVar2 - iVar1)) break;
    iVar2 = (uVar3 + param_1[2]) * 2;
    param_1[2] = iVar2;
    iVar2 = xrealloc(*param_1,iVar2);
    *param_1 = iVar2;
  }
  param_1[1] = param_1[1] + uVar3;
  return;
}

