// File: /workspace/github_cpp_makefile_star2_O1/manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImg<double>::load_tiff(char const*, unsigned int, unsigned int, unsigned int, float*, cimg_library::CImg<char>*)
CImg<T>& load_tiff(const char *const filename,
                       const unsigned int first_frame=0, const unsigned int last_frame=~0U,
                       const unsigned int step_frame=1,
                       float *const voxel_size=0,
                       CImg<charT> *const description=0) {
      if (!filename)
        throw CImgArgumentException(_cimg_instance
                                    "load_tiff(): Specified filename is (null).",
                                    cimg_instance);

      const unsigned int
        nfirst_frame = first_frame<last_frame?first_frame:last_frame,
        nstep_frame = step_frame?step_frame:1;
      unsigned int nlast_frame = first_frame<last_frame?last_frame:first_frame;

#ifndef cimg_use_tiff
      cimg::unused(voxel_size,description);
      if (nfirst_frame || nlast_frame!=~0U || nstep_frame>1)
        throw CImgArgumentException(_cimg_instance
                                    "load_tiff(): Unable to read sub-images from file '%s' unless libtiff is enabled.",
                                    cimg_instance,
                                    filename);
      return load_other(filename);
#else
      TIFF *tif = TIFFOpen(filename,"r");
      if (tif) {
        unsigned int nb_images = 0;
        do ++nb_images; while (TIFFReadDirectory(tif));
        if (nfirst_frame>=nb_images || (nlast_frame!=~0U && nlast_frame>=nb_images))
          cimg::warn(_cimg_instance
                     "load_tiff(): File '%s' contains %u image(s) while specified frame range is [%u,%u] (step %u).",
                     cimg_instance,
                     filename,nb_images,nfirst_frame,nlast_frame,nstep_frame);

        if (nfirst_frame>=nb_images) return assign();
        if (nlast_frame>=nb_images) nlast_frame = nb_images-1;
        TIFFSetDirectory(tif,0);
        CImg<T> frame;
        for (unsigned int l = nfirst_frame; l<=nlast_frame; l+=nstep_frame) {
          frame._load_tiff(tif,l,voxel_size,description);
          if (l==nfirst_frame)
            assign(frame._width,frame._height,1+(nlast_frame-nfirst_frame)/nstep_frame,frame._spectrum);
          if (frame._width>_width || frame._height>_height || frame._spectrum>_spectrum)
            resize(cimg::max(frame._width,_width),
                   cimg::max(frame._height,_height),-100,
                   cimg::max(frame._spectrum,_spectrum),0);
          draw_image(0,0,(l-nfirst_frame)/nstep_frame,frame);
        }
        TIFFClose(tif);
      } else throw CImgIOException(_cimg_instance
                                   "load_tiff(): Failed to open file '%s'.",
                                   cimg_instance,
                                   filename);
      return *this;
#endif
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x3b7e3
movq %rsi, %r15
cmpl %ecx, %edx
movl %ecx, %eax
cmovbl %edx, %eax
cmoval %edx, %ecx
cmpl $0x1, %r8d
ja 0x3b840
testl %eax, %eax
jne 0x3b840
cmpl $-0x1, %ecx
jne 0x3b840
movq %r14, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x3d31a
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %rbx
movl (%r14), %edx
movl 0x4(%r14), %ecx
movl 0x8(%r14), %r8d
movl 0xc(%r14), %r9d
leaq 0x37b32(%rip), %rax     # 0x73338
leaq 0x38f05(%rip), %r10     # 0x74712
cmpb $0x0, 0x10(%r14)
cmovneq %rax, %r10
subq $0x8, %rsp
leaq 0x583ce(%rip), %r11     # 0x93bef
leaq 0x59145(%rip), %rsi     # 0x9496d
movq %rbx, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x18(%r14)
callq 0xc196
addq $0x20, %rsp
jmp 0x3b899
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %rbx
movl (%r14), %edx
movl 0x4(%r14), %ecx
movl 0x8(%r14), %r8d
movl 0xc(%r14), %r9d
leaq 0x37ad5(%rip), %rax     # 0x73338
leaq 0x38ea8(%rip), %r10     # 0x74712
cmpb $0x0, 0x10(%r14)
cmovneq %rax, %r10
leaq 0x58375(%rip), %r11     # 0x93bef
leaq 0x59145(%rip), %rsi     # 0x949c6
movq %rbx, %rdi
xorl %eax, %eax
pushq %r15
pushq %r11
pushq %r10
pushq 0x18(%r14)
callq 0xc196
addq $0x20, %rsp
leaq 0x71380(%rip), %rsi     # 0xacc20
movq 0x71729(%rip), %rdx     # 0xacfd0
movq %rbx, %rdi
callq 0x4900
jmp 0x3b8b1
movq %rax, %r14
movq %rbx, %rdi
callq 0x43b0
movq %r14, %rdi
callq 0x4950