// File: manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImg<double>::load_graphicsmagick_external(char const*)
CImg<T>& load_graphicsmagick_external(const char *const filename) {
      if (!filename)
        throw CImgArgumentException(_cimg_instance
                                    "load_graphicsmagick_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 convert \"%s\" pnm:-",
                    cimg::graphicsmagick_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_graphicsmagick_external(): Failed to load file '%s' with external command 'gm'.",
                                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 convert \"%s\" \"%s\"",
                    cimg::graphicsmagick_path(),s_filename.data(),
                    CImg<charT>::string(filetmp)._system_strescape().data());
      cimg::system(command,cimg::graphicsmagick_path());
      if (!(file = std::fopen(filetmp,"rb"))) {
        cimg::fclose(cimg::fopen(filename,"r"));
        throw CImgIOException(_cimg_instance
                              "load_graphicsmagick_external(): Failed to load file '%s' with external command 'gm'.",
                              cimg_instance,
                              filename);

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

// Assembly:
pushq %rbx
subq $0x810, %rsp            # imm = 0x810
movq %rdi, 0x800(%rsp)
movq %rsi, 0x7f8(%rsp)
movq 0x800(%rsp), %rax
movq %rax, 0x168(%rsp)
cmpq $0x0, 0x7f8(%rsp)
jne 0x92d33
movl $0x4008, %edi           # imm = 0x4008
callq 0x5240
movq %rax, %rcx
movq 0x168(%rsp), %rax
movq %rcx, 0x138(%rsp)
movl (%rax), %ecx
movl %ecx, 0x140(%rsp)
movl 0x4(%rax), %ecx
movl %ecx, 0x144(%rsp)
movl 0x8(%rax), %ecx
movl %ecx, 0x148(%rsp)
movl 0xc(%rax), %ecx
movl %ecx, 0x14c(%rsp)
movq 0x18(%rax), %rcx
movq %rcx, 0x150(%rsp)
movb 0x10(%rax), %dl
leaq 0x55d61(%rip), %rcx     # 0xe89d2
leaq 0x36e69(%rip), %rax     # 0xc9ae1
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0x158(%rsp)
callq 0x118f0
movq %rax, 0x160(%rsp)
jmp 0x92c96
movl 0x14c(%rsp), %r9d
movl 0x148(%rsp), %r8d
movl 0x144(%rsp), %ecx
movl 0x140(%rsp), %edx
movq 0x138(%rsp), %rdi
movq 0x150(%rsp), %rsi
movq 0x158(%rsp), %r10
movq 0x160(%rsp), %r11
movq %rsp, %rax
movq %r11, 0x10(%rax)
movq %r10, 0x8(%rax)
movq %rsi, (%rax)
leaq 0x586b7(%rip), %rsi     # 0xeb3a0
xorl %eax, %eax
callq 0x12220
jmp 0x92cf2
movq 0x138(%rsp), %rdi
leaq 0x6ce5f(%rip), %rsi     # 0xffb60
leaq -0x808a8(%rip), %rdx    # 0x12460
callq 0x5920
movq 0x138(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7f0(%rsp)
movl %eax, 0x7ec(%rsp)
callq 0x53a0
jmp 0x93481
movq 0x7f8(%rsp), %rdi
leaq 0x5641c(%rip), %rsi     # 0xe915e
callq 0x654a0
movq %rax, %rdi
callq 0x5530
leaq 0x3e0(%rsp), %rdi
xorl %esi, %esi
movl %esi, 0x124(%rsp)
movl $0x400, %edx            # imm = 0x400
callq 0x52a0
movl 0x124(%rsp), %esi
leaq 0x1e0(%rsp), %rdi
movl $0x200, %edx            # imm = 0x200
callq 0x52a0
movl 0x124(%rsp), %ecx
movq $0x0, 0x1d8(%rsp)
movq 0x7f8(%rsp), %rsi
leaq 0x198(%rsp), %rdi
movq %rdi, 0x128(%rsp)
movl $0x1, %edx
callq 0x7ab40
movq 0x128(%rsp), %rdi
callq 0x7abe0
movq %rax, 0x130(%rsp)
jmp 0x92dcf
movq 0x130(%rsp), %rsi
leaq 0x1b8(%rsp), %rdi
callq 0x7b450
jmp 0x92de6
leaq 0x198(%rsp), %rdi
callq 0x1a320
leaq 0x3e0(%rsp), %rax
movq %rax, 0x110(%rsp)
xorl %esi, %esi
movl %esi, %edi
callq 0x5bfb0
movq %rax, 0x118(%rsp)
jmp 0x92e16
leaq 0x1b8(%rsp), %rdi
callq 0x7b900
movq 0x110(%rsp), %rdi
movq 0x118(%rsp), %rcx
movq %rax, %r8
leaq 0x585cf(%rip), %rdx     # 0xeb40c
xorl %eax, %eax
movl $0x400, %esi            # imm = 0x400
callq 0x5890
leaq 0x41862(%rip), %rsi     # 0xd46b2
leaq 0x3e0(%rsp), %rdi
callq 0x5180
movq %rax, 0x108(%rsp)
jmp 0x92e67
movq 0x108(%rsp), %rax
movq %rax, 0x1d8(%rsp)
cmpq $0x0, 0x1d8(%rsp)
je 0x930f5
callq 0x124b0
movq %rax, 0x100(%rsp)
jmp 0x92e95
movq 0x100(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x194(%rsp)
callq 0x124b0
movq %rax, 0xf8(%rsp)
jmp 0x92eb5
movq 0x168(%rsp), %rdi
movq 0xf8(%rsp), %rax
movl $0x0, (%rax)
movq 0x1d8(%rsp), %rsi
callq 0x7b910
jmp 0x92eda
jmp 0x930c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7f0(%rsp)
movl %eax, 0x7ec(%rsp)
leaq 0x198(%rsp), %rdi
callq 0x1a320
jmp 0x93481
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7f0(%rsp)
movl %eax, 0x7ec(%rsp)
jmp 0x93474
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7f0(%rsp)
movl %eax, 0x7ec(%rsp)
movq 0x7f0(%rsp), %rdi
callq 0x51e0
movq 0x1d8(%rsp), %rdi
callq 0x5740
jmp 0x92f4e
movl 0x194(%rsp), %eax
movl %eax, 0xec(%rsp)
callq 0x124b0
movq %rax, 0xf0(%rsp)
jmp 0x92f6b
movq 0xf0(%rsp), %rax
movl 0xec(%rsp), %ecx
movl %ecx, (%rax)
movl $0x4008, %edi           # imm = 0x4008
callq 0x5240
movq %rax, %rcx
movq 0x168(%rsp), %rax
movq %rcx, 0xb8(%rsp)
movl (%rax), %ecx
movl %ecx, 0xc0(%rsp)
movl 0x4(%rax), %ecx
movl %ecx, 0xc4(%rsp)
movl 0x8(%rax), %ecx
movl %ecx, 0xc8(%rsp)
movl 0xc(%rax), %ecx
movl %ecx, 0xcc(%rsp)
movq 0x18(%rax), %rcx
movq %rcx, 0xd0(%rsp)
movb 0x10(%rax), %dl
leaq 0x559fc(%rip), %rcx     # 0xe89d2
leaq 0x36b04(%rip), %rax     # 0xc9ae1
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0xd8(%rsp)
callq 0x118f0
movq %rax, 0xe0(%rsp)
jmp 0x92ffb
movl 0xcc(%rsp), %r9d
movl 0xc8(%rsp), %r8d
movl 0xc4(%rsp), %ecx
movl 0xc0(%rsp), %edx
movq 0xb8(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %r10
movq 0xe0(%rsp), %r11
movq 0x7f8(%rsp), %rbx
movq %rsp, %rax
movq %rbx, 0x18(%rax)
movq %r11, 0x10(%rax)
movq %r10, 0x8(%rax)
movq %rsi, (%rax)
leaq 0x583c8(%rip), %rsi     # 0xeb422
xorl %eax, %eax
callq 0x5c880
jmp 0x93063
movq 0xb8(%rsp), %rdi
leaq 0x6cbfe(%rip), %rsi     # 0xffc70
leaq -0x365b9(%rip), %rdx    # 0x5cac0
callq 0x5920
jmp 0x93496
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7f0(%rsp)
movl %eax, 0x7ec(%rsp)
jmp 0x930ba
movq 0xb8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7f0(%rsp)
movl %eax, 0x7ec(%rsp)
callq 0x53a0
callq 0x58d0
jmp 0x930c1
jmp 0x93474
movq 0x1d8(%rsp), %rdi
callq 0x5740
jmp 0x930d5
movq 0x168(%rsp), %rax
movq %rax, 0x808(%rsp)
movl $0x1, 0x190(%rsp)
jmp 0x93456
jmp 0x930f7
leaq 0x1e0(%rsp), %rax
movq %rax, 0xa8(%rsp)
xorl %esi, %esi
movl %esi, %edi
callq 0x5c290
movq %rax, 0xb0(%rsp)
jmp 0x9311a
callq 0x5c7a0
movq %rax, 0xa0(%rsp)
jmp 0x93129
movq 0xa0(%rsp), %r9
movq 0xb0(%rsp), %rcx
movq 0xa8(%rsp), %rdi
leaq 0x5823e(%rip), %rdx     # 0xeb386
xorl %eax, %eax
movl $0x200, %esi            # imm = 0x200
movl $0x2f, %r8d
callq 0x5890
leaq 0x55ffd(%rip), %rsi     # 0xe915e
leaq 0x1e0(%rsp), %rdi
callq 0x55c0
movq %rax, 0x98(%rsp)
jmp 0x93178
movq 0x98(%rsp), %rax
movq %rax, 0x1d8(%rsp)
cmpq $0x0, %rax
je 0x9319f
movq 0x1d8(%rsp), %rdi
callq 0x5c6f0
jmp 0x9319d
jmp 0x9319f
jmp 0x931a1
cmpq $0x0, 0x1d8(%rsp)
jne 0x930f7
leaq 0x3e0(%rsp), %rax
movq %rax, 0x88(%rsp)
xorl %esi, %esi
movl %esi, %edi
callq 0x5bfb0
movq %rax, 0x90(%rsp)
jmp 0x931d3
leaq 0x1b8(%rsp), %rdi
callq 0x7b900
movq %rax, 0x80(%rsp)
leaq 0x170(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x7ab40
jmp 0x93206
leaq 0x170(%rsp), %rdi
callq 0x7abe0
movq %rax, 0x78(%rsp)
jmp 0x9321a
movq 0x78(%rsp), %rdi
callq 0x1a3e0
movq 0x88(%rsp), %rdi
movq 0x90(%rsp), %rcx
movq 0x80(%rsp), %r8
movq %rax, %r9
leaq 0x5825f(%rip), %rdx     # 0xeb4a5
xorl %eax, %eax
movl %eax, 0x64(%rsp)
movl $0x400, %esi            # imm = 0x400
callq 0x5890
leaq 0x170(%rsp), %rdi
callq 0x1a320
movl 0x64(%rsp), %esi
leaq 0x3e0(%rsp), %rax
movq %rax, 0x68(%rsp)
movl %esi, %edi
callq 0x5bfb0
movq %rax, 0x70(%rsp)
jmp 0x93282
movq 0x70(%rsp), %rsi
movq 0x68(%rsp), %rdi
callq 0x66380
jmp 0x93293
leaq 0x55ec4(%rip), %rsi     # 0xe915e
leaq 0x1e0(%rsp), %rdi
callq 0x55c0
movq %rax, 0x58(%rsp)
jmp 0x932ae
movq 0x58(%rsp), %rax
movq %rax, 0x1d8(%rsp)
cmpq $0x0, %rax
jne 0x93406
movq 0x7f8(%rsp), %rdi
leaq 0x413de(%rip), %rsi     # 0xd46b2
callq 0x654a0
movq %rax, 0x50(%rsp)
jmp 0x932e0
movq 0x50(%rsp), %rdi
callq 0x5c6f0
jmp 0x932ec
movl $0x4008, %edi           # imm = 0x4008
callq 0x5240
movq %rax, %rcx
movq 0x168(%rsp), %rax
movq %rcx, 0x20(%rsp)
movl (%rax), %ecx
movl %ecx, 0x28(%rsp)
movl 0x4(%rax), %ecx
movl %ecx, 0x2c(%rsp)
movl 0x8(%rax), %ecx
movl %ecx, 0x30(%rsp)
movl 0xc(%rax), %ecx
movl %ecx, 0x34(%rsp)
movq 0x18(%rax), %rcx
movq %rcx, 0x38(%rsp)
movb 0x10(%rax), %dl
leaq 0x5569e(%rip), %rcx     # 0xe89d2
leaq 0x367a6(%rip), %rax     # 0xc9ae1
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0x40(%rsp)
callq 0x118f0
movq %rax, 0x48(%rsp)
jmp 0x93353
movl 0x34(%rsp), %r9d
movl 0x30(%rsp), %r8d
movl 0x2c(%rsp), %ecx
movl 0x28(%rsp), %edx
movq 0x20(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %r10
movq 0x48(%rsp), %r11
movq 0x7f8(%rsp), %rbx
movq %rsp, %rax
movq %rbx, 0x18(%rax)
movq %r11, 0x10(%rax)
movq %r10, 0x8(%rax)
movq %rsi, (%rax)
leaq 0x58088(%rip), %rsi     # 0xeb422
xorl %eax, %eax
callq 0x5c880
jmp 0x933a3
movq 0x20(%rsp), %rdi
leaq 0x6c8c1(%rip), %rsi     # 0xffc70
leaq -0x368f6(%rip), %rdx    # 0x5cac0
callq 0x5920
jmp 0x93496
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7f0(%rsp)
movl %eax, 0x7ec(%rsp)
leaq 0x170(%rsp), %rdi
callq 0x1a320
jmp 0x93474
movq 0x20(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7f0(%rsp)
movl %eax, 0x7ec(%rsp)
callq 0x53a0
jmp 0x93474
movq 0x1d8(%rsp), %rdi
callq 0x5c6f0
jmp 0x93415
jmp 0x93417
movq 0x168(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
callq 0x63540
jmp 0x9342e
leaq 0x1e0(%rsp), %rdi
callq 0x59c0
movq 0x168(%rsp), %rax
movq %rax, 0x808(%rsp)
movl $0x1, 0x190(%rsp)
leaq 0x1b8(%rsp), %rdi
callq 0x1a320
movq 0x808(%rsp), %rax
addq $0x810, %rsp            # imm = 0x810
popq %rbx
retq
leaq 0x1b8(%rsp), %rdi
callq 0x1a320
movq 0x7f0(%rsp), %rdi
callq 0x5970
movq %rax, %rdi
callq 0xcb20
nopw %cs:(%rax,%rax)