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

char * ambsalign(char *src,size_t *width,mbs_align_t align,int flags)

{
  uint __size;
  size_t sVar1;
  char *dest;
  size_t sVar2;
  char *__ptr;
  
  sVar1 = *width;
  sVar2 = sVar1;
  __ptr = (char *)0x0;
  while( true ) {
    __size = sVar2 + 1;
    dest = (char *)realloc(__ptr,__size);
    if (dest == (char *)0x0) {
      free(__ptr);
      return (char *)0x0;
    }
    *width = sVar1;
    sVar2 = mbsalign(src,dest,__size,width,align,flags);
    if (sVar2 == 0xffffffff) break;
    __ptr = dest;
    if (sVar2 < __size) {
      return dest;
    }
  }
  free(dest);
  return (char *)0x0;
}



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

void * FUN_00015950(undefined4 param_1,uint *param_2,undefined4 param_3,undefined4 param_4)

{
  uint __size;
  uint uVar1;
  void *__ptr;
  uint uVar2;
  void *__ptr_00;
  
  uVar1 = *param_2;
  uVar2 = uVar1;
  __ptr_00 = (void *)0x0;
  while( true ) {
    __size = uVar2 + 1;
    __ptr = realloc(__ptr_00,__size);
    if (__ptr == (void *)0x0) {
      free(__ptr_00);
      return (void *)0x0;
    }
    *param_2 = uVar1;
    uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);
    if (uVar2 == 0xffffffff) break;
    __ptr_00 = __ptr;
    if (uVar2 < __size) {
      return __ptr;
    }
  }
  free(__ptr);
  return (void *)0x0;
}


