// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./CImg.h
// Function: cimg_library::CImg<unsigned char>::load_imagemagick_external(char const*)
CImg<T>& load_imagemagick_external(const char *const filename) {
      if (!filename)
        throw CImgArgumentException(_cimg_instance
                                    "load_imagemagick_external(): Specified filename is (null).",
                                    cimg_instance);
      std::fclose(cimg::fopen(filename,"rb"));            // Check if file exists.
      char command[1024] = { 0 }, filetmp[512] = { 0 };
      std::FILE *file = 0;
      const CImg<charT> s_filename = CImg<charT>::string(filename)._system_strescape();
#if cimg_OS==1
      cimg_snprintf(command,sizeof(command),"%s \"%s\" pnm:-",
                    cimg::imagemagick_path(),s_filename.data());
      file = popen(command,"r");
      if (file) {
        const unsigned int omode = cimg::exception_mode();
        cimg::exception_mode() = 0;
        try { load_pnm(file); } catch (...) {
          pclose(file);
          cimg::exception_mode() = omode;
          throw CImgIOException(_cimg_instance
                                "load_imagemagick_external(): Failed to load file '%s' with external command 'convert'.",
                                cimg_instance,
                                filename);
        }
        pclose(file);
        return *this;
      }
#endif
      do {
        cimg_snprintf(filetmp,sizeof(filetmp),"%s%c%s.pnm",cimg::temporary_path(),cimg_file_separator,cimg::filenamerand());
        if ((file=std::fopen(filetmp,"rb"))!=0) cimg::fclose(file);
      } while (file);
      cimg_snprintf(command,sizeof(command),"%s \"%s\" \"%s\"",
                    cimg::imagemagick_path(),s_filename.data(),CImg<charT>::string(filetmp)._system_strescape().data());
      cimg::system(command,cimg::imagemagick_path());
      if (!(file = std::fopen(filetmp,"rb"))) {
        cimg::fclose(cimg::fopen(filename,"r"));
        throw CImgIOException(_cimg_instance
                              "load_imagemagick_external(): Failed to load file '%s' with external command 'convert'.",
                              cimg_instance,
                              filename);

      } else cimg::fclose(file);
      load_pnm(filetmp);
      std::remove(filetmp);
      return *this;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x658, %rsp            # imm = 0x658
movq %rdi, 0x8(%rsp)
testq %rsi, %rsi
je 0x1f95b
movq %rsi, %r14
leaq 0x2e7b(%rip), %rsi      # 0x225d8
movq %r14, %rdi
callq 0x6909
movq %rax, %rdi
callq 0x32a0
leaq 0x250(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x3150
leaq 0x50(%rsp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x3150
leaq 0x10(%rsp), %rbx
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x12bac
movq %rbx, %rdi
callq 0x12c04
leaq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0x12fac
leaq 0x10(%rsp), %rdi
callq 0x13160
xorl %edi, %edi
xorl %esi, %esi
callq 0x7427
movq 0x48(%rsp), %r8
leaq 0x5a30(%rip), %rdx      # 0x25209
leaq 0x250(%rsp), %rbx
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x3490
leaq 0x2e9c(%rip), %rsi      # 0x22696
movq %rbx, %rdi
callq 0x30a0
testq %rax, %rax
je 0x1f831
movq %rax, %r15
movl 0x10ae4(%rip), %ebx     # 0x302f4
andl $0x0, 0x10add(%rip)     # 0x302f4
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x13254
movq %r15, %rdi
callq 0x33c0
jmp 0x1f93a
leaq 0x5a64(%rip), %r15      # 0x2529c
leaq 0x50(%rsp), %r12
pushq $0x2f
popq %rbp
leaq 0x2d91(%rip), %r13      # 0x225d8
xorl %edi, %edi
xorl %esi, %esi
callq 0x76cd
movq %rax, %rbx
callq 0x7ac2
movl $0x200, %esi            # imm = 0x200
movq %r12, %rdi
movq %r15, %rdx
movq %rbx, %rcx
movl %ebp, %r8d
movq %rax, %r9
xorl %eax, %eax
callq 0x3490
movq %r12, %rdi
movq %r13, %rsi
callq 0x3340
testq %rax, %rax
je 0x1f88d
movq %rax, %rdi
callq 0x7982
jmp 0x1f847
xorl %edi, %edi
xorl %esi, %esi
callq 0x7427
movq %rax, %r15
movq 0x48(%rsp), %r12
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x12bac
leaq 0x10(%rsp), %rdi
callq 0x12c04
movq 0x18(%rax), %r9
leaq 0x59e2(%rip), %rdx      # 0x252a7
leaq 0x250(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
movq %r15, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x3490
leaq 0x10(%rsp), %rdi
callq 0x13160
xorl %edi, %edi
xorl %esi, %esi
callq 0x7427
leaq 0x250(%rsp), %rdi
callq 0x3230
leaq 0x2cd2(%rip), %rsi      # 0x225d8
leaq 0x50(%rsp), %rdi
callq 0x3340
testq %rax, %rax
je 0x1f9cd
movq %rax, %rdi
callq 0x7982
leaq 0x50(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x58a0
leaq 0x50(%rsp), %rdi
callq 0x3520
leaq 0x30(%rsp), %rdi
callq 0x13160
movq 0x8(%rsp), %rax
addq $0x658, %rsp            # imm = 0x658
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x4008, %edi           # imm = 0x4008
callq 0x3110
movq %rax, %r14
movq 0x8(%rsp), %rbx
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %r8d
movl 0xc(%rbx), %r9d
leaq 0x5a9e(%rip), %rax      # 0x2541f
leaq 0x2b47(%rip), %r10      # 0x224cf
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
subq $0x8, %rsp
leaq 0x2cef(%rip), %r11      # 0x2268a
leaq 0x57fe(%rip), %rsi      # 0x251a0
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0x531a
addq $0x20, %rsp
leaq 0x1030a(%rip), %rsi     # 0x2fcc8
movq 0x10613(%rip), %rdx     # 0x2ffd8
movq %r14, %rdi
callq 0x34e0
leaq 0x2cc2(%rip), %rsi      # 0x22696
movq %r14, %rdi
callq 0x6909
movq %rax, %rdi
callq 0x7982
movl $0x4008, %edi           # imm = 0x4008
callq 0x3110
movq %rax, %r15
movq 0x8(%rsp), %rbx
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %r8d
movl 0xc(%rbx), %r9d
leaq 0x5a15(%rip), %rax      # 0x2541f
leaq 0x2abe(%rip), %r10      # 0x224cf
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
leaq 0x2c6a(%rip), %r11      # 0x2268a
leaq 0x57f0(%rip), %rsi      # 0x25217
movq %r15, %rdi
xorl %eax, %eax
pushq %r14
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0x6806
addq $0x20, %rsp
leaq 0x1029b(%rip), %rsi     # 0x2fce0
movq 0x1058c(%rip), %rdx     # 0x2ffd8
movq %r15, %rdi
callq 0x34e0
jmp 0x1fb16
movq %rax, %rbx
movq %r15, %rdi
callq 0x31d0
jmp 0x1fb44
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x13160
jmp 0x1fb44
jmp 0x1fb41
movq %rax, %rbx
movq %r14, %rdi
callq 0x31d0
jmp 0x1fb4e
movq %rax, %rdi
callq 0x30d0
movq %r15, %rdi
callq 0x33c0
movl %ebx, 0x1084e(%rip)     # 0x302f4
movl $0x4008, %edi           # imm = 0x4008
callq 0x3110
movq %rax, %r15
movq 0x8(%rsp), %rbx
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %r8d
movl 0xc(%rbx), %r9d
leaq 0x5953(%rip), %rax      # 0x2541f
leaq 0x29fc(%rip), %r10      # 0x224cf
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
leaq 0x2ba8(%rip), %r11      # 0x2268a
leaq 0x572e(%rip), %rsi      # 0x25217
movq %r15, %rdi
xorl %eax, %eax
pushq %r14
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0x6806
addq $0x20, %rsp
leaq 0x101d9(%rip), %rsi     # 0x2fce0
movq 0x104ca(%rip), %rdx     # 0x2ffd8
movq %r15, %rdi
callq 0x34e0
movq %rax, %rbx
jmp 0x1fb26
movq %rax, %rbx
movq %r15, %rdi
callq 0x31d0
callq 0x34d0
jmp 0x1fb44
movq %rax, %rdi
callq 0x4391
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x1fb49
jmp 0x1fb41
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x13160
movq %rbx, %rdi
callq 0x3500