// File: /workspace/github_cpp_makefile_star2_O3/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 0x5fe51
movq %rdx, %r12
movq %rsi, %r14
testb %cl, %cl
je 0x5fd2a
testq %r12, %r12
movl (%rbx), %esi
movl 0x4(%rbx), %edx
movq 0x8(%rbx), %rcx
leaq 0x2f900(%rip), %r9      # 0x8f611
cmovneq %r12, %r9
leaq 0x32922(%rip), %rdi     # 0x9263e
leaq 0x2f3fc(%rip), %r8      # 0x8f11f
xorl %eax, %eax
callq 0xbb10
movq %r14, %r15
movq %r14, (%rsp)
testq %r14, %r14
jne 0x5fd48
leaq 0x2f320(%rip), %rsi     # 0x8f05d
movq %r12, %rdi
callq 0x3b111
movq %rax, %r15
movl (%rbx), %edx
leaq 0x3297b(%rip), %rsi     # 0x926cc
leaq 0x2f3c7(%rip), %rcx     # 0x8f11f
leaq 0x30f40(%rip), %r8      # 0x90c9f
movq %r15, %rdi
xorl %eax, %eax
callq 0x4750
cmpl $0x0, (%rbx)
jle 0x5fded
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 0x2fe1f(%rip), %rsi     # 0x8fbb3
xorl %eax, %eax
callq 0x4750
movq 0x18(%r14,%r13), %r12
movl $0xa, %edi
movq %r15, %rsi
callq 0x4640
testq %r12, %r12
je 0x5fdde
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 0x5fea8
incq %rbp
movslq (%rbx), %rax
addq $0x20, %r13
cmpq %rax, %rbp
jl 0x5fd73
cmpq $0x0, (%rsp)
je 0x5fe06
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r15, %r15
je 0x5fe41
movq 0x48196(%rip), %rax     # 0xa7fa8
cmpq %r15, (%rax)
je 0x5fdf4
movq 0x4816a(%rip), %rax     # 0xa7f88
cmpq %r15, (%rax)
je 0x5fdf4
movq %r15, %rdi
callq 0x4550
testl %eax, %eax
je 0x5fdf4
leaq 0x2f1c6(%rip), %rdi     # 0x8effc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb10
jmp 0x5fdf4
leaq 0x2f18a(%rip), %rdi     # 0x8efd2
xorl %eax, %eax
callq 0xbb10
jmp 0x5fdf4
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movq 0x8(%rbx), %r8
leaq 0x32782(%rip), %rsi     # 0x925f0
leaq 0x2f2aa(%rip), %r9      # 0x8f11f
movq %rax, %rdi
xorl %eax, %eax
callq 0xc16a
leaq 0x47dca(%rip), %rsi     # 0xa7c50
movq 0x48143(%rip), %rdx     # 0xa7fd0
movq %r14, %rdi
callq 0x4910
movq %rax, %rbx
movq %r14, %rdi
callq 0x43c0
movq %rbx, %rdi
callq 0x4960