// File: /workspace/github_cpp_makefile_star2_O2/manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImgList<double>::load_parrec(char const*)
CImgList<T>& load_parrec(const char *const filename) {
      if (!filename)
        throw CImgArgumentException(_cimglist_instance
                                    "load_parrec(): Specified filename is (null).",
                                    cimglist_instance);

      char body[1024] = { 0 }, filenamepar[1024] = { 0 }, filenamerec[1024] = { 0 };
      const char *const ext = cimg::split_filename(filename,body);
      if (!std::strcmp(ext,"par")) {
        std::strncpy(filenamepar,filename,sizeof(filenamepar)-1);
        cimg_snprintf(filenamerec,sizeof(filenamerec),"%s.rec",body);
      }
      if (!std::strcmp(ext,"PAR")) {
        std::strncpy(filenamepar,filename,sizeof(filenamepar)-1);
        cimg_snprintf(filenamerec,sizeof(filenamerec),"%s.REC",body);
      }
      if (!std::strcmp(ext,"rec")) {
        std::strncpy(filenamerec,filename,sizeof(filenamerec)-1);
        cimg_snprintf(filenamepar,sizeof(filenamepar),"%s.par",body);
      }
      if (!std::strcmp(ext,"REC")) {
        std::strncpy(filenamerec,filename,sizeof(filenamerec)-1);
        cimg_snprintf(filenamepar,sizeof(filenamepar),"%s.PAR",body);
      }
      std::FILE *file = cimg::fopen(filenamepar,"r");

      // Parse header file
      CImgList<floatT> st_slices;
      CImgList<uintT> st_global;
      int err;
      char line[256] = { 0 };
      do { err=std::fscanf(file,"%255[^\n]%*c",line); } while (err!=EOF && (*line=='#' || *line=='.'));
      do {
        unsigned int sn,size_x,size_y,pixsize;
        float rs,ri,ss;
        err = std::fscanf(file,"%u%*u%*u%*u%*u%*u%*u%u%*u%u%u%g%g%g%*[^\n]",&sn,&pixsize,&size_x,&size_y,&ri,&rs,&ss);
        if (err==7) {
          CImg<floatT>::vector((float)sn,(float)pixsize,(float)size_x,(float)size_y,ri,rs,ss,0).move_to(st_slices);
          unsigned int i; for (i = 0; i<st_global._width && sn<=st_global[i][2]; ++i) {}
          if (i==st_global._width) CImg<uintT>::vector(size_x,size_y,sn).move_to(st_global);
          else {
            CImg<uintT> &vec = st_global[i];
            if (size_x>vec[0]) vec[0] = size_x;
            if (size_y>vec[1]) vec[1] = size_y;
            vec[2] = sn;
          }
          st_slices[st_slices._width-1][7] = (float)i;
        }
      } while (err==7);

      // Read data
      std::FILE *file2 = cimg::fopen(filenamerec,"rb");
      cimglist_for(st_global,l) {
        const CImg<uintT>& vec = st_global[l];
        CImg<T>(vec[0],vec[1],vec[2]).move_to(*this);
      }

      cimglist_for(st_slices,l) {
        const CImg<floatT>& vec = st_slices[l];
        const unsigned int
          sn = (unsigned int)vec[0] - 1,
          pixsize = (unsigned int)vec[1],
          size_x = (unsigned int)vec[2],
          size_y = (unsigned int)vec[3],
          imn = (unsigned int)vec[7];
        const float ri = vec[4], rs = vec[5], ss = vec[6];
        switch (pixsize) {
        case 8 : {
          CImg<ucharT> buf(size_x,size_y);
          cimg::fread(buf._data,size_x*size_y,file2);
          if (cimg::endianness()) cimg::invert_endianness(buf._data,size_x*size_y);
          CImg<T>& img = (*this)[imn];
          cimg_forXY(img,x,y) img(x,y,sn) = (T)(( buf(x,y)*rs + ri )/(rs*ss));
        } break;
        case 16 : {
          CImg<ushortT> buf(size_x,size_y);
          cimg::fread(buf._data,size_x*size_y,file2);
          if (cimg::endianness()) cimg::invert_endianness(buf._data,size_x*size_y);
          CImg<T>& img = (*this)[imn];
          cimg_forXY(img,x,y) img(x,y,sn) = (T)(( buf(x,y)*rs + ri )/(rs*ss));
        } break;
        case 32 : {
          CImg<uintT> buf(size_x,size_y);
          cimg::fread(buf._data,size_x*size_y,file2);
          if (cimg::endianness()) cimg::invert_endianness(buf._data,size_x*size_y);
          CImg<T>& img = (*this)[imn];
          cimg_forXY(img,x,y) img(x,y,sn) = (T)(( buf(x,y)*rs + ri )/(rs*ss));
        } break;
        default :
          cimg::fclose(file);
          cimg::fclose(file2);
          throw CImgIOException(_cimglist_instance
                                "load_parrec(): Unsupported %d-bits pixel type for file '%s'.",
                                cimglist_instance,
                                pixsize,filename);
        }
      }
      cimg::fclose(file);
      cimg::fclose(file2);
      if (!_width)
        throw CImgIOException(_cimglist_instance
                              "load_parrec(): Failed to recognize valid PAR-REC data in file '%s'.",
                              cimglist_instance,
                              filename);
      return *this;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xda8, %rsp            # imm = 0xDA8
movq %rdi, %r12
testq %rsi, %rsi
je 0x3af08
movq %rsi, %r15
leaq 0x9a0(%rsp), %rbx
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4280
leaq 0x5a0(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x4280
leaq 0x1a0(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x4280
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2cc28
movq %rax, %rbx
leaq 0x3bddb(%rip), %rsi     # 0x7656f
movq %rax, %rdi
callq 0x4730
testl %eax, %eax
jne 0x3a7d8
leaq 0x5a0(%rsp), %rdi
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rsi
callq 0x4240
leaq 0x3bda2(%rip), %rdx     # 0x7655e
leaq 0x1a0(%rsp), %rdi
leaq 0x9a0(%rsp), %rcx
movl $0x400, %esi            # imm = 0x400
xorl %eax, %eax
callq 0x4890
leaq 0x3bd97(%rip), %rsi     # 0x76576
movq %rbx, %rdi
callq 0x4730
testl %eax, %eax
jne 0x3a823
leaq 0x5a0(%rsp), %rdi
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rsi
callq 0x4240
leaq 0x3bd5e(%rip), %rdx     # 0x76565
leaq 0x1a0(%rsp), %rdi
leaq 0x9a0(%rsp), %rcx
movl $0x400, %esi            # imm = 0x400
xorl %eax, %eax
callq 0x4890
leaq 0x3bd37(%rip), %rsi     # 0x76561
movq %rbx, %rdi
callq 0x4730
testl %eax, %eax
jne 0x3a86e
leaq 0x1a0(%rsp), %rdi
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rsi
callq 0x4240
leaq 0x3bd1a(%rip), %rdx     # 0x7656c
leaq 0x5a0(%rsp), %rdi
leaq 0x9a0(%rsp), %rcx
movl $0x400, %esi            # imm = 0x400
xorl %eax, %eax
callq 0x4890
leaq 0x3bcf3(%rip), %rsi     # 0x76568
movq %rbx, %rdi
callq 0x4730
testl %eax, %eax
jne 0x3a8b9
leaq 0x1a0(%rsp), %rdi
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rsi
callq 0x4240
leaq 0x3bcd6(%rip), %rdx     # 0x76573
leaq 0x5a0(%rsp), %rdi
leaq 0x9a0(%rsp), %rcx
movl $0x400, %esi            # imm = 0x400
xorl %eax, %eax
callq 0x4890
leaq 0x25ed3(%rip), %rsi     # 0x60793
leaq 0x5a0(%rsp), %rdi
callq 0x2dca5
movq %rax, 0x28(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
leaq 0xa0(%rsp), %rbx
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4280
leaq 0x3bc7d(%rip), %r14     # 0x7657a
movq 0x28(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x49d0
cmpl $-0x1, %eax
je 0x3a926
movzbl 0xa0(%rsp), %eax
cmpl $0x23, %eax
je 0x3a8fd
cmpl $0x2e, %eax
je 0x3a8fd
movq %r12, 0x18(%rsp)
movq %r15, 0x88(%rsp)
leaq 0x94(%rsp), %rbp
leaq 0x9c(%rsp), %r14
leaq 0x98(%rsp), %r12
leaq 0x30(%rsp), %r15
pushq $-0x1
popq %rbx
subq $0x8, %rsp
movq 0x30(%rsp), %rdi
leaq 0x3bc23(%rip), %rsi     # 0x76586
leaq 0x10(%rsp), %rdx
leaq 0x8c(%rsp), %rcx
leaq 0x1c(%rsp), %r8
leaq 0x18(%rsp), %r9
xorl %eax, %eax
pushq %rbp
pushq %r14
pushq %r12
callq 0x49d0
addq $0x20, %rsp
cmpl $0x7, %eax
jne 0x3aad4
movl 0x8(%rsp), %eax
cvtsi2ss %rax, %xmm0
movl 0x84(%rsp), %eax
cvtsi2ss %rax, %xmm1
movss %xmm0, 0x80(%rsp)
movss %xmm1, 0x7c(%rsp)
movl 0x14(%rsp), %eax
cvtsi2ss %rax, %xmm0
movss %xmm0, 0x78(%rsp)
movl 0x10(%rsp), %eax
cvtsi2ss %rax, %xmm0
movss %xmm0, 0x74(%rsp)
andl $0x0, 0x70(%rsp)
subq $0x8, %rsp
movq %r15, %rdi
leaq 0x88(%rsp), %rsi
leaq 0x84(%rsp), %rdx
leaq 0x80(%rsp), %rcx
leaq 0x7c(%rsp), %r8
movq %r12, %r9
leaq 0x78(%rsp), %rax
pushq %rax
pushq %rbp
pushq %r14
callq 0x3b040
addq $0x20, %rsp
movq %r15, %rdi
leaq 0x60(%rsp), %rsi
movl %ebx, %edx
callq 0x3b0e0
movq %r15, %rdi
callq 0x17c20
movl 0x50(%rsp), %eax
movl 0x8(%rsp), %edx
movq 0x58(%rsp), %rcx
addq $0x18, %rcx
xorl %r13d, %r13d
cmpq %r13, %rax
je 0x3aa54
movq (%rcx), %rsi
cmpl 0x8(%rsi), %edx
ja 0x3aa59
incq %r13
addq $0x20, %rcx
jmp 0x3aa3e
movl %eax, %r13d
jmp 0x3aa5e
cmpl %r13d, %eax
jne 0x3aa8e
movq %r15, %rdi
leaq 0x14(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x8(%rsp), %rcx
callq 0x3b120
movq %r15, %rdi
leaq 0x50(%rsp), %rsi
movl %ebx, %edx
callq 0x3b168
movq %r15, %rdi
callq 0x17f44
jmp 0x3aaae
movl 0x14(%rsp), %edx
movq (%rcx), %rax
cmpl (%rax), %edx
jbe 0x3aa9b
movl %edx, (%rax)
movl 0x10(%rsp), %ecx
cmpl 0x4(%rax), %ecx
jbe 0x3aaa7
movl %ecx, 0x4(%rax)
movl 0x8(%rsp), %ecx
movl %ecx, 0x8(%rax)
movl %r13d, %eax
cvtsi2ss %rax, %xmm0
movq 0x68(%rsp), %rax
movl 0x60(%rsp), %ecx
decl %ecx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %rax
movss %xmm0, 0x1c(%rax)
jmp 0x3a953
leaq 0x3a760(%rip), %rsi     # 0x7523b
leaq 0x1a0(%rsp), %rdi
callq 0x2dca5
movq %rax, 0x20(%rsp)
pushq $0x18
popq %r15
xorl %r12d, %r12d
leaq 0x30(%rsp), %rbx
pushq $0x1
popq %rbp
pushq $-0x1
popq %r14
movslq 0x50(%rsp), %rax
cmpq %rax, %r12
jge 0x3ab47
movq 0x58(%rsp), %rax
movq (%rax,%r15), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
movl 0x8(%rax), %ecx
movq %rbx, %rdi
movl %ebp, %r8d
callq 0x6caa
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
movl %r14d, %edx
callq 0x39770
movq %rbx, %rdi
callq 0x6c96
incq %r12
addq $0x20, %r15
jmp 0x3ab00
xorl %r15d, %r15d
leaq 0x30(%rsp), %rbp
movslq 0x60(%rsp), %rax
cmpq %rax, %r15
jge 0x3ae51
movq %rbp, %rsi
movq 0x68(%rsp), %rax
movq %r15, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %rax
cvttss2si (%rax), %rcx
cvttss2si 0x4(%rax), %rbp
cvttss2si 0x8(%rax), %r14
cvttss2si 0xc(%rax), %rbx
cvttss2si 0x1c(%rax), %rdx
decl %ecx
movss 0x10(%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movss 0x14(%rax), %xmm0
movss %xmm0, 0x4(%rsp)
movss 0x18(%rax), %xmm0
movss %xmm0, (%rsp)
movl %edx, %r13d
movl %ecx, %r12d
cmpl $0x8, %ebp
je 0x3ad66
cmpl $0x10, %ebp
je 0x3ac9b
cmpl $0x20, %ebp
jne 0x3ae9c
movq %rsi, %rbp
movq %rsi, %rdi
movl %r14d, %esi
movl %ebx, %edx
pushq $0x1
popq %rcx
movl %ecx, %r8d
callq 0x17c34
movq 0x48(%rsp), %rdi
imull %r14d, %ebx
movq %rbx, %rsi
movq 0x20(%rsp), %rdx
callq 0x3a371
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rcx
shlq $0x5, %r13
leaq (%rcx,%r13), %rax
movl 0x4(%rcx,%r13), %edx
movss (%rsp), %xmm0
mulss 0x4(%rsp), %xmm0
movss %xmm0, (%rsp)
testl %edx, %edx
movl $0x0, %ecx
cmovgl %edx, %ecx
imulq %rdx, %r12
xorl %edx, %edx
cmpq %rcx, %rdx
je 0x3ae41
movl (%rax), %esi
testl %esi, %esi
movl $0x0, %edi
cmovgl %esi, %edi
movq 0x48(%rsp), %r8
imulq %r12, %rsi
movl 0x30(%rsp), %r9d
imull %edx, %r9d
subq $0x1, %rdi
jb 0x3ac93
movl %r9d, %r10d
movl (%r8,%r10,4), %r10d
cvtsi2ss %r10, %xmm0
mulss 0x4(%rsp), %xmm0
addss 0xc(%rsp), %xmm0
divss (%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movq 0x18(%rax), %r10
movsd %xmm0, (%r10,%rsi,8)
incq %rsi
incl %r9d
jmp 0x3ac5a
incq %rdx
incq %r12
jmp 0x3ac33
movq %rsi, %rbp
movq %rsi, %rdi
movl %r14d, %esi
movl %ebx, %edx
pushq $0x1
popq %rcx
movl %ecx, %r8d
callq 0x3b1a8
movq 0x48(%rsp), %rdi
imull %r14d, %ebx
movq %rbx, %rsi
movq 0x20(%rsp), %rdx
callq 0x37cea
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rcx
shlq $0x5, %r13
leaq (%rcx,%r13), %rax
movl 0x4(%rcx,%r13), %edx
movss (%rsp), %xmm0
mulss 0x4(%rsp), %xmm0
movss %xmm0, (%rsp)
testl %edx, %edx
movl $0x0, %ecx
cmovgl %edx, %ecx
imulq %rdx, %r12
xorl %edx, %edx
cmpq %rcx, %rdx
je 0x3ae2d
movl (%rax), %esi
testl %esi, %esi
movl $0x0, %edi
cmovgl %esi, %edi
movq 0x48(%rsp), %r8
imulq %r12, %rsi
movl 0x30(%rsp), %r9d
imull %edx, %r9d
subq $0x1, %rdi
jb 0x3ad5e
movl %r9d, %r10d
movzwl (%r8,%r10,2), %r10d
cvtsi2ss %r10d, %xmm0
mulss 0x4(%rsp), %xmm0
addss 0xc(%rsp), %xmm0
divss (%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movq 0x18(%rax), %r10
movsd %xmm0, (%r10,%rsi,8)
incq %rsi
incl %r9d
jmp 0x3ad24
incq %rdx
incq %r12
jmp 0x3acfd
movq %rsi, %rbp
movq %rsi, %rdi
movl %r14d, %esi
movl %ebx, %edx
pushq $0x1
popq %rcx
movl %ecx, %r8d
callq 0xbbfa
movq 0x48(%rsp), %rdi
imull %r14d, %ebx
movq %rbx, %rsi
movq 0x20(%rsp), %rdx
callq 0x36072
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rcx
shlq $0x5, %r13
leaq (%rcx,%r13), %rax
movl 0x4(%rcx,%r13), %edx
movss (%rsp), %xmm0
mulss 0x4(%rsp), %xmm0
movss %xmm0, (%rsp)
testl %edx, %edx
movl $0x0, %ecx
cmovgl %edx, %ecx
imulq %rdx, %r12
xorl %edx, %edx
cmpq %rcx, %rdx
je 0x3ae37
movl (%rax), %esi
testl %esi, %esi
movl $0x0, %edi
cmovgl %esi, %edi
movq 0x48(%rsp), %r8
imulq %r12, %rsi
movl 0x30(%rsp), %r9d
imull %edx, %r9d
subq $0x1, %rdi
jb 0x3ae25
movl %r9d, %r10d
movzbl (%r8,%r10), %r10d
cvtsi2ss %r10d, %xmm0
mulss 0x4(%rsp), %xmm0
addss 0xc(%rsp), %xmm0
divss (%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movq 0x18(%rax), %r10
movsd %xmm0, (%r10,%rsi,8)
incq %rsi
incl %r9d
jmp 0x3adeb
incq %rdx
incq %r12
jmp 0x3adc8
movq %rbp, %rdi
callq 0x37e06
jmp 0x3ae49
movq %rbp, %rdi
callq 0xb8ae
jmp 0x3ae49
movq %rbp, %rdi
callq 0x17f44
incq %r15
jmp 0x3ab4f
movq 0x28(%rsp), %rdi
callq 0x2a2f8
movq 0x20(%rsp), %rdi
callq 0x2a2f8
movq 0x18(%rsp), %rbx
cmpl $0x0, (%rbx)
je 0x3af51
leaq 0x50(%rsp), %rdi
callq 0x3b328
leaq 0x60(%rsp), %rdi
callq 0x3b36e
movq %rbx, %rax
addq $0xda8, %rsp            # imm = 0xDA8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%rsp), %rdi
callq 0x2a2f8
movq 0x20(%rsp), %rdi
callq 0x2a2f8
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
movq 0x18(%rsp), %rax
movl (%rax), %edx
movl 0x4(%rax), %ecx
movq 0x8(%rax), %r8
leaq 0x3b6de(%rip), %rsi     # 0x765b0
leaq 0x3a1c6(%rip), %r9      # 0x7509f
movq %r14, %rdi
xorl %eax, %eax
pushq 0x88(%rsp)
pushq %rbp
callq 0x2a3de
popq %rax
popq %rcx
leaq 0x54e0c(%rip), %rsi     # 0x8fd00
movq 0x550dd(%rip), %rdx     # 0x8ffd8
movq %r14, %rdi
callq 0x4910
jmp 0x3afa2
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
movl (%r12), %edx
movl 0x4(%r12), %ecx
movq 0x8(%r12), %r8
leaq 0x3b5e4(%rip), %rsi     # 0x7650e
leaq 0x3a16e(%rip), %r9      # 0x7509f
movq %rax, %rdi
xorl %eax, %eax
callq 0x9d52
leaq 0x54d1e(%rip), %rsi     # 0x8fc60
movq 0x5508f(%rip), %rdx     # 0x8ffd8
movq %r14, %rdi
callq 0x4910
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movq 0x8(%rbx), %r8
subq $0x8, %rsp
leaq 0x3b69e(%rip), %rsi     # 0x76610
leaq 0x3a126(%rip), %r9      # 0x7509f
movq %rax, %rdi
xorl %eax, %eax
pushq 0x90(%rsp)
callq 0x2a3de
popq %rax
popq %rcx
leaq 0x54d6d(%rip), %rsi     # 0x8fd00
movq 0x5503e(%rip), %rdx     # 0x8ffd8
movq %r14, %rdi
callq 0x4910
jmp 0x3afb4
movq %rax, %rbx
movq %r14, %rdi
callq 0x4390
jmp 0x3b037
movq %rax, %rbx
movq %r14, %rdi
callq 0x4390
jmp 0x3b023
jmp 0x3b020
jmp 0x3b020
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xb8ae
jmp 0x3b023
jmp 0x3b020
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x37e06
jmp 0x3b023
jmp 0x3b020
jmp 0x3afed
jmp 0x3b020
jmp 0x3b020
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x17f44
jmp 0x3b023
jmp 0x3b020
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x6c96
jmp 0x3b023
jmp 0x3b020
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x17c20
jmp 0x3b023
jmp 0x3b020
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x3b328
leaq 0x60(%rsp), %rdi
callq 0x3b36e
movq %rbx, %rdi
callq 0x4950
nop