// File: /workspace/github_cpp_makefile_star2_O3/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 0x39a43
movq %rsi, %r15
cmpl %ecx, %edx
movl %ecx, %eax
cmovbl %edx, %eax
cmoval %edx, %ecx
cmpl $0x1, %r8d
ja 0x39aa0
testl %eax, %eax
jne 0x39aa0
cmpl $-0x1, %ecx
jne 0x39aa0
movq %r14, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x3b580
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 0x34e02(%rip), %rax     # 0x6e868
leaq 0x361d5(%rip), %r10     # 0x6fc42
cmpb $0x0, 0x10(%r14)
cmovneq %rax, %r10
subq $0x8, %rsp
leaq 0x5569e(%rip), %r11     # 0x8f11f
leaq 0x56415(%rip), %rsi     # 0x8fe9d
movq %rbx, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x18(%r14)
callq 0xc16a
addq $0x20, %rsp
jmp 0x39af9
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 0x34da5(%rip), %rax     # 0x6e868
leaq 0x36178(%rip), %r10     # 0x6fc42
cmpb $0x0, 0x10(%r14)
cmovneq %rax, %r10
leaq 0x55645(%rip), %r11     # 0x8f11f
leaq 0x56415(%rip), %rsi     # 0x8fef6
movq %rbx, %rdi
xorl %eax, %eax
pushq %r15
pushq %r11
pushq %r10
pushq 0x18(%r14)
callq 0xc16a
addq $0x20, %rsp
leaq 0x6e150(%rip), %rsi     # 0xa7c50
movq 0x6e4c9(%rip), %rdx     # 0xa7fd0
movq %rbx, %rdi
callq 0x4910
jmp 0x39b11
movq %rax, %r14
movq %rbx, %rdi
callq 0x43c0
movq %r14, %rdi
callq 0x4960