// File: /workspace/github_cpp_makefile_star2_O3/manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImg<double>::_load_pfm(_IO_FILE*, char const*)
CImg<T>& _load_pfm(std::FILE *const file, const char *const filename) {
      if (!file && !filename)
        throw CImgArgumentException(_cimg_instance
                                    "load_pfm(): Specified filename is (null).",
                                    cimg_instance);

      std::FILE *const nfile = file?file:cimg::fopen(filename,"rb");
      char pfm_type;
      CImg<charT> item(16384,1,1,1,0);
      int W = 0, H = 0, err = 0;
      double scale = 0;
      while ((err=std::fscanf(nfile,"%16383[^\n]",item.data()))!=EOF && (*item=='#' || !err)) std::fgetc(nfile);
      if (std::sscanf(item," P%c",&pfm_type)!=1) {
        if (!file) cimg::fclose(nfile);
        throw CImgIOException(_cimg_instance
                              "load_pfm(): PFM header not found in file '%s'.",
                              cimg_instance,
                              filename?filename:"(FILE*)");
      }
      while ((err=std::fscanf(nfile," %16383[^\n]",item.data()))!=EOF && (*item=='#' || !err)) std::fgetc(nfile);
      if ((err=std::sscanf(item," %d %d",&W,&H))<2) {
        if (!file) cimg::fclose(nfile);
        throw CImgIOException(_cimg_instance
                              "load_pfm(): WIDTH and HEIGHT fields are undefined in file '%s'.",
                              cimg_instance,
                              filename?filename:"(FILE*)");
      }
      if (err==2) {
        while ((err=std::fscanf(nfile," %16383[^\n]",item.data()))!=EOF && (*item=='#' || !err)) std::fgetc(nfile);
        if (std::sscanf(item,"%lf",&scale)!=1)
          cimg::warn(_cimg_instance
                     "load_pfm(): SCALE field is undefined in file '%s'.",
                     cimg_instance,
                     filename?filename:"(FILE*)");
      }
      std::fgetc(nfile);
      const bool is_color = (pfm_type=='F'), is_inverted = (scale>0)!=cimg::endianness();
      if (is_color) {
        assign(W,H,1,3,0);
        CImg<floatT> buf(3*W);
        T *ptr_r = data(0,0,0,0), *ptr_g = data(0,0,0,1), *ptr_b = data(0,0,0,2);
        cimg_forY(*this,y) {
          cimg::fread(buf._data,3*W,nfile);
          if (is_inverted) cimg::invert_endianness(buf._data,3*W);
          const float *ptrs = buf._data;
          cimg_forX(*this,x) {
            *(ptr_r++) = (T)*(ptrs++);
            *(ptr_g++) = (T)*(ptrs++);
            *(ptr_b++) = (T)*(ptrs++);
          }
        }
      } else {
        assign(W,H,1,1,0);
        CImg<floatT> buf(W);
        T *ptrd = data(0,0,0,0);
        cimg_forY(*this,y) {
          cimg::fread(buf._data,W,nfile);
          if (is_inverted) cimg::invert_endianness(buf._data,W);
          const float *ptrs = buf._data;
          cimg_forX(*this,x) *(ptrd++) = (T)*(ptrs++);
        }
      }
      if (!file) cimg::fclose(nfile);
      return mirror('y');  // Most of the .pfm files are flipped along the y-axis.
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq %rsi, %rax
orq %rdx, %rax
je 0x49090
movq %rdx, %r12
movq %rsi, %r14
movq %rsi, 0x10(%rsp)
testq %rsi, %rsi
jne 0x48c2b
leaq 0x466c5(%rip), %rsi     # 0x8f2e5
movq %r12, %rdi
callq 0x3b111
movq %rax, %r14
leaq 0x48(%rsp), %rdi
xorl %ebp, %ebp
movl $0x4000, %esi           # imm = 0x4000
movl $0x1, %edx
movl $0x1, %ecx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x4836a
movl %ebp, 0x4(%rsp)
movl %ebp, 0xc(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x46f40(%rip), %r13     # 0x8fba7
movq 0x60(%rsp), %rdx
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x49f0
movq 0x60(%rsp), %rdi
cmpl $-0x1, %eax
je 0x48c9e
cmpb $0x23, (%rdi)
sete %cl
testl %eax, %eax
sete %al
orb %cl, %al
cmpb $0x1, %al
jne 0x48c9e
movq %r14, %rdi
callq 0x4850
jmp 0x48c67
leaq 0x470c3(%rip), %rsi     # 0x8fd68
leaq 0xb(%rsp), %rdx
xorl %eax, %eax
callq 0x4540
cmpl $0x1, %eax
jne 0x490fd
leaq 0x46ee5(%rip), %r13     # 0x8fba6
movq 0x60(%rsp), %rdx
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x49f0
movq 0x60(%rsp), %rdi
cmpl $-0x1, %eax
je 0x48cf8
cmpb $0x23, (%rdi)
sete %cl
testl %eax, %eax
sete %al
orb %cl, %al
cmpb $0x1, %al
jne 0x48cf8
movq %r14, %rdi
callq 0x4850
jmp 0x48cc1
leaq 0x46f90(%rip), %rsi     # 0x8fc8f
leaq 0x4(%rsp), %rdx
leaq 0xc(%rsp), %rcx
xorl %eax, %eax
callq 0x4540
cmpl $0x1, %eax
jle 0x49172
cmpl $0x2, %eax
jne 0x48dcf
leaq 0x46e7d(%rip), %r13     # 0x8fba6
movq 0x60(%rsp), %rdx
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x49f0
movq 0x60(%rsp), %rdi
cmpl $-0x1, %eax
je 0x48d60
cmpb $0x23, (%rdi)
sete %cl
testl %eax, %eax
sete %al
orb %cl, %al
cmpb $0x1, %al
jne 0x48d60
movq %r14, %rdi
callq 0x4850
jmp 0x48d29
leaq 0x470d1(%rip), %rsi     # 0x8fe38
leaq 0x40(%rsp), %rdx
xorl %eax, %eax
callq 0x4540
cmpl $0x1, %eax
je 0x48dcf
leaq 0x25ae9(%rip), %rax     # 0x6e868
cmpb $0x0, 0x10(%rbx)
leaq 0x26eb8(%rip), %r10     # 0x6fc42
cmovneq %rax, %r10
testq %r12, %r12
movl (%rbx), %esi
movl 0x4(%rbx), %edx
movl 0x8(%rbx), %ecx
movl 0xc(%rbx), %r8d
movq 0x18(%rbx), %r9
leaq 0x46869(%rip), %r11     # 0x8f611
cmovneq %r12, %r11
subq $0x8, %rsp
leaq 0x46368(%rip), %r15     # 0x8f11f
leaq 0x4707e(%rip), %rdi     # 0x8fe3c
xorl %eax, %eax
pushq %r11
pushq %r15
pushq %r10
callq 0xbb10
addq $0x20, %rsp
movq %r14, %rdi
callq 0x4850
cmpb $0x46, 0xb(%rsp)
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movl 0x4(%rsp), %esi
movl 0xc(%rsp), %edx
jne 0x48f2b
movq %rbx, %rdi
movl $0x1, %ecx
movl $0x3, %r8d
callq 0xbbfc
xorps %xmm0, %xmm0
movq %rax, %rdi
callq 0x37330
movl 0x4(%rsp), %eax
leal (%rax,%rax,2), %esi
leaq 0x18(%rsp), %rdi
movl $0x1, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x1de60
movslq 0x4(%rbx), %rax
testq %rax, %rax
jle 0x48f0d
movq 0x18(%rbx), %r12
movl (%rbx), %ecx
movl 0x8(%rbx), %r13d
imulq %rcx, %rax
imulq %rax, %r13
leaq (%r12,%r13,8), %rbp
shlq $0x4, %r13
addq %r12, %r13
xorl %r15d, %r15d
movq 0x30(%rsp), %rdi
movslq 0x4(%rsp), %rax
leaq (%rax,%rax,2), %rsi
movq %r14, %rdx
callq 0x48aee
movsd 0x38(%rsp), %xmm0
ucomisd 0x251aa(%rip), %xmm0    # 0x6e030
movq 0x30(%rsp), %rdi
jbe 0x48eb1
movl 0x4(%rsp), %eax
testl %eax, %eax
jle 0x48eb1
leaq (%rax,%rax,2), %rax
leaq (%rdi,%rax,4), %rax
movl -0x4(%rax), %ecx
bswapl %ecx
movl %ecx, -0x4(%rax)
leaq -0x4(%rax), %rcx
movq %rcx, %rax
cmpq %rdi, %rcx
ja 0x48e9d
movl (%rbx), %eax
testl %eax, %eax
jle 0x48f00
xorl %ecx, %ecx
xorl %edx, %edx
movq %rdi, %rsi
xorps %xmm0, %xmm0
cvtss2sd (%rsi), %xmm0
movsd %xmm0, (%r12,%rdx,8)
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsi), %xmm0
movsd %xmm0, (%rbp,%rdx,8)
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rsi), %xmm0
movsd %xmm0, (%r13,%rdx,8)
incq %rdx
addq $-0x8, %rcx
addq $0xc, %rsi
cmpl %edx, %eax
jne 0x48ebe
subq %rcx, %r13
subq %rcx, %rbp
subq %rcx, %r12
incl %r15d
cmpl 0x4(%rbx), %r15d
jl 0x48e67
cmpb $0x0, 0x28(%rsp)
jne 0x49002
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x49002
jmp 0x48ffd
movq %rbx, %rdi
movl $0x1, %ecx
movl $0x1, %r8d
callq 0xbbfc
xorps %xmm0, %xmm0
movq %rax, %rdi
callq 0x37330
movl 0x4(%rsp), %esi
leaq 0x18(%rsp), %rdi
movl $0x1, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x1de60
cmpl $0x0, 0x4(%rbx)
jle 0x48fec
movq 0x18(%rbx), %r15
xorl %r12d, %r12d
movq 0x30(%rsp), %rdi
movslq 0x4(%rsp), %rsi
movq %r14, %rdx
callq 0x48aee
movsd 0x38(%rsp), %xmm0
ucomisd 0x2509c(%rip), %xmm0    # 0x6e030
movq 0x30(%rsp), %rdi
jbe 0x48fbd
movslq 0x4(%rsp), %rax
testq %rax, %rax
jle 0x48fbd
leaq (%rdi,%rax,4), %rax
movl -0x4(%rax), %ecx
bswapl %ecx
movl %ecx, -0x4(%rax)
leaq -0x4(%rax), %rcx
movq %rcx, %rax
cmpq %rdi, %rcx
ja 0x48fa9
movl (%rbx), %eax
testl %eax, %eax
jle 0x48fe3
xorl %ecx, %ecx
xorl %edx, %edx
xorps %xmm0, %xmm0
cvtss2sd (%rdi,%rdx,4), %xmm0
movsd %xmm0, (%r15,%rdx,8)
incq %rdx
addq $-0x8, %rcx
cmpl %edx, %eax
jne 0x48fc7
subq %rcx, %r15
incl %r12d
cmpl 0x4(%rbx), %r12d
jl 0x48f79
cmpb $0x0, 0x28(%rsp)
jne 0x49002
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x49002
callq 0x4690
cmpq $0x0, 0x10(%rsp)
je 0x49042
movq %rbx, %rdi
movl $0x79, %esi
callq 0x468f4
movq %rax, %rbx
cmpb $0x0, 0x58(%rsp)
jne 0x49030
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x49030
callq 0x4690
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r14, %r14
je 0x4907d
movq 0x5ef5a(%rip), %rax     # 0xa7fa8
cmpq %r14, (%rax)
je 0x4900a
movq 0x5ef2e(%rip), %rax     # 0xa7f88
cmpq %r14, (%rax)
je 0x4900a
movq %r14, %rdi
callq 0x4550
testl %eax, %eax
je 0x4900a
leaq 0x45f8a(%rip), %rdi     # 0x8effc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb10
jmp 0x4900a
leaq 0x45f4e(%rip), %rdi     # 0x8efd2
xorl %eax, %eax
callq 0xbb10
jmp 0x4900a
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %r8d
movl 0xc(%rbx), %r9d
leaq 0x257b7(%rip), %rax     # 0x6e868
leaq 0x26b8a(%rip), %r10     # 0x6fc42
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
subq $0x8, %rsp
leaq 0x46054(%rip), %r11     # 0x8f11f
leaq 0x46c3e(%rip), %rsi     # 0x8fd10
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0xc16a
addq $0x20, %rsp
leaq 0x5eb62(%rip), %rsi     # 0xa7c50
movq 0x5eedb(%rip), %rdx     # 0xa7fd0
movq %r14, %rdi
callq 0x4910
cmpq $0x0, 0x10(%rsp)
jne 0x4910d
movq %r14, %rdi
callq 0x367a9
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
leaq 0x25747(%rip), %rax     # 0x6e868
leaq 0x26b1a(%rip), %r10     # 0x6fc42
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
testq %r12, %r12
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %r8d
movl 0xc(%rbx), %r9d
leaq 0x464ca(%rip), %r11     # 0x8f611
cmovneq %r12, %r11
leaq 0x45fcd(%rip), %r15     # 0x8f11f
leaq 0x46c14(%rip), %rsi     # 0x8fd6d
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r15
pushq %r10
pushq 0x18(%rbx)
callq 0x36908
addq $0x20, %rsp
jmp 0x491e5
cmpq $0x0, 0x10(%rsp)
jne 0x49182
movq %r14, %rdi
callq 0x367a9
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
leaq 0x256d2(%rip), %rax     # 0x6e868
leaq 0x26aa5(%rip), %r10     # 0x6fc42
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
testq %r12, %r12
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %r8d
movl 0xc(%rbx), %r9d
leaq 0x46455(%rip), %r11     # 0x8f611
cmovneq %r12, %r11
leaq 0x45f58(%rip), %r15     # 0x8f11f
leaq 0x46bfc(%rip), %rsi     # 0x8fdca
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r15
pushq %r10
pushq 0x18(%rbx)
callq 0x36908
addq $0x20, %rsp
leaq 0x5eb04(%rip), %rsi     # 0xa7cf0
movq 0x5eddd(%rip), %rdx     # 0xa7fd0
movq %r14, %rdi
callq 0x4910
jmp 0x491fd
movq %rax, %rbx
movq %r14, %rdi
callq 0x43c0
jmp 0x49257
jmp 0x49254
jmp 0x49254
movq %rax, %rbx
movq %r14, %rdi
callq 0x43c0
jmp 0x4926d
jmp 0x49254
jmp 0x49254
jmp 0x49254
movq %rax, %rbx
cmpb $0x0, 0x28(%rsp)
jne 0x49257
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x49257
jmp 0x4924b
movq %rax, %rbx
cmpb $0x0, 0x28(%rsp)
jne 0x49257
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x49257
callq 0x4690
jmp 0x49257
jmp 0x49254
movq %rax, %rbx
cmpb $0x0, 0x58(%rsp)
jne 0x4926d
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x4926d
callq 0x4690
movq %rbx, %rdi
callq 0x4960
nop