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

MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)

{
  Image *pIVar1;
  ExceptionInfo *pEVar2;
  int iVar3;
  int iVar4;
  MagickBooleanType MVar5;
  
  if (wand == (MagickWand *)0x0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,
                  "MagickWriteImageFile");
  }
  if (wand->signature != 0xabacadab) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,
                  "MagickWriteImageFile");
  }
  if (file == (FILE *)0x0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")
    ;
  }
  if (wand->debug == MagickFalse) {
    pIVar1 = wand->images;
    pEVar2 = wand->exception;
  }
  else {
    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",wand->name
                  );
    pIVar1 = wand->images;
    pEVar2 = wand->exception;
  }
  if (pIVar1 != (Image *)0x0) {
    MVar5 = MagickFalse;
    iVar3 = CloneImage(pIVar1,0,0,1,pEVar2);
    if (iVar3 != 0) {
      iVar4 = CloneImageInfo(wand->image_info);
      SetImageInfoFile(iVar4,file);
      *(undefined4 *)(iVar4 + 0xc) = 1;
      MVar5 = WriteImage(iVar4,iVar3,wand->exception);
      DestroyImageInfo(iVar4);
      DestroyImage(iVar3);
    }
    return MVar5;
  }
  ThrowMagickException
            (pEVar2,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,
             "ContainsNoImages",&DAT_000e672e,wand->name);
  return MagickFalse;
}



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

undefined4 MagickWriteImageFile(int param_1,int param_2)

{
  undefined4 uVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  
  if (param_1 == 0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,
                  "MagickWriteImageFile");
  }
  if (*(int *)(param_1 + 0x101c) != -0x54535255) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,
                  "MagickWriteImageFile");
  }
  if (param_2 == 0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")
    ;
  }
  if (*(int *)(param_1 + 0x1018) == 0) {
    iVar2 = *(int *)(param_1 + 0x1004);
    uVar1 = *(undefined4 *)(param_1 + 0x100c);
  }
  else {
    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",
                   param_1 + 4);
    iVar2 = *(int *)(param_1 + 0x1004);
    uVar1 = *(undefined4 *)(param_1 + 0x100c);
  }
  if (iVar2 != 0) {
    uVar4 = 0;
    iVar2 = CloneImage(iVar2,0,0,1,uVar1);
    if (iVar2 != 0) {
      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));
      SetImageInfoFile(iVar3,param_2);
      *(undefined4 *)(iVar3 + 0xc) = 1;
      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));
      DestroyImageInfo(iVar3);
      DestroyImage(iVar2);
    }
    return uVar4;
  }
  ThrowMagickException
            (uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,
             "ContainsNoImages",&DAT_000e672e,param_1 + 4);
  return 0;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x0001e8f0
