
void * MHD_pool_allocate(MemoryPool *pool,size_t size,int from_end)

{
  uint uVar1;
  uint uVar2;
  char *pcVar3;
  size_t sVar4;
  
  uVar2 = size + 7 & 0xfffffff8;
  if ((uVar2 != 0) || (pcVar3 = (char *)0x0, size == 0)) {
    uVar1 = pool->pos;
    if ((pool->end < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {
      return (void *)0x0;
    }
    if (from_end == 1) {
      sVar4 = pool->end - uVar2;
      pool->end = sVar4;
      return pool->memory + sVar4;
    }
    pool->pos = uVar1 + uVar2;
    pcVar3 = pool->memory + uVar1;
  }
  return pcVar3;
}



int FUN_00020ee0(int *param_1,int param_2,int param_3)

{
  uint uVar1;
  uint uVar2;
  int iVar3;
  
  uVar2 = param_2 + 7U & 0xfffffff8;
  if ((uVar2 != 0) || (iVar3 = 0, param_2 == 0)) {
    uVar1 = param_1[2];
    if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {
      return 0;
    }
    if (param_3 == 1) {
      iVar3 = param_1[3] - uVar2;
      param_1[3] = iVar3;
      return *param_1 + iVar3;
    }
    param_1[2] = uVar1 + uVar2;
    iVar3 = uVar1 + *param_1;
  }
  return iVar3;
}


PUSH EDI
PUSH ESI
PUSH EBX
MOV EDX,dword ptr [ESP + 0x14]
MOV EBX,dword ptr [ESP + 0x10]
LEA EAX,[EDX + 0x7]
AND EAX,0xfffffff8
MOV ECX,EAX
JNZ 0x00020efb
XOR EAX,EAX
TEST EDX,EDX
JNZ 0x00020f20
MOV EAX,dword ptr [EBX + 0x8]
MOV ESI,dword ptr [EBX + 0xc]
XOR EDX,EDX
MOV EDI,EAX
ADD EDI,ECX
SETC DL
CMP EDI,ESI
JA 0x00020f28
TEST EDX,EDX
JNZ 0x00020f28
CMP dword ptr [ESP + 0x18],0x1
MOV EDX,dword ptr [EBX]
JZ 0x00020f30
MOV dword ptr [EBX + 0x8],EDI
ADD EAX,EDX
POP EBX
POP ESI
POP EDI
RET
POP EBX
XOR EAX,EAX
POP ESI
POP EDI
RET
SUB ESI,ECX
MOV dword ptr [EBX + 0xc],ESI
LEA EAX,[EDX + ESI*0x1]
POP EBX
POP ESI
POP EDI
RET
(translation_unit "int FUN_00020ee0(int *param_1,int param_2,int param_3)\n\n{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  uVar2 = param_2 + 7U & 0xfffffff8;\n  if ((uVar2 != 0) || (iVar3 = 0, param_2 == 0)) {\n    uVar1 = param_1[2];\n    if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }\n    if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }\n    param_1[2] = uVar1 + uVar2;\n    iVar3 = uVar1 + *param_1;\n  }\n  return iVar3;\n}\n\n" (function_definition "int FUN_00020ee0(int *param_1,int param_2,int param_3)\n\n{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  uVar2 = param_2 + 7U & 0xfffffff8;\n  if ((uVar2 != 0) || (iVar3 = 0, param_2 == 0)) {\n    uVar1 = param_1[2];\n    if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }\n    if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }\n    param_1[2] = uVar1 + uVar2;\n    iVar3 = uVar1 + *param_1;\n  }\n  return iVar3;\n}" primitive_type (function_declarator "FUN_00020ee0(int *param_1,int param_2,int param_3)" identifier (parameter_list "(int *param_1,int param_2,int param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  uVar2 = param_2 + 7U & 0xfffffff8;\n  if ((uVar2 != 0) || (iVar3 = 0, param_2 == 0)) {\n    uVar1 = param_1[2];\n    if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }\n    if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }\n    param_1[2] = uVar1 + uVar2;\n    iVar3 = uVar1 + *param_1;\n  }\n  return iVar3;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "uVar2 = param_2 + 7U & 0xfffffff8;" (assignment_expression "uVar2 = param_2 + 7U & 0xfffffff8" identifier = (binary_expression "param_2 + 7U & 0xfffffff8" (binary_expression "param_2 + 7U" identifier + number_literal) & number_literal)) ;) (if_statement "if ((uVar2 != 0) || (iVar3 = 0, param_2 == 0)) {\n    uVar1 = param_1[2];\n    if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }\n    if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }\n    param_1[2] = uVar1 + uVar2;\n    iVar3 = uVar1 + *param_1;\n  }" if (parenthesized_expression "((uVar2 != 0) || (iVar3 = 0, param_2 == 0))" ( (binary_expression "(uVar2 != 0) || (iVar3 = 0, param_2 == 0)" (parenthesized_expression "(uVar2 != 0)" ( (binary_expression "uVar2 != 0" identifier != number_literal) )) || (parenthesized_expression "(iVar3 = 0, param_2 == 0)" ( (comma_expression "iVar3 = 0, param_2 == 0" (assignment_expression "iVar3 = 0" identifier = number_literal) , (binary_expression "param_2 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n    uVar1 = param_1[2];\n    if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }\n    if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }\n    param_1[2] = uVar1 + uVar2;\n    iVar3 = uVar1 + *param_1;\n  }" { (expression_statement "uVar1 = param_1[2];" (assignment_expression "uVar1 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) (if_statement "if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }" if (parenthesized_expression "(((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2)))" ( (binary_expression "((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))" (parenthesized_expression "((uint)param_1[3] < uVar1 + uVar2)" ( (binary_expression "(uint)param_1[3] < uVar1 + uVar2" (cast_expression "(uint)param_1[3]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_1[3]" identifier [ number_literal ])) < (binary_expression "uVar1 + uVar2" identifier + identifier)) )) || (parenthesized_expression "(CARRY4(uVar1,uVar2))" ( (call_expression "CARRY4(uVar1,uVar2)" identifier (argument_list "(uVar1,uVar2)" ( identifier , identifier ))) ))) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (if_statement "if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }" { (expression_statement "iVar3 = param_1[3] - uVar2;" (assignment_expression "iVar3 = param_1[3] - uVar2" identifier = (binary_expression "param_1[3] - uVar2" (subscript_expression "param_1[3]" identifier [ number_literal ]) - identifier)) ;) (expression_statement "param_1[3] = iVar3;" (assignment_expression "param_1[3] = iVar3" (subscript_expression "param_1[3]" identifier [ number_literal ]) = identifier) ;) (return_statement "return *param_1 + iVar3;" return (binary_expression "*param_1 + iVar3" (pointer_expression "*param_1" * identifier) + identifier) ;) })) (expression_statement "param_1[2] = uVar1 + uVar2;" (assignment_expression "param_1[2] = uVar1 + uVar2" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "uVar1 + uVar2" identifier + identifier)) ;) (expression_statement "iVar3 = uVar1 + *param_1;" (assignment_expression "iVar3 = uVar1 + *param_1" identifier = (binary_expression "uVar1 + *param_1" identifier + (pointer_expression "*param_1" * identifier))) ;) })) (return_statement "return iVar3;" return identifier ;) })))
(translation_unit "void * MHD_pool_allocate(MemoryPool *pool,size_t size,int from_end)\n\n{\n  uint uVar1;\n  uint uVar2;\n  char *pcVar3;\n  size_t sVar4;\n  \n  uVar2 = size + 7 & 0xfffffff8;\n  if ((uVar2 != 0) || (pcVar3 = (char *)0x0, size == 0)) {\n    uVar1 = pool->pos;\n    if ((pool->end < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return (void *)0x0;\n    }\n    if (from_end == 1) {\n      sVar4 = pool->end - uVar2;\n      pool->end = sVar4;\n      return pool->memory + sVar4;\n    }\n    pool->pos = uVar1 + uVar2;\n    pcVar3 = pool->memory + uVar1;\n  }\n  return pcVar3;\n}\n\n" (function_definition "void * MHD_pool_allocate(MemoryPool *pool,size_t size,int from_end)\n\n{\n  uint uVar1;\n  uint uVar2;\n  char *pcVar3;\n  size_t sVar4;\n  \n  uVar2 = size + 7 & 0xfffffff8;\n  if ((uVar2 != 0) || (pcVar3 = (char *)0x0, size == 0)) {\n    uVar1 = pool->pos;\n    if ((pool->end < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return (void *)0x0;\n    }\n    if (from_end == 1) {\n      sVar4 = pool->end - uVar2;\n      pool->end = sVar4;\n      return pool->memory + sVar4;\n    }\n    pool->pos = uVar1 + uVar2;\n    pcVar3 = pool->memory + uVar1;\n  }\n  return pcVar3;\n}" primitive_type (pointer_declarator "* MHD_pool_allocate(MemoryPool *pool,size_t size,int from_end)" * (function_declarator "MHD_pool_allocate(MemoryPool *pool,size_t size,int from_end)" identifier (parameter_list "(MemoryPool *pool,size_t size,int from_end)" ( (parameter_declaration "MemoryPool *pool" type_identifier (pointer_declarator "*pool" * identifier)) , (parameter_declaration "size_t size" primitive_type identifier) , (parameter_declaration "int from_end" primitive_type identifier) )))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  char *pcVar3;\n  size_t sVar4;\n  \n  uVar2 = size + 7 & 0xfffffff8;\n  if ((uVar2 != 0) || (pcVar3 = (char *)0x0, size == 0)) {\n    uVar1 = pool->pos;\n    if ((pool->end < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return (void *)0x0;\n    }\n    if (from_end == 1) {\n      sVar4 = pool->end - uVar2;\n      pool->end = sVar4;\n      return pool->memory + sVar4;\n    }\n    pool->pos = uVar1 + uVar2;\n    pcVar3 = pool->memory + uVar1;\n  }\n  return pcVar3;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "size_t sVar4;" primitive_type identifier ;) (expression_statement "uVar2 = size + 7 & 0xfffffff8;" (assignment_expression "uVar2 = size + 7 & 0xfffffff8" identifier = (binary_expression "size + 7 & 0xfffffff8" (binary_expression "size + 7" identifier + number_literal) & number_literal)) ;) (if_statement "if ((uVar2 != 0) || (pcVar3 = (char *)0x0, size == 0)) {\n    uVar1 = pool->pos;\n    if ((pool->end < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return (void *)0x0;\n    }\n    if (from_end == 1) {\n      sVar4 = pool->end - uVar2;\n      pool->end = sVar4;\n      return pool->memory + sVar4;\n    }\n    pool->pos = uVar1 + uVar2;\n    pcVar3 = pool->memory + uVar1;\n  }" if (parenthesized_expression "((uVar2 != 0) || (pcVar3 = (char *)0x0, size == 0))" ( (binary_expression "(uVar2 != 0) || (pcVar3 = (char *)0x0, size == 0)" (parenthesized_expression "(uVar2 != 0)" ( (binary_expression "uVar2 != 0" identifier != number_literal) )) || (parenthesized_expression "(pcVar3 = (char *)0x0, size == 0)" ( (comma_expression "pcVar3 = (char *)0x0, size == 0" (assignment_expression "pcVar3 = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) , (binary_expression "size == 0" identifier == number_literal)) ))) )) (compound_statement "{\n    uVar1 = pool->pos;\n    if ((pool->end < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return (void *)0x0;\n    }\n    if (from_end == 1) {\n      sVar4 = pool->end - uVar2;\n      pool->end = sVar4;\n      return pool->memory + sVar4;\n    }\n    pool->pos = uVar1 + uVar2;\n    pcVar3 = pool->memory + uVar1;\n  }" { (expression_statement "uVar1 = pool->pos;" (assignment_expression "uVar1 = pool->pos" identifier = (field_expression "pool->pos" identifier -> field_identifier)) ;) (if_statement "if ((pool->end < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return (void *)0x0;\n    }" if (parenthesized_expression "((pool->end < uVar1 + uVar2) || (CARRY4(uVar1,uVar2)))" ( (binary_expression "(pool->end < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))" (parenthesized_expression "(pool->end < uVar1 + uVar2)" ( (binary_expression "pool->end < uVar1 + uVar2" (field_expression "pool->end" identifier -> field_identifier) < (binary_expression "uVar1 + uVar2" identifier + identifier)) )) || (parenthesized_expression "(CARRY4(uVar1,uVar2))" ( (call_expression "CARRY4(uVar1,uVar2)" identifier (argument_list "(uVar1,uVar2)" ( identifier , identifier ))) ))) )) (compound_statement "{\n      return (void *)0x0;\n    }" { (return_statement "return (void *)0x0;" return (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (if_statement "if (from_end == 1) {\n      sVar4 = pool->end - uVar2;\n      pool->end = sVar4;\n      return pool->memory + sVar4;\n    }" if (parenthesized_expression "(from_end == 1)" ( (binary_expression "from_end == 1" identifier == number_literal) )) (compound_statement "{\n      sVar4 = pool->end - uVar2;\n      pool->end = sVar4;\n      return pool->memory + sVar4;\n    }" { (expression_statement "sVar4 = pool->end - uVar2;" (assignment_expression "sVar4 = pool->end - uVar2" identifier = (binary_expression "pool->end - uVar2" (field_expression "pool->end" identifier -> field_identifier) - identifier)) ;) (expression_statement "pool->end = sVar4;" (assignment_expression "pool->end = sVar4" (field_expression "pool->end" identifier -> field_identifier) = identifier) ;) (return_statement "return pool->memory + sVar4;" return (binary_expression "pool->memory + sVar4" (field_expression "pool->memory" identifier -> field_identifier) + identifier) ;) })) (expression_statement "pool->pos = uVar1 + uVar2;" (assignment_expression "pool->pos = uVar1 + uVar2" (field_expression "pool->pos" identifier -> field_identifier) = (binary_expression "uVar1 + uVar2" identifier + identifier)) ;) (expression_statement "pcVar3 = pool->memory + uVar1;" (assignment_expression "pcVar3 = pool->memory + uVar1" identifier = (binary_expression "pool->memory + uVar1" (field_expression "pool->memory" identifier -> field_identifier) + identifier)) ;) })) (return_statement "return pcVar3;" return identifier ;) })))
(translation_unit "int FUN_00020ee0(int *param_1,int param_2,int param_3)\n\n{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  uVar2 = param_2 + 7U & 0xfffffff8;\n  if ((uVar2 != 0) || (iVar3 = 0, param_2 == 0)) {\n    uVar1 = param_1[2];\n    if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }\n    if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }\n    param_1[2] = uVar1 + uVar2;\n    iVar3 = uVar1 + *param_1;\n  }\n  return iVar3;\n}\n\n" (function_definition "int FUN_00020ee0(int *param_1,int param_2,int param_3)\n\n{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  uVar2 = param_2 + 7U & 0xfffffff8;\n  if ((uVar2 != 0) || (iVar3 = 0, param_2 == 0)) {\n    uVar1 = param_1[2];\n    if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }\n    if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }\n    param_1[2] = uVar1 + uVar2;\n    iVar3 = uVar1 + *param_1;\n  }\n  return iVar3;\n}" primitive_type (function_declarator "FUN_00020ee0(int *param_1,int param_2,int param_3)" identifier (parameter_list "(int *param_1,int param_2,int param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  uVar2 = param_2 + 7U & 0xfffffff8;\n  if ((uVar2 != 0) || (iVar3 = 0, param_2 == 0)) {\n    uVar1 = param_1[2];\n    if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }\n    if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }\n    param_1[2] = uVar1 + uVar2;\n    iVar3 = uVar1 + *param_1;\n  }\n  return iVar3;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "uVar2 = param_2 + 7U & 0xfffffff8;" (assignment_expression "uVar2 = param_2 + 7U & 0xfffffff8" identifier = (binary_expression "param_2 + 7U & 0xfffffff8" (binary_expression "param_2 + 7U" identifier + number_literal) & number_literal)) ;) (if_statement "if ((uVar2 != 0) || (iVar3 = 0, param_2 == 0)) {\n    uVar1 = param_1[2];\n    if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }\n    if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }\n    param_1[2] = uVar1 + uVar2;\n    iVar3 = uVar1 + *param_1;\n  }" if (parenthesized_expression "((uVar2 != 0) || (iVar3 = 0, param_2 == 0))" ( (binary_expression "(uVar2 != 0) || (iVar3 = 0, param_2 == 0)" (parenthesized_expression "(uVar2 != 0)" ( (binary_expression "uVar2 != 0" identifier != number_literal) )) || (parenthesized_expression "(iVar3 = 0, param_2 == 0)" ( (comma_expression "iVar3 = 0, param_2 == 0" (assignment_expression "iVar3 = 0" identifier = number_literal) , (binary_expression "param_2 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n    uVar1 = param_1[2];\n    if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }\n    if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }\n    param_1[2] = uVar1 + uVar2;\n    iVar3 = uVar1 + *param_1;\n  }" { (expression_statement "uVar1 = param_1[2];" (assignment_expression "uVar1 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) (if_statement "if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }" if (parenthesized_expression "(((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2)))" ( (binary_expression "((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))" (parenthesized_expression "((uint)param_1[3] < uVar1 + uVar2)" ( (binary_expression "(uint)param_1[3] < uVar1 + uVar2" (cast_expression "(uint)param_1[3]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_1[3]" identifier [ number_literal ])) < (binary_expression "uVar1 + uVar2" identifier + identifier)) )) || (parenthesized_expression "(CARRY4(uVar1,uVar2))" ( (call_expression "CARRY4(uVar1,uVar2)" identifier (argument_list "(uVar1,uVar2)" ( identifier , identifier ))) ))) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (if_statement "if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }" { (expression_statement "iVar3 = param_1[3] - uVar2;" (assignment_expression "iVar3 = param_1[3] - uVar2" identifier = (binary_expression "param_1[3] - uVar2" (subscript_expression "param_1[3]" identifier [ number_literal ]) - identifier)) ;) (expression_statement "param_1[3] = iVar3;" (assignment_expression "param_1[3] = iVar3" (subscript_expression "param_1[3]" identifier [ number_literal ]) = identifier) ;) (return_statement "return *param_1 + iVar3;" return (binary_expression "*param_1 + iVar3" (pointer_expression "*param_1" * identifier) + identifier) ;) })) (expression_statement "param_1[2] = uVar1 + uVar2;" (assignment_expression "param_1[2] = uVar1 + uVar2" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "uVar1 + uVar2" identifier + identifier)) ;) (expression_statement "iVar3 = uVar1 + *param_1;" (assignment_expression "iVar3 = uVar1 + *param_1" identifier = (binary_expression "uVar1 + *param_1" identifier + (pointer_expression "*param_1" * identifier))) ;) })) (return_statement "return iVar3;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT + LIT) & LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != LIT) )) || (parenthesized_expression ( (comma_expression (assignment_expression IDENT = LIT) , (binary_expression IDENT == LIT)) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) < (binary_expression IDENT + IDENT)) )) || (parenthesized_expression ( (call_expression IDENT (argument_list ( IDENT , IDENT ))) ))) )) (compound_statement { (return_statement return LIT ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) - IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (return_statement return (binary_expression (pointer_expression * IDENT) + IDENT) ;) })) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + (pointer_expression * IDENT))) ;) })) (return_statement return IDENT ;) })))
(function_definition "int FUN_00020ee0(int *param_1,int param_2,int param_3)\n\n{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  uVar2 = param_2 + 7U & 0xfffffff8;\n  if ((uVar2 != 0) || (iVar3 = 0, param_2 == 0)) {\n    uVar1 = param_1[2];\n    if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }\n    if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }\n    param_1[2] = uVar1 + uVar2;\n    iVar3 = uVar1 + *param_1;\n  }\n  return iVar3;\n}" (primitive_type "int") (function_declarator "FUN_00020ee0(int *param_1,int param_2,int param_3)" (identifier "FUN_00020ee0") (parameter_list "(int *param_1,int param_2,int param_3)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  uVar2 = param_2 + 7U & 0xfffffff8;\n  if ((uVar2 != 0) || (iVar3 = 0, param_2 == 0)) {\n    uVar1 = param_1[2];\n    if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }\n    if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }\n    param_1[2] = uVar1 + uVar2;\n    iVar3 = uVar1 + *param_1;\n  }\n  return iVar3;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (expression_statement "uVar2 = param_2 + 7U & 0xfffffff8;" (assignment_expression "uVar2 = param_2 + 7U & 0xfffffff8" (identifier "uVar2") (= "=") (binary_expression "param_2 + 7U & 0xfffffff8" (binary_expression "param_2 + 7U" (identifier "param_2") (+ "+") (number_literal "7U")) (& "&") (number_literal "0xfffffff8"))) (; ";")) (if_statement "if ((uVar2 != 0) || (iVar3 = 0, param_2 == 0)) {\n    uVar1 = param_1[2];\n    if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }\n    if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }\n    param_1[2] = uVar1 + uVar2;\n    iVar3 = uVar1 + *param_1;\n  }" (if "if") (parenthesized_expression "((uVar2 != 0) || (iVar3 = 0, param_2 == 0))" (( "(") (binary_expression "(uVar2 != 0) || (iVar3 = 0, param_2 == 0)" (parenthesized_expression "(uVar2 != 0)" (( "(") (binary_expression "uVar2 != 0" (identifier "uVar2") (!= "!=") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(iVar3 = 0, param_2 == 0)" (( "(") (comma_expression "iVar3 = 0, param_2 == 0" (assignment_expression "iVar3 = 0" (identifier "iVar3") (= "=") (number_literal "0")) (, ",") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0"))) () ")"))) () ")")) (compound_statement "{\n    uVar1 = param_1[2];\n    if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }\n    if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }\n    param_1[2] = uVar1 + uVar2;\n    iVar3 = uVar1 + *param_1;\n  }" ({ "{") (expression_statement "uVar1 = param_1[2];" (assignment_expression "uVar1 = param_1[2]" (identifier "uVar1") (= "=") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (if_statement "if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {\n      return 0;\n    }" (if "if") (parenthesized_expression "(((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2)))" (( "(") (binary_expression "((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))" (parenthesized_expression "((uint)param_1[3] < uVar1 + uVar2)" (( "(") (binary_expression "(uint)param_1[3] < uVar1 + uVar2" (cast_expression "(uint)param_1[3]" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) (< "<") (binary_expression "uVar1 + uVar2" (identifier "uVar1") (+ "+") (identifier "uVar2"))) () ")")) (|| "||") (parenthesized_expression "(CARRY4(uVar1,uVar2))" (( "(") (call_expression "CARRY4(uVar1,uVar2)" (identifier "CARRY4") (argument_list "(uVar1,uVar2)" (( "(") (identifier "uVar1") (, ",") (identifier "uVar2") () ")"))) () ")"))) () ")")) (compound_statement "{\n      return 0;\n    }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (if_statement "if (param_3 == 1) {\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }" (if "if") (parenthesized_expression "(param_3 == 1)" (( "(") (binary_expression "param_3 == 1" (identifier "param_3") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n      iVar3 = param_1[3] - uVar2;\n      param_1[3] = iVar3;\n      return *param_1 + iVar3;\n    }" ({ "{") (expression_statement "iVar3 = param_1[3] - uVar2;" (assignment_expression "iVar3 = param_1[3] - uVar2" (identifier "iVar3") (= "=") (binary_expression "param_1[3] - uVar2" (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]")) (- "-") (identifier "uVar2"))) (; ";")) (expression_statement "param_1[3] = iVar3;" (assignment_expression "param_1[3] = iVar3" (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]")) (= "=") (identifier "iVar3")) (; ";")) (return_statement "return *param_1 + iVar3;" (return "return") (binary_expression "*param_1 + iVar3" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (identifier "iVar3")) (; ";")) (} "}"))) (expression_statement "param_1[2] = uVar1 + uVar2;" (assignment_expression "param_1[2] = uVar1 + uVar2" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (binary_expression "uVar1 + uVar2" (identifier "uVar1") (+ "+") (identifier "uVar2"))) (; ";")) (expression_statement "iVar3 = uVar1 + *param_1;" (assignment_expression "iVar3 = uVar1 + *param_1" (identifier "iVar3") (= "=") (binary_expression "uVar1 + *param_1" (identifier "uVar1") (+ "+") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}"))) (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}")))

void * function_1(type_1 *pool,size_t var_1,int var_5)

{
  type_2 var_3;
  type_2 var_2;
  char *pcVar3;
  size_t var_6;
  
  var_2 = var_1 + 7 & 0xfffffff8;
  if ((var_2 != 0) || (pcVar3 = (char *)0x0, var_1 == 0)) {
    var_3 = pool->pos;
    if ((pool->end < var_3 + var_2) || (var_4(var_3,var_2))) {
      return (void *)0x0;
    }
    if (var_5 == 1) {
      var_6 = pool->end - var_2;
      pool->end = var_6;
      return pool->memory + var_6;
    }
    pool->pos = var_3 + var_2;
    pcVar3 = pool->memory + var_3;
  }
  return pcVar3;
}


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

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

{
  uint uVar1;
  uint uVar2;
  int iVar3;
  
  uVar2 = param_2 + 7U & 0xfffffff8;
  if ((uVar2 != 0) || (iVar3 = 0, param_2 == 0)) {
    uVar1 = param_1[2];
    if (((uint)param_1[3] < uVar1 + uVar2) || (CARRY4(uVar1,uVar2))) {
      return 0;
    }
    if (param_3 == 1) {
      iVar3 = param_1[3] - uVar2;
      param_1[3] = iVar3;
      return *param_1 + iVar3;
    }
    param_1[2] = uVar1 + uVar2;
    iVar3 = uVar1 + *param_1;
  }
  return iVar3;
}

