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

void * ResizeMagickMemory(void *memory,size_t size)

{
  void *pvVar1;
  
  if (memory == (void *)0x0) {
    pvVar1 = AcquireMagickMemory(size);
    return pvVar1;
  }
  if (size == 0) {
    size = 1;
  }
  pvVar1 = (*memory_methods.resize_memory_handler)(memory,size);
  if (pvVar1 != (void *)0x0) {
    return pvVar1;
  }
  RelinquishMagickMemory(memory);
  return (void *)0x0;
}



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

int ResizeMagickMemory(int param_1,int param_2)

{
  int iVar1;
  
  if (param_1 == 0) {
    iVar1 = AcquireMagickMemory(param_2);
    return iVar1;
  }
  if (param_2 == 0) {
    param_2 = 1;
  }
  iVar1 = (*(code *)PTR_realloc_0041ff04)(param_1,param_2);
  if (iVar1 != 0) {
    return iVar1;
  }
  RelinquishMagickMemory(param_1);
  return 0;
}


PUSH EDI
PUSH ESI
PUSH EBX
MOV ESI,dword ptr [ESP + 0x10]
CALL 0x00039d70
ADD EBX,0x30fd54
MOV EAX,dword ptr [ESP + 0x14]
TEST ESI,ESI
JZ 0x0010e2f8
TEST EAX,EAX
MOV EDX,0x1
CMOVZ EAX,EDX
SUB ESP,0x8
PUSH EAX
PUSH ESI
CALL dword ptr [EBX + 0x1f04]
ADD ESP,0x10
MOV EDI,EAX
TEST EAX,EAX
JZ 0x0010e2e0
MOV EAX,EDI
POP EBX
POP ESI
POP EDI
RET
SUB ESP,0xc
PUSH ESI
CALL 0x00033ac8
ADD ESP,0x10
MOV EAX,EDI
POP EBX
POP ESI
POP EDI
RET
SUB ESP,0xc
PUSH EAX
CALL 0x00030900
ADD ESP,0x10
MOV EDI,EAX
POP EBX
MOV EAX,EDI
POP ESI
POP EDI
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint ResizeMagickMemory(int param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_1 == 0) {\n    iVar1 = AcquireMagickMemory(param_2);\n    return iVar1;\n  }\n  if (param_2 == 0) {\n    param_2 = 1;\n  }\n  iVar1 = (*(code *)PTR_realloc_0041ff04)(param_1,param_2);\n  if (iVar1 != 0) {\n    return iVar1;\n  }\n  RelinquishMagickMemory(param_1);\n  return 0;\n}\n\n" comment (function_definition "int ResizeMagickMemory(int param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_1 == 0) {\n    iVar1 = AcquireMagickMemory(param_2);\n    return iVar1;\n  }\n  if (param_2 == 0) {\n    param_2 = 1;\n  }\n  iVar1 = (*(code *)PTR_realloc_0041ff04)(param_1,param_2);\n  if (iVar1 != 0) {\n    return iVar1;\n  }\n  RelinquishMagickMemory(param_1);\n  return 0;\n}" primitive_type (function_declarator "ResizeMagickMemory(int param_1,int param_2)" identifier (parameter_list "(int param_1,int param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  if (param_1 == 0) {\n    iVar1 = AcquireMagickMemory(param_2);\n    return iVar1;\n  }\n  if (param_2 == 0) {\n    param_2 = 1;\n  }\n  iVar1 = (*(code *)PTR_realloc_0041ff04)(param_1,param_2);\n  if (iVar1 != 0) {\n    return iVar1;\n  }\n  RelinquishMagickMemory(param_1);\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if (param_1 == 0) {\n    iVar1 = AcquireMagickMemory(param_2);\n    return iVar1;\n  }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar1 = AcquireMagickMemory(param_2);\n    return iVar1;\n  }" { (expression_statement "iVar1 = AcquireMagickMemory(param_2);" (assignment_expression "iVar1 = AcquireMagickMemory(param_2)" identifier = (call_expression "AcquireMagickMemory(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (return_statement "return iVar1;" return identifier ;) })) (if_statement "if (param_2 == 0) {\n    param_2 = 1;\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    param_2 = 1;\n  }" { (expression_statement "param_2 = 1;" (assignment_expression "param_2 = 1" identifier = number_literal) ;) })) (expression_statement "iVar1 = (*(code *)PTR_realloc_0041ff04)(param_1,param_2);" (assignment_expression "iVar1 = (*(code *)PTR_realloc_0041ff04)(param_1,param_2)" identifier = (call_expression "(*(code *)PTR_realloc_0041ff04)(param_1,param_2)" (parenthesized_expression "(*(code *)PTR_realloc_0041ff04)" ( (pointer_expression "*(code *)PTR_realloc_0041ff04" * (cast_expression "(code *)PTR_realloc_0041ff04" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,param_2)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n    return iVar1;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    return iVar1;\n  }" { (return_statement "return iVar1;" return identifier ;) })) (expression_statement "RelinquishMagickMemory(param_1);" (call_expression "RelinquishMagickMemory(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid * ResizeMagickMemory(void *memory,size_t size)\n\n{\n  void *pvVar1;\n  \n  if (memory == (void *)0x0) {\n    pvVar1 = AcquireMagickMemory(size);\n    return pvVar1;\n  }\n  if (size == 0) {\n    size = 1;\n  }\n  pvVar1 = (*memory_methods.resize_memory_handler)(memory,size);\n  if (pvVar1 != (void *)0x0) {\n    return pvVar1;\n  }\n  RelinquishMagickMemory(memory);\n  return (void *)0x0;\n}\n\n" comment (function_definition "void * ResizeMagickMemory(void *memory,size_t size)\n\n{\n  void *pvVar1;\n  \n  if (memory == (void *)0x0) {\n    pvVar1 = AcquireMagickMemory(size);\n    return pvVar1;\n  }\n  if (size == 0) {\n    size = 1;\n  }\n  pvVar1 = (*memory_methods.resize_memory_handler)(memory,size);\n  if (pvVar1 != (void *)0x0) {\n    return pvVar1;\n  }\n  RelinquishMagickMemory(memory);\n  return (void *)0x0;\n}" primitive_type (pointer_declarator "* ResizeMagickMemory(void *memory,size_t size)" * (function_declarator "ResizeMagickMemory(void *memory,size_t size)" identifier (parameter_list "(void *memory,size_t size)" ( (parameter_declaration "void *memory" primitive_type (pointer_declarator "*memory" * identifier)) , (parameter_declaration "size_t size" primitive_type identifier) )))) (compound_statement "{\n  void *pvVar1;\n  \n  if (memory == (void *)0x0) {\n    pvVar1 = AcquireMagickMemory(size);\n    return pvVar1;\n  }\n  if (size == 0) {\n    size = 1;\n  }\n  pvVar1 = (*memory_methods.resize_memory_handler)(memory,size);\n  if (pvVar1 != (void *)0x0) {\n    return pvVar1;\n  }\n  RelinquishMagickMemory(memory);\n  return (void *)0x0;\n}" { (declaration "void *pvVar1;" primitive_type (pointer_declarator "*pvVar1" * identifier) ;) (if_statement "if (memory == (void *)0x0) {\n    pvVar1 = AcquireMagickMemory(size);\n    return pvVar1;\n  }" if (parenthesized_expression "(memory == (void *)0x0)" ( (binary_expression "memory == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    pvVar1 = AcquireMagickMemory(size);\n    return pvVar1;\n  }" { (expression_statement "pvVar1 = AcquireMagickMemory(size);" (assignment_expression "pvVar1 = AcquireMagickMemory(size)" identifier = (call_expression "AcquireMagickMemory(size)" identifier (argument_list "(size)" ( identifier )))) ;) (return_statement "return pvVar1;" return identifier ;) })) (if_statement "if (size == 0) {\n    size = 1;\n  }" if (parenthesized_expression "(size == 0)" ( (binary_expression "size == 0" identifier == number_literal) )) (compound_statement "{\n    size = 1;\n  }" { (expression_statement "size = 1;" (assignment_expression "size = 1" identifier = number_literal) ;) })) (expression_statement "pvVar1 = (*memory_methods.resize_memory_handler)(memory,size);" (assignment_expression "pvVar1 = (*memory_methods.resize_memory_handler)(memory,size)" identifier = (call_expression "(*memory_methods.resize_memory_handler)(memory,size)" (parenthesized_expression "(*memory_methods.resize_memory_handler)" ( (pointer_expression "*memory_methods.resize_memory_handler" * (field_expression "memory_methods.resize_memory_handler" identifier . field_identifier)) )) (argument_list "(memory,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 ;) })) (expression_statement "RelinquishMagickMemory(memory);" (call_expression "RelinquishMagickMemory(memory)" identifier (argument_list "(memory)" ( identifier ))) ;) (return_statement "return (void *)0x0;" return (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "int ResizeMagickMemory(int param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_1 == 0) {\n    iVar1 = AcquireMagickMemory(param_2);\n    return iVar1;\n  }\n  if (param_2 == 0) {\n    param_2 = 1;\n  }\n  iVar1 = (*(code *)PTR_realloc_0041ff04)(param_1,param_2);\n  if (iVar1 != 0) {\n    return iVar1;\n  }\n  RelinquishMagickMemory(param_1);\n  return 0;\n}\n\n" (function_definition "int ResizeMagickMemory(int param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_1 == 0) {\n    iVar1 = AcquireMagickMemory(param_2);\n    return iVar1;\n  }\n  if (param_2 == 0) {\n    param_2 = 1;\n  }\n  iVar1 = (*(code *)PTR_realloc_0041ff04)(param_1,param_2);\n  if (iVar1 != 0) {\n    return iVar1;\n  }\n  RelinquishMagickMemory(param_1);\n  return 0;\n}" primitive_type (function_declarator "ResizeMagickMemory(int param_1,int param_2)" identifier (parameter_list "(int param_1,int param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  if (param_1 == 0) {\n    iVar1 = AcquireMagickMemory(param_2);\n    return iVar1;\n  }\n  if (param_2 == 0) {\n    param_2 = 1;\n  }\n  iVar1 = (*(code *)PTR_realloc_0041ff04)(param_1,param_2);\n  if (iVar1 != 0) {\n    return iVar1;\n  }\n  RelinquishMagickMemory(param_1);\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if (param_1 == 0) {\n    iVar1 = AcquireMagickMemory(param_2);\n    return iVar1;\n  }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar1 = AcquireMagickMemory(param_2);\n    return iVar1;\n  }" { (expression_statement "iVar1 = AcquireMagickMemory(param_2);" (assignment_expression "iVar1 = AcquireMagickMemory(param_2)" identifier = (call_expression "AcquireMagickMemory(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (return_statement "return iVar1;" return identifier ;) })) (if_statement "if (param_2 == 0) {\n    param_2 = 1;\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    param_2 = 1;\n  }" { (expression_statement "param_2 = 1;" (assignment_expression "param_2 = 1" identifier = number_literal) ;) })) (expression_statement "iVar1 = (*(code *)PTR_realloc_0041ff04)(param_1,param_2);" (assignment_expression "iVar1 = (*(code *)PTR_realloc_0041ff04)(param_1,param_2)" identifier = (call_expression "(*(code *)PTR_realloc_0041ff04)(param_1,param_2)" (parenthesized_expression "(*(code *)PTR_realloc_0041ff04)" ( (pointer_expression "*(code *)PTR_realloc_0041ff04" * (cast_expression "(code *)PTR_realloc_0041ff04" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,param_2)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n    return iVar1;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    return iVar1;\n  }" { (return_statement "return iVar1;" return identifier ;) })) (expression_statement "RelinquishMagickMemory(param_1);" (call_expression "RelinquishMagickMemory(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (return_statement return IDENT ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return LIT ;) })))
(function_definition "int ResizeMagickMemory(int param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_1 == 0) {\n    iVar1 = AcquireMagickMemory(param_2);\n    return iVar1;\n  }\n  if (param_2 == 0) {\n    param_2 = 1;\n  }\n  iVar1 = (*(code *)PTR_realloc_0041ff04)(param_1,param_2);\n  if (iVar1 != 0) {\n    return iVar1;\n  }\n  RelinquishMagickMemory(param_1);\n  return 0;\n}" (primitive_type "int") (function_declarator "ResizeMagickMemory(int param_1,int param_2)" (identifier "ResizeMagickMemory") (parameter_list "(int param_1,int param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  \n  if (param_1 == 0) {\n    iVar1 = AcquireMagickMemory(param_2);\n    return iVar1;\n  }\n  if (param_2 == 0) {\n    param_2 = 1;\n  }\n  iVar1 = (*(code *)PTR_realloc_0041ff04)(param_1,param_2);\n  if (iVar1 != 0) {\n    return iVar1;\n  }\n  RelinquishMagickMemory(param_1);\n  return 0;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (if_statement "if (param_1 == 0) {\n    iVar1 = AcquireMagickMemory(param_2);\n    return iVar1;\n  }" (if "if") (parenthesized_expression "(param_1 == 0)" (( "(") (binary_expression "param_1 == 0" (identifier "param_1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    iVar1 = AcquireMagickMemory(param_2);\n    return iVar1;\n  }" ({ "{") (expression_statement "iVar1 = AcquireMagickMemory(param_2);" (assignment_expression "iVar1 = AcquireMagickMemory(param_2)" (identifier "iVar1") (= "=") (call_expression "AcquireMagickMemory(param_2)" (identifier "AcquireMagickMemory") (argument_list "(param_2)" (( "(") (identifier "param_2") () ")")))) (; ";")) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (if_statement "if (param_2 == 0) {\n    param_2 = 1;\n  }" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    param_2 = 1;\n  }" ({ "{") (expression_statement "param_2 = 1;" (assignment_expression "param_2 = 1" (identifier "param_2") (= "=") (number_literal "1")) (; ";")) (} "}"))) (expression_statement "iVar1 = (*(code *)PTR_realloc_0041ff04)(param_1,param_2);" (assignment_expression "iVar1 = (*(code *)PTR_realloc_0041ff04)(param_1,param_2)" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_realloc_0041ff04)(param_1,param_2)" (parenthesized_expression "(*(code *)PTR_realloc_0041ff04)" (( "(") (pointer_expression "*(code *)PTR_realloc_0041ff04" (* "*") (cast_expression "(code *)PTR_realloc_0041ff04" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_realloc_0041ff04"))) () ")")) (argument_list "(param_1,param_2)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n    return iVar1;\n  }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    return iVar1;\n  }" ({ "{") (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (expression_statement "RelinquishMagickMemory(param_1);" (call_expression "RelinquishMagickMemory(param_1)" (identifier "RelinquishMagickMemory") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

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

void * function_1(void *var_1,size_t var_3)

{
  void *var_4;
  
  if (var_1 == (void *)0x0) {
    var_4 = var_2(var_3);
    return var_4;
  }
  if (var_3 == 0) {
    var_3 = 1;
  }
  var_4 = (*memory_methods.resize_memory_handler)(var_1,var_3);
  if (var_4 != (void *)0x0) {
    return var_4;
  }
  var_5(var_1);
  return (void *)0x0;
}


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

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

int MASKED(int param_1,int param_2)

{
  int iVar1;
  
  if (param_1 == 0) {
    iVar1 = AcquireMagickMemory(param_2);
    return iVar1;
  }
  if (param_2 == 0) {
    param_2 = 1;
  }
  iVar1 = (*(code *)PTR_realloc_0041ff04)(param_1,param_2);
  if (iVar1 != 0) {
    return iVar1;
  }
  RelinquishMagickMemory(param_1);
  return 0;
}