ADD EBX,0xe3a47
SUB ESP,0x1c
MOV ESI,dword ptr [ESP + 0x30]
TEST ESI,ESI
JZ 0x0008274f
CMP dword ptr [ESI + 0x101c],0xabacadab
JNZ 0x00082730
MOV EDI,dword ptr [ESP + 0x34]
TEST EDI,EDI
JZ 0x00082711
MOV ECX,dword ptr [ESI + 0x1018]
TEST ECX,ECX
JNZ 0x00082690
MOV EAX,dword ptr [ESI + 0x1004]
MOV EDX,dword ptr [ESI + 0x100c]
TEST EAX,EAX
JZ 0x000826d2
SUB ESP,0xc
XOR EBP,EBP
PUSH EDX
PUSH 0x1
PUSH 0x0
PUSH 0x0
PUSH EAX
CALL 0x0001c840
ADD ESP,0x20
MOV EDI,EAX
TEST EAX,EAX
JZ 0x0008267f
SUB ESP,0xc
PUSH dword ptr [ESI + 0x1008]
CALL 0x0001d7f0
MOV ECX,EAX
POP EAX
POP EDX
PUSH dword ptr [ESP + 0x3c]
PUSH ECX
MOV dword ptr [ESP + 0x1c],ECX
CALL 0x0001d020
MOV ECX,dword ptr [ESP + 0x1c]
ADD ESP,0xc
MOV dword ptr [ECX + 0xc],0x1
PUSH dword ptr [ESI + 0x100c]
PUSH EDI
PUSH ECX
MOV dword ptr [ESP + 0x1c],ECX
CALL 0x0001dd20
MOV ECX,dword ptr [ESP + 0x1c]
MOV EBP,EAX
MOV dword ptr [ESP],ECX
CALL 0x0001cd60
MOV dword ptr [ESP],EDI
CALL 0x0001dd70
ADD ESP,0x10
ADD ESP,0x1c
MOV EAX,EBP
POP EBX
POP ESI
POP EDI
POP EBP
RET
LEA EAX,[ESI + 0x4]
SUB ESP,0x8
PUSH EAX
LEA EAX,[EBX + 0xfff92fa4]
PUSH EAX
LEA EAX,[EBX + 0xfff8ec38]
PUSH 0x33d6
PUSH EAX
LEA EAX,[EBX + 0xfff8e919]
PUSH EAX
PUSH 0x40000
CALL 0x0001d6f0
MOV EAX,dword ptr [ESI + 0x1004]
ADD ESP,0x20
MOV EDX,dword ptr [ESI + 0x100c]
TEST EAX,EAX
JNZ 0x0008260c
LEA EAX,[EBX + 0xfff8072e]
ADD ESI,0x4
XOR EBP,EBP
PUSH ESI
PUSH EAX
LEA EAX,[EBX + 0xfff884fe]
PUSH EAX
LEA EAX,[EBX + 0xfff8ec38]
PUSH 0x1d6
PUSH 0x33d8
PUSH EAX
LEA EAX,[EBX + 0xfff8e919]
PUSH EAX
PUSH EDX
CALL 0x0001de10
ADD ESP,0x20
MOV EAX,EBP
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
LEA EAX,[EBX + 0xfff8ec50]
PUSH EAX
LEA EAX,[EBX + 0xfff8e919]
PUSH 0x33d4
PUSH EAX
LEA EAX,[EBX + 0xfff8e9b5]
PUSH EAX
CALL 0x0001ccf0
LEA EAX,[EBX + 0xfff8ec50]
PUSH EAX
LEA EAX,[EBX + 0xfff8e919]
PUSH 0x33d3
PUSH EAX
LEA EAX,[EBX + 0xfff8e9f8]
PUSH EAX
CALL 0x0001ccf0
LEA EAX,[EBX + 0xfff8ec50]
PUSH EAX
LEA EAX,[EBX + 0xfff8e919]
PUSH 0x33d2
PUSH EAX
LEA EAX,[EBX + 0xfff8e933]
PUSH EAX
CALL 0x0001ccf0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 MagickWriteImageFile(int param_1,int param_2)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  \n  if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }\n  if (*(int *)(param_1 + 0x101c) != -0x54535255) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }\n  if (param_2 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }\n  if (*(int *)(param_1 + 0x1018) == 0) {\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  if (iVar2 != 0) {\n    uVar4 = 0;\n    iVar2 = CloneImage(iVar2,0,0,1,uVar1);\n    if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }\n    return uVar4;\n  }\n  ThrowMagickException\n            (uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4);\n  return 0;\n}\n\n" comment (function_definition "undefined4 MagickWriteImageFile(int param_1,int param_2)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  \n  if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }\n  if (*(int *)(param_1 + 0x101c) != -0x54535255) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }\n  if (param_2 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }\n  if (*(int *)(param_1 + 0x1018) == 0) {\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  if (iVar2 != 0) {\n    uVar4 = 0;\n    iVar2 = CloneImage(iVar2,0,0,1,uVar1);\n    if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }\n    return uVar4;\n  }\n  ThrowMagickException\n            (uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4);\n  return 0;\n}" type_identifier (function_declarator "MagickWriteImageFile(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  undefined4 uVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  \n  if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }\n  if (*(int *)(param_1 + 0x101c) != -0x54535255) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }\n  if (param_2 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }\n  if (*(int *)(param_1 + 0x1018) == 0) {\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  if (iVar2 != 0) {\n    uVar4 = 0;\n    iVar2 = CloneImage(iVar2,0,0,1,uVar1);\n    if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }\n    return uVar4;\n  }\n  ThrowMagickException\n            (uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4);\n  return 0;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (if_statement "if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }" { comment (expression_statement "__assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");" (call_expression "__assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile")" identifier (argument_list "("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile")" ( (string_literal ""wand != (MagickWand *) NULL"" " string_content ") , (string_literal ""MagickWand/magick-image.c"" " string_content ") , number_literal , (string_literal ""MagickWriteImageFile"" " string_content ") ))) ;) })) (if_statement "if (*(int *)(param_1 + 0x101c) != -0x54535255) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }" if (parenthesized_expression "(*(int *)(param_1 + 0x101c) != -0x54535255)" ( (binary_expression "*(int *)(param_1 + 0x101c) != -0x54535255" (pointer_expression "*(int *)(param_1 + 0x101c)" * (cast_expression "(int *)(param_1 + 0x101c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x101c)" ( (binary_expression "param_1 + 0x101c" identifier + number_literal) )))) != number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }" { comment (expression_statement "__assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");" (call_expression "__assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile")" identifier (argument_list "("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile")" ( (string_literal ""wand->signature == MagickWandSignature"" " string_content ") , (string_literal ""MagickWand/magick-image.c"" " string_content ") , number_literal , (string_literal ""MagickWriteImageFile"" " string_content ") ))) ;) })) (if_statement "if (param_2 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }" { comment (expression_statement "__assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;" (call_expression "__assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")" identifier (argument_list "("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")" ( (string_literal ""file != (FILE *) NULL"" " string_content ") , (string_literal ""MagickWand/magick-image.c"" " string_content ") , number_literal , (string_literal ""MagickWriteImageFile"" " string_content ") ))) ;) })) (if_statement "if (*(int *)(param_1 + 0x1018) == 0) {\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }" if (parenthesized_expression "(*(int *)(param_1 + 0x1018) == 0)" ( (binary_expression "*(int *)(param_1 + 0x1018) == 0" (pointer_expression "*(int *)(param_1 + 0x1018)" * (cast_expression "(int *)(param_1 + 0x1018)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1018)" ( (binary_expression "param_1 + 0x1018" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }" { (expression_statement "iVar2 = *(int *)(param_1 + 0x1004);" (assignment_expression "iVar2 = *(int *)(param_1 + 0x1004)" identifier = (pointer_expression "*(int *)(param_1 + 0x1004)" * (cast_expression "(int *)(param_1 + 0x1004)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1004)" ( (binary_expression "param_1 + 0x1004" identifier + number_literal) ))))) ;) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 0x100c);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 0x100c)" identifier = (pointer_expression "*(undefined4 *)(param_1 + 0x100c)" * (cast_expression "(undefined4 *)(param_1 + 0x100c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x100c)" ( (binary_expression "param_1 + 0x100c" identifier + number_literal) ))))) ;) }) (else_clause "else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }" else (compound_statement "{\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }" { (expression_statement "LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);" (call_expression "LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4)" identifier (argument_list "(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4)" ( number_literal , (string_literal ""MagickWand/magick-image.c"" " string_content ") , (string_literal ""MagickWriteImageFile"" " string_content ") , number_literal , (string_literal ""%s"" " string_content ") , (binary_expression "param_1 + 4" identifier + number_literal) ))) ;) (expression_statement "iVar2 = *(int *)(param_1 + 0x1004);" (assignment_expression "iVar2 = *(int *)(param_1 + 0x1004)" identifier = (pointer_expression "*(int *)(param_1 + 0x1004)" * (cast_expression "(int *)(param_1 + 0x1004)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1004)" ( (binary_expression "param_1 + 0x1004" identifier + number_literal) ))))) ;) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 0x100c);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 0x100c)" identifier = (pointer_expression "*(undefined4 *)(param_1 + 0x100c)" * (cast_expression "(undefined4 *)(param_1 + 0x100c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x100c)" ( (binary_expression "param_1 + 0x100c" identifier + number_literal) ))))) ;) }))) (if_statement "if (iVar2 != 0) {\n    uVar4 = 0;\n    iVar2 = CloneImage(iVar2,0,0,1,uVar1);\n    if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }\n    return uVar4;\n  }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n    uVar4 = 0;\n    iVar2 = CloneImage(iVar2,0,0,1,uVar1);\n    if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }\n    return uVar4;\n  }" { (expression_statement "uVar4 = 0;" (assignment_expression "uVar4 = 0" identifier = number_literal) ;) (expression_statement "iVar2 = CloneImage(iVar2,0,0,1,uVar1);" (assignment_expression "iVar2 = CloneImage(iVar2,0,0,1,uVar1)" identifier = (call_expression "CloneImage(iVar2,0,0,1,uVar1)" identifier (argument_list "(iVar2,0,0,1,uVar1)" ( identifier , number_literal , number_literal , number_literal , identifier )))) ;) (if_statement "if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }" { (expression_statement "iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));" (assignment_expression "iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008))" identifier = (call_expression "CloneImageInfo(*(undefined4 *)(param_1 + 0x1008))" identifier (argument_list "(*(undefined4 *)(param_1 + 0x1008))" ( (pointer_expression "*(undefined4 *)(param_1 + 0x1008)" * (cast_expression "(undefined4 *)(param_1 + 0x1008)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1008)" ( (binary_expression "param_1 + 0x1008" identifier + number_literal) )))) )))) ;) (expression_statement "SetImageInfoFile(iVar3,param_2);" (call_expression "SetImageInfoFile(iVar3,param_2)" identifier (argument_list "(iVar3,param_2)" ( identifier , identifier ))) ;) (expression_statement "*(undefined4 *)(iVar3 + 0xc) = 1;" (assignment_expression "*(undefined4 *)(iVar3 + 0xc) = 1" (pointer_expression "*(undefined4 *)(iVar3 + 0xc)" * (cast_expression "(undefined4 *)(iVar3 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 0xc)" ( (binary_expression "iVar3 + 0xc" identifier + number_literal) )))) = number_literal) ;) (expression_statement "uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));" (assignment_expression "uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c))" identifier = (call_expression "WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c))" identifier (argument_list "(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c))" ( identifier , identifier , (pointer_expression "*(undefined4 *)(param_1 + 0x100c)" * (cast_expression "(undefined4 *)(param_1 + 0x100c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x100c)" ( (binary_expression "param_1 + 0x100c" identifier + number_literal) )))) )))) ;) (expression_statement "DestroyImageInfo(iVar3);" (call_expression "DestroyImageInfo(iVar3)" identifier (argument_list "(iVar3)" ( identifier ))) ;) (expression_statement "DestroyImage(iVar2);" (call_expression "DestroyImage(iVar2)" identifier (argument_list "(iVar2)" ( identifier ))) ;) })) (return_statement "return uVar4;" return identifier ;) })) (expression_statement "ThrowMagickException\n            (uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4);" (call_expression "ThrowMagickException\n            (uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4)" identifier (argument_list "(uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4)" ( identifier , (string_literal ""MagickWand/magick-image.c"" " string_content ") , (string_literal ""MagickWriteImageFile"" " string_content ") , number_literal , number_literal , (string_literal ""ContainsNoImages"" " string_content ") , (pointer_expression "&DAT_000e672e" & identifier) , (binary_expression "param_1 + 4" identifier + number_literal) ))) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\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 "ChannelType": Some values do not have unique names */\n/* WARNING: Enum "PixelChannel": Some values do not have unique names */\n/* WARNING: Enum "ExceptionType": Some values do not have unique names */\n\nMagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)\n\n{\n  Image *pIVar1;\n  ExceptionInfo *pEVar2;\n  int iVar3;\n  int iVar4;\n  MagickBooleanType MVar5;\n  \n  if (wand == (MagickWand *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }\n  if (wand->signature != 0xabacadab) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }\n  if (file == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }\n  if (wand->debug == MagickFalse) {\n    pIVar1 = wand->images;\n    pEVar2 = wand->exception;\n  }\n  else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",wand->name\n                  );\n    pIVar1 = wand->images;\n    pEVar2 = wand->exception;\n  }\n  if (pIVar1 != (Image *)0x0) {\n    MVar5 = MagickFalse;\n    iVar3 = CloneImage(pIVar1,0,0,1,pEVar2);\n    if (iVar3 != 0) {\n      iVar4 = CloneImageInfo(wand->image_info);\n      SetImageInfoFile(iVar4,file);\n      *(undefined4 *)(iVar4 + 0xc) = 1;\n      MVar5 = WriteImage(iVar4,iVar3,wand->exception);\n      DestroyImageInfo(iVar4);\n      DestroyImage(iVar3);\n    }\n    return MVar5;\n  }\n  ThrowMagickException\n            (pEVar2,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,wand->name);\n  return MagickFalse;\n}\n\n" comment comment comment comment comment comment comment (function_definition "MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)\n\n{\n  Image *pIVar1;\n  ExceptionInfo *pEVar2;\n  int iVar3;\n  int iVar4;\n  MagickBooleanType MVar5;\n  \n  if (wand == (MagickWand *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }\n  if (wand->signature != 0xabacadab) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }\n  if (file == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }\n  if (wand->debug == MagickFalse) {\n    pIVar1 = wand->images;\n    pEVar2 = wand->exception;\n  }\n  else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",wand->name\n                  );\n    pIVar1 = wand->images;\n    pEVar2 = wand->exception;\n  }\n  if (pIVar1 != (Image *)0x0) {\n    MVar5 = MagickFalse;\n    iVar3 = CloneImage(pIVar1,0,0,1,pEVar2);\n    if (iVar3 != 0) {\n      iVar4 = CloneImageInfo(wand->image_info);\n      SetImageInfoFile(iVar4,file);\n      *(undefined4 *)(iVar4 + 0xc) = 1;\n      MVar5 = WriteImage(iVar4,iVar3,wand->exception);\n      DestroyImageInfo(iVar4);\n      DestroyImage(iVar3);\n    }\n    return MVar5;\n  }\n  ThrowMagickException\n            (pEVar2,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,wand->name);\n  return MagickFalse;\n}" type_identifier (function_declarator "MagickWriteImageFile(MagickWand *wand,FILE *file)" identifier (parameter_list "(MagickWand *wand,FILE *file)" ( (parameter_declaration "MagickWand *wand" type_identifier (pointer_declarator "*wand" * identifier)) , (parameter_declaration "FILE *file" type_identifier (pointer_declarator "*file" * identifier)) ))) (compound_statement "{\n  Image *pIVar1;\n  ExceptionInfo *pEVar2;\n  int iVar3;\n  int iVar4;\n  MagickBooleanType MVar5;\n  \n  if (wand == (MagickWand *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }\n  if (wand->signature != 0xabacadab) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }\n  if (file == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }\n  if (wand->debug == MagickFalse) {\n    pIVar1 = wand->images;\n    pEVar2 = wand->exception;\n  }\n  else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",wand->name\n                  );\n    pIVar1 = wand->images;\n    pEVar2 = wand->exception;\n  }\n  if (pIVar1 != (Image *)0x0) {\n    MVar5 = MagickFalse;\n    iVar3 = CloneImage(pIVar1,0,0,1,pEVar2);\n    if (iVar3 != 0) {\n      iVar4 = CloneImageInfo(wand->image_info);\n      SetImageInfoFile(iVar4,file);\n      *(undefined4 *)(iVar4 + 0xc) = 1;\n      MVar5 = WriteImage(iVar4,iVar3,wand->exception);\n      DestroyImageInfo(iVar4);\n      DestroyImage(iVar3);\n    }\n    return MVar5;\n  }\n  ThrowMagickException\n            (pEVar2,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,wand->name);\n  return MagickFalse;\n}" { (declaration "Image *pIVar1;" type_identifier (pointer_declarator "*pIVar1" * identifier) ;) (declaration "ExceptionInfo *pEVar2;" type_identifier (pointer_declarator "*pEVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "MagickBooleanType MVar5;" type_identifier identifier ;) (if_statement "if (wand == (MagickWand *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }" if (parenthesized_expression "(wand == (MagickWand *)0x0)" ( (binary_expression "wand == (MagickWand *)0x0" identifier == (cast_expression "(MagickWand *)0x0" ( (type_descriptor "MagickWand *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }" { comment (expression_statement "__assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");" (call_expression "__assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile")" identifier (argument_list "("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile")" ( (string_literal ""wand != (MagickWand *) NULL"" " string_content ") , (string_literal ""MagickWand/magick-image.c"" " string_content ") , number_literal , (string_literal ""MagickWriteImageFile"" " string_content ") ))) ;) })) (if_statement "if (wand->signature != 0xabacadab) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }" if (parenthesized_expression "(wand->signature != 0xabacadab)" ( (binary_expression "wand->signature != 0xabacadab" (field_expression "wand->signature" identifier -> field_identifier) != number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }" { comment (expression_statement "__assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");" (call_expression "__assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile")" identifier (argument_list "("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile")" ( (string_literal ""wand->signature == MagickWandSignature"" " string_content ") , (string_literal ""MagickWand/magick-image.c"" " string_content ") , number_literal , (string_literal ""MagickWriteImageFile"" " string_content ") ))) ;) })) (if_statement "if (file == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }" if (parenthesized_expression "(file == (FILE *)0x0)" ( (binary_expression "file == (FILE *)0x0" identifier == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }" { comment (expression_statement "__assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;" (call_expression "__assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")" identifier (argument_list "("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")" ( (string_literal ""file != (FILE *) NULL"" " string_content ") , (string_literal ""MagickWand/magick-image.c"" " string_content ") , number_literal , (string_literal ""MagickWriteImageFile"" " string_content ") ))) ;) })) (if_statement "if (wand->debug == MagickFalse) {\n    pIVar1 = wand->images;\n    pEVar2 = wand->exception;\n  }\n  else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",wand->name\n                  );\n    pIVar1 = wand->images;\n    pEVar2 = wand->exception;\n  }" if (parenthesized_expression "(wand->debug == MagickFalse)" ( (binary_expression "wand->debug == MagickFalse" (field_expression "wand->debug" identifier -> field_identifier) == identifier) )) (compound_statement "{\n    pIVar1 = wand->images;\n    pEVar2 = wand->exception;\n  }" { (expression_statement "pIVar1 = wand->images;" (assignment_expression "pIVar1 = wand->images" identifier = (field_expression "wand->images" identifier -> field_identifier)) ;) (expression_statement "pEVar2 = wand->exception;" (assignment_expression "pEVar2 = wand->exception" identifier = (field_expression "wand->exception" identifier -> field_identifier)) ;) }) (else_clause "else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",wand->name\n                  );\n    pIVar1 = wand->images;\n    pEVar2 = wand->exception;\n  }" else (compound_statement "{\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",wand->name\n                  );\n    pIVar1 = wand->images;\n    pEVar2 = wand->exception;\n  }" { (expression_statement "LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",wand->name\n                  );" (call_expression "LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",wand->name\n                  )" identifier (argument_list "(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",wand->name\n                  )" ( number_literal , (string_literal ""MagickWand/magick-image.c"" " string_content ") , (string_literal ""MagickWriteImageFile"" " string_content ") , number_literal , (string_literal ""%s"" " string_content ") , (field_expression "wand->name" identifier -> field_identifier) ))) ;) (expression_statement "pIVar1 = wand->images;" (assignment_expression "pIVar1 = wand->images" identifier = (field_expression "wand->images" identifier -> field_identifier)) ;) (expression_statement "pEVar2 = wand->exception;" (assignment_expression "pEVar2 = wand->exception" identifier = (field_expression "wand->exception" identifier -> field_identifier)) ;) }))) (if_statement "if (pIVar1 != (Image *)0x0) {\n    MVar5 = MagickFalse;\n    iVar3 = CloneImage(pIVar1,0,0,1,pEVar2);\n    if (iVar3 != 0) {\n      iVar4 = CloneImageInfo(wand->image_info);\n      SetImageInfoFile(iVar4,file);\n      *(undefined4 *)(iVar4 + 0xc) = 1;\n      MVar5 = WriteImage(iVar4,iVar3,wand->exception);\n      DestroyImageInfo(iVar4);\n      DestroyImage(iVar3);\n    }\n    return MVar5;\n  }" if (parenthesized_expression "(pIVar1 != (Image *)0x0)" ( (binary_expression "pIVar1 != (Image *)0x0" identifier != (cast_expression "(Image *)0x0" ( (type_descriptor "Image *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    MVar5 = MagickFalse;\n    iVar3 = CloneImage(pIVar1,0,0,1,pEVar2);\n    if (iVar3 != 0) {\n      iVar4 = CloneImageInfo(wand->image_info);\n      SetImageInfoFile(iVar4,file);\n      *(undefined4 *)(iVar4 + 0xc) = 1;\n      MVar5 = WriteImage(iVar4,iVar3,wand->exception);\n      DestroyImageInfo(iVar4);\n      DestroyImage(iVar3);\n    }\n    return MVar5;\n  }" { (expression_statement "MVar5 = MagickFalse;" (assignment_expression "MVar5 = MagickFalse" identifier = identifier) ;) (expression_statement "iVar3 = CloneImage(pIVar1,0,0,1,pEVar2);" (assignment_expression "iVar3 = CloneImage(pIVar1,0,0,1,pEVar2)" identifier = (call_expression "CloneImage(pIVar1,0,0,1,pEVar2)" identifier (argument_list "(pIVar1,0,0,1,pEVar2)" ( identifier , number_literal , number_literal , number_literal , identifier )))) ;) (if_statement "if (iVar3 != 0) {\n      iVar4 = CloneImageInfo(wand->image_info);\n      SetImageInfoFile(iVar4,file);\n      *(undefined4 *)(iVar4 + 0xc) = 1;\n      MVar5 = WriteImage(iVar4,iVar3,wand->exception);\n      DestroyImageInfo(iVar4);\n      DestroyImage(iVar3);\n    }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n      iVar4 = CloneImageInfo(wand->image_info);\n      SetImageInfoFile(iVar4,file);\n      *(undefined4 *)(iVar4 + 0xc) = 1;\n      MVar5 = WriteImage(iVar4,iVar3,wand->exception);\n      DestroyImageInfo(iVar4);\n      DestroyImage(iVar3);\n    }" { (expression_statement "iVar4 = CloneImageInfo(wand->image_info);" (assignment_expression "iVar4 = CloneImageInfo(wand->image_info)" identifier = (call_expression "CloneImageInfo(wand->image_info)" identifier (argument_list "(wand->image_info)" ( (field_expression "wand->image_info" identifier -> field_identifier) )))) ;) (expression_statement "SetImageInfoFile(iVar4,file);" (call_expression "SetImageInfoFile(iVar4,file)" identifier (argument_list "(iVar4,file)" ( identifier , identifier ))) ;) (expression_statement "*(undefined4 *)(iVar4 + 0xc) = 1;" (assignment_expression "*(undefined4 *)(iVar4 + 0xc) = 1" (pointer_expression "*(undefined4 *)(iVar4 + 0xc)" * (cast_expression "(undefined4 *)(iVar4 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar4 + 0xc)" ( (binary_expression "iVar4 + 0xc" identifier + number_literal) )))) = number_literal) ;) (expression_statement "MVar5 = WriteImage(iVar4,iVar3,wand->exception);" (assignment_expression "MVar5 = WriteImage(iVar4,iVar3,wand->exception)" identifier = (call_expression "WriteImage(iVar4,iVar3,wand->exception)" identifier (argument_list "(iVar4,iVar3,wand->exception)" ( identifier , identifier , (field_expression "wand->exception" identifier -> field_identifier) )))) ;) (expression_statement "DestroyImageInfo(iVar4);" (call_expression "DestroyImageInfo(iVar4)" identifier (argument_list "(iVar4)" ( identifier ))) ;) (expression_statement "DestroyImage(iVar3);" (call_expression "DestroyImage(iVar3)" identifier (argument_list "(iVar3)" ( identifier ))) ;) })) (return_statement "return MVar5;" return identifier ;) })) (expression_statement "ThrowMagickException\n            (pEVar2,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,wand->name);" (call_expression "ThrowMagickException\n            (pEVar2,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,wand->name)" identifier (argument_list "(pEVar2,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,wand->name)" ( identifier , (string_literal ""MagickWand/magick-image.c"" " string_content ") , (string_literal ""MagickWriteImageFile"" " string_content ") , number_literal , number_literal , (string_literal ""ContainsNoImages"" " string_content ") , (pointer_expression "&DAT_000e672e" & identifier) , (field_expression "wand->name" identifier -> field_identifier) ))) ;) (return_statement "return MagickFalse;" return identifier ;) })))
(translation_unit "undefined4 MagickWriteImageFile(int param_1,int param_2)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  \n  if (param_1 == 0) {\n                    \n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }\n  if (*(int *)(param_1 + 0x101c) != -0x54535255) {\n                    \n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }\n  if (param_2 == 0) {\n                    \n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }\n  if (*(int *)(param_1 + 0x1018) == 0) {\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  if (iVar2 != 0) {\n    uVar4 = 0;\n    iVar2 = CloneImage(iVar2,0,0,1,uVar1);\n    if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }\n    return uVar4;\n  }\n  ThrowMagickException\n            (uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4);\n  return 0;\n}\n\n" (function_definition "undefined4 MagickWriteImageFile(int param_1,int param_2)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  \n  if (param_1 == 0) {\n                    \n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }\n  if (*(int *)(param_1 + 0x101c) != -0x54535255) {\n                    \n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }\n  if (param_2 == 0) {\n                    \n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }\n  if (*(int *)(param_1 + 0x1018) == 0) {\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  if (iVar2 != 0) {\n    uVar4 = 0;\n    iVar2 = CloneImage(iVar2,0,0,1,uVar1);\n    if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }\n    return uVar4;\n  }\n  ThrowMagickException\n            (uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4);\n  return 0;\n}" type_identifier (function_declarator "MagickWriteImageFile(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  undefined4 uVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  \n  if (param_1 == 0) {\n                    \n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }\n  if (*(int *)(param_1 + 0x101c) != -0x54535255) {\n                    \n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }\n  if (param_2 == 0) {\n                    \n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }\n  if (*(int *)(param_1 + 0x1018) == 0) {\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  if (iVar2 != 0) {\n    uVar4 = 0;\n    iVar2 = CloneImage(iVar2,0,0,1,uVar1);\n    if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }\n    return uVar4;\n  }\n  ThrowMagickException\n            (uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4);\n  return 0;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (if_statement "if (param_1 == 0) {\n                    \n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\n                    \n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }" { (expression_statement "__assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");" (call_expression "__assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile")" identifier (argument_list "("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile")" ( (string_literal ""wand != (MagickWand *) NULL"" " string_content ") , (string_literal ""MagickWand/magick-image.c"" " string_content ") , number_literal , (string_literal ""MagickWriteImageFile"" " string_content ") ))) ;) })) (if_statement "if (*(int *)(param_1 + 0x101c) != -0x54535255) {\n                    \n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }" if (parenthesized_expression "(*(int *)(param_1 + 0x101c) != -0x54535255)" ( (binary_expression "*(int *)(param_1 + 0x101c) != -0x54535255" (pointer_expression "*(int *)(param_1 + 0x101c)" * (cast_expression "(int *)(param_1 + 0x101c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x101c)" ( (binary_expression "param_1 + 0x101c" identifier + number_literal) )))) != number_literal) )) (compound_statement "{\n                    \n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }" { (expression_statement "__assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");" (call_expression "__assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile")" identifier (argument_list "("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile")" ( (string_literal ""wand->signature == MagickWandSignature"" " string_content ") , (string_literal ""MagickWand/magick-image.c"" " string_content ") , number_literal , (string_literal ""MagickWriteImageFile"" " string_content ") ))) ;) })) (if_statement "if (param_2 == 0) {\n                    \n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n                    \n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }" { (expression_statement "__assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;" (call_expression "__assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")" identifier (argument_list "("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")" ( (string_literal ""file != (FILE *) NULL"" " string_content ") , (string_literal ""MagickWand/magick-image.c"" " string_content ") , number_literal , (string_literal ""MagickWriteImageFile"" " string_content ") ))) ;) })) (if_statement "if (*(int *)(param_1 + 0x1018) == 0) {\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }" if (parenthesized_expression "(*(int *)(param_1 + 0x1018) == 0)" ( (binary_expression "*(int *)(param_1 + 0x1018) == 0" (pointer_expression "*(int *)(param_1 + 0x1018)" * (cast_expression "(int *)(param_1 + 0x1018)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1018)" ( (binary_expression "param_1 + 0x1018" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }" { (expression_statement "iVar2 = *(int *)(param_1 + 0x1004);" (assignment_expression "iVar2 = *(int *)(param_1 + 0x1004)" identifier = (pointer_expression "*(int *)(param_1 + 0x1004)" * (cast_expression "(int *)(param_1 + 0x1004)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1004)" ( (binary_expression "param_1 + 0x1004" identifier + number_literal) ))))) ;) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 0x100c);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 0x100c)" identifier = (pointer_expression "*(undefined4 *)(param_1 + 0x100c)" * (cast_expression "(undefined4 *)(param_1 + 0x100c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x100c)" ( (binary_expression "param_1 + 0x100c" identifier + number_literal) ))))) ;) }) (else_clause "else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }" else (compound_statement "{\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }" { (expression_statement "LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);" (call_expression "LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4)" identifier (argument_list "(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4)" ( number_literal , (string_literal ""MagickWand/magick-image.c"" " string_content ") , (string_literal ""MagickWriteImageFile"" " string_content ") , number_literal , (string_literal ""%s"" " string_content ") , (binary_expression "param_1 + 4" identifier + number_literal) ))) ;) (expression_statement "iVar2 = *(int *)(param_1 + 0x1004);" (assignment_expression "iVar2 = *(int *)(param_1 + 0x1004)" identifier = (pointer_expression "*(int *)(param_1 + 0x1004)" * (cast_expression "(int *)(param_1 + 0x1004)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1004)" ( (binary_expression "param_1 + 0x1004" identifier + number_literal) ))))) ;) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 0x100c);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 0x100c)" identifier = (pointer_expression "*(undefined4 *)(param_1 + 0x100c)" * (cast_expression "(undefined4 *)(param_1 + 0x100c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x100c)" ( (binary_expression "param_1 + 0x100c" identifier + number_literal) ))))) ;) }))) (if_statement "if (iVar2 != 0) {\n    uVar4 = 0;\n    iVar2 = CloneImage(iVar2,0,0,1,uVar1);\n    if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }\n    return uVar4;\n  }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n    uVar4 = 0;\n    iVar2 = CloneImage(iVar2,0,0,1,uVar1);\n    if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }\n    return uVar4;\n  }" { (expression_statement "uVar4 = 0;" (assignment_expression "uVar4 = 0" identifier = number_literal) ;) (expression_statement "iVar2 = CloneImage(iVar2,0,0,1,uVar1);" (assignment_expression "iVar2 = CloneImage(iVar2,0,0,1,uVar1)" identifier = (call_expression "CloneImage(iVar2,0,0,1,uVar1)" identifier (argument_list "(iVar2,0,0,1,uVar1)" ( identifier , number_literal , number_literal , number_literal , identifier )))) ;) (if_statement "if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }" { (expression_statement "iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));" (assignment_expression "iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008))" identifier = (call_expression "CloneImageInfo(*(undefined4 *)(param_1 + 0x1008))" identifier (argument_list "(*(undefined4 *)(param_1 + 0x1008))" ( (pointer_expression "*(undefined4 *)(param_1 + 0x1008)" * (cast_expression "(undefined4 *)(param_1 + 0x1008)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1008)" ( (binary_expression "param_1 + 0x1008" identifier + number_literal) )))) )))) ;) (expression_statement "SetImageInfoFile(iVar3,param_2);" (call_expression "SetImageInfoFile(iVar3,param_2)" identifier (argument_list "(iVar3,param_2)" ( identifier , identifier ))) ;) (expression_statement "*(undefined4 *)(iVar3 + 0xc) = 1;" (assignment_expression "*(undefined4 *)(iVar3 + 0xc) = 1" (pointer_expression "*(undefined4 *)(iVar3 + 0xc)" * (cast_expression "(undefined4 *)(iVar3 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 0xc)" ( (binary_expression "iVar3 + 0xc" identifier + number_literal) )))) = number_literal) ;) (expression_statement "uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));" (assignment_expression "uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c))" identifier = (call_expression "WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c))" identifier (argument_list "(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c))" ( identifier , identifier , (pointer_expression "*(undefined4 *)(param_1 + 0x100c)" * (cast_expression "(undefined4 *)(param_1 + 0x100c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x100c)" ( (binary_expression "param_1 + 0x100c" identifier + number_literal) )))) )))) ;) (expression_statement "DestroyImageInfo(iVar3);" (call_expression "DestroyImageInfo(iVar3)" identifier (argument_list "(iVar3)" ( identifier ))) ;) (expression_statement "DestroyImage(iVar2);" (call_expression "DestroyImage(iVar2)" identifier (argument_list "(iVar2)" ( identifier ))) ;) })) (return_statement "return uVar4;" return identifier ;) })) (expression_statement "ThrowMagickException\n            (uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4);" (call_expression "ThrowMagickException\n            (uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4)" identifier (argument_list "(uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4)" ( identifier , (string_literal ""MagickWand/magick-image.c"" " string_content ") , (string_literal ""MagickWriteImageFile"" " string_content ") , number_literal , number_literal , (string_literal ""ContainsNoImages"" " string_content ") , (pointer_expression "&DAT_000e672e" & identifier) , (binary_expression "param_1 + 4" identifier + number_literal) ))) ;) (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 ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) (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 ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) (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 (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( LIT , (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") , (binary_expression IDENT + LIT) ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , LIT , LIT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , (string_literal " string_content ") , (string_literal " string_content ") , LIT , LIT , (string_literal " string_content ") , (pointer_expression & IDENT) , (binary_expression IDENT + LIT) ))) ;) (return_statement return LIT ;) })))
(function_definition "undefined4 MagickWriteImageFile(int param_1,int param_2)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  \n  if (param_1 == 0) {\n                    \n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }\n  if (*(int *)(param_1 + 0x101c) != -0x54535255) {\n                    \n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }\n  if (param_2 == 0) {\n                    \n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }\n  if (*(int *)(param_1 + 0x1018) == 0) {\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  if (iVar2 != 0) {\n    uVar4 = 0;\n    iVar2 = CloneImage(iVar2,0,0,1,uVar1);\n    if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }\n    return uVar4;\n  }\n  ThrowMagickException\n            (uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4);\n  return 0;\n}" (type_identifier "undefined4") (function_declarator "MagickWriteImageFile(int param_1,int param_2)" (identifier "MagickWriteImageFile") (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  undefined4 uVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  \n  if (param_1 == 0) {\n                    \n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }\n  if (*(int *)(param_1 + 0x101c) != -0x54535255) {\n                    \n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }\n  if (param_2 == 0) {\n                    \n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }\n  if (*(int *)(param_1 + 0x1018) == 0) {\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  if (iVar2 != 0) {\n    uVar4 = 0;\n    iVar2 = CloneImage(iVar2,0,0,1,uVar1);\n    if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }\n    return uVar4;\n  }\n  ThrowMagickException\n            (uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4);\n  return 0;\n}" ({ "{") (declaration "undefined4 uVar1;" (type_identifier "undefined4") (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "undefined4 uVar4;" (type_identifier "undefined4") (identifier "uVar4") (; ";")) (if_statement "if (param_1 == 0) {\n                    \n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }" (if "if") (parenthesized_expression "(param_1 == 0)" (( "(") (binary_expression "param_1 == 0" (identifier "param_1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n                    \n    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");\n  }" ({ "{") (expression_statement "__assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile");" (call_expression "__assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile")" (identifier "__assert_fail") (argument_list "("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,\n                  "MagickWriteImageFile")" (( "(") (string_literal ""wand != (MagickWand *) NULL"" (" """) (string_content "wand != (MagickWand *) NULL") (" """)) (, ",") (string_literal ""MagickWand/magick-image.c"" (" """) (string_content "MagickWand/magick-image.c") (" """)) (, ",") (number_literal "0x33d2") (, ",") (string_literal ""MagickWriteImageFile"" (" """) (string_content "MagickWriteImageFile") (" """)) () ")"))) (; ";")) (} "}"))) (if_statement "if (*(int *)(param_1 + 0x101c) != -0x54535255) {\n                    \n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }" (if "if") (parenthesized_expression "(*(int *)(param_1 + 0x101c) != -0x54535255)" (( "(") (binary_expression "*(int *)(param_1 + 0x101c) != -0x54535255" (pointer_expression "*(int *)(param_1 + 0x101c)" (* "*") (cast_expression "(int *)(param_1 + 0x101c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x101c)" (( "(") (binary_expression "param_1 + 0x101c" (identifier "param_1") (+ "+") (number_literal "0x101c")) () ")")))) (!= "!=") (number_literal "-0x54535255")) () ")")) (compound_statement "{\n                    \n    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");\n  }" ({ "{") (expression_statement "__assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile");" (call_expression "__assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile")" (identifier "__assert_fail") (argument_list "("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,\n                  "MagickWriteImageFile")" (( "(") (string_literal ""wand->signature == MagickWandSignature"" (" """) (string_content "wand->signature == MagickWandSignature") (" """)) (, ",") (string_literal ""MagickWand/magick-image.c"" (" """) (string_content "MagickWand/magick-image.c") (" """)) (, ",") (number_literal "0x33d3") (, ",") (string_literal ""MagickWriteImageFile"" (" """) (string_content "MagickWriteImageFile") (" """)) () ")"))) (; ";")) (} "}"))) (if_statement "if (param_2 == 0) {\n                    \n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n                    \n    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;\n  }" ({ "{") (expression_statement "__assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")\n    ;" (call_expression "__assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")" (identifier "__assert_fail") (argument_list "("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")" (( "(") (string_literal ""file != (FILE *) NULL"" (" """) (string_content "file != (FILE *) NULL") (" """)) (, ",") (string_literal ""MagickWand/magick-image.c"" (" """) (string_content "MagickWand/magick-image.c") (" """)) (, ",") (number_literal "0x33d4") (, ",") (string_literal ""MagickWriteImageFile"" (" """) (string_content "MagickWriteImageFile") (" """)) () ")"))) (; ";")) (} "}"))) (if_statement "if (*(int *)(param_1 + 0x1018) == 0) {\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }\n  else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }" (if "if") (parenthesized_expression "(*(int *)(param_1 + 0x1018) == 0)" (( "(") (binary_expression "*(int *)(param_1 + 0x1018) == 0" (pointer_expression "*(int *)(param_1 + 0x1018)" (* "*") (cast_expression "(int *)(param_1 + 0x1018)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1018)" (( "(") (binary_expression "param_1 + 0x1018" (identifier "param_1") (+ "+") (number_literal "0x1018")) () ")")))) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }" ({ "{") (expression_statement "iVar2 = *(int *)(param_1 + 0x1004);" (assignment_expression "iVar2 = *(int *)(param_1 + 0x1004)" (identifier "iVar2") (= "=") (pointer_expression "*(int *)(param_1 + 0x1004)" (* "*") (cast_expression "(int *)(param_1 + 0x1004)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1004)" (( "(") (binary_expression "param_1 + 0x1004" (identifier "param_1") (+ "+") (number_literal "0x1004")) () ")"))))) (; ";")) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 0x100c);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 0x100c)" (identifier "uVar1") (= "=") (pointer_expression "*(undefined4 *)(param_1 + 0x100c)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x100c)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x100c)" (( "(") (binary_expression "param_1 + 0x100c" (identifier "param_1") (+ "+") (number_literal "0x100c")) () ")"))))) (; ";")) (} "}")) (else_clause "else {\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }" (else "else") (compound_statement "{\n    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);\n    iVar2 = *(int *)(param_1 + 0x1004);\n    uVar1 = *(undefined4 *)(param_1 + 0x100c);\n  }" ({ "{") (expression_statement "LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4);" (call_expression "LogMagickEvent(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4)" (identifier "LogMagickEvent") (argument_list "(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",\n                   param_1 + 4)" (( "(") (number_literal "0x40000") (, ",") (string_literal ""MagickWand/magick-image.c"" (" """) (string_content "MagickWand/magick-image.c") (" """)) (, ",") (string_literal ""MagickWriteImageFile"" (" """) (string_content "MagickWriteImageFile") (" """)) (, ",") (number_literal "0x33d6") (, ",") (string_literal ""%s"" (" """) (string_content "%s") (" """)) (, ",") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) () ")"))) (; ";")) (expression_statement "iVar2 = *(int *)(param_1 + 0x1004);" (assignment_expression "iVar2 = *(int *)(param_1 + 0x1004)" (identifier "iVar2") (= "=") (pointer_expression "*(int *)(param_1 + 0x1004)" (* "*") (cast_expression "(int *)(param_1 + 0x1004)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1004)" (( "(") (binary_expression "param_1 + 0x1004" (identifier "param_1") (+ "+") (number_literal "0x1004")) () ")"))))) (; ";")) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 0x100c);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 0x100c)" (identifier "uVar1") (= "=") (pointer_expression "*(undefined4 *)(param_1 + 0x100c)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x100c)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x100c)" (( "(") (binary_expression "param_1 + 0x100c" (identifier "param_1") (+ "+") (number_literal "0x100c")) () ")"))))) (; ";")) (} "}")))) (if_statement "if (iVar2 != 0) {\n    uVar4 = 0;\n    iVar2 = CloneImage(iVar2,0,0,1,uVar1);\n    if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }\n    return uVar4;\n  }" (if "if") (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    uVar4 = 0;\n    iVar2 = CloneImage(iVar2,0,0,1,uVar1);\n    if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }\n    return uVar4;\n  }" ({ "{") (expression_statement "uVar4 = 0;" (assignment_expression "uVar4 = 0" (identifier "uVar4") (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar2 = CloneImage(iVar2,0,0,1,uVar1);" (assignment_expression "iVar2 = CloneImage(iVar2,0,0,1,uVar1)" (identifier "iVar2") (= "=") (call_expression "CloneImage(iVar2,0,0,1,uVar1)" (identifier "CloneImage") (argument_list "(iVar2,0,0,1,uVar1)" (( "(") (identifier "iVar2") (, ",") (number_literal "0") (, ",") (number_literal "0") (, ",") (number_literal "1") (, ",") (identifier "uVar1") () ")")))) (; ";")) (if_statement "if (iVar2 != 0) {\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }" (if "if") (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));\n      SetImageInfoFile(iVar3,param_2);\n      *(undefined4 *)(iVar3 + 0xc) = 1;\n      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));\n      DestroyImageInfo(iVar3);\n      DestroyImage(iVar2);\n    }" ({ "{") (expression_statement "iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));" (assignment_expression "iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008))" (identifier "iVar3") (= "=") (call_expression "CloneImageInfo(*(undefined4 *)(param_1 + 0x1008))" (identifier "CloneImageInfo") (argument_list "(*(undefined4 *)(param_1 + 0x1008))" (( "(") (pointer_expression "*(undefined4 *)(param_1 + 0x1008)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x1008)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1008)" (( "(") (binary_expression "param_1 + 0x1008" (identifier "param_1") (+ "+") (number_literal "0x1008")) () ")")))) () ")")))) (; ";")) (expression_statement "SetImageInfoFile(iVar3,param_2);" (call_expression "SetImageInfoFile(iVar3,param_2)" (identifier "SetImageInfoFile") (argument_list "(iVar3,param_2)" (( "(") (identifier "iVar3") (, ",") (identifier "param_2") () ")"))) (; ";")) (expression_statement "*(undefined4 *)(iVar3 + 0xc) = 1;" (assignment_expression "*(undefined4 *)(iVar3 + 0xc) = 1" (pointer_expression "*(undefined4 *)(iVar3 + 0xc)" (* "*") (cast_expression "(undefined4 *)(iVar3 + 0xc)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + 0xc)" (( "(") (binary_expression "iVar3 + 0xc" (identifier "iVar3") (+ "+") (number_literal "0xc")) () ")")))) (= "=") (number_literal "1")) (; ";")) (expression_statement "uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));" (assignment_expression "uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c))" (identifier "uVar4") (= "=") (call_expression "WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c))" (identifier "WriteImage") (argument_list "(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c))" (( "(") (identifier "iVar3") (, ",") (identifier "iVar2") (, ",") (pointer_expression "*(undefined4 *)(param_1 + 0x100c)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x100c)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x100c)" (( "(") (binary_expression "param_1 + 0x100c" (identifier "param_1") (+ "+") (number_literal "0x100c")) () ")")))) () ")")))) (; ";")) (expression_statement "DestroyImageInfo(iVar3);" (call_expression "DestroyImageInfo(iVar3)" (identifier "DestroyImageInfo") (argument_list "(iVar3)" (( "(") (identifier "iVar3") () ")"))) (; ";")) (expression_statement "DestroyImage(iVar2);" (call_expression "DestroyImage(iVar2)" (identifier "DestroyImage") (argument_list "(iVar2)" (( "(") (identifier "iVar2") () ")"))) (; ";")) (} "}"))) (return_statement "return uVar4;" (return "return") (identifier "uVar4") (; ";")) (} "}"))) (expression_statement "ThrowMagickException\n            (uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4);" (call_expression "ThrowMagickException\n            (uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4)" (identifier "ThrowMagickException") (argument_list "(uVar1,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,\n             "ContainsNoImages",&DAT_000e672e,param_1 + 4)" (( "(") (identifier "uVar1") (, ",") (string_literal ""MagickWand/magick-image.c"" (" """) (string_content "MagickWand/magick-image.c") (" """)) (, ",") (string_literal ""MagickWriteImageFile"" (" """) (string_content "MagickWriteImageFile") (" """)) (, ",") (number_literal "0x33d8") (, ",") (number_literal "0x1d6") (, ",") (string_literal ""ContainsNoImages"" (" """) (string_content "ContainsNoImages") (" """)) (, ",") (pointer_expression "&DAT_000e672e" (& "&") (identifier "DAT_000e672e")) (, ",") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) () ")"))) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

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

