// File: manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImg<double>::load_medcon_external(char const*)
CImg<T>& load_medcon_external(const char *const filename) {
      if (!filename)
        throw CImgArgumentException(_cimg_instance
                                    "load_medcon_external(): Specified filename is (null).",
                                    cimg_instance);
      std::fclose(cimg::fopen(filename,"rb"));            // Check if file exists.
      char command[1024] = { 0 }, filetmp[512] = { 0 }, body[512] = { 0 };
      cimg::fclose(cimg::fopen(filename,"r"));
      std::FILE *file = 0;
      do {
        cimg_snprintf(filetmp,sizeof(filetmp),"%s.hdr",cimg::filenamerand());
        if ((file=std::fopen(filetmp,"rb"))!=0) cimg::fclose(file);
      } while (file);
      cimg_snprintf(command,sizeof(command),"%s -w -c anlz -o \"%s\" -f \"%s\"",
                    cimg::medcon_path(),
                    CImg<charT>::string(filetmp)._system_strescape().data(),
                    CImg<charT>::string(filename)._system_strescape().data());
      cimg::system(command);
      cimg::split_filename(filetmp,body);

      cimg_snprintf(command,sizeof(command),"%s.hdr",body);
      file = std::fopen(command,"rb");
      if (!file) {
        cimg_snprintf(command,sizeof(command),"m000-%s.hdr",body);
        file = std::fopen(command,"rb");
        if (!file) {
          throw CImgIOException(_cimg_instance
                                "load_medcon_external(): Failed to load file '%s' with external command 'medcon'.",
                                cimg_instance,
                                filename);
        }
      }
      cimg::fclose(file);
      load_analyze(command);
      std::remove(command);
      cimg::split_filename(command,body);
      cimg_snprintf(command,sizeof(command),"%s.img",body);
      std::remove(command);
      return *this;
    }

