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

#ifdef cimg_use_png
#define _cimg_sie_ext1 "png"
#define _cimg_sie_ext2 "png"
#else
#define _cimg_sie_ext1 "pgm"
#define _cimg_sie_ext2 "ppm"
#endif
      char command[1024] = { 0 }, filetmp[512] = { 0 };
      std::FILE *file;
      do {
        cimg_snprintf(filetmp,sizeof(filetmp),"%s%c%s.%s",cimg::temporary_path(),
                      cimg_file_separator,cimg::filenamerand(),_spectrum==1?_cimg_sie_ext1:_cimg_sie_ext2);
        if ((file=std::fopen(filetmp,"rb"))!=0) cimg::fclose(file);
      } while (file);
#ifdef cimg_use_png
      save_png(filetmp);
#else
      save_pnm(filetmp);
#endif
      cimg_snprintf(command,sizeof(command),"%s -quality %u \"%s\" \"%s\"",
                    cimg::imagemagick_path(),quality,
                    CImg<charT>::string(filetmp)._system_strescape().data(),
                    CImg<charT>::string(filename)._system_strescape().data());
      cimg::system(command);
      file = std::fopen(filename,"rb");
      if (!file)
        throw CImgIOException(_cimg_instance
                              "save_imagemagick_external(): Failed to save file '%s' with external command 'convert'.",
                              cimg_instance,
                              filename);

      if (file) cimg::fclose(file);
      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, %rbx
testq %rsi, %rsi
je 0x4ba9b
movl %edx, %ebp
movq %rsi, %r14
movq %rbx, %rdi
callq 0x8dc8
testb %al, %al
je 0x4b901
xorl %edi, %edi
movq %r14, %rsi
callq 0x465c3
jmp 0x4ba86
movl %ebp, 0x4(%rsp)
movq %r14, 0x8(%rsp)
leaq 0x250(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x4280
leaq 0x50(%rsp), %r15
movl $0x200, %edx            # imm = 0x200
movq %r15, %rdi
xorl %esi, %esi
callq 0x4280
leaq 0x2b4cd(%rip), %r12     # 0x76e06
pushq $0x2f
popq %r13
leaq 0x298f7(%rip), %rbp     # 0x7523b
xorl %edi, %edi
xorl %esi, %esi
callq 0x2a028
movq %rax, %r14
callq 0x2a352
cmpl $0x1, 0xc(%rbx)
leaq 0x2b65d(%rip), %r10     # 0x76fbd
leaq 0x29800(%rip), %rcx     # 0x75167
cmoveq %rcx, %r10
subq $0x8, %rsp
movl $0x200, %esi            # imm = 0x200
movq %r15, %rdi
movq %r12, %rdx
movq %r14, %rcx
movl %r13d, %r8d
movq %rax, %r9
xorl %eax, %eax
pushq %r10
callq 0x4890
popq %rcx
popq %rdx
movq %r15, %rdi
movq %rbp, %rsi
callq 0x45b0
testq %rax, %rax
je 0x4b9a8
movq %rax, %rdi
callq 0x2a2f8
jmp 0x4b944
leaq 0x50(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x44fda
xorl %edi, %edi
xorl %esi, %esi
callq 0x29d46
movq %rax, %r15
leaq 0x30(%rsp), %r12
pushq $0x1
popq %rdx
movq %r12, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x38750
movq %r12, %rdi
callq 0x387b0
movq 0x18(%rax), %r12
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rdx
movq 0x8(%rsp), %r13
movq %r13, %rsi
xorl %ecx, %ecx
callq 0x38750
leaq 0x10(%rsp), %rdi
callq 0x387b0
movq %rax, %r10
subq $0x8, %rsp
leaq 0x2d663(%rip), %rdx     # 0x79079
leaq 0x258(%rsp), %r14
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
movq %r15, %rcx
movl 0xc(%rsp), %r8d
movq %r12, %r9
xorl %eax, %eax
pushq 0x18(%r10)
callq 0x4890
popq %rcx
popq %rdx
leaq 0x10(%rsp), %rdi
callq 0xdba4
leaq 0x30(%rsp), %rdi
callq 0xdba4
movq %r14, %rdi
xorl %esi, %esi
callq 0x2e487
leaq 0x297d8(%rip), %rsi     # 0x7523b
movq %r13, %rdi
callq 0x45b0
testq %rax, %rax
je 0x4bb08
movq %rax, %rdi
callq 0x2a2f8
leaq 0x50(%rsp), %rdi
callq 0x4990
movq %rbx, %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 0x4210
movq %rax, %r14
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %r8d
movl 0xc(%rbx), %r9d
leaq 0x8d2c(%rip), %rax      # 0x547e8
leaq 0xa0ff(%rip), %r10      # 0x55bc2
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
subq $0x8, %rsp
leaq 0x295c9(%rip), %r11     # 0x7509f
leaq 0x2d533(%rip), %rsi     # 0x79010
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0x9d52
addq $0x20, %rsp
leaq 0x44167(%rip), %rsi     # 0x8fc60
movq 0x444d8(%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 0x8cbf(%rip), %rax      # 0x547e8
leaq 0xa092(%rip), %r10      # 0x55bc2
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
leaq 0x29560(%rip), %r11     # 0x7509f
leaq 0x2d54c(%rip), %rsi     # 0x79092
movq %r15, %rdi
xorl %eax, %eax
pushq %r13
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0x2a3de
addq $0x20, %rsp
leaq 0x4419c(%rip), %rsi     # 0x8fd00
movq 0x4446d(%rip), %rdx     # 0x8ffd8
movq %r15, %rdi
callq 0x4910
movq %rax, %rbx
movq %r15, %rdi
jmp 0x4bba1
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xdba4
jmp 0x4bb8f
jmp 0x4bb8c
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xdba4
jmp 0x4bba6
movq %rax, %rbx
movq %r14, %rdi
callq 0x4390
movq %rbx, %rdi
callq 0x4950