type_1 function_1(type_2 *var_1,type_3 *var_3)

{
  type_4 *var_6;
  type_5 *pEVar2;
  int var_8;
  int var_11;
  type_1 MVar5;
  
  if (var_1 == (type_2 *)0x0) {
                    /* WARNING: Subroutine does not return */
    var_2("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,
                  "MagickWriteImageFile");
  }
  if (var_1->signature != 0xabacadab) {
                    /* WARNING: Subroutine does not return */
    var_2("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,
                  "MagickWriteImageFile");
  }
  if (var_3 == (type_3 *)0x0) {
                    /* WARNING: Subroutine does not return */
    var_2("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MagickWriteImageFile")
    ;
  }
  if (var_1->debug == var_4) {
    var_6 = var_1->images;
    pEVar2 = var_1->exception;
  }
  else {
    var_5(0x40000,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d6,"%s",var_1->name
                  );
    var_6 = var_1->images;
    pEVar2 = var_1->exception;
  }
  if (var_6 != (type_4 *)0x0) {
    MVar5 = var_4;
    var_8 = var_7(var_6,0,0,1,pEVar2);
    if (var_8 != 0) {
      var_11 = var_9(var_1->image_info);
      var_10(var_11,var_3);
      *(type_6 *)(var_11 + 0xc) = 1;
      MVar5 = var_12(var_11,var_8,var_1->exception);
      var_13(var_11);
      var_14(var_8);
    }
    return MVar5;
  }
  var_15
            (pEVar2,"MagickWand/magick-image.c","MagickWriteImageFile",0x33d8,0x1d6,
             "ContainsNoImages",&DAT_000e672e,var_1->name);
  return var_4;
}


