// File: /workspace/github_cpp_makefile_star2_O1/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 0x670ab
movq %rsi, %r15
cmpq $0x0, 0x18(%rbx)
je 0x6704a
movdqu (%rbx), %xmm0
pxor %xmm1, %xmm1
pcmpeqd %xmm0, %xmm1
movmskps %xmm1, %eax
testb %al, %al
je 0x6710b
leaq 0x2cadc(%rip), %rsi     # 0x93b2d
movq %r15, %rdi
callq 0x3ceb3
testq %rax, %rax
je 0x67094
movq 0x45f43(%rip), %rcx     # 0xacfa8
cmpq %rax, (%rcx)
je 0x670a2
movq 0x45f17(%rip), %rcx     # 0xacf88
cmpq %rax, (%rcx)
je 0x670a2
movq %rax, %rdi
callq 0x4540
testl %eax, %eax
je 0x670a2
leaq 0x2ca43(%rip), %rdi     # 0x93acc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb52
jmp 0x670a2
leaq 0x2ca07(%rip), %rdi     # 0x93aa2
xorl %eax, %eax
callq 0xbb52
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 0xc26c(%rip), %rax      # 0x73338
leaq 0xd63f(%rip), %r10      # 0x74712
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
subq $0x8, %rsp
leaq 0x2cb09(%rip), %r11     # 0x93bef
leaq 0x30963(%rip), %rsi     # 0x97a50
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0xc196
addq $0x20, %rsp
leaq 0x45b17(%rip), %rsi     # 0xacc20
jmp 0x67167
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 0xc20c(%rip), %rax      # 0x73338
leaq 0xd5df(%rip), %r10      # 0x74712
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
leaq 0x2caad(%rip), %r11     # 0x93bef
leaq 0x30962(%rip), %rsi     # 0x97aab
movq %r14, %rdi
xorl %eax, %eax
pushq %r15
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0x385b4
addq $0x20, %rsp
leaq 0x45b89(%rip), %rsi     # 0xaccf0
movq 0x45e62(%rip), %rdx     # 0xacfd0
movq %r14, %rdi
callq 0x4900
jmp 0x67178
movq %rax, %rbx
movq %r14, %rdi
callq 0x43b0
movq %rbx, %rdi
callq 0x4950
nop