// Assembly:
pushq %rbx
subq $0x930, %rsp            # imm = 0x930
movq %rdi, 0x928(%rsp)
movq %rsi, 0x920(%rsp)
movq 0x928(%rsp), %rax
movq %rax, 0xc0(%rsp)
cmpq $0x0, 0x920(%rsp)
jne 0x644b3
movl $0x4008, %edi           # imm = 0x4008
callq 0x5240
movq %rax, %rcx
movq 0xc0(%rsp), %rax
movq %rcx, 0x90(%rsp)
movl (%rax), %ecx
movl %ecx, 0x98(%rsp)
movl 0x4(%rax), %ecx
movl %ecx, 0x9c(%rsp)
movl 0x8(%rax), %ecx
movl %ecx, 0xa0(%rsp)
movl 0xc(%rax), %ecx
movl %ecx, 0xa4(%rsp)
movq 0x18(%rax), %rcx
movq %rcx, 0xa8(%rsp)
movb 0x10(%rax), %dl
leaq 0x845e1(%rip), %rcx     # 0xe89d2
leaq 0x656e9(%rip), %rax     # 0xc9ae1
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0xb0(%rsp)
callq 0x118f0
movq %rax, 0xb8(%rsp)
jmp 0x64416
movl 0xa4(%rsp), %r9d
movl 0xa0(%rsp), %r8d
movl 0x9c(%rsp), %ecx
movl 0x98(%rsp), %edx
movq 0x90(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %r10
movq 0xb8(%rsp), %r11
movq %rsp, %rax
movq %r11, 0x10(%rax)
movq %r10, 0x8(%rax)
movq %rsi, (%rax)
leaq 0x85c29(%rip), %rsi     # 0xea092
xorl %eax, %eax
callq 0x12220
jmp 0x64472
movq 0x90(%rsp), %rdi
leaq 0x9b6df(%rip), %rsi     # 0xffb60
leaq -0x52028(%rip), %rdx    # 0x12460
callq 0x5920
movq 0x90(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x918(%rsp)
movl %eax, 0x914(%rsp)
callq 0x53a0
jmp 0x6490d
movq 0x920(%rsp), %rdi
leaq 0x84c9c(%rip), %rsi     # 0xe915e
callq 0x654a0
movq %rax, %rdi
callq 0x5530
leaq 0x510(%rsp), %rdi
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x52a0
leaq 0x310(%rsp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x52a0
leaq 0x110(%rsp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x52a0
movq 0x920(%rsp), %rdi
leaq 0x70198(%rip), %rsi     # 0xd46b2
callq 0x654a0
movq %rax, %rdi
callq 0x5c6f0
movq $0x0, 0x108(%rsp)
leaq 0x310(%rsp), %rax
movq %rax, 0x88(%rsp)
callq 0x5c7a0
movq 0x88(%rsp), %rdi
movq %rax, %rcx
movl $0x200, %esi            # imm = 0x200
leaq 0x85bba(%rip), %rdx     # 0xea119
movb $0x0, %al
callq 0x5890
leaq 0x310(%rsp), %rdi
leaq 0x84be9(%rip), %rsi     # 0xe915e
callq 0x55c0
movq %rax, 0x108(%rsp)
cmpq $0x0, %rax
je 0x64595
movq 0x108(%rsp), %rdi
callq 0x5c6f0
jmp 0x64597
cmpq $0x0, 0x108(%rsp)
jne 0x64533
leaq 0x510(%rsp), %rax
movq %rax, 0x60(%rsp)
xorl %esi, %esi
movl %esi, 0x6c(%rsp)
movl %esi, %edi
callq 0x5c120
movl 0x6c(%rsp), %ecx
movq %rax, 0x70(%rsp)
leaq 0xe8(%rsp), %rdi
movq %rdi, 0x78(%rsp)
leaq 0x310(%rsp), %rsi
movl $0x1, %edx
callq 0x7ab40
movq 0x78(%rsp), %rdi
callq 0x7abe0
movq %rax, 0x80(%rsp)
jmp 0x645f8
movq 0x80(%rsp), %rdi
callq 0x1a3e0
movq %rax, 0x58(%rsp)
movq 0x920(%rsp), %rsi
leaq 0xc8(%rsp), %rdi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x7ab40
jmp 0x64628
leaq 0xc8(%rsp), %rdi
callq 0x7abe0
movq %rax, 0x50(%rsp)
jmp 0x6463c
movq 0x50(%rsp), %rdi
callq 0x1a3e0
movq 0x60(%rsp), %rdi
movq 0x70(%rsp), %rcx
movq 0x58(%rsp), %r8
movq %rax, %r9
movl $0x400, %esi            # imm = 0x400
leaq 0x85a92(%rip), %rdx     # 0xea0f6
movb $0x0, %al
callq 0x5890
leaq 0xc8(%rsp), %rdi
callq 0x1a320
leaq 0xe8(%rsp), %rdi
callq 0x1a320
leaq 0x510(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x66380
leaq 0x310(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x63280
leaq 0x510(%rsp), %rdi
leaq 0x110(%rsp), %rcx
movl $0x400, %esi            # imm = 0x400
leaq 0x85a52(%rip), %rdx     # 0xea119
movb $0x0, %al
callq 0x5890
leaq 0x510(%rsp), %rdi
leaq 0x84a81(%rip), %rsi     # 0xe915e
callq 0x55c0
movq %rax, 0x108(%rsp)
cmpq $0x0, 0x108(%rsp)
jne 0x64884
leaq 0x510(%rsp), %rdi
leaq 0x110(%rsp), %rcx
movl $0x400, %esi            # imm = 0x400
leaq 0x859ff(%rip), %rdx     # 0xea114
movb $0x0, %al
callq 0x5890
leaq 0x510(%rsp), %rdi
leaq 0x84a33(%rip), %rsi     # 0xe915e
callq 0x55c0
movq %rax, 0x108(%rsp)
cmpq $0x0, 0x108(%rsp)
jne 0x64882
movl $0x4008, %edi           # imm = 0x4008
callq 0x5240
movq %rax, %rcx
movq 0xc0(%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 0x84243(%rip), %rcx     # 0xe89d2
leaq 0x6534b(%rip), %rax     # 0xc9ae1
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0x40(%rsp)
callq 0x118f0
movq %rax, 0x48(%rsp)
jmp 0x647ae
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 0x920(%rsp), %rbx
movq %rsp, %rax
movq %rbx, 0x18(%rax)
movq %r11, 0x10(%rax)
movq %r10, 0x8(%rax)
movq %rsi, (%rax)
leaq 0x8592b(%rip), %rsi     # 0xea120
xorl %eax, %eax
callq 0x5c880
jmp 0x647fe
movq 0x20(%rsp), %rdi
leaq 0x9b466(%rip), %rsi     # 0xffc70
leaq -0x7d51(%rip), %rdx     # 0x5cac0
callq 0x5920
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x918(%rsp)
movl %eax, 0x914(%rsp)
jmp 0x6484d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x918(%rsp)
movl %eax, 0x914(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x1a320
leaq 0xe8(%rsp), %rdi
callq 0x1a320
jmp 0x6490d
movq 0x20(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x918(%rsp)
movl %eax, 0x914(%rsp)
callq 0x53a0
jmp 0x6490d
jmp 0x64884
movq 0x108(%rsp), %rdi
callq 0x5c6f0
movq 0xc0(%rsp), %rdi
leaq 0x510(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x64920
leaq 0x510(%rsp), %rdi
callq 0x59c0
leaq 0x510(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x63280
leaq 0x510(%rsp), %rdi
leaq 0x110(%rsp), %rcx
movl $0x400, %esi            # imm = 0x400
leaq 0x858b7(%rip), %rdx     # 0xea19f
movb $0x0, %al
callq 0x5890
leaq 0x510(%rsp), %rdi
callq 0x59c0
movq 0xc0(%rsp), %rax
addq $0x930, %rsp            # imm = 0x930
popq %rbx
retq
movq 0x918(%rsp), %rdi
callq 0x5970
nopw (%rax,%rax)