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

#ifdef cimg_use_magick
      double stmin, stmax = (double)max_min(stmin);
      if (_depth>1)
        cimg::warn(_cimg_instance
                   "save_magick(): Instance is volumetric, only the first slice will be saved in file '%s'.",
                   cimg_instance,
                   filename);

      if (_spectrum>3)
        cimg::warn(_cimg_instance
                   "save_magick(): Instance is multispectral, only the three first channels will be "
                   "saved in file '%s'.",
                   cimg_instance,
                   filename);

      if (stmin<0 || (bytes_per_pixel==1 && stmax>=256) || stmax>=65536)
        cimg::warn(_cimg_instance
                   "save_magick(): Instance has pixel values in [%g,%g], probable type overflow in file '%s'.",
                   cimg_instance,
                   filename,stmin,stmax);

      Magick::Image image(Magick::Geometry(_width,_height),"black");
      image.type(Magick::TrueColorType);
      image.depth(bytes_per_pixel?(8*bytes_per_pixel):(stmax>=256?16:8));
      const T
        *ptr_r = data(0,0,0,0),
        *ptr_g = _spectrum>1?data(0,0,0,1):0,
        *ptr_b = _spectrum>2?data(0,0,0,2):0;
      Magick::PixelPacket *pixels = image.getPixels(0,0,_width,_height);
      switch (_spectrum) {
      case 1 : // Scalar images
        for (unsigned long off = (unsigned long)_width*_height; off; --off) {
          pixels->red = pixels->green = pixels->blue = (Magick::Quantum)*(ptr_r++);
          ++pixels;
        }
        break;
      case 2 : // RG images
        for (unsigned long off = (unsigned long)_width*_height; off; --off) {
          pixels->red = (Magick::Quantum)*(ptr_r++);
          pixels->green = (Magick::Quantum)*(ptr_g++);
          pixels->blue = 0; ++pixels;
        }
        break;
      default : // RGB images
        for (unsigned long off = (unsigned long)_width*_height; off; --off) {
          pixels->red = (Magick::Quantum)*(ptr_r++);
          pixels->green = (Magick::Quantum)*(ptr_g++);
          pixels->blue = (Magick::Quantum)*(ptr_b++);
          ++pixels;
        }
      }
      image.syncPixels();
      image.write(filename);
      return *this;
#else
      cimg::unused(bytes_per_pixel);
      throw CImgIOException(_cimg_instance
                            "save_magick(): Unable to save file '%s' unless libMagick++ is enabled.",
                            cimg_instance,
                            filename);
#endif
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rsi, %rsi
je 0x643a3
movq %rsi, %r15
cmpq $0x0, 0x18(%rbx)
je 0x64342
movdqu (%rbx), %xmm0
pxor %xmm1, %xmm1
pcmpeqd %xmm0, %xmm1
movmskps %xmm1, %eax
testb %al, %al
je 0x64403
leaq 0x2ad14(%rip), %rsi     # 0x8f05d
movq %r15, %rdi
callq 0x3b111
testq %rax, %rax
je 0x6438c
movq 0x43c4b(%rip), %rcx     # 0xa7fa8
cmpq %rax, (%rcx)
je 0x6439a
movq 0x43c1f(%rip), %rcx     # 0xa7f88
cmpq %rax, (%rcx)
je 0x6439a
movq %rax, %rdi
callq 0x4550
testl %eax, %eax
je 0x6439a
leaq 0x2ac7b(%rip), %rdi     # 0x8effc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb10
jmp 0x6439a
leaq 0x2ac3f(%rip), %rdi     # 0x8efd2
xorl %eax, %eax
callq 0xbb10
movq %rbx, %rax
popq %rbx
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 0xa4a4(%rip), %rax      # 0x6e868
leaq 0xb877(%rip), %r10      # 0x6fc42
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
subq $0x8, %rsp
leaq 0x2ad41(%rip), %r11     # 0x8f11f
leaq 0x2eaa5(%rip), %rsi     # 0x92e8a
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0xc16a
addq $0x20, %rsp
leaq 0x4384f(%rip), %rsi     # 0xa7c50
jmp 0x6445f
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 0xa444(%rip), %rax      # 0x6e868
leaq 0xb817(%rip), %r10      # 0x6fc42
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
leaq 0x2ace5(%rip), %r11     # 0x8f11f
leaq 0x2eaa4(%rip), %rsi     # 0x92ee5
movq %r14, %rdi
xorl %eax, %eax
pushq %r15
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0x36908
addq $0x20, %rsp
leaq 0x43891(%rip), %rsi     # 0xa7cf0
movq 0x43b6a(%rip), %rdx     # 0xa7fd0
movq %r14, %rdi
callq 0x4910
jmp 0x64470
movq %rax, %rbx
movq %r14, %rdi
callq 0x43c0
movq %rbx, %rdi
callq 0x4960
nop