
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Enum "ChannelType": Some values do not have unique names */
/* WARNING: Enum "PixelChannel": Some values do not have unique names */
/* WARNING: Enum "GravityType": Some values do not have unique names */
/* WARNING: Enum "DisposeType": Some values do not have unique names */
/* WARNING: Enum "ExceptionType": Some values do not have unique names */

MagickBooleanType __regparm3 OpenPixelCacheOnDisk(CacheInfo *cache_info,MapMode mode)

{
  char *path;
  int iVar1;
  
  if ((cache_info->file != -1) && (cache_info->disk_mode == mode)) {
    return MagickTrue;
  }
  path = cache_info->cache_filename;
  if (cache_info->cache_filename[0] == '\0') {
    iVar1 = AcquireUniqueFileResource(path);
  }
  else if (mode == ReadMode) {
    iVar1 = open64(path,0,0);
  }
  else if (mode == WriteMode) {
    iVar1 = open64(path,0xc1,0x180);
    if (iVar1 != -1) goto LAB_0004cdcd;
    iVar1 = open64(path,1,0x180);
  }
  else {
    iVar1 = open64(path,0xc2,0x180);
    if (iVar1 != -1) goto LAB_0004cdcd;
    iVar1 = open64(path,2,0x180);
  }
  if (iVar1 == -1) {
    return MagickFalse;
  }
LAB_0004cdcd:
  AcquireMagickResource(FileResource,1);
  if (cache_info->file != -1) {
    ClosePixelCacheOnDisk((CacheInfo *)&cache_info->file);
  }
  cache_info->file = iVar1;
  cache_info->disk_mode = mode;
  return MagickTrue;
}



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

undefined4 __regparm3 FUN_0004cd50(int param_1,int param_2)

{
  char *__file;
  int iVar1;
  
  if ((*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2)) {
    return 1;
  }
  __file = (char *)(param_1 + 0x13a8);
  if (*(char *)(param_1 + 0x13a8) == '\0') {
    iVar1 = AcquireUniqueFileResource(__file);
  }
  else if (param_2 == 0) {
    iVar1 = open64(__file,0,0);
  }
  else if (param_2 == 1) {
    iVar1 = open64(__file,0xc1,0x180);
    if (iVar1 != -1) goto LAB_0004cdcd;
    iVar1 = open64(__file,1,0x180);
  }
  else {
    iVar1 = open64(__file,0xc2,0x180);
    if (iVar1 != -1) goto LAB_0004cdcd;
    iVar1 = open64(__file,2,0x180);
  }
  if (iVar1 == -1) {
    return 0;
  }
LAB_0004cdcd:
  AcquireMagickResource(3,1,0);
  if (*(int *)(param_1 + 0x3a4) != -1) {
    FUN_0004cb50();
  }
  *(int *)(param_1 + 0x3a4) = iVar1;
  *(int *)(param_1 + 0x328) = param_2;
  return 1;
}


