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

void * x2realloc(void *p,size_t *pn)

{
  void *pvVar1;
  size_t __size;
  
  __size = *pn;
  if (p == (void *)0x0) {
    if (__size == 0) {
      __size = 0x40;
    }
    else if ((int)__size < 0) goto LAB_000277f2;
  }
  else {
    if (0x55555553 < __size) goto LAB_000277f2;
    __size = __size + 1 + (__size >> 1);
  }
  *pn = __size;
  pvVar1 = realloc(p,__size);
  if (pvVar1 != (void *)0x0) {
    return pvVar1;
  }
LAB_000277f2:
                    /* WARNING: Subroutine does not return */
  xalloc_die();
}



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

void FUN_00027790(void *param_1,uint *param_2)

{
  void *pvVar1;
  size_t __size;
  undefined4 uVar2;
  
  uVar2 = 0x27797;
  __size = *param_2;
  if (param_1 == (void *)0x0) {
    if (__size == 0) {
      __size = 0x40;
    }
    else if ((int)__size < 0) goto LAB_000277f2;
  }
  else {
    if (0x55555553 < __size) goto LAB_000277f2;
    __size = __size + 1 + (__size >> 1);
  }
  *param_2 = __size;
  pvVar1 = realloc(param_1,__size);
  if (pvVar1 != (void *)0x0) {
    return;
  }
LAB_000277f2:
                    /* WARNING: Subroutine does not return */
  FUN_000179f0(uVar2);
}


