// File: /workspace/github_cpp_makefile_star2_O2/manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::cimg::file_type(_IO_FILE*, char const*)
inline const char *file_type(std::FILE *const file, const char *const filename) {
      if (!file && !filename)
        throw CImgArgumentException("cimg::file_type(): Specified filename is (null).");
      static const char
        *const _pnm = "pnm",
        *const _pfm = "pfm",
        *const _bmp = "bmp",
        *const _gif = "gif",
        *const _jpg = "jpg",
        *const _off = "off",
        *const _pan = "pan",
        *const _png = "png",
        *const _tif = "tif",
        *const _inr = "inr",
        *const _dcm = "dcm";
      std::FILE *const nfile = file?file:cimg::fopen(filename,"rb");
      const char *f_type = 0, *head;
      char header[2048] = { 0 }, item[1024] = { 0 };
      const unsigned char *const uheader = (unsigned char*)header;
      int err; char cerr;
      const unsigned int siz = (unsigned int)std::fread(header,2048,1,nfile);   // Read first 2048 bytes.
      if (!file) cimg::fclose(nfile);

      if (!std::strncmp(header,"OFF\n",4)) f_type = _off; // OFF.
      else if (!std::strncmp(header,"#INRIMAGE",9)) f_type = _inr; // INRIMAGE.
      else if (!std::strncmp(header,"PANDORE",7)) f_type = _pan; // PANDORE.
      else if (!std::strncmp(header+128,"DICM",4)) f_type = _dcm; // DICOM.
      else if (uheader[0]==0xFF && uheader[1]==0xD8 && uheader[2]==0xFF) f_type = _jpg;  // JPEG.
      else if (header[0]=='B' && header[1]=='M') f_type = _bmp;  // BMP.
      else if (header[0]=='G' && header[1]=='I' && header[2]=='F' && header[3]=='8' && header[5]=='a' && // GIF.
               (header[4]=='7' || header[4]=='9')) f_type = _gif;
      else if (uheader[0]==0x89 && uheader[1]==0x50 && uheader[2]==0x4E && uheader[3]==0x47 &&  // PNG.
               uheader[4]==0x0D && uheader[5]==0x0A && uheader[6]==0x1A && uheader[7]==0x0A) f_type = _png;
      else if ((uheader[0]==0x49 && uheader[1]==0x49) || (uheader[0]==0x4D && uheader[1]==0x4D)) f_type = _tif; // TIFF.
      else { // PNM or PFM.
        head = header;
        while (head<header+siz && (err=std::sscanf(head,"%1023[^\n]",item))!=EOF && (*item=='#' || !err))
          head+=1+(err?std::strlen(item):0);
        if (std::sscanf(item," P%d",&err)==1) f_type = _pnm;
        else if (std::sscanf(item," P%c",&cerr)==1 && (cerr=='f' || cerr=='F')) f_type = _pfm;
      }
      return f_type;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc18, %rsp            # imm = 0xC18
movq %rdi, %rax
orq %rsi, %rax
je 0x2e08d
movq %rdi, %r14
movq %rdi, %r12
testq %rdi, %rdi
jne 0x2ddd7
leaq 0x47472(%rip), %rax     # 0x7523b
movq %rsi, %rdi
movq %rax, %rsi
callq 0x2dca5
movq %rax, %r12
leaq 0x410(%rsp), %r15
movl $0x800, %edx            # imm = 0x800
movq %r15, %rdi
xorl %esi, %esi
callq 0x4280
leaq 0x10(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x4280
pushq $0x1
popq %rbx
movl $0x800, %esi            # imm = 0x800
movq %r15, %rdi
movq %rbx, %rdx
movq %r12, %rcx
callq 0x47d0
movq %rax, %r15
testq %r14, %r14
jne 0x2de25
movq %r12, %rdi
callq 0x2a2f8
movl 0x410(%rsp), %ebp
cmpl $0xa46464f, %ebp        # imm = 0xA46464F
jne 0x2de40
leaq 0x49306(%rip), %r12     # 0x77141
jmp 0x2e078
leaq 0x492fe(%rip), %rsi     # 0x77145
leaq 0x410(%rsp), %rdi
pushq $0x9
popq %rdx
callq 0x4550
testl %eax, %eax
je 0x2de92
leaq 0x48bef(%rip), %rsi     # 0x76a51
leaq 0x410(%rsp), %r14
pushq $0x7
popq %rdx
movq %r14, %rdi
callq 0x4550
testl %eax, %eax
je 0x2de9e
cmpl $0x4d434944, 0x490(%rsp) # imm = 0x4D434944
jne 0x2deaa
leaq 0x47323(%rip), %r12     # 0x751b0
jmp 0x2e078
leaq 0x47329(%rip), %r12     # 0x751c2
jmp 0x2e078
leaq 0x47321(%rip), %r12     # 0x751c6
jmp 0x2e078
movl %ebp, %eax
shrl $0x8, %eax
movl %ebp, %edx
shrl $0x10, %edx
movl %eax, %ecx
xorb $-0x28, %cl
movl %ebp, %esi
andb %dl, %sil
notb %sil
orb %cl, %sil
jne 0x2ded2
leaq 0x27c4f(%rip), %r12     # 0x55b1c
jmp 0x2e078
movl %ebp, %esi
xorb $0x42, %sil
movl %eax, %ecx
xorb $0x4d, %cl
orb %cl, %sil
jne 0x2deee
leaq 0x47268(%rip), %r12     # 0x75151
jmp 0x2e078
movl %ebp, %esi
shrl $0x18, %esi
movl %ebp, %edi
xorb $0x47, %dil
cmpb $0x49, %al
sete %r8b
movl %edx, %r9d
xorb $0x46, %r9b
orb %dil, %r9b
sete %dil
cmpl $0x38, %esi
sete %r9b
andb %r8b, %r9b
andb %dil, %r9b
movb 0x415(%rsp), %dil
cmpb $0x61, %dil
sete %r10b
andb %r9b, %r10b
movzbl 0x414(%rsp), %r8d
cmpb $0x1, %r10b
jne 0x2df57
leaq 0x47269(%rip), %r12     # 0x751ac
cmpl $0x37, %r8d
je 0x2e078
cmpl $0x39, %r8d
je 0x2e078
cmpb $-0x77, %bpl
jne 0x2df97
cmpb $0x50, %al
jne 0x2df97
cmpb $0x4e, %dl
jne 0x2df97
cmpl $0x47, %esi
jne 0x2df97
cmpb $0xd, %r8b
jne 0x2df97
cmpb $0xa, %dil
jne 0x2df97
cmpb $0x1a, 0x416(%rsp)
jne 0x2df97
cmpb $0xa, 0x417(%rsp)
jne 0x2df97
leaq 0x48172(%rip), %r12     # 0x76104
jmp 0x2e078
xorb $0x49, %al
movl %ebp, %edx
xorb $0x49, %dl
xorb $0x4d, %bpl
orb %cl, %bpl
sete %cl
orb %al, %dl
leaq 0x471c6(%rip), %r12     # 0x75177
je 0x2e078
testb %cl, %cl
jne 0x2e078
movl %r15d, %eax
leaq (%rsp,%rax), %r13
addq $0x410, %r13            # imm = 0x410
leaq 0x4917b(%rip), %r15     # 0x7714f
leaq 0x10(%rsp), %r12
cmpq %r13, %r14
jae 0x2e01c
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x4510
movl %eax, 0xc(%rsp)
cmpl $-0x1, %eax
je 0x2e01c
testl %eax, %eax
je 0x2e002
cmpb $0x23, 0x10(%rsp)
jne 0x2e01c
movq %rbx, %rcx
testl %eax, %eax
je 0x2e017
movq %r12, %rdi
callq 0x41e0
movq %rax, %rcx
incq %rcx
addq %rcx, %r14
jmp 0x2dfd9
leaq 0x49136(%rip), %rsi     # 0x77159
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x4510
cmpl $0x1, %eax
jne 0x2e042
leaq 0x4941e(%rip), %r12     # 0x7745e
jmp 0x2e078
leaq 0x47c75(%rip), %rsi     # 0x75cbe
xorl %r12d, %r12d
leaq 0x10(%rsp), %rdi
leaq 0xb(%rsp), %rdx
xorl %eax, %eax
callq 0x4510
cmpl $0x1, %eax
jne 0x2e078
movb 0xb(%rsp), %al
andb $-0x21, %al
xorl %r12d, %r12d
cmpb $0x46, %al
leaq 0x470ff(%rip), %rax     # 0x75173
cmoveq %rax, %r12
movq %r12, %rax
addq $0xc18, %rsp            # imm = 0xC18
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %rbx
leaq 0x4906f(%rip), %rsi     # 0x77110
movq %rax, %rdi
xorl %eax, %eax
callq 0x9d52
leaq 0x61bae(%rip), %rsi     # 0x8fc60
movq 0x61f1f(%rip), %rdx     # 0x8ffd8
movq %rbx, %rdi
callq 0x4910
movq %rax, %r14
movq %rbx, %rdi
callq 0x4390
movq %r14, %rdi
callq 0x4950