// File: /workspace/github_cpp_makefile_star2_O2/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 0x3857f
movq %rdx, %r12
movq %rsi, %rbp
movq %rsi, %r14
testq %rsi, %rsi
jne 0x381f9
leaq 0x3d04d(%rip), %rsi     # 0x7523b
movq %r12, %rdi
callq 0x2dca5
movq %rax, %r14
leaq 0x40(%rsp), %rdi
pushq $0x1
popq %rcx
movl $0x4000, %esi           # imm = 0x4000
movl %ecx, %edx
movl %ecx, %r8d
xorl %r9d, %r9d
callq 0x37910
andl $0x0, 0x4(%rsp)
andl $0x0, 0xc(%rsp)
andq $0x0, 0x38(%rsp)
leaq 0x3d8d3(%rip), %r13     # 0x75afd
movq 0x58(%rsp), %rdx
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x49d0
movq 0x58(%rsp), %rdi
cmpl $-0x1, %eax
je 0x38261
cmpb $0x23, (%rdi)
sete %cl
testl %eax, %eax
sete %al
orb %cl, %al
cmpb $0x1, %al
jne 0x38261
movq %r14, %rdi
callq 0x4850
jmp 0x3822a
leaq 0x3da56(%rip), %rsi     # 0x75cbe
leaq 0xb(%rsp), %rdx
xorl %eax, %eax
callq 0x4510
cmpl $0x1, %eax
jne 0x385ec
leaq 0x3d878(%rip), %r13     # 0x75afc
movq 0x58(%rsp), %rdx
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x49d0
movq 0x58(%rsp), %rdi
cmpl $-0x1, %eax
je 0x382bb
cmpb $0x23, (%rdi)
sete %cl
testl %eax, %eax
sete %al
orb %cl, %al
cmpb $0x1, %al
jne 0x382bb
movq %r14, %rdi
callq 0x4850
jmp 0x38284
leaq 0x3d923(%rip), %rsi     # 0x75be5
leaq 0x4(%rsp), %rdx
leaq 0xc(%rsp), %rcx
xorl %eax, %eax
callq 0x4510
cmpl $0x1, %eax
jle 0x3865e
cmpl $0x2, %eax
jne 0x38392
leaq 0x3d810(%rip), %r13     # 0x75afc
movq 0x58(%rsp), %rdx
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x49d0
movq 0x58(%rsp), %rdi
cmpl $-0x1, %eax
je 0x38323
cmpb $0x23, (%rdi)
sete %cl
testl %eax, %eax
sete %al
orb %cl, %al
cmpb $0x1, %al
jne 0x38323
movq %r14, %rdi
callq 0x4850
jmp 0x382ec
leaq 0x3da64(%rip), %rsi     # 0x75d8e
leaq 0x38(%rsp), %rdx
xorl %eax, %eax
callq 0x4510
cmpl $0x1, %eax
je 0x38392
leaq 0x1c4a6(%rip), %rax     # 0x547e8
cmpb $0x0, 0x10(%rbx)
leaq 0x1d875(%rip), %r10     # 0x55bc2
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 0x3d1fc(%rip), %r11     # 0x75567
cmovneq %r12, %r11
subq $0x8, %rsp
leaq 0x3cd25(%rip), %r15     # 0x7509f
leaq 0x3da11(%rip), %rdi     # 0x75d92
xorl %eax, %eax
pushq %r11
pushq %r15
pushq %r10
callq 0x97a7
addq $0x20, %rsp
movq %r14, %rdi
callq 0x4850
cmpb $0x46, 0xb(%rsp)
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x4(%rsp), %esi
movl 0xc(%rsp), %edx
movq %rbp, 0x60(%rsp)
jne 0x384a8
pushq $0x1
popq %rcx
pushq $0x3
popq %r8
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x2a6c0
imull $0x3, 0x4(%rsp), %esi
leaq 0x18(%rsp), %rdi
pushq $0x1
popq %rcx
movl %ecx, %edx
movl %ecx, %r8d
callq 0x17dbc
movq 0x18(%rbx), %r12
movl (%rbx), %r13d
movl 0x4(%rbx), %eax
movl 0x8(%rbx), %ecx
imulq %rax, %r13
imulq %rcx, %r13
leaq (%r12,%r13,8), %rbp
shlq $0x4, %r13
addq %r12, %r13
xorl %r15d, %r15d
cmpl %eax, %r15d
jge 0x38539
movq 0x30(%rsp), %rdi
movslq 0x4(%rsp), %rax
leaq (%rax,%rax,2), %rsi
movq %r14, %rdx
callq 0x38089
movsd 0x10(%rsp), %xmm0
ucomisd 0x1bbf8(%rip), %xmm0    # 0x54030
jbe 0x3844d
movq 0x30(%rsp), %rdi
movslq 0x4(%rsp), %rax
leaq (%rax,%rax,2), %rsi
callq 0x38732
movq 0x30(%rsp), %rax
movl (%rbx), %edx
testl %edx, %edx
movl $0x0, %ecx
cmovlel %ecx, %edx
xorl %esi, %esi
xorl %ecx, %ecx
cmpl %esi, %edx
je 0x38494
cvtss2sd (%rax), %xmm0
movsd %xmm0, (%r12,%rsi,8)
cvtss2sd 0x4(%rax), %xmm0
movsd %xmm0, (%rbp,%rsi,8)
cvtss2sd 0x8(%rax), %xmm0
movsd %xmm0, (%r13,%rsi,8)
addq $-0x8, %rcx
incq %rsi
addq $0xc, %rax
jmp 0x38462
incl %r15d
movl 0x4(%rbx), %eax
subq %rcx, %r12
subq %rcx, %rbp
subq %rcx, %r13
jmp 0x3840b
pushq $0x1
popq %rcx
xorpd %xmm0, %xmm0
movq %rbx, %rdi
movl %ecx, %r8d
callq 0x2a6c0
movl 0x4(%rsp), %esi
leaq 0x18(%rsp), %rdi
pushq $0x1
popq %rcx
movl %ecx, %edx
movl %ecx, %r8d
callq 0x17dbc
movq 0x18(%rbx), %r15
xorl %r12d, %r12d
xorl %ebp, %ebp
cmpl 0x4(%rbx), %ebp
jge 0x3853b
movq 0x30(%rsp), %rdi
movslq 0x4(%rsp), %rsi
movq %r14, %rdx
callq 0x38089
movsd 0x10(%rsp), %xmm0
ucomisd 0x1bb32(%rip), %xmm0    # 0x54030
jbe 0x3850f
movq 0x30(%rsp), %rdi
movslq 0x4(%rsp), %rsi
callq 0x38732
movq 0x30(%rsp), %rax
movl (%rbx), %ecx
testl %ecx, %ecx
cmovlel %r12d, %ecx
xorl %edx, %edx
cmpl %edx, %ecx
je 0x38535
cvtss2sd (%rax,%rdx,4), %xmm0
movsd %xmm0, (%r15)
addq $0x8, %r15
incq %rdx
jmp 0x3851e
incl %ebp
jmp 0x384d9
jmp 0x3853b
leaq 0x18(%rsp), %rdi
callq 0x17c20
cmpq $0x0, 0x60(%rsp)
jne 0x38555
movq %r14, %rdi
callq 0x2a2f8
pushq $0x79
popq %rsi
movq %rbx, %rdi
callq 0x364e8
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0xdba4
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
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 0x1c248(%rip), %rax     # 0x547e8
leaq 0x1d61b(%rip), %r10     # 0x55bc2
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
subq $0x8, %rsp
leaq 0x3cae5(%rip), %r11     # 0x7509f
leaq 0x3d6a5(%rip), %rsi     # 0x75c66
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0x9d52
addq $0x20, %rsp
leaq 0x57683(%rip), %rsi     # 0x8fc60
movq 0x579f4(%rip), %rdx     # 0x8ffd8
movq %r14, %rdi
callq 0x4910
testq %rbp, %rbp
jne 0x385f9
movq %r14, %rdi
callq 0x2a2f8
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
leaq 0x1c1db(%rip), %rax     # 0x547e8
leaq 0x1d5ae(%rip), %r10     # 0x55bc2
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 0x3cf34(%rip), %r11     # 0x75567
cmovneq %r12, %r11
leaq 0x3ca61(%rip), %r15     # 0x7509f
leaq 0x3d67e(%rip), %rsi     # 0x75cc3
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r15
pushq %r10
pushq 0x18(%rbx)
callq 0x2a3de
addq $0x20, %rsp
jmp 0x386ce
testq %rbp, %rbp
jne 0x3866b
movq %r14, %rdi
callq 0x2a2f8
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
leaq 0x1c169(%rip), %rax     # 0x547e8
leaq 0x1d53c(%rip), %r10     # 0x55bc2
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 0x3cec2(%rip), %r11     # 0x75567
cmovneq %r12, %r11
leaq 0x3c9ef(%rip), %r15     # 0x7509f
leaq 0x3d669(%rip), %rsi     # 0x75d20
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r15
pushq %r10
pushq 0x18(%rbx)
callq 0x2a3de
addq $0x20, %rsp
leaq 0x5762b(%rip), %rsi     # 0x8fd00
movq 0x578fc(%rip), %rdx     # 0x8ffd8
movq %r14, %rdi
callq 0x4910
jmp 0x386e6
movq %rax, %rbx
movq %r14, %rdi
callq 0x4390
jmp 0x38720
jmp 0x3871d
jmp 0x3871d
movq %rax, %rbx
movq %r14, %rdi
callq 0x4390
jmp 0x3872a
jmp 0x3871d
jmp 0x3871d
jmp 0x3871d
jmp 0x3870c
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x17c20
jmp 0x38720
jmp 0x3871d
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0xdba4
movq %rbx, %rdi
callq 0x4950