PUSH ESI
PUSH EBX
CALL 0x00012830
ADD EBX,0x136d9
SUB ESP,0x4
MOV ECX,dword ptr [ESP + 0x14]
MOV EDX,dword ptr [ESP + 0x10]
MOV EAX,dword ptr [ECX]
TEST EDX,EDX
JZ 0x000277e0
CMP EAX,0x55555553
JA 0x000277f2
MOV ESI,EAX
SHR ESI,0x1
LEA EAX,[EAX + ESI*0x1 + 0x1]
SUB ESP,0x8
MOV dword ptr [ECX],EAX
PUSH EAX
PUSH EDX
CALL 0x000121f0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x000277f2
ADD ESP,0x4
POP EBX
POP ESI
RET
TEST EAX,EAX
JNZ 0x000277f0
MOV EAX,0x40
JMP 0x000277bd
JNS 0x000277bd
CALL 0x000179f0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_00027790(void *param_1,uint *param_2)\n\n{\n  void *pvVar1;\n  size_t __size;\n  undefined4 uVar2;\n  \n  uVar2 = 0x27797;\n  __size = *param_2;\n  if (param_1 == (void *)0x0) {\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }\n  else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }\n  *param_2 = __size;\n  pvVar1 = realloc(param_1,__size);\n  if (pvVar1 != (void *)0x0) {\n    return;\n  }\nLAB_000277f2:\n                    /* WARNING: Subroutine does not return */\n  FUN_000179f0(uVar2);\n}\n\n" comment (function_definition "void FUN_00027790(void *param_1,uint *param_2)\n\n{\n  void *pvVar1;\n  size_t __size;\n  undefined4 uVar2;\n  \n  uVar2 = 0x27797;\n  __size = *param_2;\n  if (param_1 == (void *)0x0) {\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }\n  else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }\n  *param_2 = __size;\n  pvVar1 = realloc(param_1,__size);\n  if (pvVar1 != (void *)0x0) {\n    return;\n  }\nLAB_000277f2:\n                    /* WARNING: Subroutine does not return */\n  FUN_000179f0(uVar2);\n}" primitive_type (function_declarator "FUN_00027790(void *param_1,uint *param_2)" identifier (parameter_list "(void *param_1,uint *param_2)" ( (parameter_declaration "void *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  void *pvVar1;\n  size_t __size;\n  undefined4 uVar2;\n  \n  uVar2 = 0x27797;\n  __size = *param_2;\n  if (param_1 == (void *)0x0) {\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }\n  else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }\n  *param_2 = __size;\n  pvVar1 = realloc(param_1,__size);\n  if (pvVar1 != (void *)0x0) {\n    return;\n  }\nLAB_000277f2:\n                    /* WARNING: Subroutine does not return */\n  FUN_000179f0(uVar2);\n}" { (declaration "void *pvVar1;" primitive_type (pointer_declarator "*pvVar1" * identifier) ;) (declaration "size_t __size;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (expression_statement "uVar2 = 0x27797;" (assignment_expression "uVar2 = 0x27797" identifier = number_literal) ;) (expression_statement "__size = *param_2;" (assignment_expression "__size = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (if_statement "if (param_1 == (void *)0x0) {\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }\n  else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }" if (parenthesized_expression "(param_1 == (void *)0x0)" ( (binary_expression "param_1 == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }" { (if_statement "if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;" if (parenthesized_expression "(__size == 0)" ( (binary_expression "__size == 0" identifier == number_literal) )) (compound_statement "{\n      __size = 0x40;\n    }" { (expression_statement "__size = 0x40;" (assignment_expression "__size = 0x40" identifier = number_literal) ;) }) (else_clause "else if ((int)__size < 0) goto LAB_000277f2;" else (if_statement "if ((int)__size < 0) goto LAB_000277f2;" if (parenthesized_expression "((int)__size < 0)" ( (binary_expression "(int)__size < 0" (cast_expression "(int)__size" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (goto_statement "goto LAB_000277f2;" goto statement_identifier ;)))) }) (else_clause "else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }" else (compound_statement "{\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }" { (if_statement "if (0x55555553 < __size) goto LAB_000277f2;" if (parenthesized_expression "(0x55555553 < __size)" ( (binary_expression "0x55555553 < __size" number_literal < identifier) )) (goto_statement "goto LAB_000277f2;" goto statement_identifier ;)) (expression_statement "__size = __size + 1 + (__size >> 1);" (assignment_expression "__size = __size + 1 + (__size >> 1)" identifier = (binary_expression "__size + 1 + (__size >> 1)" (binary_expression "__size + 1" identifier + number_literal) + (parenthesized_expression "(__size >> 1)" ( (binary_expression "__size >> 1" identifier >> number_literal) )))) ;) }))) (expression_statement "*param_2 = __size;" (assignment_expression "*param_2 = __size" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "pvVar1 = realloc(param_1,__size);" (assignment_expression "pvVar1 = realloc(param_1,__size)" identifier = (call_expression "realloc(param_1,__size)" identifier (argument_list "(param_1,__size)" ( identifier , identifier )))) ;) (if_statement "if (pvVar1 != (void *)0x0) {\n    return;\n  }" if (parenthesized_expression "(pvVar1 != (void *)0x0)" ( (binary_expression "pvVar1 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (labeled_statement "LAB_000277f2:\n                    /* WARNING: Subroutine does not return */\n  FUN_000179f0(uVar2);" statement_identifier : comment (expression_statement "FUN_000179f0(uVar2);" (call_expression "FUN_000179f0(uVar2)" identifier (argument_list "(uVar2)" ( identifier ))) ;)) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nvoid * x2realloc(void *p,size_t *pn)\n\n{\n  void *pvVar1;\n  size_t __size;\n  \n  __size = *pn;\n  if (p == (void *)0x0) {\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }\n  else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }\n  *pn = __size;\n  pvVar1 = realloc(p,__size);\n  if (pvVar1 != (void *)0x0) {\n    return pvVar1;\n  }\nLAB_000277f2:\n                    /* WARNING: Subroutine does not return */\n  xalloc_die();\n}\n\n" comment comment (function_definition "void * x2realloc(void *p,size_t *pn)\n\n{\n  void *pvVar1;\n  size_t __size;\n  \n  __size = *pn;\n  if (p == (void *)0x0) {\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }\n  else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }\n  *pn = __size;\n  pvVar1 = realloc(p,__size);\n  if (pvVar1 != (void *)0x0) {\n    return pvVar1;\n  }\nLAB_000277f2:\n                    /* WARNING: Subroutine does not return */\n  xalloc_die();\n}" primitive_type (pointer_declarator "* x2realloc(void *p,size_t *pn)" * (function_declarator "x2realloc(void *p,size_t *pn)" identifier (parameter_list "(void *p,size_t *pn)" ( (parameter_declaration "void *p" primitive_type (pointer_declarator "*p" * identifier)) , (parameter_declaration "size_t *pn" primitive_type (pointer_declarator "*pn" * identifier)) )))) (compound_statement "{\n  void *pvVar1;\n  size_t __size;\n  \n  __size = *pn;\n  if (p == (void *)0x0) {\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }\n  else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }\n  *pn = __size;\n  pvVar1 = realloc(p,__size);\n  if (pvVar1 != (void *)0x0) {\n    return pvVar1;\n  }\nLAB_000277f2:\n                    /* WARNING: Subroutine does not return */\n  xalloc_die();\n}" { (declaration "void *pvVar1;" primitive_type (pointer_declarator "*pvVar1" * identifier) ;) (declaration "size_t __size;" primitive_type identifier ;) (expression_statement "__size = *pn;" (assignment_expression "__size = *pn" identifier = (pointer_expression "*pn" * identifier)) ;) (if_statement "if (p == (void *)0x0) {\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }\n  else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }" if (parenthesized_expression "(p == (void *)0x0)" ( (binary_expression "p == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }" { (if_statement "if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;" if (parenthesized_expression "(__size == 0)" ( (binary_expression "__size == 0" identifier == number_literal) )) (compound_statement "{\n      __size = 0x40;\n    }" { (expression_statement "__size = 0x40;" (assignment_expression "__size = 0x40" identifier = number_literal) ;) }) (else_clause "else if ((int)__size < 0) goto LAB_000277f2;" else (if_statement "if ((int)__size < 0) goto LAB_000277f2;" if (parenthesized_expression "((int)__size < 0)" ( (binary_expression "(int)__size < 0" (cast_expression "(int)__size" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (goto_statement "goto LAB_000277f2;" goto statement_identifier ;)))) }) (else_clause "else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }" else (compound_statement "{\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }" { (if_statement "if (0x55555553 < __size) goto LAB_000277f2;" if (parenthesized_expression "(0x55555553 < __size)" ( (binary_expression "0x55555553 < __size" number_literal < identifier) )) (goto_statement "goto LAB_000277f2;" goto statement_identifier ;)) (expression_statement "__size = __size + 1 + (__size >> 1);" (assignment_expression "__size = __size + 1 + (__size >> 1)" identifier = (binary_expression "__size + 1 + (__size >> 1)" (binary_expression "__size + 1" identifier + number_literal) + (parenthesized_expression "(__size >> 1)" ( (binary_expression "__size >> 1" identifier >> number_literal) )))) ;) }))) (expression_statement "*pn = __size;" (assignment_expression "*pn = __size" (pointer_expression "*pn" * identifier) = identifier) ;) (expression_statement "pvVar1 = realloc(p,__size);" (assignment_expression "pvVar1 = realloc(p,__size)" identifier = (call_expression "realloc(p,__size)" identifier (argument_list "(p,__size)" ( identifier , identifier )))) ;) (if_statement "if (pvVar1 != (void *)0x0) {\n    return pvVar1;\n  }" if (parenthesized_expression "(pvVar1 != (void *)0x0)" ( (binary_expression "pvVar1 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    return pvVar1;\n  }" { (return_statement "return pvVar1;" return identifier ;) })) (labeled_statement "LAB_000277f2:\n                    /* WARNING: Subroutine does not return */\n  xalloc_die();" statement_identifier : comment (expression_statement "xalloc_die();" (call_expression "xalloc_die()" identifier (argument_list "()" ( ))) ;)) })))
(translation_unit "void FUN_00027790(void *param_1,uint *param_2)\n\n{\n  void *pvVar1;\n  size_t __size;\n  undefined4 uVar2;\n  \n  uVar2 = 0x27797;\n  __size = *param_2;\n  if (param_1 == (void *)0x0) {\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }\n  else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }\n  *param_2 = __size;\n  pvVar1 = realloc(param_1,__size);\n  if (pvVar1 != (void *)0x0) {\n    return;\n  }\nLAB_000277f2:\n                    \n  FUN_000179f0(uVar2);\n}\n\n" (function_definition "void FUN_00027790(void *param_1,uint *param_2)\n\n{\n  void *pvVar1;\n  size_t __size;\n  undefined4 uVar2;\n  \n  uVar2 = 0x27797;\n  __size = *param_2;\n  if (param_1 == (void *)0x0) {\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }\n  else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }\n  *param_2 = __size;\n  pvVar1 = realloc(param_1,__size);\n  if (pvVar1 != (void *)0x0) {\n    return;\n  }\nLAB_000277f2:\n                    \n  FUN_000179f0(uVar2);\n}" primitive_type (function_declarator "FUN_00027790(void *param_1,uint *param_2)" identifier (parameter_list "(void *param_1,uint *param_2)" ( (parameter_declaration "void *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  void *pvVar1;\n  size_t __size;\n  undefined4 uVar2;\n  \n  uVar2 = 0x27797;\n  __size = *param_2;\n  if (param_1 == (void *)0x0) {\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }\n  else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }\n  *param_2 = __size;\n  pvVar1 = realloc(param_1,__size);\n  if (pvVar1 != (void *)0x0) {\n    return;\n  }\nLAB_000277f2:\n                    \n  FUN_000179f0(uVar2);\n}" { (declaration "void *pvVar1;" primitive_type (pointer_declarator "*pvVar1" * identifier) ;) (declaration "size_t __size;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (expression_statement "uVar2 = 0x27797;" (assignment_expression "uVar2 = 0x27797" identifier = number_literal) ;) (expression_statement "__size = *param_2;" (assignment_expression "__size = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (if_statement "if (param_1 == (void *)0x0) {\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }\n  else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }" if (parenthesized_expression "(param_1 == (void *)0x0)" ( (binary_expression "param_1 == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }" { (if_statement "if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;" if (parenthesized_expression "(__size == 0)" ( (binary_expression "__size == 0" identifier == number_literal) )) (compound_statement "{\n      __size = 0x40;\n    }" { (expression_statement "__size = 0x40;" (assignment_expression "__size = 0x40" identifier = number_literal) ;) }) (else_clause "else if ((int)__size < 0) goto LAB_000277f2;" else (if_statement "if ((int)__size < 0) goto LAB_000277f2;" if (parenthesized_expression "((int)__size < 0)" ( (binary_expression "(int)__size < 0" (cast_expression "(int)__size" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (goto_statement "goto LAB_000277f2;" goto statement_identifier ;)))) }) (else_clause "else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }" else (compound_statement "{\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }" { (if_statement "if (0x55555553 < __size) goto LAB_000277f2;" if (parenthesized_expression "(0x55555553 < __size)" ( (binary_expression "0x55555553 < __size" number_literal < identifier) )) (goto_statement "goto LAB_000277f2;" goto statement_identifier ;)) (expression_statement "__size = __size + 1 + (__size >> 1);" (assignment_expression "__size = __size + 1 + (__size >> 1)" identifier = (binary_expression "__size + 1 + (__size >> 1)" (binary_expression "__size + 1" identifier + number_literal) + (parenthesized_expression "(__size >> 1)" ( (binary_expression "__size >> 1" identifier >> number_literal) )))) ;) }))) (expression_statement "*param_2 = __size;" (assignment_expression "*param_2 = __size" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "pvVar1 = realloc(param_1,__size);" (assignment_expression "pvVar1 = realloc(param_1,__size)" identifier = (call_expression "realloc(param_1,__size)" identifier (argument_list "(param_1,__size)" ( identifier , identifier )))) ;) (if_statement "if (pvVar1 != (void *)0x0) {\n    return;\n  }" if (parenthesized_expression "(pvVar1 != (void *)0x0)" ( (binary_expression "pvVar1 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (labeled_statement "LAB_000277f2:\n                    \n  FUN_000179f0(uVar2);" statement_identifier : (expression_statement "FUN_000179f0(uVar2);" (call_expression "FUN_000179f0(uVar2)" identifier (argument_list "(uVar2)" ( identifier ))) ;)) })))
(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 (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) < LIT) )) (goto_statement goto statement_identifier ;)))) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT + LIT) + (parenthesized_expression ( (binary_expression IDENT >> LIT) )))) ;) }))) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (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 { (return_statement return ;) })) (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;)) })))
(function_definition "void FUN_00027790(void *param_1,uint *param_2)\n\n{\n  void *pvVar1;\n  size_t __size;\n  undefined4 uVar2;\n  \n  uVar2 = 0x27797;\n  __size = *param_2;\n  if (param_1 == (void *)0x0) {\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }\n  else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }\n  *param_2 = __size;\n  pvVar1 = realloc(param_1,__size);\n  if (pvVar1 != (void *)0x0) {\n    return;\n  }\nLAB_000277f2:\n                    \n  FUN_000179f0(uVar2);\n}" (primitive_type "void") (function_declarator "FUN_00027790(void *param_1,uint *param_2)" (identifier "FUN_00027790") (parameter_list "(void *param_1,uint *param_2)" (( "(") (parameter_declaration "void *param_1" (primitive_type "void") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "uint *param_2" (type_identifier "uint") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")"))) (compound_statement "{\n  void *pvVar1;\n  size_t __size;\n  undefined4 uVar2;\n  \n  uVar2 = 0x27797;\n  __size = *param_2;\n  if (param_1 == (void *)0x0) {\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }\n  else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }\n  *param_2 = __size;\n  pvVar1 = realloc(param_1,__size);\n  if (pvVar1 != (void *)0x0) {\n    return;\n  }\nLAB_000277f2:\n                    \n  FUN_000179f0(uVar2);\n}" ({ "{") (declaration "void *pvVar1;" (primitive_type "void") (pointer_declarator "*pvVar1" (* "*") (identifier "pvVar1")) (; ";")) (declaration "size_t __size;" (primitive_type "size_t") (identifier "__size") (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (expression_statement "uVar2 = 0x27797;" (assignment_expression "uVar2 = 0x27797" (identifier "uVar2") (= "=") (number_literal "0x27797")) (; ";")) (expression_statement "__size = *param_2;" (assignment_expression "__size = *param_2" (identifier "__size") (= "=") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (; ";")) (if_statement "if (param_1 == (void *)0x0) {\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }\n  else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }" (if "if") (parenthesized_expression "(param_1 == (void *)0x0)" (( "(") (binary_expression "param_1 == (void *)0x0" (identifier "param_1") (== "==") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;\n  }" ({ "{") (if_statement "if (__size == 0) {\n      __size = 0x40;\n    }\n    else if ((int)__size < 0) goto LAB_000277f2;" (if "if") (parenthesized_expression "(__size == 0)" (( "(") (binary_expression "__size == 0" (identifier "__size") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      __size = 0x40;\n    }" ({ "{") (expression_statement "__size = 0x40;" (assignment_expression "__size = 0x40" (identifier "__size") (= "=") (number_literal "0x40")) (; ";")) (} "}")) (else_clause "else if ((int)__size < 0) goto LAB_000277f2;" (else "else") (if_statement "if ((int)__size < 0) goto LAB_000277f2;" (if "if") (parenthesized_expression "((int)__size < 0)" (( "(") (binary_expression "(int)__size < 0" (cast_expression "(int)__size" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "__size")) (< "<") (number_literal "0")) () ")")) (goto_statement "goto LAB_000277f2;" (goto "goto") (statement_identifier "LAB_000277f2") (; ";"))))) (} "}")) (else_clause "else {\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }" (else "else") (compound_statement "{\n    if (0x55555553 < __size) goto LAB_000277f2;\n    __size = __size + 1 + (__size >> 1);\n  }" ({ "{") (if_statement "if (0x55555553 < __size) goto LAB_000277f2;" (if "if") (parenthesized_expression "(0x55555553 < __size)" (( "(") (binary_expression "0x55555553 < __size" (number_literal "0x55555553") (< "<") (identifier "__size")) () ")")) (goto_statement "goto LAB_000277f2;" (goto "goto") (statement_identifier "LAB_000277f2") (; ";"))) (expression_statement "__size = __size + 1 + (__size >> 1);" (assignment_expression "__size = __size + 1 + (__size >> 1)" (identifier "__size") (= "=") (binary_expression "__size + 1 + (__size >> 1)" (binary_expression "__size + 1" (identifier "__size") (+ "+") (number_literal "1")) (+ "+") (parenthesized_expression "(__size >> 1)" (( "(") (binary_expression "__size >> 1" (identifier "__size") (>> ">>") (number_literal "1")) () ")")))) (; ";")) (} "}")))) (expression_statement "*param_2 = __size;" (assignment_expression "*param_2 = __size" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "__size")) (; ";")) (expression_statement "pvVar1 = realloc(param_1,__size);" (assignment_expression "pvVar1 = realloc(param_1,__size)" (identifier "pvVar1") (= "=") (call_expression "realloc(param_1,__size)" (identifier "realloc") (argument_list "(param_1,__size)" (( "(") (identifier "param_1") (, ",") (identifier "__size") () ")")))) (; ";")) (if_statement "if (pvVar1 != (void *)0x0) {\n    return;\n  }" (if "if") (parenthesized_expression "(pvVar1 != (void *)0x0)" (( "(") (binary_expression "pvVar1 != (void *)0x0" (identifier "pvVar1") (!= "!=") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    return;\n  }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (labeled_statement "LAB_000277f2:\n                    \n  FUN_000179f0(uVar2);" (statement_identifier "LAB_000277f2") (: ":") (expression_statement "FUN_000179f0(uVar2);" (call_expression "FUN_000179f0(uVar2)" (identifier "FUN_000179f0") (argument_list "(uVar2)" (( "(") (identifier "uVar2") () ")"))) (; ";"))) (} "}")))

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

void * function_1(void *var_1,size_t *pn)

{
  void *var_4;
  size_t var_2;
  
  var_2 = *pn;
  if (var_1 == (void *)0x0) {
    if (var_2 == 0) {
      var_2 = 0x40;
    }
    else if ((int)var_2 < 0) goto LAB_000277f2;
  }
  else {
    if (0x55555553 < var_2) goto LAB_000277f2;
    var_2 = var_2 + 1 + (var_2 >> 1);
  }
  *pn = var_2;
  var_4 = var_3(var_1,var_2);
  if (var_4 != (void *)0x0) {
    return var_4;
  }
LAB_000277f2:
                    /* WARNING: Subroutine does not return */
  var_5();
}


(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: (type_identifier) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (if_statement condition: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal))) consequence: (goto_statement label: (statement_identifier)))))) alternative: (else_clause (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (goto_statement label: (statement_identifier))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (parenthesized_expression (binary_expression left: (identifier) right: (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))))) (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 (return_statement))) (labeled_statement label: (statement_identifier) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier))))))))

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

void MASKED(void *param_1,uint *param_2)

{
  void *pvVar1;
  size_t __size;
  undefined4 uVar2;
  
  uVar2 = 0x27797;
  __size = *param_2;
  if (param_1 == (void *)0x0) {
    if (__size == 0) {
      __size = 0x40;
    }
    else if ((int)__size < 0) goto LAB_000277f2;
  }
  else {
    if (0x55555553 < __size) goto LAB_000277f2;
    __size = __size + 1 + (__size >> 1);
  }
  *param_2 = __size;
  pvVar1 = realloc(param_1,__size);
  if (pvVar1 != (void *)0x0) {
    return;
  }
LAB_000277f2:
                    /* WARNING: Subroutine does not return */
  FUN_000179f0(uVar2);
}

