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

MemoryPool * MHD_pool_create(size_t max)

{
  MemoryPool *__ptr;
  char *pcVar1;
  MemoryPool *pMVar2;
  
  __ptr = (MemoryPool *)malloc(0x14);
  pMVar2 = __ptr;
  if (__ptr != (MemoryPool *)0x0) {
    if (0x8000 < max) {
      pcVar1 = (char *)mmap64((void *)0x0,max,3,0x22,-1,0);
      __ptr->memory = pcVar1;
      if (pcVar1 + -1 < (char *)0xfffffffe) {
        __ptr->is_mmap = 1;
        __ptr->pos = 0;
        __ptr->end = max;
        __ptr->size = max;
        return __ptr;
      }
    }
    pcVar1 = (char *)malloc(max);
    __ptr->memory = pcVar1;
    if (pcVar1 == (char *)0x0) {
      pMVar2 = (MemoryPool *)0x0;
      free(__ptr);
    }
    else {
      __ptr->is_mmap = 0;
      __ptr->pos = 0;
      __ptr->end = max;
      __ptr->size = max;
    }
  }
  return pMVar2;
}



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

undefined4 * FUN_000219e0(uint param_1)

{
  undefined4 *__ptr;
  void *pvVar1;
  undefined4 *puVar2;
  
  __ptr = (undefined4 *)malloc(0x14);
  puVar2 = __ptr;
  if (__ptr != (undefined4 *)0x0) {
    if (0x8000 < param_1) {
      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);
      *__ptr = pvVar1;
      if ((int)pvVar1 - 1U < 0xfffffffe) {
        __ptr[4] = 1;
        __ptr[2] = 0;
        __ptr[3] = param_1;
        __ptr[1] = param_1;
        return __ptr;
      }
    }
    pvVar1 = malloc(param_1);
    *__ptr = pvVar1;
    if (pvVar1 == (void *)0x0) {
      puVar2 = (undefined4 *)0x0;
      free(__ptr);
    }
    else {
      __ptr[4] = 0;
      __ptr[2] = 0;
      __ptr[3] = param_1;
      __ptr[1] = param_1;
    }
  }
  return puVar2;
}