PUSH EBP
PUSH EDI
PUSH ESI
MOV ESI,EAX
PUSH EBX
CALL 0x00038830
ADD EBX,0x38c2a5
SUB ESP,0x1c
CMP dword ptr [EAX + 0x3a4],-0x1
JZ 0x0004cd7e
MOV EAX,0x1
CMP dword ptr [ESI + 0x328],EDX
JZ 0x0004ce03
CMP byte ptr [ESI + 0x13a8],0x0
MOV EDI,EDX
LEA EDX,[ESI + 0x13a8]
JZ 0x0004ce10
TEST EDI,EDI
JZ 0x0004ce70
CMP EDI,0x1
JNZ 0x0004ce30
SUB ESP,0x4
PUSH 0x180
PUSH 0xc1
PUSH EDX
MOV dword ptr [ESP + 0x1c],EDX
CALL 0x000332b0
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0xc]
CMP EAX,-0x1
MOV EBP,EAX
JZ 0x0004ce88
SUB ESP,0x4
PUSH 0x0
PUSH 0x1
PUSH 0x3
CALL 0x00030be0
ADD ESP,0x10
CMP dword ptr [ESI + 0x3a4],-0x1
JZ 0x0004cdf2
LEA EAX,[ESI + 0x3a4]
CALL 0x0004cb50
MOV dword ptr [ESI + 0x3a4],EBP
MOV EAX,0x1
MOV dword ptr [ESI + 0x328],EDI
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH EDX
CALL 0x000331d0
ADD ESP,0x10
MOV EBP,EAX
XOR EAX,EAX
CMP EBP,-0x1
JNZ 0x0004cdcd
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0x4
PUSH 0x180
PUSH 0xc2
PUSH EDX
MOV dword ptr [ESP + 0x1c],EDX
CALL 0x000332b0
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0xc]
CMP EAX,-0x1
MOV EBP,EAX
JNZ 0x0004cdcd
SUB ESP,0x4
PUSH 0x180
PUSH 0x2
PUSH EDX
CALL 0x000332b0
ADD ESP,0x10
MOV EBP,EAX
JMP 0x0004ce1e
SUB ESP,0x4
PUSH 0x0
PUSH 0x0
PUSH EDX
CALL 0x000332b0
ADD ESP,0x10
MOV EBP,EAX
JMP 0x0004ce1e
SUB ESP,0x4
PUSH 0x180
PUSH 0x1
PUSH EDX
CALL 0x000332b0
ADD ESP,0x10
MOV EBP,EAX
JMP 0x0004ce1e
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 __regparm3 FUN_0004cd50(int param_1,int param_2)\n\n{\n  char *__file;\n  int iVar1;\n  \n  if ((*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2)) {\n    return 1;\n  }\n  __file = (char *)(param_1 + 0x13a8);\n  if (*(char *)(param_1 + 0x13a8) == '\0') {\n    iVar1 = AcquireUniqueFileResource(__file);\n  }\n  else if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }\n  if (iVar1 == -1) {\n    return 0;\n  }\nLAB_0004cdcd:\n  AcquireMagickResource(3,1,0);\n  if (*(int *)(param_1 + 0x3a4) != -1) {\n    FUN_0004cb50();\n  }\n  *(int *)(param_1 + 0x3a4) = iVar1;\n  *(int *)(param_1 + 0x328) = param_2;\n  return 1;\n}\n\n" comment (function_definition "undefined4 __regparm3 FUN_0004cd50(int param_1,int param_2)\n\n{\n  char *__file;\n  int iVar1;\n  \n  if ((*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2)) {\n    return 1;\n  }\n  __file = (char *)(param_1 + 0x13a8);\n  if (*(char *)(param_1 + 0x13a8) == '\0') {\n    iVar1 = AcquireUniqueFileResource(__file);\n  }\n  else if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }\n  if (iVar1 == -1) {\n    return 0;\n  }\nLAB_0004cdcd:\n  AcquireMagickResource(3,1,0);\n  if (*(int *)(param_1 + 0x3a4) != -1) {\n    FUN_0004cb50();\n  }\n  *(int *)(param_1 + 0x3a4) = iVar1;\n  *(int *)(param_1 + 0x328) = param_2;\n  return 1;\n}" type_identifier (ERROR "__regparm3" identifier) (function_declarator "FUN_0004cd50(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  char *__file;\n  int iVar1;\n  \n  if ((*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2)) {\n    return 1;\n  }\n  __file = (char *)(param_1 + 0x13a8);\n  if (*(char *)(param_1 + 0x13a8) == '\0') {\n    iVar1 = AcquireUniqueFileResource(__file);\n  }\n  else if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }\n  if (iVar1 == -1) {\n    return 0;\n  }\nLAB_0004cdcd:\n  AcquireMagickResource(3,1,0);\n  if (*(int *)(param_1 + 0x3a4) != -1) {\n    FUN_0004cb50();\n  }\n  *(int *)(param_1 + 0x3a4) = iVar1;\n  *(int *)(param_1 + 0x328) = param_2;\n  return 1;\n}" { (declaration "char *__file;" primitive_type (pointer_declarator "*__file" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if ((*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2)) {\n    return 1;\n  }" if (parenthesized_expression "((*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2))" ( (binary_expression "(*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2)" (parenthesized_expression "(*(int *)(param_1 + 0x3a4) != -1)" ( (binary_expression "*(int *)(param_1 + 0x3a4) != -1" (pointer_expression "*(int *)(param_1 + 0x3a4)" * (cast_expression "(int *)(param_1 + 0x3a4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x3a4)" ( (binary_expression "param_1 + 0x3a4" identifier + number_literal) )))) != number_literal) )) && (parenthesized_expression "(*(int *)(param_1 + 0x328) == param_2)" ( (binary_expression "*(int *)(param_1 + 0x328) == param_2" (pointer_expression "*(int *)(param_1 + 0x328)" * (cast_expression "(int *)(param_1 + 0x328)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x328)" ( (binary_expression "param_1 + 0x328" identifier + number_literal) )))) == identifier) ))) )) (compound_statement "{\n    return 1;\n  }" { (return_statement "return 1;" return number_literal ;) })) (expression_statement "__file = (char *)(param_1 + 0x13a8);" (assignment_expression "__file = (char *)(param_1 + 0x13a8)" identifier = (cast_expression "(char *)(param_1 + 0x13a8)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x13a8)" ( (binary_expression "param_1 + 0x13a8" identifier + number_literal) )))) ;) (if_statement "if (*(char *)(param_1 + 0x13a8) == '\0') {\n    iVar1 = AcquireUniqueFileResource(__file);\n  }\n  else if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" if (parenthesized_expression "(*(char *)(param_1 + 0x13a8) == '\0')" ( (binary_expression "*(char *)(param_1 + 0x13a8) == '\0'" (pointer_expression "*(char *)(param_1 + 0x13a8)" * (cast_expression "(char *)(param_1 + 0x13a8)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x13a8)" ( (binary_expression "param_1 + 0x13a8" identifier + number_literal) )))) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    iVar1 = AcquireUniqueFileResource(__file);\n  }" { (expression_statement "iVar1 = AcquireUniqueFileResource(__file);" (assignment_expression "iVar1 = AcquireUniqueFileResource(__file)" identifier = (call_expression "AcquireUniqueFileResource(__file)" identifier (argument_list "(__file)" ( identifier )))) ;) }) (else_clause "else if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" else (if_statement "if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar1 = open64(__file,0,0);\n  }" { (expression_statement "iVar1 = open64(__file,0,0);" (assignment_expression "iVar1 = open64(__file,0,0)" identifier = (call_expression "open64(__file,0,0)" identifier (argument_list "(__file,0,0)" ( identifier , number_literal , number_literal )))) ;) }) (else_clause "else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" else (if_statement "if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }" { (expression_statement "iVar1 = open64(__file,0xc1,0x180);" (assignment_expression "iVar1 = open64(__file,0xc1,0x180)" identifier = (call_expression "open64(__file,0xc1,0x180)" identifier (argument_list "(__file,0xc1,0x180)" ( identifier , number_literal , number_literal )))) ;) (if_statement "if (iVar1 != -1) goto LAB_0004cdcd;" if (parenthesized_expression "(iVar1 != -1)" ( (binary_expression "iVar1 != -1" identifier != number_literal) )) (goto_statement "goto LAB_0004cdcd;" goto statement_identifier ;)) (expression_statement "iVar1 = open64(__file,1,0x180);" (assignment_expression "iVar1 = open64(__file,1,0x180)" identifier = (call_expression "open64(__file,1,0x180)" identifier (argument_list "(__file,1,0x180)" ( identifier , number_literal , number_literal )))) ;) }) (else_clause "else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" else (compound_statement "{\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" { (expression_statement "iVar1 = open64(__file,0xc2,0x180);" (assignment_expression "iVar1 = open64(__file,0xc2,0x180)" identifier = (call_expression "open64(__file,0xc2,0x180)" identifier (argument_list "(__file,0xc2,0x180)" ( identifier , number_literal , number_literal )))) ;) (if_statement "if (iVar1 != -1) goto LAB_0004cdcd;" if (parenthesized_expression "(iVar1 != -1)" ( (binary_expression "iVar1 != -1" identifier != number_literal) )) (goto_statement "goto LAB_0004cdcd;" goto statement_identifier ;)) (expression_statement "iVar1 = open64(__file,2,0x180);" (assignment_expression "iVar1 = open64(__file,2,0x180)" identifier = (call_expression "open64(__file,2,0x180)" identifier (argument_list "(__file,2,0x180)" ( identifier , number_literal , number_literal )))) ;) }))))))) (if_statement "if (iVar1 == -1) {\n    return 0;\n  }" if (parenthesized_expression "(iVar1 == -1)" ( (binary_expression "iVar1 == -1" identifier == number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (labeled_statement "LAB_0004cdcd:\n  AcquireMagickResource(3,1,0);" statement_identifier : (expression_statement "AcquireMagickResource(3,1,0);" (call_expression "AcquireMagickResource(3,1,0)" identifier (argument_list "(3,1,0)" ( number_literal , number_literal , number_literal ))) ;)) (if_statement "if (*(int *)(param_1 + 0x3a4) != -1) {\n    FUN_0004cb50();\n  }" if (parenthesized_expression "(*(int *)(param_1 + 0x3a4) != -1)" ( (binary_expression "*(int *)(param_1 + 0x3a4) != -1" (pointer_expression "*(int *)(param_1 + 0x3a4)" * (cast_expression "(int *)(param_1 + 0x3a4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x3a4)" ( (binary_expression "param_1 + 0x3a4" identifier + number_literal) )))) != number_literal) )) (compound_statement "{\n    FUN_0004cb50();\n  }" { (expression_statement "FUN_0004cb50();" (call_expression "FUN_0004cb50()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "*(int *)(param_1 + 0x3a4) = iVar1;" (assignment_expression "*(int *)(param_1 + 0x3a4) = iVar1" (pointer_expression "*(int *)(param_1 + 0x3a4)" * (cast_expression "(int *)(param_1 + 0x3a4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x3a4)" ( (binary_expression "param_1 + 0x3a4" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(int *)(param_1 + 0x328) = param_2;" (assignment_expression "*(int *)(param_1 + 0x328) = param_2" (pointer_expression "*(int *)(param_1 + 0x328)" * (cast_expression "(int *)(param_1 + 0x328)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x328)" ( (binary_expression "param_1 + 0x328" identifier + number_literal) )))) = identifier) ;) (return_statement "return 1;" return number_literal ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Enum "ChannelType": Some values do not have unique names */\n/* WARNING: Enum "PixelChannel": Some values do not have unique names */\n/* WARNING: Enum "GravityType": Some values do not have unique names */\n/* WARNING: Enum "DisposeType": Some values do not have unique names */\n/* WARNING: Enum "ExceptionType": Some values do not have unique names */\n\nMagickBooleanType __regparm3 OpenPixelCacheOnDisk(CacheInfo *cache_info,MapMode mode)\n\n{\n  char *path;\n  int iVar1;\n  \n  if ((cache_info->file != -1) && (cache_info->disk_mode == mode)) {\n    return MagickTrue;\n  }\n  path = cache_info->cache_filename;\n  if (cache_info->cache_filename[0] == '\0') {\n    iVar1 = AcquireUniqueFileResource(path);\n  }\n  else if (mode == ReadMode) {\n    iVar1 = open64(path,0,0);\n  }\n  else if (mode == WriteMode) {\n    iVar1 = open64(path,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,1,0x180);\n  }\n  else {\n    iVar1 = open64(path,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,2,0x180);\n  }\n  if (iVar1 == -1) {\n    return MagickFalse;\n  }\nLAB_0004cdcd:\n  AcquireMagickResource(FileResource,1);\n  if (cache_info->file != -1) {\n    ClosePixelCacheOnDisk((CacheInfo *)&cache_info->file);\n  }\n  cache_info->file = iVar1;\n  cache_info->disk_mode = mode;\n  return MagickTrue;\n}\n\n" comment comment comment comment comment comment (function_definition "MagickBooleanType __regparm3 OpenPixelCacheOnDisk(CacheInfo *cache_info,MapMode mode)\n\n{\n  char *path;\n  int iVar1;\n  \n  if ((cache_info->file != -1) && (cache_info->disk_mode == mode)) {\n    return MagickTrue;\n  }\n  path = cache_info->cache_filename;\n  if (cache_info->cache_filename[0] == '\0') {\n    iVar1 = AcquireUniqueFileResource(path);\n  }\n  else if (mode == ReadMode) {\n    iVar1 = open64(path,0,0);\n  }\n  else if (mode == WriteMode) {\n    iVar1 = open64(path,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,1,0x180);\n  }\n  else {\n    iVar1 = open64(path,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,2,0x180);\n  }\n  if (iVar1 == -1) {\n    return MagickFalse;\n  }\nLAB_0004cdcd:\n  AcquireMagickResource(FileResource,1);\n  if (cache_info->file != -1) {\n    ClosePixelCacheOnDisk((CacheInfo *)&cache_info->file);\n  }\n  cache_info->file = iVar1;\n  cache_info->disk_mode = mode;\n  return MagickTrue;\n}" type_identifier (ERROR "__regparm3" identifier) (function_declarator "OpenPixelCacheOnDisk(CacheInfo *cache_info,MapMode mode)" identifier (parameter_list "(CacheInfo *cache_info,MapMode mode)" ( (parameter_declaration "CacheInfo *cache_info" type_identifier (pointer_declarator "*cache_info" * identifier)) , (parameter_declaration "MapMode mode" type_identifier identifier) ))) (compound_statement "{\n  char *path;\n  int iVar1;\n  \n  if ((cache_info->file != -1) && (cache_info->disk_mode == mode)) {\n    return MagickTrue;\n  }\n  path = cache_info->cache_filename;\n  if (cache_info->cache_filename[0] == '\0') {\n    iVar1 = AcquireUniqueFileResource(path);\n  }\n  else if (mode == ReadMode) {\n    iVar1 = open64(path,0,0);\n  }\n  else if (mode == WriteMode) {\n    iVar1 = open64(path,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,1,0x180);\n  }\n  else {\n    iVar1 = open64(path,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,2,0x180);\n  }\n  if (iVar1 == -1) {\n    return MagickFalse;\n  }\nLAB_0004cdcd:\n  AcquireMagickResource(FileResource,1);\n  if (cache_info->file != -1) {\n    ClosePixelCacheOnDisk((CacheInfo *)&cache_info->file);\n  }\n  cache_info->file = iVar1;\n  cache_info->disk_mode = mode;\n  return MagickTrue;\n}" { (declaration "char *path;" primitive_type (pointer_declarator "*path" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if ((cache_info->file != -1) && (cache_info->disk_mode == mode)) {\n    return MagickTrue;\n  }" if (parenthesized_expression "((cache_info->file != -1) && (cache_info->disk_mode == mode))" ( (binary_expression "(cache_info->file != -1) && (cache_info->disk_mode == mode)" (parenthesized_expression "(cache_info->file != -1)" ( (binary_expression "cache_info->file != -1" (field_expression "cache_info->file" identifier -> field_identifier) != number_literal) )) && (parenthesized_expression "(cache_info->disk_mode == mode)" ( (binary_expression "cache_info->disk_mode == mode" (field_expression "cache_info->disk_mode" identifier -> field_identifier) == identifier) ))) )) (compound_statement "{\n    return MagickTrue;\n  }" { (return_statement "return MagickTrue;" return identifier ;) })) (expression_statement "path = cache_info->cache_filename;" (assignment_expression "path = cache_info->cache_filename" identifier = (field_expression "cache_info->cache_filename" identifier -> field_identifier)) ;) (if_statement "if (cache_info->cache_filename[0] == '\0') {\n    iVar1 = AcquireUniqueFileResource(path);\n  }\n  else if (mode == ReadMode) {\n    iVar1 = open64(path,0,0);\n  }\n  else if (mode == WriteMode) {\n    iVar1 = open64(path,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,1,0x180);\n  }\n  else {\n    iVar1 = open64(path,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,2,0x180);\n  }" if (parenthesized_expression "(cache_info->cache_filename[0] == '\0')" ( (binary_expression "cache_info->cache_filename[0] == '\0'" (subscript_expression "cache_info->cache_filename[0]" (field_expression "cache_info->cache_filename" identifier -> field_identifier) [ number_literal ]) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    iVar1 = AcquireUniqueFileResource(path);\n  }" { (expression_statement "iVar1 = AcquireUniqueFileResource(path);" (assignment_expression "iVar1 = AcquireUniqueFileResource(path)" identifier = (call_expression "AcquireUniqueFileResource(path)" identifier (argument_list "(path)" ( identifier )))) ;) }) (else_clause "else if (mode == ReadMode) {\n    iVar1 = open64(path,0,0);\n  }\n  else if (mode == WriteMode) {\n    iVar1 = open64(path,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,1,0x180);\n  }\n  else {\n    iVar1 = open64(path,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,2,0x180);\n  }" else (if_statement "if (mode == ReadMode) {\n    iVar1 = open64(path,0,0);\n  }\n  else if (mode == WriteMode) {\n    iVar1 = open64(path,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,1,0x180);\n  }\n  else {\n    iVar1 = open64(path,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,2,0x180);\n  }" if (parenthesized_expression "(mode == ReadMode)" ( (binary_expression "mode == ReadMode" identifier == identifier) )) (compound_statement "{\n    iVar1 = open64(path,0,0);\n  }" { (expression_statement "iVar1 = open64(path,0,0);" (assignment_expression "iVar1 = open64(path,0,0)" identifier = (call_expression "open64(path,0,0)" identifier (argument_list "(path,0,0)" ( identifier , number_literal , number_literal )))) ;) }) (else_clause "else if (mode == WriteMode) {\n    iVar1 = open64(path,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,1,0x180);\n  }\n  else {\n    iVar1 = open64(path,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,2,0x180);\n  }" else (if_statement "if (mode == WriteMode) {\n    iVar1 = open64(path,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,1,0x180);\n  }\n  else {\n    iVar1 = open64(path,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,2,0x180);\n  }" if (parenthesized_expression "(mode == WriteMode)" ( (binary_expression "mode == WriteMode" identifier == identifier) )) (compound_statement "{\n    iVar1 = open64(path,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,1,0x180);\n  }" { (expression_statement "iVar1 = open64(path,0xc1,0x180);" (assignment_expression "iVar1 = open64(path,0xc1,0x180)" identifier = (call_expression "open64(path,0xc1,0x180)" identifier (argument_list "(path,0xc1,0x180)" ( identifier , number_literal , number_literal )))) ;) (if_statement "if (iVar1 != -1) goto LAB_0004cdcd;" if (parenthesized_expression "(iVar1 != -1)" ( (binary_expression "iVar1 != -1" identifier != number_literal) )) (goto_statement "goto LAB_0004cdcd;" goto statement_identifier ;)) (expression_statement "iVar1 = open64(path,1,0x180);" (assignment_expression "iVar1 = open64(path,1,0x180)" identifier = (call_expression "open64(path,1,0x180)" identifier (argument_list "(path,1,0x180)" ( identifier , number_literal , number_literal )))) ;) }) (else_clause "else {\n    iVar1 = open64(path,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,2,0x180);\n  }" else (compound_statement "{\n    iVar1 = open64(path,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(path,2,0x180);\n  }" { (expression_statement "iVar1 = open64(path,0xc2,0x180);" (assignment_expression "iVar1 = open64(path,0xc2,0x180)" identifier = (call_expression "open64(path,0xc2,0x180)" identifier (argument_list "(path,0xc2,0x180)" ( identifier , number_literal , number_literal )))) ;) (if_statement "if (iVar1 != -1) goto LAB_0004cdcd;" if (parenthesized_expression "(iVar1 != -1)" ( (binary_expression "iVar1 != -1" identifier != number_literal) )) (goto_statement "goto LAB_0004cdcd;" goto statement_identifier ;)) (expression_statement "iVar1 = open64(path,2,0x180);" (assignment_expression "iVar1 = open64(path,2,0x180)" identifier = (call_expression "open64(path,2,0x180)" identifier (argument_list "(path,2,0x180)" ( identifier , number_literal , number_literal )))) ;) }))))))) (if_statement "if (iVar1 == -1) {\n    return MagickFalse;\n  }" if (parenthesized_expression "(iVar1 == -1)" ( (binary_expression "iVar1 == -1" identifier == number_literal) )) (compound_statement "{\n    return MagickFalse;\n  }" { (return_statement "return MagickFalse;" return identifier ;) })) (labeled_statement "LAB_0004cdcd:\n  AcquireMagickResource(FileResource,1);" statement_identifier : (expression_statement "AcquireMagickResource(FileResource,1);" (call_expression "AcquireMagickResource(FileResource,1)" identifier (argument_list "(FileResource,1)" ( identifier , number_literal ))) ;)) (if_statement "if (cache_info->file != -1) {\n    ClosePixelCacheOnDisk((CacheInfo *)&cache_info->file);\n  }" if (parenthesized_expression "(cache_info->file != -1)" ( (binary_expression "cache_info->file != -1" (field_expression "cache_info->file" identifier -> field_identifier) != number_literal) )) (compound_statement "{\n    ClosePixelCacheOnDisk((CacheInfo *)&cache_info->file);\n  }" { (expression_statement "ClosePixelCacheOnDisk((CacheInfo *)&cache_info->file);" (call_expression "ClosePixelCacheOnDisk((CacheInfo *)&cache_info->file)" identifier (argument_list "((CacheInfo *)&cache_info->file)" ( (cast_expression "(CacheInfo *)&cache_info->file" ( (type_descriptor "CacheInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&cache_info->file" & (field_expression "cache_info->file" identifier -> field_identifier))) ))) ;) })) (expression_statement "cache_info->file = iVar1;" (assignment_expression "cache_info->file = iVar1" (field_expression "cache_info->file" identifier -> field_identifier) = identifier) ;) (expression_statement "cache_info->disk_mode = mode;" (assignment_expression "cache_info->disk_mode = mode" (field_expression "cache_info->disk_mode" identifier -> field_identifier) = identifier) ;) (return_statement "return MagickTrue;" return identifier ;) })))
(translation_unit "undefined4 __regparm3 FUN_0004cd50(int param_1,int param_2)\n\n{\n  char *__file;\n  int iVar1;\n  \n  if ((*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2)) {\n    return 1;\n  }\n  __file = (char *)(param_1 + 0x13a8);\n  if (*(char *)(param_1 + 0x13a8) == '\0') {\n    iVar1 = AcquireUniqueFileResource(__file);\n  }\n  else if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }\n  if (iVar1 == -1) {\n    return 0;\n  }\nLAB_0004cdcd:\n  AcquireMagickResource(3,1,0);\n  if (*(int *)(param_1 + 0x3a4) != -1) {\n    FUN_0004cb50();\n  }\n  *(int *)(param_1 + 0x3a4) = iVar1;\n  *(int *)(param_1 + 0x328) = param_2;\n  return 1;\n}\n\n" (function_definition "undefined4 __regparm3 FUN_0004cd50(int param_1,int param_2)\n\n{\n  char *__file;\n  int iVar1;\n  \n  if ((*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2)) {\n    return 1;\n  }\n  __file = (char *)(param_1 + 0x13a8);\n  if (*(char *)(param_1 + 0x13a8) == '\0') {\n    iVar1 = AcquireUniqueFileResource(__file);\n  }\n  else if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }\n  if (iVar1 == -1) {\n    return 0;\n  }\nLAB_0004cdcd:\n  AcquireMagickResource(3,1,0);\n  if (*(int *)(param_1 + 0x3a4) != -1) {\n    FUN_0004cb50();\n  }\n  *(int *)(param_1 + 0x3a4) = iVar1;\n  *(int *)(param_1 + 0x328) = param_2;\n  return 1;\n}" type_identifier (ERROR "__regparm3" identifier) (function_declarator "FUN_0004cd50(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  char *__file;\n  int iVar1;\n  \n  if ((*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2)) {\n    return 1;\n  }\n  __file = (char *)(param_1 + 0x13a8);\n  if (*(char *)(param_1 + 0x13a8) == '\0') {\n    iVar1 = AcquireUniqueFileResource(__file);\n  }\n  else if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }\n  if (iVar1 == -1) {\n    return 0;\n  }\nLAB_0004cdcd:\n  AcquireMagickResource(3,1,0);\n  if (*(int *)(param_1 + 0x3a4) != -1) {\n    FUN_0004cb50();\n  }\n  *(int *)(param_1 + 0x3a4) = iVar1;\n  *(int *)(param_1 + 0x328) = param_2;\n  return 1;\n}" { (declaration "char *__file;" primitive_type (pointer_declarator "*__file" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if ((*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2)) {\n    return 1;\n  }" if (parenthesized_expression "((*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2))" ( (binary_expression "(*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2)" (parenthesized_expression "(*(int *)(param_1 + 0x3a4) != -1)" ( (binary_expression "*(int *)(param_1 + 0x3a4) != -1" (pointer_expression "*(int *)(param_1 + 0x3a4)" * (cast_expression "(int *)(param_1 + 0x3a4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x3a4)" ( (binary_expression "param_1 + 0x3a4" identifier + number_literal) )))) != number_literal) )) && (parenthesized_expression "(*(int *)(param_1 + 0x328) == param_2)" ( (binary_expression "*(int *)(param_1 + 0x328) == param_2" (pointer_expression "*(int *)(param_1 + 0x328)" * (cast_expression "(int *)(param_1 + 0x328)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x328)" ( (binary_expression "param_1 + 0x328" identifier + number_literal) )))) == identifier) ))) )) (compound_statement "{\n    return 1;\n  }" { (return_statement "return 1;" return number_literal ;) })) (expression_statement "__file = (char *)(param_1 + 0x13a8);" (assignment_expression "__file = (char *)(param_1 + 0x13a8)" identifier = (cast_expression "(char *)(param_1 + 0x13a8)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x13a8)" ( (binary_expression "param_1 + 0x13a8" identifier + number_literal) )))) ;) (if_statement "if (*(char *)(param_1 + 0x13a8) == '\0') {\n    iVar1 = AcquireUniqueFileResource(__file);\n  }\n  else if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" if (parenthesized_expression "(*(char *)(param_1 + 0x13a8) == '\0')" ( (binary_expression "*(char *)(param_1 + 0x13a8) == '\0'" (pointer_expression "*(char *)(param_1 + 0x13a8)" * (cast_expression "(char *)(param_1 + 0x13a8)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x13a8)" ( (binary_expression "param_1 + 0x13a8" identifier + number_literal) )))) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    iVar1 = AcquireUniqueFileResource(__file);\n  }" { (expression_statement "iVar1 = AcquireUniqueFileResource(__file);" (assignment_expression "iVar1 = AcquireUniqueFileResource(__file)" identifier = (call_expression "AcquireUniqueFileResource(__file)" identifier (argument_list "(__file)" ( identifier )))) ;) }) (else_clause "else if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" else (if_statement "if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar1 = open64(__file,0,0);\n  }" { (expression_statement "iVar1 = open64(__file,0,0);" (assignment_expression "iVar1 = open64(__file,0,0)" identifier = (call_expression "open64(__file,0,0)" identifier (argument_list "(__file,0,0)" ( identifier , number_literal , number_literal )))) ;) }) (else_clause "else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" else (if_statement "if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }" { (expression_statement "iVar1 = open64(__file,0xc1,0x180);" (assignment_expression "iVar1 = open64(__file,0xc1,0x180)" identifier = (call_expression "open64(__file,0xc1,0x180)" identifier (argument_list "(__file,0xc1,0x180)" ( identifier , number_literal , number_literal )))) ;) (if_statement "if (iVar1 != -1) goto LAB_0004cdcd;" if (parenthesized_expression "(iVar1 != -1)" ( (binary_expression "iVar1 != -1" identifier != number_literal) )) (goto_statement "goto LAB_0004cdcd;" goto statement_identifier ;)) (expression_statement "iVar1 = open64(__file,1,0x180);" (assignment_expression "iVar1 = open64(__file,1,0x180)" identifier = (call_expression "open64(__file,1,0x180)" identifier (argument_list "(__file,1,0x180)" ( identifier , number_literal , number_literal )))) ;) }) (else_clause "else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" else (compound_statement "{\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" { (expression_statement "iVar1 = open64(__file,0xc2,0x180);" (assignment_expression "iVar1 = open64(__file,0xc2,0x180)" identifier = (call_expression "open64(__file,0xc2,0x180)" identifier (argument_list "(__file,0xc2,0x180)" ( identifier , number_literal , number_literal )))) ;) (if_statement "if (iVar1 != -1) goto LAB_0004cdcd;" if (parenthesized_expression "(iVar1 != -1)" ( (binary_expression "iVar1 != -1" identifier != number_literal) )) (goto_statement "goto LAB_0004cdcd;" goto statement_identifier ;)) (expression_statement "iVar1 = open64(__file,2,0x180);" (assignment_expression "iVar1 = open64(__file,2,0x180)" identifier = (call_expression "open64(__file,2,0x180)" identifier (argument_list "(__file,2,0x180)" ( identifier , number_literal , number_literal )))) ;) }))))))) (if_statement "if (iVar1 == -1) {\n    return 0;\n  }" if (parenthesized_expression "(iVar1 == -1)" ( (binary_expression "iVar1 == -1" identifier == number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (labeled_statement "LAB_0004cdcd:\n  AcquireMagickResource(3,1,0);" statement_identifier : (expression_statement "AcquireMagickResource(3,1,0);" (call_expression "AcquireMagickResource(3,1,0)" identifier (argument_list "(3,1,0)" ( number_literal , number_literal , number_literal ))) ;)) (if_statement "if (*(int *)(param_1 + 0x3a4) != -1) {\n    FUN_0004cb50();\n  }" if (parenthesized_expression "(*(int *)(param_1 + 0x3a4) != -1)" ( (binary_expression "*(int *)(param_1 + 0x3a4) != -1" (pointer_expression "*(int *)(param_1 + 0x3a4)" * (cast_expression "(int *)(param_1 + 0x3a4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x3a4)" ( (binary_expression "param_1 + 0x3a4" identifier + number_literal) )))) != number_literal) )) (compound_statement "{\n    FUN_0004cb50();\n  }" { (expression_statement "FUN_0004cb50();" (call_expression "FUN_0004cb50()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "*(int *)(param_1 + 0x3a4) = iVar1;" (assignment_expression "*(int *)(param_1 + 0x3a4) = iVar1" (pointer_expression "*(int *)(param_1 + 0x3a4)" * (cast_expression "(int *)(param_1 + 0x3a4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x3a4)" ( (binary_expression "param_1 + 0x3a4" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(int *)(param_1 + 0x328) = param_2;" (assignment_expression "*(int *)(param_1 + 0x328) = param_2" (pointer_expression "*(int *)(param_1 + 0x328)" * (cast_expression "(int *)(param_1 + 0x328)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x328)" ( (binary_expression "param_1 + 0x328" identifier + number_literal) )))) = identifier) ;) (return_statement "return 1;" return number_literal ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != LIT) )) && (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == IDENT) ))) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , LIT )))) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , LIT )))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , LIT )))) ;) }))))))) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( LIT , LIT , LIT ))) ;)) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (return_statement return LIT ;) })))
(function_definition "undefined4 __regparm3 FUN_0004cd50(int param_1,int param_2)\n\n{\n  char *__file;\n  int iVar1;\n  \n  if ((*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2)) {\n    return 1;\n  }\n  __file = (char *)(param_1 + 0x13a8);\n  if (*(char *)(param_1 + 0x13a8) == '\0') {\n    iVar1 = AcquireUniqueFileResource(__file);\n  }\n  else if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }\n  if (iVar1 == -1) {\n    return 0;\n  }\nLAB_0004cdcd:\n  AcquireMagickResource(3,1,0);\n  if (*(int *)(param_1 + 0x3a4) != -1) {\n    FUN_0004cb50();\n  }\n  *(int *)(param_1 + 0x3a4) = iVar1;\n  *(int *)(param_1 + 0x328) = param_2;\n  return 1;\n}" (type_identifier "undefined4") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_0004cd50(int param_1,int param_2)" (identifier "FUN_0004cd50") (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  char *__file;\n  int iVar1;\n  \n  if ((*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2)) {\n    return 1;\n  }\n  __file = (char *)(param_1 + 0x13a8);\n  if (*(char *)(param_1 + 0x13a8) == '\0') {\n    iVar1 = AcquireUniqueFileResource(__file);\n  }\n  else if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }\n  if (iVar1 == -1) {\n    return 0;\n  }\nLAB_0004cdcd:\n  AcquireMagickResource(3,1,0);\n  if (*(int *)(param_1 + 0x3a4) != -1) {\n    FUN_0004cb50();\n  }\n  *(int *)(param_1 + 0x3a4) = iVar1;\n  *(int *)(param_1 + 0x328) = param_2;\n  return 1;\n}" ({ "{") (declaration "char *__file;" (primitive_type "char") (pointer_declarator "*__file" (* "*") (identifier "__file")) (; ";")) (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (if_statement "if ((*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2)) {\n    return 1;\n  }" (if "if") (parenthesized_expression "((*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2))" (( "(") (binary_expression "(*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2)" (parenthesized_expression "(*(int *)(param_1 + 0x3a4) != -1)" (( "(") (binary_expression "*(int *)(param_1 + 0x3a4) != -1" (pointer_expression "*(int *)(param_1 + 0x3a4)" (* "*") (cast_expression "(int *)(param_1 + 0x3a4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x3a4)" (( "(") (binary_expression "param_1 + 0x3a4" (identifier "param_1") (+ "+") (number_literal "0x3a4")) () ")")))) (!= "!=") (number_literal "-1")) () ")")) (&& "&&") (parenthesized_expression "(*(int *)(param_1 + 0x328) == param_2)" (( "(") (binary_expression "*(int *)(param_1 + 0x328) == param_2" (pointer_expression "*(int *)(param_1 + 0x328)" (* "*") (cast_expression "(int *)(param_1 + 0x328)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x328)" (( "(") (binary_expression "param_1 + 0x328" (identifier "param_1") (+ "+") (number_literal "0x328")) () ")")))) (== "==") (identifier "param_2")) () ")"))) () ")")) (compound_statement "{\n    return 1;\n  }" ({ "{") (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}"))) (expression_statement "__file = (char *)(param_1 + 0x13a8);" (assignment_expression "__file = (char *)(param_1 + 0x13a8)" (identifier "__file") (= "=") (cast_expression "(char *)(param_1 + 0x13a8)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x13a8)" (( "(") (binary_expression "param_1 + 0x13a8" (identifier "param_1") (+ "+") (number_literal "0x13a8")) () ")")))) (; ";")) (if_statement "if (*(char *)(param_1 + 0x13a8) == '\0') {\n    iVar1 = AcquireUniqueFileResource(__file);\n  }\n  else if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" (if "if") (parenthesized_expression "(*(char *)(param_1 + 0x13a8) == '\0')" (( "(") (binary_expression "*(char *)(param_1 + 0x13a8) == '\0'" (pointer_expression "*(char *)(param_1 + 0x13a8)" (* "*") (cast_expression "(char *)(param_1 + 0x13a8)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x13a8)" (( "(") (binary_expression "param_1 + 0x13a8" (identifier "param_1") (+ "+") (number_literal "0x13a8")) () ")")))) (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n    iVar1 = AcquireUniqueFileResource(__file);\n  }" ({ "{") (expression_statement "iVar1 = AcquireUniqueFileResource(__file);" (assignment_expression "iVar1 = AcquireUniqueFileResource(__file)" (identifier "iVar1") (= "=") (call_expression "AcquireUniqueFileResource(__file)" (identifier "AcquireUniqueFileResource") (argument_list "(__file)" (( "(") (identifier "__file") () ")")))) (; ";")) (} "}")) (else_clause "else if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" (else "else") (if_statement "if (param_2 == 0) {\n    iVar1 = open64(__file,0,0);\n  }\n  else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    iVar1 = open64(__file,0,0);\n  }" ({ "{") (expression_statement "iVar1 = open64(__file,0,0);" (assignment_expression "iVar1 = open64(__file,0,0)" (identifier "iVar1") (= "=") (call_expression "open64(__file,0,0)" (identifier "open64") (argument_list "(__file,0,0)" (( "(") (identifier "__file") (, ",") (number_literal "0") (, ",") (number_literal "0") () ")")))) (; ";")) (} "}")) (else_clause "else if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" (else "else") (if_statement "if (param_2 == 1) {\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }\n  else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" (if "if") (parenthesized_expression "(param_2 == 1)" (( "(") (binary_expression "param_2 == 1" (identifier "param_2") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n    iVar1 = open64(__file,0xc1,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,1,0x180);\n  }" ({ "{") (expression_statement "iVar1 = open64(__file,0xc1,0x180);" (assignment_expression "iVar1 = open64(__file,0xc1,0x180)" (identifier "iVar1") (= "=") (call_expression "open64(__file,0xc1,0x180)" (identifier "open64") (argument_list "(__file,0xc1,0x180)" (( "(") (identifier "__file") (, ",") (number_literal "0xc1") (, ",") (number_literal "0x180") () ")")))) (; ";")) (if_statement "if (iVar1 != -1) goto LAB_0004cdcd;" (if "if") (parenthesized_expression "(iVar1 != -1)" (( "(") (binary_expression "iVar1 != -1" (identifier "iVar1") (!= "!=") (number_literal "-1")) () ")")) (goto_statement "goto LAB_0004cdcd;" (goto "goto") (statement_identifier "LAB_0004cdcd") (; ";"))) (expression_statement "iVar1 = open64(__file,1,0x180);" (assignment_expression "iVar1 = open64(__file,1,0x180)" (identifier "iVar1") (= "=") (call_expression "open64(__file,1,0x180)" (identifier "open64") (argument_list "(__file,1,0x180)" (( "(") (identifier "__file") (, ",") (number_literal "1") (, ",") (number_literal "0x180") () ")")))) (; ";")) (} "}")) (else_clause "else {\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" (else "else") (compound_statement "{\n    iVar1 = open64(__file,0xc2,0x180);\n    if (iVar1 != -1) goto LAB_0004cdcd;\n    iVar1 = open64(__file,2,0x180);\n  }" ({ "{") (expression_statement "iVar1 = open64(__file,0xc2,0x180);" (assignment_expression "iVar1 = open64(__file,0xc2,0x180)" (identifier "iVar1") (= "=") (call_expression "open64(__file,0xc2,0x180)" (identifier "open64") (argument_list "(__file,0xc2,0x180)" (( "(") (identifier "__file") (, ",") (number_literal "0xc2") (, ",") (number_literal "0x180") () ")")))) (; ";")) (if_statement "if (iVar1 != -1) goto LAB_0004cdcd;" (if "if") (parenthesized_expression "(iVar1 != -1)" (( "(") (binary_expression "iVar1 != -1" (identifier "iVar1") (!= "!=") (number_literal "-1")) () ")")) (goto_statement "goto LAB_0004cdcd;" (goto "goto") (statement_identifier "LAB_0004cdcd") (; ";"))) (expression_statement "iVar1 = open64(__file,2,0x180);" (assignment_expression "iVar1 = open64(__file,2,0x180)" (identifier "iVar1") (= "=") (call_expression "open64(__file,2,0x180)" (identifier "open64") (argument_list "(__file,2,0x180)" (( "(") (identifier "__file") (, ",") (number_literal "2") (, ",") (number_literal "0x180") () ")")))) (; ";")) (} "}")))))))) (if_statement "if (iVar1 == -1) {\n    return 0;\n  }" (if "if") (parenthesized_expression "(iVar1 == -1)" (( "(") (binary_expression "iVar1 == -1" (identifier "iVar1") (== "==") (number_literal "-1")) () ")")) (compound_statement "{\n    return 0;\n  }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (labeled_statement "LAB_0004cdcd:\n  AcquireMagickResource(3,1,0);" (statement_identifier "LAB_0004cdcd") (: ":") (expression_statement "AcquireMagickResource(3,1,0);" (call_expression "AcquireMagickResource(3,1,0)" (identifier "AcquireMagickResource") (argument_list "(3,1,0)" (( "(") (number_literal "3") (, ",") (number_literal "1") (, ",") (number_literal "0") () ")"))) (; ";"))) (if_statement "if (*(int *)(param_1 + 0x3a4) != -1) {\n    FUN_0004cb50();\n  }" (if "if") (parenthesized_expression "(*(int *)(param_1 + 0x3a4) != -1)" (( "(") (binary_expression "*(int *)(param_1 + 0x3a4) != -1" (pointer_expression "*(int *)(param_1 + 0x3a4)" (* "*") (cast_expression "(int *)(param_1 + 0x3a4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x3a4)" (( "(") (binary_expression "param_1 + 0x3a4" (identifier "param_1") (+ "+") (number_literal "0x3a4")) () ")")))) (!= "!=") (number_literal "-1")) () ")")) (compound_statement "{\n    FUN_0004cb50();\n  }" ({ "{") (expression_statement "FUN_0004cb50();" (call_expression "FUN_0004cb50()" (identifier "FUN_0004cb50") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (expression_statement "*(int *)(param_1 + 0x3a4) = iVar1;" (assignment_expression "*(int *)(param_1 + 0x3a4) = iVar1" (pointer_expression "*(int *)(param_1 + 0x3a4)" (* "*") (cast_expression "(int *)(param_1 + 0x3a4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x3a4)" (( "(") (binary_expression "param_1 + 0x3a4" (identifier "param_1") (+ "+") (number_literal "0x3a4")) () ")")))) (= "=") (identifier "iVar1")) (; ";")) (expression_statement "*(int *)(param_1 + 0x328) = param_2;" (assignment_expression "*(int *)(param_1 + 0x328) = param_2" (pointer_expression "*(int *)(param_1 + 0x328)" (* "*") (cast_expression "(int *)(param_1 + 0x328)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x328)" (( "(") (binary_expression "param_1 + 0x328" (identifier "param_1") (+ "+") (number_literal "0x328")) () ")")))) (= "=") (identifier "param_2")) (; ";")) (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Enum "ChannelType": Some values do not have unique names */
/* WARNING: Enum "PixelChannel": Some values do not have unique names */
/* WARNING: Enum "GravityType": Some values do not have unique names */
/* WARNING: Enum "DisposeType": Some values do not have unique names */
/* WARNING: Enum "ExceptionType": Some values do not have unique names */

type_1 __regparm3 function_1(type_2 *cache_info,type_3 var_1)

{
  char *path;
  int var_6;
  
  if ((cache_info->file != -1) && (cache_info->disk_mode == var_1)) {
    return MagickTrue;
  }
  path = cache_info->cache_filename;
  if (cache_info->cache_filename[0] == '\0') {
    var_6 = var_2(path);
  }
  else if (var_1 == var_3) {
    var_6 = var_4(path,0,0);
  }
  else if (var_1 == var_5) {
    var_6 = var_4(path,0xc1,0x180);
    if (var_6 != -1) goto LAB_0004cdcd;
    var_6 = var_4(path,1,0x180);
  }
  else {
    var_6 = var_4(path,0xc2,0x180);
    if (var_6 != -1) goto LAB_0004cdcd;
    var_6 = var_4(path,2,0x180);
  }
  if (var_6 == -1) {
    return MagickFalse;
  }
LAB_0004cdcd:
  var_7(FileResource,1);
  if (cache_info->file != -1) {
    var_8((type_2 *)&cache_info->file);
  }
  cache_info->file = var_6;
  cache_info->disk_mode = var_1;
  return MagickTrue;
}


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

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

undefined4 __regparm3 MASKED(int param_1,int param_2)

{
  char *__file;
  int iVar1;
  
  if ((*(int *)(param_1 + 0x3a4) != -1) && (*(int *)(param_1 + 0x328) == param_2)) {
    return 1;
  }
  __file = (char *)(param_1 + 0x13a8);
  if (*(char *)(param_1 + 0x13a8) == '\0') {
    iVar1 = AcquireUniqueFileResource(__file);
  }
  else if (param_2 == 0) {
    iVar1 = open64(__file,0,0);
  }
  else if (param_2 == 1) {
    iVar1 = open64(__file,0xc1,0x180);
    if (iVar1 != -1) goto LAB_0004cdcd;
    iVar1 = open64(__file,1,0x180);
  }
  else {
    iVar1 = open64(__file,0xc2,0x180);
    if (iVar1 != -1) goto LAB_0004cdcd;
    iVar1 = open64(__file,2,0x180);
  }
  if (iVar1 == -1) {
    return 0;
  }
LAB_0004cdcd:
  AcquireMagickResource(3,1,0);
  if (*(int *)(param_1 + 0x3a4) != -1) {
    FUN_0004cb50();
  }
  *(int *)(param_1 + 0x3a4) = iVar1;
  *(int *)(param_1 + 0x328) = param_2;
  return 1;
}