PUSH EBP
PUSH EDI
XOR EDI,EDI
PUSH ESI
PUSH EBX
CALL 0x000122a0
ADD EBX,0xd6a5
SUB ESP,0x1c
MOV EAX,dword ptr [ESP + 0x34]
MOV EAX,dword ptr [EAX]
MOV dword ptr [ESP + 0xc],EAX
NOP
SUB ESP,0x8
LEA ESI,[EAX + 0x1]
PUSH ESI
PUSH EDI
CALL 0x000111e0
ADD ESP,0x10
MOV EBP,EAX
TEST EAX,EAX
JZ 0x000159c8
MOV EAX,dword ptr [ESP + 0x34]
MOV EDX,dword ptr [ESP + 0xc]
SUB ESP,0x8
MOV dword ptr [EAX],EDX
PUSH dword ptr [ESP + 0x44]
PUSH dword ptr [ESP + 0x44]
PUSH dword ptr [ESP + 0x44]
PUSH ESI
PUSH EBP
PUSH dword ptr [ESP + 0x4c]
CALL 0x00015550
ADD ESP,0x20
CMP EAX,-0x1
JZ 0x000159e0
MOV EDI,EBP
CMP ESI,EAX
JBE 0x00015970
ADD ESP,0x1c
MOV EAX,EBP
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH EDI
CALL 0x000110a0
ADD ESP,0x10
MOV EAX,EBP
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH EBP
XOR EBP,EBP
CALL 0x000110a0
ADD ESP,0x10
MOV EAX,EBP
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 * FUN_00015950(undefined4 param_1,uint *param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  uint __size;\n  uint uVar1;\n  void *__ptr;\n  uint uVar2;\n  void *__ptr_00;\n  \n  uVar1 = *param_2;\n  uVar2 = uVar1;\n  __ptr_00 = (void *)0x0;\n  while( true ) {\n    __size = uVar2 + 1;\n    __ptr = realloc(__ptr_00,__size);\n    if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }\n    *param_2 = uVar1;\n    uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);\n    if (uVar2 == 0xffffffff) break;\n    __ptr_00 = __ptr;\n    if (uVar2 < __size) {\n      return __ptr;\n    }\n  }\n  free(__ptr);\n  return (void *)0x0;\n}\n\n" comment (function_definition "void * FUN_00015950(undefined4 param_1,uint *param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  uint __size;\n  uint uVar1;\n  void *__ptr;\n  uint uVar2;\n  void *__ptr_00;\n  \n  uVar1 = *param_2;\n  uVar2 = uVar1;\n  __ptr_00 = (void *)0x0;\n  while( true ) {\n    __size = uVar2 + 1;\n    __ptr = realloc(__ptr_00,__size);\n    if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }\n    *param_2 = uVar1;\n    uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);\n    if (uVar2 == 0xffffffff) break;\n    __ptr_00 = __ptr;\n    if (uVar2 < __size) {\n      return __ptr;\n    }\n  }\n  free(__ptr);\n  return (void *)0x0;\n}" primitive_type (pointer_declarator "* FUN_00015950(undefined4 param_1,uint *param_2,undefined4 param_3,undefined4 param_4)" * (function_declarator "FUN_00015950(undefined4 param_1,uint *param_2,undefined4 param_3,undefined4 param_4)" identifier (parameter_list "(undefined4 param_1,uint *param_2,undefined4 param_3,undefined4 param_4)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "uint *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) )))) (compound_statement "{\n  uint __size;\n  uint uVar1;\n  void *__ptr;\n  uint uVar2;\n  void *__ptr_00;\n  \n  uVar1 = *param_2;\n  uVar2 = uVar1;\n  __ptr_00 = (void *)0x0;\n  while( true ) {\n    __size = uVar2 + 1;\n    __ptr = realloc(__ptr_00,__size);\n    if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }\n    *param_2 = uVar1;\n    uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);\n    if (uVar2 == 0xffffffff) break;\n    __ptr_00 = __ptr;\n    if (uVar2 < __size) {\n      return __ptr;\n    }\n  }\n  free(__ptr);\n  return (void *)0x0;\n}" { (declaration "uint __size;" type_identifier identifier ;) (declaration "uint uVar1;" type_identifier identifier ;) (declaration "void *__ptr;" primitive_type (pointer_declarator "*__ptr" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "void *__ptr_00;" primitive_type (pointer_declarator "*__ptr_00" * identifier) ;) (expression_statement "uVar1 = *param_2;" (assignment_expression "uVar1 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (expression_statement "uVar2 = uVar1;" (assignment_expression "uVar2 = uVar1" identifier = identifier) ;) (expression_statement "__ptr_00 = (void *)0x0;" (assignment_expression "__ptr_00 = (void *)0x0" identifier = (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (while_statement "while( true ) {\n    __size = uVar2 + 1;\n    __ptr = realloc(__ptr_00,__size);\n    if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }\n    *param_2 = uVar1;\n    uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);\n    if (uVar2 == 0xffffffff) break;\n    __ptr_00 = __ptr;\n    if (uVar2 < __size) {\n      return __ptr;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    __size = uVar2 + 1;\n    __ptr = realloc(__ptr_00,__size);\n    if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }\n    *param_2 = uVar1;\n    uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);\n    if (uVar2 == 0xffffffff) break;\n    __ptr_00 = __ptr;\n    if (uVar2 < __size) {\n      return __ptr;\n    }\n  }" { (expression_statement "__size = uVar2 + 1;" (assignment_expression "__size = uVar2 + 1" identifier = (binary_expression "uVar2 + 1" identifier + number_literal)) ;) (expression_statement "__ptr = realloc(__ptr_00,__size);" (assignment_expression "__ptr = realloc(__ptr_00,__size)" identifier = (call_expression "realloc(__ptr_00,__size)" identifier (argument_list "(__ptr_00,__size)" ( identifier , identifier )))) ;) (if_statement "if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }" if (parenthesized_expression "(__ptr == (void *)0x0)" ( (binary_expression "__ptr == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      free(__ptr_00);\n      return (void *)0x0;\n    }" { (expression_statement "free(__ptr_00);" (call_expression "free(__ptr_00)" identifier (argument_list "(__ptr_00)" ( identifier ))) ;) (return_statement "return (void *)0x0;" return (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "*param_2 = uVar1;" (assignment_expression "*param_2 = uVar1" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);" (assignment_expression "uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4)" identifier = (call_expression "FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4)" identifier (argument_list "(param_1,__ptr,__size,param_2,param_3,param_4)" ( identifier , identifier , identifier , identifier , identifier , identifier )))) ;) (if_statement "if (uVar2 == 0xffffffff) break;" if (parenthesized_expression "(uVar2 == 0xffffffff)" ( (binary_expression "uVar2 == 0xffffffff" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "__ptr_00 = __ptr;" (assignment_expression "__ptr_00 = __ptr" identifier = identifier) ;) (if_statement "if (uVar2 < __size) {\n      return __ptr;\n    }" if (parenthesized_expression "(uVar2 < __size)" ( (binary_expression "uVar2 < __size" identifier < identifier) )) (compound_statement "{\n      return __ptr;\n    }" { (return_statement "return __ptr;" return identifier ;) })) })) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) (return_statement "return (void *)0x0;" return (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nchar * ambsalign(char *src,size_t *width,mbs_align_t align,int flags)\n\n{\n  uint __size;\n  size_t sVar1;\n  char *dest;\n  size_t sVar2;\n  char *__ptr;\n  \n  sVar1 = *width;\n  sVar2 = sVar1;\n  __ptr = (char *)0x0;\n  while( true ) {\n    __size = sVar2 + 1;\n    dest = (char *)realloc(__ptr,__size);\n    if (dest == (char *)0x0) {\n      free(__ptr);\n      return (char *)0x0;\n    }\n    *width = sVar1;\n    sVar2 = mbsalign(src,dest,__size,width,align,flags);\n    if (sVar2 == 0xffffffff) break;\n    __ptr = dest;\n    if (sVar2 < __size) {\n      return dest;\n    }\n  }\n  free(dest);\n  return (char *)0x0;\n}\n\n" comment comment (function_definition "char * ambsalign(char *src,size_t *width,mbs_align_t align,int flags)\n\n{\n  uint __size;\n  size_t sVar1;\n  char *dest;\n  size_t sVar2;\n  char *__ptr;\n  \n  sVar1 = *width;\n  sVar2 = sVar1;\n  __ptr = (char *)0x0;\n  while( true ) {\n    __size = sVar2 + 1;\n    dest = (char *)realloc(__ptr,__size);\n    if (dest == (char *)0x0) {\n      free(__ptr);\n      return (char *)0x0;\n    }\n    *width = sVar1;\n    sVar2 = mbsalign(src,dest,__size,width,align,flags);\n    if (sVar2 == 0xffffffff) break;\n    __ptr = dest;\n    if (sVar2 < __size) {\n      return dest;\n    }\n  }\n  free(dest);\n  return (char *)0x0;\n}" primitive_type (pointer_declarator "* ambsalign(char *src,size_t *width,mbs_align_t align,int flags)" * (function_declarator "ambsalign(char *src,size_t *width,mbs_align_t align,int flags)" identifier (parameter_list "(char *src,size_t *width,mbs_align_t align,int flags)" ( (parameter_declaration "char *src" primitive_type (pointer_declarator "*src" * identifier)) , (parameter_declaration "size_t *width" primitive_type (pointer_declarator "*width" * identifier)) , (parameter_declaration "mbs_align_t align" type_identifier identifier) , (parameter_declaration "int flags" primitive_type identifier) )))) (compound_statement "{\n  uint __size;\n  size_t sVar1;\n  char *dest;\n  size_t sVar2;\n  char *__ptr;\n  \n  sVar1 = *width;\n  sVar2 = sVar1;\n  __ptr = (char *)0x0;\n  while( true ) {\n    __size = sVar2 + 1;\n    dest = (char *)realloc(__ptr,__size);\n    if (dest == (char *)0x0) {\n      free(__ptr);\n      return (char *)0x0;\n    }\n    *width = sVar1;\n    sVar2 = mbsalign(src,dest,__size,width,align,flags);\n    if (sVar2 == 0xffffffff) break;\n    __ptr = dest;\n    if (sVar2 < __size) {\n      return dest;\n    }\n  }\n  free(dest);\n  return (char *)0x0;\n}" { (declaration "uint __size;" type_identifier identifier ;) (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "char *dest;" primitive_type (pointer_declarator "*dest" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "char *__ptr;" primitive_type (pointer_declarator "*__ptr" * identifier) ;) (expression_statement "sVar1 = *width;" (assignment_expression "sVar1 = *width" identifier = (pointer_expression "*width" * identifier)) ;) (expression_statement "sVar2 = sVar1;" (assignment_expression "sVar2 = sVar1" identifier = identifier) ;) (expression_statement "__ptr = (char *)0x0;" (assignment_expression "__ptr = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (while_statement "while( true ) {\n    __size = sVar2 + 1;\n    dest = (char *)realloc(__ptr,__size);\n    if (dest == (char *)0x0) {\n      free(__ptr);\n      return (char *)0x0;\n    }\n    *width = sVar1;\n    sVar2 = mbsalign(src,dest,__size,width,align,flags);\n    if (sVar2 == 0xffffffff) break;\n    __ptr = dest;\n    if (sVar2 < __size) {\n      return dest;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    __size = sVar2 + 1;\n    dest = (char *)realloc(__ptr,__size);\n    if (dest == (char *)0x0) {\n      free(__ptr);\n      return (char *)0x0;\n    }\n    *width = sVar1;\n    sVar2 = mbsalign(src,dest,__size,width,align,flags);\n    if (sVar2 == 0xffffffff) break;\n    __ptr = dest;\n    if (sVar2 < __size) {\n      return dest;\n    }\n  }" { (expression_statement "__size = sVar2 + 1;" (assignment_expression "__size = sVar2 + 1" identifier = (binary_expression "sVar2 + 1" identifier + number_literal)) ;) (expression_statement "dest = (char *)realloc(__ptr,__size);" (assignment_expression "dest = (char *)realloc(__ptr,__size)" identifier = (cast_expression "(char *)realloc(__ptr,__size)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "realloc(__ptr,__size)" identifier (argument_list "(__ptr,__size)" ( identifier , identifier ))))) ;) (if_statement "if (dest == (char *)0x0) {\n      free(__ptr);\n      return (char *)0x0;\n    }" if (parenthesized_expression "(dest == (char *)0x0)" ( (binary_expression "dest == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      free(__ptr);\n      return (char *)0x0;\n    }" { (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "*width = sVar1;" (assignment_expression "*width = sVar1" (pointer_expression "*width" * identifier) = identifier) ;) (expression_statement "sVar2 = mbsalign(src,dest,__size,width,align,flags);" (assignment_expression "sVar2 = mbsalign(src,dest,__size,width,align,flags)" identifier = (call_expression "mbsalign(src,dest,__size,width,align,flags)" identifier (argument_list "(src,dest,__size,width,align,flags)" ( identifier , identifier , identifier , identifier , identifier , identifier )))) ;) (if_statement "if (sVar2 == 0xffffffff) break;" if (parenthesized_expression "(sVar2 == 0xffffffff)" ( (binary_expression "sVar2 == 0xffffffff" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "__ptr = dest;" (assignment_expression "__ptr = dest" identifier = identifier) ;) (if_statement "if (sVar2 < __size) {\n      return dest;\n    }" if (parenthesized_expression "(sVar2 < __size)" ( (binary_expression "sVar2 < __size" identifier < identifier) )) (compound_statement "{\n      return dest;\n    }" { (return_statement "return dest;" return identifier ;) })) })) (expression_statement "free(dest);" (call_expression "free(dest)" identifier (argument_list "(dest)" ( identifier ))) ;) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "void * FUN_00015950(undefined4 param_1,uint *param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  uint __size;\n  uint uVar1;\n  void *__ptr;\n  uint uVar2;\n  void *__ptr_00;\n  \n  uVar1 = *param_2;\n  uVar2 = uVar1;\n  __ptr_00 = (void *)0x0;\n  while( true ) {\n    __size = uVar2 + 1;\n    __ptr = realloc(__ptr_00,__size);\n    if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }\n    *param_2 = uVar1;\n    uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);\n    if (uVar2 == 0xffffffff) break;\n    __ptr_00 = __ptr;\n    if (uVar2 < __size) {\n      return __ptr;\n    }\n  }\n  free(__ptr);\n  return (void *)0x0;\n}\n\n" (function_definition "void * FUN_00015950(undefined4 param_1,uint *param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  uint __size;\n  uint uVar1;\n  void *__ptr;\n  uint uVar2;\n  void *__ptr_00;\n  \n  uVar1 = *param_2;\n  uVar2 = uVar1;\n  __ptr_00 = (void *)0x0;\n  while( true ) {\n    __size = uVar2 + 1;\n    __ptr = realloc(__ptr_00,__size);\n    if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }\n    *param_2 = uVar1;\n    uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);\n    if (uVar2 == 0xffffffff) break;\n    __ptr_00 = __ptr;\n    if (uVar2 < __size) {\n      return __ptr;\n    }\n  }\n  free(__ptr);\n  return (void *)0x0;\n}" primitive_type (pointer_declarator "* FUN_00015950(undefined4 param_1,uint *param_2,undefined4 param_3,undefined4 param_4)" * (function_declarator "FUN_00015950(undefined4 param_1,uint *param_2,undefined4 param_3,undefined4 param_4)" identifier (parameter_list "(undefined4 param_1,uint *param_2,undefined4 param_3,undefined4 param_4)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "uint *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) )))) (compound_statement "{\n  uint __size;\n  uint uVar1;\n  void *__ptr;\n  uint uVar2;\n  void *__ptr_00;\n  \n  uVar1 = *param_2;\n  uVar2 = uVar1;\n  __ptr_00 = (void *)0x0;\n  while( true ) {\n    __size = uVar2 + 1;\n    __ptr = realloc(__ptr_00,__size);\n    if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }\n    *param_2 = uVar1;\n    uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);\n    if (uVar2 == 0xffffffff) break;\n    __ptr_00 = __ptr;\n    if (uVar2 < __size) {\n      return __ptr;\n    }\n  }\n  free(__ptr);\n  return (void *)0x0;\n}" { (declaration "uint __size;" type_identifier identifier ;) (declaration "uint uVar1;" type_identifier identifier ;) (declaration "void *__ptr;" primitive_type (pointer_declarator "*__ptr" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "void *__ptr_00;" primitive_type (pointer_declarator "*__ptr_00" * identifier) ;) (expression_statement "uVar1 = *param_2;" (assignment_expression "uVar1 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (expression_statement "uVar2 = uVar1;" (assignment_expression "uVar2 = uVar1" identifier = identifier) ;) (expression_statement "__ptr_00 = (void *)0x0;" (assignment_expression "__ptr_00 = (void *)0x0" identifier = (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (while_statement "while( true ) {\n    __size = uVar2 + 1;\n    __ptr = realloc(__ptr_00,__size);\n    if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }\n    *param_2 = uVar1;\n    uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);\n    if (uVar2 == 0xffffffff) break;\n    __ptr_00 = __ptr;\n    if (uVar2 < __size) {\n      return __ptr;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    __size = uVar2 + 1;\n    __ptr = realloc(__ptr_00,__size);\n    if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }\n    *param_2 = uVar1;\n    uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);\n    if (uVar2 == 0xffffffff) break;\n    __ptr_00 = __ptr;\n    if (uVar2 < __size) {\n      return __ptr;\n    }\n  }" { (expression_statement "__size = uVar2 + 1;" (assignment_expression "__size = uVar2 + 1" identifier = (binary_expression "uVar2 + 1" identifier + number_literal)) ;) (expression_statement "__ptr = realloc(__ptr_00,__size);" (assignment_expression "__ptr = realloc(__ptr_00,__size)" identifier = (call_expression "realloc(__ptr_00,__size)" identifier (argument_list "(__ptr_00,__size)" ( identifier , identifier )))) ;) (if_statement "if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }" if (parenthesized_expression "(__ptr == (void *)0x0)" ( (binary_expression "__ptr == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      free(__ptr_00);\n      return (void *)0x0;\n    }" { (expression_statement "free(__ptr_00);" (call_expression "free(__ptr_00)" identifier (argument_list "(__ptr_00)" ( identifier ))) ;) (return_statement "return (void *)0x0;" return (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "*param_2 = uVar1;" (assignment_expression "*param_2 = uVar1" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);" (assignment_expression "uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4)" identifier = (call_expression "FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4)" identifier (argument_list "(param_1,__ptr,__size,param_2,param_3,param_4)" ( identifier , identifier , identifier , identifier , identifier , identifier )))) ;) (if_statement "if (uVar2 == 0xffffffff) break;" if (parenthesized_expression "(uVar2 == 0xffffffff)" ( (binary_expression "uVar2 == 0xffffffff" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "__ptr_00 = __ptr;" (assignment_expression "__ptr_00 = __ptr" identifier = identifier) ;) (if_statement "if (uVar2 < __size) {\n      return __ptr;\n    }" if (parenthesized_expression "(uVar2 < __size)" ( (binary_expression "uVar2 < __size" identifier < identifier) )) (compound_statement "{\n      return __ptr;\n    }" { (return_statement "return __ptr;" return identifier ;) })) })) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) (return_statement "return (void *)0x0;" return (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , IDENT , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (return_statement return IDENT ;) })) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ;) })))
(function_definition "void * FUN_00015950(undefined4 param_1,uint *param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  uint __size;\n  uint uVar1;\n  void *__ptr;\n  uint uVar2;\n  void *__ptr_00;\n  \n  uVar1 = *param_2;\n  uVar2 = uVar1;\n  __ptr_00 = (void *)0x0;\n  while( true ) {\n    __size = uVar2 + 1;\n    __ptr = realloc(__ptr_00,__size);\n    if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }\n    *param_2 = uVar1;\n    uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);\n    if (uVar2 == 0xffffffff) break;\n    __ptr_00 = __ptr;\n    if (uVar2 < __size) {\n      return __ptr;\n    }\n  }\n  free(__ptr);\n  return (void *)0x0;\n}" (primitive_type "void") (pointer_declarator "* FUN_00015950(undefined4 param_1,uint *param_2,undefined4 param_3,undefined4 param_4)" (* "*") (function_declarator "FUN_00015950(undefined4 param_1,uint *param_2,undefined4 param_3,undefined4 param_4)" (identifier "FUN_00015950") (parameter_list "(undefined4 param_1,uint *param_2,undefined4 param_3,undefined4 param_4)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "uint *param_2" (type_identifier "uint") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) (, ",") (parameter_declaration "undefined4 param_4" (type_identifier "undefined4") (identifier "param_4")) () ")")))) (compound_statement "{\n  uint __size;\n  uint uVar1;\n  void *__ptr;\n  uint uVar2;\n  void *__ptr_00;\n  \n  uVar1 = *param_2;\n  uVar2 = uVar1;\n  __ptr_00 = (void *)0x0;\n  while( true ) {\n    __size = uVar2 + 1;\n    __ptr = realloc(__ptr_00,__size);\n    if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }\n    *param_2 = uVar1;\n    uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);\n    if (uVar2 == 0xffffffff) break;\n    __ptr_00 = __ptr;\n    if (uVar2 < __size) {\n      return __ptr;\n    }\n  }\n  free(__ptr);\n  return (void *)0x0;\n}" ({ "{") (declaration "uint __size;" (type_identifier "uint") (identifier "__size") (; ";")) (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "void *__ptr;" (primitive_type "void") (pointer_declarator "*__ptr" (* "*") (identifier "__ptr")) (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "void *__ptr_00;" (primitive_type "void") (pointer_declarator "*__ptr_00" (* "*") (identifier "__ptr_00")) (; ";")) (expression_statement "uVar1 = *param_2;" (assignment_expression "uVar1 = *param_2" (identifier "uVar1") (= "=") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (; ";")) (expression_statement "uVar2 = uVar1;" (assignment_expression "uVar2 = uVar1" (identifier "uVar2") (= "=") (identifier "uVar1")) (; ";")) (expression_statement "__ptr_00 = (void *)0x0;" (assignment_expression "__ptr_00 = (void *)0x0" (identifier "__ptr_00") (= "=") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (while_statement "while( true ) {\n    __size = uVar2 + 1;\n    __ptr = realloc(__ptr_00,__size);\n    if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }\n    *param_2 = uVar1;\n    uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);\n    if (uVar2 == 0xffffffff) break;\n    __ptr_00 = __ptr;\n    if (uVar2 < __size) {\n      return __ptr;\n    }\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    __size = uVar2 + 1;\n    __ptr = realloc(__ptr_00,__size);\n    if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }\n    *param_2 = uVar1;\n    uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);\n    if (uVar2 == 0xffffffff) break;\n    __ptr_00 = __ptr;\n    if (uVar2 < __size) {\n      return __ptr;\n    }\n  }" ({ "{") (expression_statement "__size = uVar2 + 1;" (assignment_expression "__size = uVar2 + 1" (identifier "__size") (= "=") (binary_expression "uVar2 + 1" (identifier "uVar2") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "__ptr = realloc(__ptr_00,__size);" (assignment_expression "__ptr = realloc(__ptr_00,__size)" (identifier "__ptr") (= "=") (call_expression "realloc(__ptr_00,__size)" (identifier "realloc") (argument_list "(__ptr_00,__size)" (( "(") (identifier "__ptr_00") (, ",") (identifier "__size") () ")")))) (; ";")) (if_statement "if (__ptr == (void *)0x0) {\n      free(__ptr_00);\n      return (void *)0x0;\n    }" (if "if") (parenthesized_expression "(__ptr == (void *)0x0)" (( "(") (binary_expression "__ptr == (void *)0x0" (identifier "__ptr") (== "==") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      free(__ptr_00);\n      return (void *)0x0;\n    }" ({ "{") (expression_statement "free(__ptr_00);" (call_expression "free(__ptr_00)" (identifier "free") (argument_list "(__ptr_00)" (( "(") (identifier "__ptr_00") () ")"))) (; ";")) (return_statement "return (void *)0x0;" (return "return") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (; ";")) (} "}"))) (expression_statement "*param_2 = uVar1;" (assignment_expression "*param_2 = uVar1" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "uVar1")) (; ";")) (expression_statement "uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);" (assignment_expression "uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4)" (identifier "uVar2") (= "=") (call_expression "FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4)" (identifier "FUN_00015550") (argument_list "(param_1,__ptr,__size,param_2,param_3,param_4)" (( "(") (identifier "param_1") (, ",") (identifier "__ptr") (, ",") (identifier "__size") (, ",") (identifier "param_2") (, ",") (identifier "param_3") (, ",") (identifier "param_4") () ")")))) (; ";")) (if_statement "if (uVar2 == 0xffffffff) break;" (if "if") (parenthesized_expression "(uVar2 == 0xffffffff)" (( "(") (binary_expression "uVar2 == 0xffffffff" (identifier "uVar2") (== "==") (number_literal "0xffffffff")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "__ptr_00 = __ptr;" (assignment_expression "__ptr_00 = __ptr" (identifier "__ptr_00") (= "=") (identifier "__ptr")) (; ";")) (if_statement "if (uVar2 < __size) {\n      return __ptr;\n    }" (if "if") (parenthesized_expression "(uVar2 < __size)" (( "(") (binary_expression "uVar2 < __size" (identifier "uVar2") (< "<") (identifier "__size")) () ")")) (compound_statement "{\n      return __ptr;\n    }" ({ "{") (return_statement "return __ptr;" (return "return") (identifier "__ptr") (; ";")) (} "}"))) (} "}"))) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" (identifier "free") (argument_list "(__ptr)" (( "(") (identifier "__ptr") () ")"))) (; ";")) (return_statement "return (void *)0x0;" (return "return") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (; ";")) (} "}")))

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

char * function_1(char *src,size_t *width,type_1 align,int flags)

{
  type_2 var_6;
  size_t sVar1;
  char *var_3;
  size_t var_1;
  char *__ptr;
  
  sVar1 = *width;
  var_1 = sVar1;
  __ptr = (char *)0x0;
  while( true ) {
    var_6 = var_1 + 1;
    var_3 = (char *)var_2(__ptr,var_6);
    if (var_3 == (char *)0x0) {
      var_4(__ptr);
      return (char *)0x0;
    }
    *width = sVar1;
    var_1 = var_5(src,var_3,var_6,width,align,flags);
    if (var_1 == 0xffffffff) break;
    __ptr = var_3;
    if (var_1 < var_6) {
      return var_3;
    }
  }
  var_4(var_3);
  return (char *)0x0;
}


(translation_unit (function_definition type: (primitive_type) declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier))))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) (while_statement condition: (parenthesized_expression (true)) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier) (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (break_statement)) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (return_statement (identifier)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal))))))

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

void * MASKED(undefined4 param_1,uint *param_2,undefined4 param_3,undefined4 param_4)

{
  uint __size;
  uint uVar1;
  void *__ptr;
  uint uVar2;
  void *__ptr_00;
  
  uVar1 = *param_2;
  uVar2 = uVar1;
  __ptr_00 = (void *)0x0;
  while( true ) {
    __size = uVar2 + 1;
    __ptr = realloc(__ptr_00,__size);
    if (__ptr == (void *)0x0) {
      free(__ptr_00);
      return (void *)0x0;
    }
    *param_2 = uVar1;
    uVar2 = FUN_00015550(param_1,__ptr,__size,param_2,param_3,param_4);
    if (uVar2 == 0xffffffff) break;
    __ptr_00 = __ptr;
    if (uVar2 < __size) {
      return __ptr;
    }
  }
  free(__ptr);
  return (void *)0x0;
}

