// File: /workspace/github_cpp_makefile_star2_O1/manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImgList<double>::_save_cimg(_IO_FILE*, char const*, bool) const
const CImgList<T>& _save_cimg(std::FILE *const file, const char *const filename, const bool is_compressed) const {
      if (!file && !filename)
        throw CImgArgumentException(_cimglist_instance
                                    "save_cimg(): Specified filename is (null).",
                                    cimglist_instance);
#ifndef cimg_use_zlib
      if (is_compressed)
        cimg::warn(_cimglist_instance
                   "save_cimg(): Unable to save compressed data in file '%s' unless zlib is enabled, "
                   "saving them uncompressed.",
                   cimglist_instance,
                   filename?filename:"(FILE*)");
#endif
      std::FILE *const nfile = file?file:cimg::fopen(filename,"wb");
      const char *const ptype = pixel_type(), *const etype = cimg::endianness()?"big":"little";
      if (std::strstr(ptype,"unsigned")==ptype) std::fprintf(nfile,"%u unsigned_%s %s_endian\n",_width,ptype+9,etype);
      else std::fprintf(nfile,"%u %s %s_endian\n",_width,ptype,etype);
      cimglist_for(*this,l) {
        const CImg<T>& img = _data[l];
        std::fprintf(nfile,"%u %u %u %u",img._width,img._height,img._depth,img._spectrum);
        if (img._data) {
          CImg<T> tmp;
          if (cimg::endianness()) { tmp = img; cimg::invert_endianness(tmp._data,tmp.size()); }
          const CImg<T>& ref = cimg::endianness()?tmp:img;
          bool failed_to_compress = true;
          if (is_compressed) {
#ifdef cimg_use_zlib
            const unsigned long siz = sizeof(T)*ref.size();
            unsigned long csiz = siz + siz/100 + 16;
            Bytef *const cbuf = new Bytef[csiz];
            if (compress(cbuf,&csiz,(Bytef*)ref._data,siz))
              cimg::warn(_cimglist_instance
                         "save_cimg(): Failed to save compressed data for file '%s', saving them uncompressed.",
                         cimglist_instance,
                         filename?filename:"(FILE*)");
            else {
              std::fprintf(nfile," #%lu\n",csiz);
              cimg::fwrite(cbuf,csiz,nfile);
              delete[] cbuf;
              failed_to_compress = false;
            }
#endif
          }
          if (failed_to_compress) { // Write in a non-compressed way.
            std::fputc('\n',nfile);
            cimg::fwrite(ref._data,ref.size(),nfile);
          }
        } else std::fputc('\n',nfile);
      }
      if (!file) cimg::fclose(nfile);
      return *this;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rax
orq %rdx, %rax
je 0x6299d
movq %rdx, %r12
movq %rsi, %r14
testb %cl, %cl
je 0x62876
testq %r12, %r12
movl (%rbx), %esi
movl 0x4(%rbx), %edx
movq 0x8(%rbx), %rcx
leaq 0x31884(%rip), %r9      # 0x940e1
cmovneq %r12, %r9
leaq 0x348a6(%rip), %rdi     # 0x9710e
leaq 0x31380(%rip), %r8      # 0x93bef
xorl %eax, %eax
callq 0xbb52
movq %r14, %r15
movq %r14, (%rsp)
testq %r14, %r14
jne 0x62894
leaq 0x312a4(%rip), %rsi     # 0x93b2d
movq %r12, %rdi
callq 0x3ceb3
movq %rax, %r15
movl (%rbx), %edx
leaq 0x348ff(%rip), %rsi     # 0x9719c
leaq 0x3134b(%rip), %rcx     # 0x93bef
leaq 0x32ec4(%rip), %r8      # 0x9576f
movq %r15, %rdi
xorl %eax, %eax
callq 0x4740
cmpl $0x0, (%rbx)
jle 0x62939
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x8(%rbx), %r14
movl (%r14,%r13), %edx
movl 0x4(%r14,%r13), %ecx
movl 0x8(%r14,%r13), %r8d
movl 0xc(%r14,%r13), %r9d
movq %r15, %rdi
leaq 0x31da3(%rip), %rsi     # 0x94683
xorl %eax, %eax
callq 0x4740
movq 0x18(%r14,%r13), %r12
movl $0xa, %edi
movq %r15, %rsi
callq 0x4630
testq %r12, %r12
je 0x6292a
movq 0x18(%r14,%r13), %rdi
movl (%r14,%r13), %eax
movl 0x4(%r14,%r13), %ecx
imulq %rax, %rcx
movl 0x8(%r14,%r13), %eax
movl 0xc(%r14,%r13), %esi
imulq %rax, %rsi
imulq %rcx, %rsi
movq %r15, %rdx
callq 0x629f4
incq %rbp
movslq (%rbx), %rax
addq $0x20, %r13
cmpq %rax, %rbp
jl 0x628bf
cmpq $0x0, (%rsp)
je 0x62952
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r15, %r15
je 0x6298d
movq 0x4a64a(%rip), %rax     # 0xacfa8
cmpq %r15, (%rax)
je 0x62940
movq 0x4a61e(%rip), %rax     # 0xacf88
cmpq %r15, (%rax)
je 0x62940
movq %r15, %rdi
callq 0x4540
testl %eax, %eax
je 0x62940
leaq 0x3114a(%rip), %rdi     # 0x93acc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb52
jmp 0x62940
leaq 0x3110e(%rip), %rdi     # 0x93aa2
xorl %eax, %eax
callq 0xbb52
jmp 0x62940
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movq 0x8(%rbx), %r8
leaq 0x34706(%rip), %rsi     # 0x970c0
leaq 0x3122e(%rip), %r9      # 0x93bef
movq %rax, %rdi
xorl %eax, %eax
callq 0xc196
leaq 0x4a24e(%rip), %rsi     # 0xacc20
movq 0x4a5f7(%rip), %rdx     # 0xacfd0
movq %r14, %rdi
callq 0x4900
movq %rax, %rbx
movq %r14, %rdi
callq 0x43b0
movq %rbx, %rdi
callq 0x4950