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

#ifdef cimg_use_png
#define _cimg_sge_ext1 "png"
#define _cimg_sge_ext2 "png"
#else
#define _cimg_sge_ext1 "pgm"
#define _cimg_sge_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_sge_ext1:_cimg_sge_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 convert -quality %u \"%s\" \"%s\"",
                    cimg::graphicsmagick_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_graphicsmagick_external(): Failed to save file '%s' with external command 'gm'.",
                              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 0x4bd85
movl %edx, %ebp
movq %rsi, %r14
movq %rbx, %rdi
callq 0x8dc8
testb %al, %al
je 0x4bbeb
xorl %edi, %edi
movq %r14, %rsi
callq 0x465c3
jmp 0x4bd70
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 0x2b1e3(%rip), %r12     # 0x76e06
pushq $0x2f
popq %r13
leaq 0x2960d(%rip), %rbp     # 0x7523b
xorl %edi, %edi
xorl %esi, %esi
callq 0x2a028
movq %rax, %r14
callq 0x2a352
cmpl $0x1, 0xc(%rbx)
leaq 0x2b373(%rip), %r10     # 0x76fbd
leaq 0x29516(%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 0x4bc92
movq %rax, %rdi
callq 0x2a2f8
jmp 0x4bc2e
leaq 0x50(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x44fda
xorl %edi, %edi
xorl %esi, %esi
callq 0x29e41
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 0x2d483(%rip), %rdx     # 0x79183
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 0x294ee(%rip), %rsi     # 0x7523b
movq %r13, %rdi
callq 0x45b0
testq %rax, %rax
je 0x4bdf2
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 0x8a42(%rip), %rax      # 0x547e8
leaq 0x9e15(%rip), %r10      # 0x55bc2
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
subq $0x8, %rsp
leaq 0x292df(%rip), %r11     # 0x7509f
leaq 0x2d350(%rip), %rsi     # 0x79117
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0x9d52
addq $0x20, %rsp
leaq 0x43e7d(%rip), %rsi     # 0x8fc60
movq 0x441ee(%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 0x89d5(%rip), %rax      # 0x547e8
leaq 0x9da8(%rip), %r10      # 0x55bc2
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
leaq 0x29276(%rip), %r11     # 0x7509f
leaq 0x2d374(%rip), %rsi     # 0x791a4
movq %r15, %rdi
xorl %eax, %eax
pushq %r13
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0x2a3de
addq $0x20, %rsp
leaq 0x43eb2(%rip), %rsi     # 0x8fd00
movq 0x44183(%rip), %rdx     # 0x8ffd8
movq %r15, %rdi
callq 0x4910
movq %rax, %rbx
movq %r15, %rdi
jmp 0x4be8b
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xdba4
jmp 0x4be79
jmp 0x4be76
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xdba4
jmp 0x4be90
movq %rax, %rbx
movq %r14, %rdi
callq 0x4390
movq %rbx, %rdi
callq 0x4950