// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x840, %rsp            # imm = 0x840
movq %rdi, %rbx
testq %rsi, %rsi
je 0x2d5c2
movq %rsi, %r14
leaq 0x47e8f(%rip), %r15     # 0x7523b
movq %rsi, %rdi
movq %r15, %rsi
callq 0x2dca5
movq %rax, %rdi
callq 0x4530
leaq 0x440(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x4280
leaq 0x240(%rsp), %r12
movl $0x200, %edx            # imm = 0x200
movq %r12, %rdi
xorl %esi, %esi
callq 0x4280
leaq 0x40(%rsp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x4280
leaq 0x33391(%rip), %rsi     # 0x60793
movq %r14, %rdi
callq 0x2dca5
movq %rax, %rdi
callq 0x2a2f8
leaq 0x48ddb(%rip), %r13     # 0x761f4
callq 0x2a352
movl $0x200, %esi            # imm = 0x200
movq %r12, %rdi
movq %r13, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4890
movq %r12, %rdi
movq %r15, %rsi
callq 0x45b0
testq %rax, %rax
je 0x2d44d
movq %rax, %rdi
callq 0x2a2f8
jmp 0x2d419
xorl %edi, %edi
xorl %esi, %esi
callq 0x29f2f
movq %rax, %r15
leaq 0x20(%rsp), %r12
leaq 0x240(%rsp), %rsi
pushq $0x1
popq %rdx
movq %r12, %rdi
xorl %ecx, %ecx
callq 0x38750
movq %r12, %rdi
callq 0x387b0
movq 0x18(%rax), %r13
movq %rsp, %rdi
pushq $0x1
popq %rdx
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x38750
movq %rsp, %rdi
callq 0x387b0
movq 0x18(%rax), %r9
leaq 0x48d2f(%rip), %rdx     # 0x761d1
leaq 0x440(%rsp), %r12
movl $0x400, %esi            # imm = 0x400
movq %r12, %rdi
movq %r15, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x4890
movq %rsp, %rdi
callq 0xdba4
leaq 0x20(%rsp), %rdi
callq 0xdba4
movq %r12, %rdi
xorl %esi, %esi
callq 0x2e487
leaq 0x240(%rsp), %rdi
leaq 0x40(%rsp), %r15
movq %r15, %rsi
callq 0x2cc28
leaq 0x48cfd(%rip), %rdx     # 0x761f4
movl $0x400, %esi            # imm = 0x400
movq %r12, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x4890
leaq 0x47d2b(%rip), %rsi     # 0x7523b
movq %r12, %rdi
callq 0x45b0
testq %rax, %rax
jne 0x2d558
leaq 0x48ccb(%rip), %rdx     # 0x761ef
leaq 0x440(%rsp), %r15
leaq 0x40(%rsp), %rcx
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdi
xorl %eax, %eax
callq 0x4890
leaq 0x47cf4(%rip), %rsi     # 0x7523b
movq %r15, %rdi
callq 0x45b0
testq %rax, %rax
je 0x2d62f
movq %rax, %rdi
callq 0x2a2f8
leaq 0x440(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2d6d4
movq %r14, %rdi
callq 0x4990
leaq 0x40(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2cc28
leaq 0x48ce6(%rip), %rdx     # 0x7627a
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x4890
movq %r14, %rdi
callq 0x4990
movq %rbx, %rax
addq $0x840, %rsp            # imm = 0x840
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %r8d
movl 0xc(%rbx), %r9d
leaq 0x27205(%rip), %rax     # 0x547e8
leaq 0x285d8(%rip), %r10     # 0x55bc2
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
subq $0x8, %rsp
leaq 0x47aa2(%rip), %r11     # 0x7509f
leaq 0x48b69(%rip), %rsi     # 0x7616d
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0x9d52
addq $0x20, %rsp
leaq 0x62640(%rip), %rsi     # 0x8fc60
movq 0x629b1(%rip), %rdx     # 0x8ffd8
movq %r14, %rdi
callq 0x4910
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r15
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %r8d
movl 0xc(%rbx), %r9d
leaq 0x27198(%rip), %rax     # 0x547e8
leaq 0x2856b(%rip), %r10     # 0x55bc2
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
leaq 0x47a39(%rip), %r11     # 0x7509f
leaq 0x48b8e(%rip), %rsi     # 0x761fb
movq %r15, %rdi
xorl %eax, %eax
pushq %r14
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0x2a3de
addq $0x20, %rsp
leaq 0x62675(%rip), %rsi     # 0x8fd00
movq 0x62946(%rip), %rdx     # 0x8ffd8
movq %r15, %rdi
callq 0x4910
movq %rax, %rbx
movq %r15, %rdi
jmp 0x2d6a8
movq %rax, %rbx
movq %r14, %rdi
callq 0x4390
jmp 0x2d6cb
movq %rax, %rbx
movq %rsp, %rdi
callq 0xdba4
jmp 0x2d6c1
jmp 0x2d6be
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xdba4
movq %rbx, %rdi
callq 0x4950
nop