(translation_unit (function_definition type: (type_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: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content)) (string_literal (string_content)) (number_literal) (string_literal (string_content))))))) (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 (string_literal (string_content)) (string_literal (string_content)) (number_literal) (string_literal (string_content))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content)) (string_literal (string_content)) (number_literal) (string_literal (string_content))))))) (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 (assignment_expression left: (identifier) right: (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))))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (number_literal) (string_literal (string_content)) (string_literal (string_content)) (number_literal) (string_literal (string_content)) (binary_expression left: (identifier) right: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (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))))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))))) (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: (identifier) arguments: (argument_list (identifier) (number_literal) (number_literal) (number_literal) (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 (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (return_statement (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (string_literal (string_content)) (string_literal (string_content)) (number_literal) (number_literal) (string_literal (string_content)) (pointer_expression argument: (identifier)) (binary_expression left: (identifier) right: (number_literal))))) (return_statement (number_literal)))))

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

undefined4 MASKED(int param_1,int param_2)

{
  undefined4 uVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  
  if (param_1 == 0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("wand != (MagickWand *) NULL","MagickWand/magick-image.c",0x33d2,
                  "MASKED");
  }
  if (*(int *)(param_1 + 0x101c) != -0x54535255) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("wand->signature == MagickWandSignature","MagickWand/magick-image.c",0x33d3,
                  "MASKED");
  }
  if (param_2 == 0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("file != (FILE *) NULL","MagickWand/magick-image.c",0x33d4,"MASKED")
    ;
  }
  if (*(int *)(param_1 + 0x1018) == 0) {
    iVar2 = *(int *)(param_1 + 0x1004);
    uVar1 = *(undefined4 *)(param_1 + 0x100c);
  }
  else {
    LogMagickEvent(0x40000,"MagickWand/magick-image.c","MASKED",0x33d6,"%s",
                   param_1 + 4);
    iVar2 = *(int *)(param_1 + 0x1004);
    uVar1 = *(undefined4 *)(param_1 + 0x100c);
  }
  if (iVar2 != 0) {
    uVar4 = 0;
    iVar2 = CloneImage(iVar2,0,0,1,uVar1);
    if (iVar2 != 0) {
      iVar3 = CloneImageInfo(*(undefined4 *)(param_1 + 0x1008));
      SetImageInfoFile(iVar3,param_2);
      *(undefined4 *)(iVar3 + 0xc) = 1;
      uVar4 = WriteImage(iVar3,iVar2,*(undefined4 *)(param_1 + 0x100c));
      DestroyImageInfo(iVar3);
      DestroyImage(iVar2);
    }
    return uVar4;
  }
  ThrowMagickException
            (uVar1,"MagickWand/magick-image.c","MASKED",0x33d8,0x1d6,
             "ContainsNoImages",&DAT_000e672e,param_1 + 4);
  return 0;
}

