// File: /workspace/github_cpp_makefile_star2_O1/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 0x4af8c
movq %rdx, %r12
movq %rsi, %r14
movq %rsi, 0x10(%rsp)
testq %rsi, %rsi
jne 0x4ab0d
leaq 0x492b3(%rip), %rsi     # 0x93db5
movq %r12, %rdi
callq 0x3ceb3
movq %rax, %r14
leaq 0x38(%rsp), %rdi
xorl %ebp, %ebp
movl $0x4000, %esi           # imm = 0x4000
movl $0x1, %edx
movl $0x1, %ecx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x4a26e
movl %ebp, 0x4(%rsp)
movl %ebp, 0xc(%rsp)
movq $0x0, 0x60(%rsp)
leaq 0x49b2e(%rip), %r13     # 0x94677
movq 0x50(%rsp), %rdx
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x49e0
cmpl $-0x1, %eax
je 0x4ab80
movq 0x50(%rsp), %rcx
cmpb $0x23, (%rcx)
sete %cl
testl %eax, %eax
sete %al
orb %cl, %al
cmpb $0x1, %al
jne 0x4ab80
movq %r14, %rdi
callq 0x4840
jmp 0x4ab49
movq 0x50(%rsp), %rdi
leaq 0x49cac(%rip), %rsi     # 0x94838
leaq 0xb(%rsp), %rdx
xorl %eax, %eax
callq 0x4530
cmpl $0x1, %eax
jne 0x4aff9
leaq 0x49ace(%rip), %r13     # 0x94676
movq 0x50(%rsp), %rdx
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x49e0
cmpl $-0x1, %eax
je 0x4abdf
movq 0x50(%rsp), %rcx
cmpb $0x23, (%rcx)
sete %cl
testl %eax, %eax
sete %al
orb %cl, %al
cmpb $0x1, %al
jne 0x4abdf
movq %r14, %rdi
callq 0x4840
jmp 0x4aba8
movq 0x50(%rsp), %rdi
leaq 0x49b74(%rip), %rsi     # 0x9475f
leaq 0x4(%rsp), %rdx
leaq 0xc(%rsp), %rcx
xorl %eax, %eax
callq 0x4530
cmpl $0x1, %eax
jle 0x4b06e
cmpl $0x2, %eax
jne 0x4acc0
leaq 0x49a61(%rip), %r13     # 0x94676
movq 0x50(%rsp), %rdx
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x49e0
cmpl $-0x1, %eax
je 0x4ac4c
movq 0x50(%rsp), %rcx
cmpb $0x23, (%rcx)
sete %cl
testl %eax, %eax
sete %al
orb %cl, %al
cmpb $0x1, %al
jne 0x4ac4c
movq %r14, %rdi
callq 0x4840
jmp 0x4ac15
movq 0x50(%rsp), %rdi
leaq 0x49cb0(%rip), %rsi     # 0x94908
leaq 0x60(%rsp), %rdx
xorl %eax, %eax
callq 0x4530
cmpl $0x1, %eax
je 0x4acc0
leaq 0x286c8(%rip), %rax     # 0x73338
cmpb $0x0, 0x10(%rbx)
leaq 0x29a97(%rip), %r10     # 0x74712
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 0x49448(%rip), %r11     # 0x940e1
cmovneq %r12, %r11
subq $0x8, %rsp
leaq 0x48f47(%rip), %r15     # 0x93bef
leaq 0x49c5d(%rip), %rdi     # 0x9490c
xorl %eax, %eax
pushq %r11
pushq %r15
pushq %r10
callq 0xbb52
addq $0x20, %rsp
movq %r14, %rdi
callq 0x4840
cmpb $0x46, 0xb(%rsp)
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
movl 0x4(%rsp), %esi
movl 0xc(%rsp), %edx
jne 0x4ae1e
movq %rbx, %rdi
movl $0x1, %ecx
movl $0x3, %r8d
callq 0xbc3e
xorps %xmm0, %xmm0
movq %rax, %rdi
callq 0x38fd2
movl 0x4(%rsp), %eax
leal (%rax,%rax,2), %esi
leaq 0x18(%rsp), %rdi
movl $0x1, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x1de54
cmpl $0x0, 0x4(%rbx)
jle 0x4ae00
movq 0x18(%rbx), %r12
movl (%rbx), %eax
movl 0x4(%rbx), %ecx
imulq %rcx, %rax
movl 0x8(%rbx), %r13d
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 0x4a9cf
movsd 0x58(%rsp), %xmm0
ucomisd 0x262c1(%rip), %xmm0    # 0x71038
jbe 0x4ada2
movl 0x4(%rsp), %ecx
testl %ecx, %ecx
jle 0x4ada2
movq 0x30(%rsp), %rax
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,4), %rcx
movl -0x4(%rcx), %edx
bswapl %edx
movl %edx, -0x4(%rcx)
leaq -0x4(%rcx), %rdx
movq %rdx, %rcx
cmpq %rax, %rdx
ja 0x4ad8e
movl (%rbx), %eax
testl %eax, %eax
jle 0x4adf3
movq 0x30(%rsp), %rdx
xorl %ecx, %ecx
xorl %esi, %esi
xorps %xmm0, %xmm0
cvtss2sd (%rdx), %xmm0
movsd %xmm0, (%r12,%rsi,8)
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rdx), %xmm0
movsd %xmm0, (%rbp,%rsi,8)
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rdx), %xmm0
movsd %xmm0, (%r13,%rsi,8)
incq %rsi
addq $-0x8, %rcx
addq $0xc, %rdx
cmpl %esi, %eax
jne 0x4adb1
subq %rcx, %r13
subq %rcx, %rbp
subq %rcx, %r12
incl %r15d
cmpl 0x4(%rbx), %r15d
jl 0x4ad53
cmpb $0x0, 0x28(%rsp)
jne 0x4aefe
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x4aefe
jmp 0x4aef9
movq %rbx, %rdi
movl $0x1, %ecx
movl $0x1, %r8d
callq 0xbc3e
xorps %xmm0, %xmm0
movq %rax, %rdi
callq 0x38fd2
movl 0x4(%rsp), %esi
leaq 0x18(%rsp), %rdi
movl $0x1, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x1de54
cmpl $0x0, 0x4(%rbx)
jle 0x4aee8
movq 0x18(%rbx), %r15
xorl %r12d, %r12d
movq 0x30(%rsp), %rdi
movslq 0x4(%rsp), %rsi
movq %r14, %rdx
callq 0x4a9cf
movsd 0x58(%rsp), %xmm0
ucomisd 0x261ad(%rip), %xmm0    # 0x71038
jbe 0x4aeb4
movslq 0x4(%rsp), %rcx
testq %rcx, %rcx
jle 0x4aeb4
movq 0x30(%rsp), %rax
leaq (%rax,%rcx,4), %rcx
movl -0x4(%rcx), %edx
bswapl %edx
movl %edx, -0x4(%rcx)
leaq -0x4(%rcx), %rdx
movq %rdx, %rcx
cmpq %rax, %rdx
ja 0x4aea0
movl (%rbx), %eax
testl %eax, %eax
jle 0x4aedf
movq 0x30(%rsp), %rcx
xorl %edx, %edx
xorl %esi, %esi
xorps %xmm0, %xmm0
cvtss2sd (%rcx,%rsi,4), %xmm0
movsd %xmm0, (%r15,%rsi,8)
incq %rsi
addq $-0x8, %rdx
cmpl %esi, %eax
jne 0x4aec3
subq %rdx, %r15
incl %r12d
cmpl 0x4(%rbx), %r12d
jl 0x4ae6b
cmpb $0x0, 0x28(%rsp)
jne 0x4aefe
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x4aefe
callq 0x4680
cmpq $0x0, 0x10(%rsp)
je 0x4af3e
movq %rbx, %rdi
movl $0x79, %esi
callq 0x48832
movq %rax, %rbx
cmpb $0x0, 0x48(%rsp)
jne 0x4af2c
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x4af2c
callq 0x4680
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r14, %r14
je 0x4af79
movq 0x6205e(%rip), %rax     # 0xacfa8
cmpq %r14, (%rax)
je 0x4af06
movq 0x62032(%rip), %rax     # 0xacf88
cmpq %r14, (%rax)
je 0x4af06
movq %r14, %rdi
callq 0x4540
testl %eax, %eax
je 0x4af06
leaq 0x48b5e(%rip), %rdi     # 0x93acc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb52
jmp 0x4af06
leaq 0x48b22(%rip), %rdi     # 0x93aa2
xorl %eax, %eax
callq 0xbb52
jmp 0x4af06
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 0x2838b(%rip), %rax     # 0x73338
leaq 0x2975e(%rip), %r10     # 0x74712
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
subq $0x8, %rsp
leaq 0x48c28(%rip), %r11     # 0x93bef
leaq 0x49812(%rip), %rsi     # 0x947e0
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0xc196
addq $0x20, %rsp
leaq 0x61c36(%rip), %rsi     # 0xacc20
movq 0x61fdf(%rip), %rdx     # 0xacfd0
movq %r14, %rdi
callq 0x4900
cmpq $0x0, 0x10(%rsp)
jne 0x4b009
movq %r14, %rdi
callq 0x3845e
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
leaq 0x2831b(%rip), %rax     # 0x73338
leaq 0x296ee(%rip), %r10     # 0x74712
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 0x4909e(%rip), %r11     # 0x940e1
cmovneq %r12, %r11
leaq 0x48ba1(%rip), %r15     # 0x93bef
leaq 0x497e8(%rip), %rsi     # 0x9483d
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r15
pushq %r10
pushq 0x18(%rbx)
callq 0x385b4
addq $0x20, %rsp
jmp 0x4b0e1
cmpq $0x0, 0x10(%rsp)
jne 0x4b07e
movq %r14, %rdi
callq 0x3845e
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
leaq 0x282a6(%rip), %rax     # 0x73338
leaq 0x29679(%rip), %r10     # 0x74712
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 0x49029(%rip), %r11     # 0x940e1
cmovneq %r12, %r11
leaq 0x48b2c(%rip), %r15     # 0x93bef
leaq 0x497d0(%rip), %rsi     # 0x9489a
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r15
pushq %r10
pushq 0x18(%rbx)
callq 0x385b4
addq $0x20, %rsp
leaq 0x61c08(%rip), %rsi     # 0xaccf0
movq 0x61ee1(%rip), %rdx     # 0xacfd0
movq %r14, %rdi
callq 0x4900
jmp 0x4b0f9
movq %rax, %rbx
movq %r14, %rdi
callq 0x43b0
jmp 0x4b153
jmp 0x4b150
jmp 0x4b150
movq %rax, %rbx
movq %r14, %rdi
callq 0x43b0
jmp 0x4b169
jmp 0x4b150
jmp 0x4b150
jmp 0x4b150
movq %rax, %rbx
cmpb $0x0, 0x28(%rsp)
jne 0x4b153
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x4b153
jmp 0x4b147
movq %rax, %rbx
cmpb $0x0, 0x28(%rsp)
jne 0x4b153
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x4b153
callq 0x4680
jmp 0x4b153
jmp 0x4b150
movq %rax, %rbx
cmpb $0x0, 0x48(%rsp)
jne 0x4b169
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x4b169
callq 0x4680
movq %rbx, %rdi
callq 0x4950
nop