PUSH EDI
PUSH ESI
PUSH EBX
MOV EDI,dword ptr [ESP + 0x10]
CALL 0x00013810
ADD EBX,0x133f4
SUB ESP,0xc
PUSH 0x14
CALL 0x00013370
ADD ESP,0x10
MOV ESI,EAX
TEST EAX,EAX
JZ 0x00021a33
CMP EDI,0x8000
JA 0x00021a40
SUB ESP,0xc
PUSH EDI
CALL 0x00013370
ADD ESP,0x10
MOV dword ptr [ESI],EAX
TEST EAX,EAX
JZ 0x00021a80
MOV dword ptr [ESI + 0x10],0x0
MOV dword ptr [ESI + 0x8],0x0
MOV dword ptr [ESI + 0xc],EDI
MOV dword ptr [ESI + 0x4],EDI
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
RET
SUB ESP,0x4
PUSH 0x0
PUSH 0x0
PUSH -0x1
PUSH 0x22
PUSH 0x3
PUSH EDI
PUSH 0x0
CALL 0x00013500
ADD ESP,0x20
MOV dword ptr [ESI],EAX
SUB EAX,0x1
CMP EAX,-0x3
JA 0x00021a0d
MOV dword ptr [ESI + 0x10],0x1
MOV EAX,ESI
MOV dword ptr [ESI + 0x8],0x0
MOV dword ptr [ESI + 0xc],EDI
MOV dword ptr [ESI + 0x4],EDI
POP EBX
POP ESI
POP EDI
RET
SUB ESP,0xc
PUSH ESI
XOR ESI,ESI
CALL 0x000137d0
ADD ESP,0x10
JMP 0x00021a33
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 * FUN_000219e0(uint param_1)\n\n{\n  undefined4 *__ptr;\n  void *pvVar1;\n  undefined4 *puVar2;\n  \n  __ptr = (undefined4 *)malloc(0x14);\n  puVar2 = __ptr;\n  if (__ptr != (undefined4 *)0x0) {\n    if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }\n    pvVar1 = malloc(param_1);\n    *__ptr = pvVar1;\n    if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }\n  }\n  return puVar2;\n}\n\n" comment (function_definition "undefined4 * FUN_000219e0(uint param_1)\n\n{\n  undefined4 *__ptr;\n  void *pvVar1;\n  undefined4 *puVar2;\n  \n  __ptr = (undefined4 *)malloc(0x14);\n  puVar2 = __ptr;\n  if (__ptr != (undefined4 *)0x0) {\n    if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }\n    pvVar1 = malloc(param_1);\n    *__ptr = pvVar1;\n    if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }\n  }\n  return puVar2;\n}" type_identifier (pointer_declarator "* FUN_000219e0(uint param_1)" * (function_declarator "FUN_000219e0(uint param_1)" identifier (parameter_list "(uint param_1)" ( (parameter_declaration "uint param_1" type_identifier identifier) )))) (compound_statement "{\n  undefined4 *__ptr;\n  void *pvVar1;\n  undefined4 *puVar2;\n  \n  __ptr = (undefined4 *)malloc(0x14);\n  puVar2 = __ptr;\n  if (__ptr != (undefined4 *)0x0) {\n    if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }\n    pvVar1 = malloc(param_1);\n    *__ptr = pvVar1;\n    if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }\n  }\n  return puVar2;\n}" { (declaration "undefined4 *__ptr;" type_identifier (pointer_declarator "*__ptr" * identifier) ;) (declaration "void *pvVar1;" primitive_type (pointer_declarator "*pvVar1" * identifier) ;) (declaration "undefined4 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (expression_statement "__ptr = (undefined4 *)malloc(0x14);" (assignment_expression "__ptr = (undefined4 *)malloc(0x14)" identifier = (cast_expression "(undefined4 *)malloc(0x14)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "malloc(0x14)" identifier (argument_list "(0x14)" ( number_literal ))))) ;) (expression_statement "puVar2 = __ptr;" (assignment_expression "puVar2 = __ptr" identifier = identifier) ;) (if_statement "if (__ptr != (undefined4 *)0x0) {\n    if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }\n    pvVar1 = malloc(param_1);\n    *__ptr = pvVar1;\n    if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }\n  }" if (parenthesized_expression "(__ptr != (undefined4 *)0x0)" ( (binary_expression "__ptr != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }\n    pvVar1 = malloc(param_1);\n    *__ptr = pvVar1;\n    if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }\n  }" { (if_statement "if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }" if (parenthesized_expression "(0x8000 < param_1)" ( (binary_expression "0x8000 < param_1" number_literal < identifier) )) (compound_statement "{\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }" { (expression_statement "pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);" (assignment_expression "pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0)" identifier = (call_expression "mmap64((void *)0x0,param_1,3,0x22,-1,0)" identifier (argument_list "((void *)0x0,param_1,3,0x22,-1,0)" ( (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , identifier , number_literal , number_literal , number_literal , number_literal )))) ;) (expression_statement "*__ptr = pvVar1;" (assignment_expression "*__ptr = pvVar1" (pointer_expression "*__ptr" * identifier) = identifier) ;) (if_statement "if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }" if (parenthesized_expression "((int)pvVar1 - 1U < 0xfffffffe)" ( (binary_expression "(int)pvVar1 - 1U < 0xfffffffe" (binary_expression "(int)pvVar1 - 1U" (cast_expression "(int)pvVar1" ( (type_descriptor "int" primitive_type) ) identifier) - number_literal) < number_literal) )) (compound_statement "{\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }" { (expression_statement "__ptr[4] = 1;" (assignment_expression "__ptr[4] = 1" (subscript_expression "__ptr[4]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "__ptr[2] = 0;" (assignment_expression "__ptr[2] = 0" (subscript_expression "__ptr[2]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "__ptr[3] = param_1;" (assignment_expression "__ptr[3] = param_1" (subscript_expression "__ptr[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "__ptr[1] = param_1;" (assignment_expression "__ptr[1] = param_1" (subscript_expression "__ptr[1]" identifier [ number_literal ]) = identifier) ;) (return_statement "return __ptr;" return identifier ;) })) })) (expression_statement "pvVar1 = malloc(param_1);" (assignment_expression "pvVar1 = malloc(param_1)" identifier = (call_expression "malloc(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (expression_statement "*__ptr = pvVar1;" (assignment_expression "*__ptr = pvVar1" (pointer_expression "*__ptr" * identifier) = identifier) ;) (if_statement "if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\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      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }" { (expression_statement "puVar2 = (undefined4 *)0x0;" (assignment_expression "puVar2 = (undefined4 *)0x0" identifier = (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) }) (else_clause "else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }" else (compound_statement "{\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }" { (expression_statement "__ptr[4] = 0;" (assignment_expression "__ptr[4] = 0" (subscript_expression "__ptr[4]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "__ptr[2] = 0;" (assignment_expression "__ptr[2] = 0" (subscript_expression "__ptr[2]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "__ptr[3] = param_1;" (assignment_expression "__ptr[3] = param_1" (subscript_expression "__ptr[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "__ptr[1] = param_1;" (assignment_expression "__ptr[1] = param_1" (subscript_expression "__ptr[1]" identifier [ number_literal ]) = identifier) ;) }))) })) (return_statement "return puVar2;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nMemoryPool * MHD_pool_create(size_t max)\n\n{\n  MemoryPool *__ptr;\n  char *pcVar1;\n  MemoryPool *pMVar2;\n  \n  __ptr = (MemoryPool *)malloc(0x14);\n  pMVar2 = __ptr;\n  if (__ptr != (MemoryPool *)0x0) {\n    if (0x8000 < max) {\n      pcVar1 = (char *)mmap64((void *)0x0,max,3,0x22,-1,0);\n      __ptr->memory = pcVar1;\n      if (pcVar1 + -1 < (char *)0xfffffffe) {\n        __ptr->is_mmap = 1;\n        __ptr->pos = 0;\n        __ptr->end = max;\n        __ptr->size = max;\n        return __ptr;\n      }\n    }\n    pcVar1 = (char *)malloc(max);\n    __ptr->memory = pcVar1;\n    if (pcVar1 == (char *)0x0) {\n      pMVar2 = (MemoryPool *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr->is_mmap = 0;\n      __ptr->pos = 0;\n      __ptr->end = max;\n      __ptr->size = max;\n    }\n  }\n  return pMVar2;\n}\n\n" comment comment (function_definition "MemoryPool * MHD_pool_create(size_t max)\n\n{\n  MemoryPool *__ptr;\n  char *pcVar1;\n  MemoryPool *pMVar2;\n  \n  __ptr = (MemoryPool *)malloc(0x14);\n  pMVar2 = __ptr;\n  if (__ptr != (MemoryPool *)0x0) {\n    if (0x8000 < max) {\n      pcVar1 = (char *)mmap64((void *)0x0,max,3,0x22,-1,0);\n      __ptr->memory = pcVar1;\n      if (pcVar1 + -1 < (char *)0xfffffffe) {\n        __ptr->is_mmap = 1;\n        __ptr->pos = 0;\n        __ptr->end = max;\n        __ptr->size = max;\n        return __ptr;\n      }\n    }\n    pcVar1 = (char *)malloc(max);\n    __ptr->memory = pcVar1;\n    if (pcVar1 == (char *)0x0) {\n      pMVar2 = (MemoryPool *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr->is_mmap = 0;\n      __ptr->pos = 0;\n      __ptr->end = max;\n      __ptr->size = max;\n    }\n  }\n  return pMVar2;\n}" type_identifier (pointer_declarator "* MHD_pool_create(size_t max)" * (function_declarator "MHD_pool_create(size_t max)" identifier (parameter_list "(size_t max)" ( (parameter_declaration "size_t max" primitive_type identifier) )))) (compound_statement "{\n  MemoryPool *__ptr;\n  char *pcVar1;\n  MemoryPool *pMVar2;\n  \n  __ptr = (MemoryPool *)malloc(0x14);\n  pMVar2 = __ptr;\n  if (__ptr != (MemoryPool *)0x0) {\n    if (0x8000 < max) {\n      pcVar1 = (char *)mmap64((void *)0x0,max,3,0x22,-1,0);\n      __ptr->memory = pcVar1;\n      if (pcVar1 + -1 < (char *)0xfffffffe) {\n        __ptr->is_mmap = 1;\n        __ptr->pos = 0;\n        __ptr->end = max;\n        __ptr->size = max;\n        return __ptr;\n      }\n    }\n    pcVar1 = (char *)malloc(max);\n    __ptr->memory = pcVar1;\n    if (pcVar1 == (char *)0x0) {\n      pMVar2 = (MemoryPool *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr->is_mmap = 0;\n      __ptr->pos = 0;\n      __ptr->end = max;\n      __ptr->size = max;\n    }\n  }\n  return pMVar2;\n}" { (declaration "MemoryPool *__ptr;" type_identifier (pointer_declarator "*__ptr" * identifier) ;) (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "MemoryPool *pMVar2;" type_identifier (pointer_declarator "*pMVar2" * identifier) ;) (expression_statement "__ptr = (MemoryPool *)malloc(0x14);" (assignment_expression "__ptr = (MemoryPool *)malloc(0x14)" identifier = (cast_expression "(MemoryPool *)malloc(0x14)" ( (type_descriptor "MemoryPool *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "malloc(0x14)" identifier (argument_list "(0x14)" ( number_literal ))))) ;) (expression_statement "pMVar2 = __ptr;" (assignment_expression "pMVar2 = __ptr" identifier = identifier) ;) (if_statement "if (__ptr != (MemoryPool *)0x0) {\n    if (0x8000 < max) {\n      pcVar1 = (char *)mmap64((void *)0x0,max,3,0x22,-1,0);\n      __ptr->memory = pcVar1;\n      if (pcVar1 + -1 < (char *)0xfffffffe) {\n        __ptr->is_mmap = 1;\n        __ptr->pos = 0;\n        __ptr->end = max;\n        __ptr->size = max;\n        return __ptr;\n      }\n    }\n    pcVar1 = (char *)malloc(max);\n    __ptr->memory = pcVar1;\n    if (pcVar1 == (char *)0x0) {\n      pMVar2 = (MemoryPool *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr->is_mmap = 0;\n      __ptr->pos = 0;\n      __ptr->end = max;\n      __ptr->size = max;\n    }\n  }" if (parenthesized_expression "(__ptr != (MemoryPool *)0x0)" ( (binary_expression "__ptr != (MemoryPool *)0x0" identifier != (cast_expression "(MemoryPool *)0x0" ( (type_descriptor "MemoryPool *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (0x8000 < max) {\n      pcVar1 = (char *)mmap64((void *)0x0,max,3,0x22,-1,0);\n      __ptr->memory = pcVar1;\n      if (pcVar1 + -1 < (char *)0xfffffffe) {\n        __ptr->is_mmap = 1;\n        __ptr->pos = 0;\n        __ptr->end = max;\n        __ptr->size = max;\n        return __ptr;\n      }\n    }\n    pcVar1 = (char *)malloc(max);\n    __ptr->memory = pcVar1;\n    if (pcVar1 == (char *)0x0) {\n      pMVar2 = (MemoryPool *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr->is_mmap = 0;\n      __ptr->pos = 0;\n      __ptr->end = max;\n      __ptr->size = max;\n    }\n  }" { (if_statement "if (0x8000 < max) {\n      pcVar1 = (char *)mmap64((void *)0x0,max,3,0x22,-1,0);\n      __ptr->memory = pcVar1;\n      if (pcVar1 + -1 < (char *)0xfffffffe) {\n        __ptr->is_mmap = 1;\n        __ptr->pos = 0;\n        __ptr->end = max;\n        __ptr->size = max;\n        return __ptr;\n      }\n    }" if (parenthesized_expression "(0x8000 < max)" ( (binary_expression "0x8000 < max" number_literal < identifier) )) (compound_statement "{\n      pcVar1 = (char *)mmap64((void *)0x0,max,3,0x22,-1,0);\n      __ptr->memory = pcVar1;\n      if (pcVar1 + -1 < (char *)0xfffffffe) {\n        __ptr->is_mmap = 1;\n        __ptr->pos = 0;\n        __ptr->end = max;\n        __ptr->size = max;\n        return __ptr;\n      }\n    }" { (expression_statement "pcVar1 = (char *)mmap64((void *)0x0,max,3,0x22,-1,0);" (assignment_expression "pcVar1 = (char *)mmap64((void *)0x0,max,3,0x22,-1,0)" identifier = (cast_expression "(char *)mmap64((void *)0x0,max,3,0x22,-1,0)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "mmap64((void *)0x0,max,3,0x22,-1,0)" identifier (argument_list "((void *)0x0,max,3,0x22,-1,0)" ( (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , identifier , number_literal , number_literal , number_literal , number_literal ))))) ;) (expression_statement "__ptr->memory = pcVar1;" (assignment_expression "__ptr->memory = pcVar1" (field_expression "__ptr->memory" identifier -> field_identifier) = identifier) ;) (if_statement "if (pcVar1 + -1 < (char *)0xfffffffe) {\n        __ptr->is_mmap = 1;\n        __ptr->pos = 0;\n        __ptr->end = max;\n        __ptr->size = max;\n        return __ptr;\n      }" if (parenthesized_expression "(pcVar1 + -1 < (char *)0xfffffffe)" ( (binary_expression "pcVar1 + -1 < (char *)0xfffffffe" (binary_expression "pcVar1 + -1" identifier + number_literal) < (cast_expression "(char *)0xfffffffe" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        __ptr->is_mmap = 1;\n        __ptr->pos = 0;\n        __ptr->end = max;\n        __ptr->size = max;\n        return __ptr;\n      }" { (expression_statement "__ptr->is_mmap = 1;" (assignment_expression "__ptr->is_mmap = 1" (field_expression "__ptr->is_mmap" identifier -> field_identifier) = number_literal) ;) (expression_statement "__ptr->pos = 0;" (assignment_expression "__ptr->pos = 0" (field_expression "__ptr->pos" identifier -> field_identifier) = number_literal) ;) (expression_statement "__ptr->end = max;" (assignment_expression "__ptr->end = max" (field_expression "__ptr->end" identifier -> field_identifier) = identifier) ;) (expression_statement "__ptr->size = max;" (assignment_expression "__ptr->size = max" (field_expression "__ptr->size" identifier -> field_identifier) = identifier) ;) (return_statement "return __ptr;" return identifier ;) })) })) (expression_statement "pcVar1 = (char *)malloc(max);" (assignment_expression "pcVar1 = (char *)malloc(max)" identifier = (cast_expression "(char *)malloc(max)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "malloc(max)" identifier (argument_list "(max)" ( identifier ))))) ;) (expression_statement "__ptr->memory = pcVar1;" (assignment_expression "__ptr->memory = pcVar1" (field_expression "__ptr->memory" identifier -> field_identifier) = identifier) ;) (if_statement "if (pcVar1 == (char *)0x0) {\n      pMVar2 = (MemoryPool *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr->is_mmap = 0;\n      __ptr->pos = 0;\n      __ptr->end = max;\n      __ptr->size = max;\n    }" if (parenthesized_expression "(pcVar1 == (char *)0x0)" ( (binary_expression "pcVar1 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      pMVar2 = (MemoryPool *)0x0;\n      free(__ptr);\n    }" { (expression_statement "pMVar2 = (MemoryPool *)0x0;" (assignment_expression "pMVar2 = (MemoryPool *)0x0" identifier = (cast_expression "(MemoryPool *)0x0" ( (type_descriptor "MemoryPool *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) }) (else_clause "else {\n      __ptr->is_mmap = 0;\n      __ptr->pos = 0;\n      __ptr->end = max;\n      __ptr->size = max;\n    }" else (compound_statement "{\n      __ptr->is_mmap = 0;\n      __ptr->pos = 0;\n      __ptr->end = max;\n      __ptr->size = max;\n    }" { (expression_statement "__ptr->is_mmap = 0;" (assignment_expression "__ptr->is_mmap = 0" (field_expression "__ptr->is_mmap" identifier -> field_identifier) = number_literal) ;) (expression_statement "__ptr->pos = 0;" (assignment_expression "__ptr->pos = 0" (field_expression "__ptr->pos" identifier -> field_identifier) = number_literal) ;) (expression_statement "__ptr->end = max;" (assignment_expression "__ptr->end = max" (field_expression "__ptr->end" identifier -> field_identifier) = identifier) ;) (expression_statement "__ptr->size = max;" (assignment_expression "__ptr->size = max" (field_expression "__ptr->size" identifier -> field_identifier) = identifier) ;) }))) })) (return_statement "return pMVar2;" return identifier ;) })))
(translation_unit "undefined4 * FUN_000219e0(uint param_1)\n\n{\n  undefined4 *__ptr;\n  void *pvVar1;\n  undefined4 *puVar2;\n  \n  __ptr = (undefined4 *)malloc(0x14);\n  puVar2 = __ptr;\n  if (__ptr != (undefined4 *)0x0) {\n    if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }\n    pvVar1 = malloc(param_1);\n    *__ptr = pvVar1;\n    if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }\n  }\n  return puVar2;\n}\n\n" (function_definition "undefined4 * FUN_000219e0(uint param_1)\n\n{\n  undefined4 *__ptr;\n  void *pvVar1;\n  undefined4 *puVar2;\n  \n  __ptr = (undefined4 *)malloc(0x14);\n  puVar2 = __ptr;\n  if (__ptr != (undefined4 *)0x0) {\n    if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }\n    pvVar1 = malloc(param_1);\n    *__ptr = pvVar1;\n    if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }\n  }\n  return puVar2;\n}" type_identifier (pointer_declarator "* FUN_000219e0(uint param_1)" * (function_declarator "FUN_000219e0(uint param_1)" identifier (parameter_list "(uint param_1)" ( (parameter_declaration "uint param_1" type_identifier identifier) )))) (compound_statement "{\n  undefined4 *__ptr;\n  void *pvVar1;\n  undefined4 *puVar2;\n  \n  __ptr = (undefined4 *)malloc(0x14);\n  puVar2 = __ptr;\n  if (__ptr != (undefined4 *)0x0) {\n    if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }\n    pvVar1 = malloc(param_1);\n    *__ptr = pvVar1;\n    if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }\n  }\n  return puVar2;\n}" { (declaration "undefined4 *__ptr;" type_identifier (pointer_declarator "*__ptr" * identifier) ;) (declaration "void *pvVar1;" primitive_type (pointer_declarator "*pvVar1" * identifier) ;) (declaration "undefined4 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (expression_statement "__ptr = (undefined4 *)malloc(0x14);" (assignment_expression "__ptr = (undefined4 *)malloc(0x14)" identifier = (cast_expression "(undefined4 *)malloc(0x14)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "malloc(0x14)" identifier (argument_list "(0x14)" ( number_literal ))))) ;) (expression_statement "puVar2 = __ptr;" (assignment_expression "puVar2 = __ptr" identifier = identifier) ;) (if_statement "if (__ptr != (undefined4 *)0x0) {\n    if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }\n    pvVar1 = malloc(param_1);\n    *__ptr = pvVar1;\n    if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }\n  }" if (parenthesized_expression "(__ptr != (undefined4 *)0x0)" ( (binary_expression "__ptr != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }\n    pvVar1 = malloc(param_1);\n    *__ptr = pvVar1;\n    if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }\n  }" { (if_statement "if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }" if (parenthesized_expression "(0x8000 < param_1)" ( (binary_expression "0x8000 < param_1" number_literal < identifier) )) (compound_statement "{\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }" { (expression_statement "pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);" (assignment_expression "pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0)" identifier = (call_expression "mmap64((void *)0x0,param_1,3,0x22,-1,0)" identifier (argument_list "((void *)0x0,param_1,3,0x22,-1,0)" ( (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , identifier , number_literal , number_literal , number_literal , number_literal )))) ;) (expression_statement "*__ptr = pvVar1;" (assignment_expression "*__ptr = pvVar1" (pointer_expression "*__ptr" * identifier) = identifier) ;) (if_statement "if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }" if (parenthesized_expression "((int)pvVar1 - 1U < 0xfffffffe)" ( (binary_expression "(int)pvVar1 - 1U < 0xfffffffe" (binary_expression "(int)pvVar1 - 1U" (cast_expression "(int)pvVar1" ( (type_descriptor "int" primitive_type) ) identifier) - number_literal) < number_literal) )) (compound_statement "{\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }" { (expression_statement "__ptr[4] = 1;" (assignment_expression "__ptr[4] = 1" (subscript_expression "__ptr[4]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "__ptr[2] = 0;" (assignment_expression "__ptr[2] = 0" (subscript_expression "__ptr[2]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "__ptr[3] = param_1;" (assignment_expression "__ptr[3] = param_1" (subscript_expression "__ptr[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "__ptr[1] = param_1;" (assignment_expression "__ptr[1] = param_1" (subscript_expression "__ptr[1]" identifier [ number_literal ]) = identifier) ;) (return_statement "return __ptr;" return identifier ;) })) })) (expression_statement "pvVar1 = malloc(param_1);" (assignment_expression "pvVar1 = malloc(param_1)" identifier = (call_expression "malloc(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (expression_statement "*__ptr = pvVar1;" (assignment_expression "*__ptr = pvVar1" (pointer_expression "*__ptr" * identifier) = identifier) ;) (if_statement "if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\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      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }" { (expression_statement "puVar2 = (undefined4 *)0x0;" (assignment_expression "puVar2 = (undefined4 *)0x0" identifier = (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) }) (else_clause "else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }" else (compound_statement "{\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }" { (expression_statement "__ptr[4] = 0;" (assignment_expression "__ptr[4] = 0" (subscript_expression "__ptr[4]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "__ptr[2] = 0;" (assignment_expression "__ptr[2] = 0" (subscript_expression "__ptr[2]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "__ptr[3] = param_1;" (assignment_expression "__ptr[3] = param_1" (subscript_expression "__ptr[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "__ptr[1] = param_1;" (assignment_expression "__ptr[1] = param_1" (subscript_expression "__ptr[1]" identifier [ number_literal ]) = identifier) ;) }))) })) (return_statement "return puVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT ))))) ;) (expression_statement (assignment_expression IDENT = 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 LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) , IDENT , LIT , LIT , LIT , LIT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) - LIT) < LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (return_statement return IDENT ;) })) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) }))) })) (return_statement return IDENT ;) })))
(function_definition "undefined4 * FUN_000219e0(uint param_1)\n\n{\n  undefined4 *__ptr;\n  void *pvVar1;\n  undefined4 *puVar2;\n  \n  __ptr = (undefined4 *)malloc(0x14);\n  puVar2 = __ptr;\n  if (__ptr != (undefined4 *)0x0) {\n    if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }\n    pvVar1 = malloc(param_1);\n    *__ptr = pvVar1;\n    if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }\n  }\n  return puVar2;\n}" (type_identifier "undefined4") (pointer_declarator "* FUN_000219e0(uint param_1)" (* "*") (function_declarator "FUN_000219e0(uint param_1)" (identifier "FUN_000219e0") (parameter_list "(uint param_1)" (( "(") (parameter_declaration "uint param_1" (type_identifier "uint") (identifier "param_1")) () ")")))) (compound_statement "{\n  undefined4 *__ptr;\n  void *pvVar1;\n  undefined4 *puVar2;\n  \n  __ptr = (undefined4 *)malloc(0x14);\n  puVar2 = __ptr;\n  if (__ptr != (undefined4 *)0x0) {\n    if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }\n    pvVar1 = malloc(param_1);\n    *__ptr = pvVar1;\n    if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }\n  }\n  return puVar2;\n}" ({ "{") (declaration "undefined4 *__ptr;" (type_identifier "undefined4") (pointer_declarator "*__ptr" (* "*") (identifier "__ptr")) (; ";")) (declaration "void *pvVar1;" (primitive_type "void") (pointer_declarator "*pvVar1" (* "*") (identifier "pvVar1")) (; ";")) (declaration "undefined4 *puVar2;" (type_identifier "undefined4") (pointer_declarator "*puVar2" (* "*") (identifier "puVar2")) (; ";")) (expression_statement "__ptr = (undefined4 *)malloc(0x14);" (assignment_expression "__ptr = (undefined4 *)malloc(0x14)" (identifier "__ptr") (= "=") (cast_expression "(undefined4 *)malloc(0x14)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "malloc(0x14)" (identifier "malloc") (argument_list "(0x14)" (( "(") (number_literal "0x14") () ")"))))) (; ";")) (expression_statement "puVar2 = __ptr;" (assignment_expression "puVar2 = __ptr" (identifier "puVar2") (= "=") (identifier "__ptr")) (; ";")) (if_statement "if (__ptr != (undefined4 *)0x0) {\n    if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }\n    pvVar1 = malloc(param_1);\n    *__ptr = pvVar1;\n    if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }\n  }" (if "if") (parenthesized_expression "(__ptr != (undefined4 *)0x0)" (( "(") (binary_expression "__ptr != (undefined4 *)0x0" (identifier "__ptr") (!= "!=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }\n    pvVar1 = malloc(param_1);\n    *__ptr = pvVar1;\n    if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }\n  }" ({ "{") (if_statement "if (0x8000 < param_1) {\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }" (if "if") (parenthesized_expression "(0x8000 < param_1)" (( "(") (binary_expression "0x8000 < param_1" (number_literal "0x8000") (< "<") (identifier "param_1")) () ")")) (compound_statement "{\n      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);\n      *__ptr = pvVar1;\n      if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }\n    }" ({ "{") (expression_statement "pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);" (assignment_expression "pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0)" (identifier "pvVar1") (= "=") (call_expression "mmap64((void *)0x0,param_1,3,0x22,-1,0)" (identifier "mmap64") (argument_list "((void *)0x0,param_1,3,0x22,-1,0)" (( "(") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (, ",") (identifier "param_1") (, ",") (number_literal "3") (, ",") (number_literal "0x22") (, ",") (number_literal "-1") (, ",") (number_literal "0") () ")")))) (; ";")) (expression_statement "*__ptr = pvVar1;" (assignment_expression "*__ptr = pvVar1" (pointer_expression "*__ptr" (* "*") (identifier "__ptr")) (= "=") (identifier "pvVar1")) (; ";")) (if_statement "if ((int)pvVar1 - 1U < 0xfffffffe) {\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }" (if "if") (parenthesized_expression "((int)pvVar1 - 1U < 0xfffffffe)" (( "(") (binary_expression "(int)pvVar1 - 1U < 0xfffffffe" (binary_expression "(int)pvVar1 - 1U" (cast_expression "(int)pvVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pvVar1")) (- "-") (number_literal "1U")) (< "<") (number_literal "0xfffffffe")) () ")")) (compound_statement "{\n        __ptr[4] = 1;\n        __ptr[2] = 0;\n        __ptr[3] = param_1;\n        __ptr[1] = param_1;\n        return __ptr;\n      }" ({ "{") (expression_statement "__ptr[4] = 1;" (assignment_expression "__ptr[4] = 1" (subscript_expression "__ptr[4]" (identifier "__ptr") ([ "[") (number_literal "4") (] "]")) (= "=") (number_literal "1")) (; ";")) (expression_statement "__ptr[2] = 0;" (assignment_expression "__ptr[2] = 0" (subscript_expression "__ptr[2]" (identifier "__ptr") ([ "[") (number_literal "2") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "__ptr[3] = param_1;" (assignment_expression "__ptr[3] = param_1" (subscript_expression "__ptr[3]" (identifier "__ptr") ([ "[") (number_literal "3") (] "]")) (= "=") (identifier "param_1")) (; ";")) (expression_statement "__ptr[1] = param_1;" (assignment_expression "__ptr[1] = param_1" (subscript_expression "__ptr[1]" (identifier "__ptr") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "param_1")) (; ";")) (return_statement "return __ptr;" (return "return") (identifier "__ptr") (; ";")) (} "}"))) (} "}"))) (expression_statement "pvVar1 = malloc(param_1);" (assignment_expression "pvVar1 = malloc(param_1)" (identifier "pvVar1") (= "=") (call_expression "malloc(param_1)" (identifier "malloc") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (expression_statement "*__ptr = pvVar1;" (assignment_expression "*__ptr = pvVar1" (pointer_expression "*__ptr" (* "*") (identifier "__ptr")) (= "=") (identifier "pvVar1")) (; ";")) (if_statement "if (pvVar1 == (void *)0x0) {\n      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }\n    else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\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      puVar2 = (undefined4 *)0x0;\n      free(__ptr);\n    }" ({ "{") (expression_statement "puVar2 = (undefined4 *)0x0;" (assignment_expression "puVar2 = (undefined4 *)0x0" (identifier "puVar2") (= "=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" (identifier "free") (argument_list "(__ptr)" (( "(") (identifier "__ptr") () ")"))) (; ";")) (} "}")) (else_clause "else {\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }" (else "else") (compound_statement "{\n      __ptr[4] = 0;\n      __ptr[2] = 0;\n      __ptr[3] = param_1;\n      __ptr[1] = param_1;\n    }" ({ "{") (expression_statement "__ptr[4] = 0;" (assignment_expression "__ptr[4] = 0" (subscript_expression "__ptr[4]" (identifier "__ptr") ([ "[") (number_literal "4") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "__ptr[2] = 0;" (assignment_expression "__ptr[2] = 0" (subscript_expression "__ptr[2]" (identifier "__ptr") ([ "[") (number_literal "2") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "__ptr[3] = param_1;" (assignment_expression "__ptr[3] = param_1" (subscript_expression "__ptr[3]" (identifier "__ptr") ([ "[") (number_literal "3") (] "]")) (= "=") (identifier "param_1")) (; ";")) (expression_statement "__ptr[1] = param_1;" (assignment_expression "__ptr[1] = param_1" (subscript_expression "__ptr[1]" (identifier "__ptr") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "param_1")) (; ";")) (} "}")))) (} "}"))) (return_statement "return puVar2;" (return "return") (identifier "puVar2") (; ";")) (} "}")))

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

type_1 * function_1(size_t var_3)

{
  type_1 *var_2;
  char *var_5;
  type_1 *pMVar2;
  
  var_2 = (type_1 *)var_1(0x14);
  pMVar2 = var_2;
  if (var_2 != (type_1 *)0x0) {
    if (0x8000 < var_3) {
      var_5 = (char *)var_4((void *)0x0,var_3,3,0x22,-1,0);
      var_2->memory = var_5;
      if (var_5 + -1 < (char *)0xfffffffe) {
        var_2->is_mmap = 1;
        var_2->pos = 0;
        var_2->end = var_3;
        var_2->size = var_3;
        return var_2;
      }
    }
    var_5 = (char *)var_1(var_3);
    var_2->memory = var_5;
    if (var_5 == (char *)0x0) {
      pMVar2 = (type_1 *)0x0;
      var_6(var_2);
    }
    else {
      var_2->is_mmap = 0;
      var_2->pos = 0;
      var_2->end = var_3;
      var_2->size = var_3;
    }
  }
  return pMVar2;
}


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

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

undefined4 * MASKED(uint param_1)

{
  undefined4 *__ptr;
  void *pvVar1;
  undefined4 *puVar2;
  
  __ptr = (undefined4 *)malloc(0x14);
  puVar2 = __ptr;
  if (__ptr != (undefined4 *)0x0) {
    if (0x8000 < param_1) {
      pvVar1 = mmap64((void *)0x0,param_1,3,0x22,-1,0);
      *__ptr = pvVar1;
      if ((int)pvVar1 - 1U < 0xfffffffe) {
        __ptr[4] = 1;
        __ptr[2] = 0;
        __ptr[3] = param_1;
        __ptr[1] = param_1;
        return __ptr;
      }
    }
    pvVar1 = malloc(param_1);
    *__ptr = pvVar1;
    if (pvVar1 == (void *)0x0) {
      puVar2 = (undefined4 *)0x0;
      free(__ptr);
    }
    else {
      __ptr[4] = 0;
      __ptr[2] = 0;
      __ptr[3] = param_1;
      __ptr[1] = param_1;
    }
  }
  return puVar2;
}

