// File: /workspace/github_cpp_makefile_star2_O1/manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImg<double>::save_medcon_external(char const*) const
const CImg<T>& save_medcon_external(const char *const filename) const {
      if (!filename)
        throw CImgArgumentException(_cimg_instance
                                    "save_medcon_external(): Specified filename is (null).",
                                    cimg_instance);
      if (is_empty()) { cimg::fempty(0,filename); return *this; }

      char command[1024] = { 0 }, filetmp[512] = { 0 }, body[512] = { 0 };
      std::FILE *file;
      do {
        cimg_snprintf(filetmp,sizeof(filetmp),"%s.hdr",cimg::filenamerand());
        if ((file=std::fopen(filetmp,"rb"))!=0) cimg::fclose(file);
      } while (file);
      save_analyze(filetmp);
      cimg_snprintf(command,sizeof(command),"%s -w -c dicom -o \"%s\" -f \"%s\"",
                    cimg::medcon_path(),
                    CImg<charT>::string(filename)._system_strescape().data(),
                    CImg<charT>::string(filetmp)._system_strescape().data());
      cimg::system(command);
      std::remove(filetmp);
      cimg::split_filename(filetmp,body);
      cimg_snprintf(filetmp,sizeof(filetmp),"%s.img",body);
      std::remove(filetmp);

      file = std::fopen(filename,"rb");
      if (!file) {
        cimg_snprintf(command,sizeof(command),"m000-%s",filename);
        file = std::fopen(command,"rb");
        if (!file) {
          cimg::fclose(cimg::fopen(filename,"r"));
          throw CImgIOException(_cimg_instance
                                "save_medcon_external(): Failed to save file '%s' with external command 'medcon'.",
                                cimg_instance,
                                filename);
        }
      }
      cimg::fclose(file);
      std::rename(command,filename);
      return *this;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x858, %rsp            # imm = 0x858
movq %rdi, %rbx
testq %rsi, %rsi
je 0x5e2a4
movq %rsi, %rcx
cmpq $0x0, 0x18(%rbx)
je 0x5e155
movdqu (%rbx), %xmm0
pxor %xmm1, %xmm1
pcmpeqd %xmm0, %xmm1
movmskps %xmm1, %eax
testb %al, %al
jne 0x5e155
movq %rcx, (%rsp)
movq %rbx, 0x8(%rsp)
leaq 0x450(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x4290
leaq 0x50(%rsp), %r15
movl $0x200, %edx            # imm = 0x200
movq %r15, %rdi
xorl %esi, %esi
callq 0x4290
leaq 0x250(%rsp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x4290
callq 0x384af
leaq 0x36e6b(%rip), %rdx     # 0x94d6e
movl $0x200, %esi            # imm = 0x200
movq %r15, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x4880
leaq 0x35e99(%rip), %rsi     # 0x93db5
movq %r15, %rdi
callq 0x45c0
testq %rax, %rax
je 0x5df9d
movq 0x4f078(%rip), %rbx     # 0xacfa8
movq 0x4f051(%rip), %r14     # 0xacf88
leaq 0x36e30(%rip), %r15     # 0x94d6e
leaq 0x50(%rsp), %r12
leaq 0x35e6b(%rip), %r13     # 0x93db5
leaq 0x35b7b(%rip), %rbp     # 0x93acc
cmpq %rax, (%rbx)
je 0x5df73
cmpq %rax, (%r14)
je 0x5df73
movq %rax, %rdi
callq 0x4540
testl %eax, %eax
je 0x5df73
movq %rbp, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0xbb52
callq 0x384af
movl $0x200, %esi            # imm = 0x200
movq %r12, %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4880
movq %r12, %rdi
movq %r13, %rsi
callq 0x45c0
testq %rax, %rax
jne 0x5df51
leaq 0x50(%rsp), %rsi
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x5e3e6
xorl %edi, %edi
xorl %esi, %esi
callq 0x37ec9
movq %rax, %r12
movq (%rsp), %r14
movq %r14, %rdi
callq 0x41e0
leal 0x1(%rax), %edx
subq $0x8, %rsp
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x1, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
pushq $0x0
callq 0x106cc
addq $0x10, %rsp
movq %r15, %rdi
callq 0x4b1dc
movq 0x18(%rax), %r13
leaq 0x50(%rsp), %r15
movq %r15, %rdi
callq 0x41e0
leal 0x1(%rax), %edx
subq $0x8, %rsp
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
movl $0x1, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
pushq $0x0
callq 0x106cc
addq $0x10, %rsp
leaq 0x10(%rsp), %rdi
callq 0x4b1dc
movq 0x18(%rax), %r9
leaq 0x391c1(%rip), %rdx     # 0x97211
leaq 0x450(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
movq %r12, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x4880
cmpb $0x0, 0x20(%rsp)
jne 0x5e080
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x5e080
callq 0x4680
cmpb $0x0, 0x40(%rsp)
jne 0x5e096
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x5e096
callq 0x4680
leaq 0x450(%rsp), %rdi
callq 0x41e0
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
andq %rax, %r12
je 0x5e0fd
addl $0x10, %eax
movq %rax, %rdi
callq 0x4040
movq %rax, %r13
leaq 0x450(%rsp), %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0x4240
movabsq $0x7665642f203e3220, %rax # imm = 0x7665642F203E3220
movq %rax, (%r13,%r12)
movabsq $0x6c6c756e2f7665, %rax # imm = 0x6C6C756E2F7665
movq %rax, 0x6(%r13,%r12)
movq %r13, %rdi
callq 0x4480
movq %r13, %rdi
callq 0x4680
movq %r15, %rdi
callq 0x49a0
movq %r15, %rax
movq %rax, %r12
movq %rax, %rdi
movl $0x2e, %esi
callq 0x41a0
incq %rax
cmpq %r15, %rax
jae 0x5e108
leaq 0x50(%rsp), %rax
cmpq %rax, %r12
je 0x5e1c1
leaq 0x50(%rsp), %rsi
movl %esi, %eax
notl %eax
addl %eax, %r12d
leaq 0x250(%rsp), %rdi
movq %r12, %rdx
callq 0x4430
movb $0x0, 0x250(%rsp,%r12)
jmp 0x5e1d3
leaq 0x359d1(%rip), %rsi     # 0x93b2d
movq %rcx, %rdi
callq 0x3ceb3
testq %rax, %rax
je 0x5e1ae
movq 0x4ee38(%rip), %rcx     # 0xacfa8
cmpq %rax, (%rcx)
je 0x5e28f
movq 0x4ee08(%rip), %rcx     # 0xacf88
cmpq %rax, (%rcx)
je 0x5e28f
movq %rax, %rdi
callq 0x4540
testl %eax, %eax
je 0x5e28f
leaq 0x3592c(%rip), %rdi     # 0x93acc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb52
jmp 0x5e28f
leaq 0x358ed(%rip), %rdi     # 0x93aa2
xorl %eax, %eax
callq 0xbb52
jmp 0x5e28f
leaq 0x250(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x44d0
leaq 0x36c1a(%rip), %rdx     # 0x94df4
leaq 0x50(%rsp), %r15
leaq 0x250(%rsp), %rcx
movl $0x200, %esi            # imm = 0x200
movq %r15, %rdi
xorl %eax, %eax
callq 0x4880
movq %r15, %rdi
callq 0x49a0
leaq 0x35bb0(%rip), %rsi     # 0x93db5
movq %r14, %rdi
callq 0x45c0
testq %rax, %rax
jne 0x5e24b
leaq 0x39017(%rip), %rdx     # 0x97230
leaq 0x450(%rsp), %r15
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x4880
leaq 0x35b7b(%rip), %rsi     # 0x93db5
movq %r15, %rdi
callq 0x45c0
testq %rax, %rax
je 0x5e311
movq 0x4ed56(%rip), %rcx     # 0xacfa8
cmpq %rax, (%rcx)
je 0x5e27f
movq 0x4ed2a(%rip), %rcx     # 0xacf88
cmpq %rax, (%rcx)
je 0x5e27f
movq %rax, %rdi
callq 0x4540
testl %eax, %eax
je 0x5e27f
leaq 0x35856(%rip), %rdi     # 0x93acc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb52
leaq 0x450(%rsp), %rdi
movq %r14, %rsi
callq 0x42e0
movq %rbx, %rax
addq $0x858, %rsp            # imm = 0x858
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
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 0x15073(%rip), %rax     # 0x73338
leaq 0x16446(%rip), %r10     # 0x74712
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
subq $0x8, %rsp
leaq 0x35910(%rip), %r11     # 0x93bef
leaq 0x38ec7(%rip), %rsi     # 0x971ad
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0xc196
addq $0x20, %rsp
leaq 0x4e91e(%rip), %rsi     # 0xacc20
movq 0x4ecc7(%rip), %rdx     # 0xacfd0
movq %r14, %rdi
callq 0x4900
leaq 0x20fcb(%rip), %rsi     # 0x7f2e3
movq %r14, %rdi
callq 0x3ceb3
movq %rax, %rdi
callq 0x3845e
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 0x14fef(%rip), %rax     # 0x73338
leaq 0x163c2(%rip), %r10     # 0x74712
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
leaq 0x35890(%rip), %r11     # 0x93bef
leaq 0x38ed2(%rip), %rsi     # 0x97238
movq %r15, %rdi
xorl %eax, %eax
pushq %r14
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0x385b4
addq $0x20, %rsp
leaq 0x4e96c(%rip), %rsi     # 0xaccf0
movq 0x4ec45(%rip), %rdx     # 0xacfd0
movq %r15, %rdi
callq 0x4900
movq %rax, %rbx
movq %r15, %rdi
jmp 0x5e3d9
movq %rax, %rbx
cmpb $0x0, 0x20(%rsp)
jne 0x5e3bb
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x5e3bb
callq 0x4680
jmp 0x5e3bb
jmp 0x5e3b8
movq %rax, %rbx
cmpb $0x0, 0x40(%rsp)
jne 0x5e3de
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x5e3de
callq 0x4680
jmp 0x5e3de
movq %rax, %rbx
movq %r14, %rdi
callq 0x43b0
movq %rbx, %rdi
callq 0x4950