// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0xc10, %rsp            # imm = 0xC10
movq %rdi, %rax
orq %rsi, %rax
je 0x3d2d3
movq %rdi, %r12
movq %rdi, %r15
testq %rdi, %rdi
jne 0x3cfe3
leaq 0x56de0(%rip), %rax     # 0x93db5
movq %rsi, %rdi
movq %rax, %rsi
callq 0x3ceb3
movq %rax, %r15
leaq 0x10(%rsp), %rbx
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4290
leaq 0x810(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x4290
movl $0x800, %esi            # imm = 0x800
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rcx
callq 0x47c0
movq %rax, %r14
testq %r12, %r12
je 0x3d08a
cmpl $0xa46464f, 0x10(%rsp)  # imm = 0xA46464F
jne 0x3d03e
leaq 0x58c82(%rip), %r15     # 0x95cbb
jmp 0x3d2c0
movabsq $0x47414d49524e4923, %rax # imm = 0x47414D49524E4923
xorq 0x10(%rsp), %rax
movzbl 0x18(%rsp), %ecx
xorq $0x45, %rcx
orq %rax, %rcx
je 0x3d0cc
movl $0x444e4150, %eax       # imm = 0x444E4150
xorl 0x10(%rsp), %eax
movl $0x45524f44, %ecx       # imm = 0x45524F44
xorl 0x13(%rsp), %ecx
orl %eax, %ecx
je 0x3d0eb
cmpl $0x4d434944, 0x90(%rsp) # imm = 0x4D434944
jne 0x3d0f7
leaq 0x56ca5(%rip), %r15     # 0x93d2a
jmp 0x3d2c0
testq %r15, %r15
je 0x3d0d8
movq 0x6ff12(%rip), %rax     # 0xacfa8
cmpq %r15, (%rax)
je 0x3d028
movq 0x6fee6(%rip), %rax     # 0xacf88
cmpq %r15, (%rax)
je 0x3d028
movq %r15, %rdi
callq 0x4540
testl %eax, %eax
je 0x3d028
leaq 0x56a0e(%rip), %rdi     # 0x93acc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb52
jmp 0x3d028
leaq 0x56c69(%rip), %r15     # 0x93d3c
jmp 0x3d2c0
leaq 0x569c3(%rip), %rdi     # 0x93aa2
xorl %eax, %eax
callq 0xbb52
jmp 0x3d028
leaq 0x56c4e(%rip), %r15     # 0x93d40
jmp 0x3d2c0
movb 0x10(%rsp), %al
movb 0x11(%rsp), %sil
movl %eax, %ecx
notb %cl
movl %esi, %edx
xorb $-0x28, %dl
orb %cl, %dl
movb 0x12(%rsp), %dil
movl %edi, %ecx
notb %cl
orb %dl, %cl
jne 0x3d124
leaq 0x3754d(%rip), %r15     # 0x7466c
jmp 0x3d2c0
movl %eax, %edx
xorb $0x42, %dl
movl %esi, %ecx
xorb $0x4d, %cl
orb %cl, %dl
jne 0x3d13e
leaq 0x56b92(%rip), %r15     # 0x93ccb
jmp 0x3d2c0
movl %eax, %r10d
xorb $0x47, %r10b
movl %esi, %edx
xorb $0x49, %dl
orb %dl, %r10b
movl %edi, %r11d
xorb $0x46, %r11b
movb 0x13(%rsp), %r9b
movb 0x15(%rsp), %r8b
movl %r9d, %ebp
xorb $0x38, %bpl
orb %r11b, %bpl
orb %r10b, %bpl
movl %r8d, %r10d
xorb $0x61, %r10b
orb %bpl, %r10b
jne 0x3d198
movzbl 0x14(%rsp), %r10d
leaq 0x56ba2(%rip), %r15     # 0x93d26
cmpl $0x37, %r10d
je 0x3d2c0
cmpl $0x39, %r10d
je 0x3d2c0
cmpb $-0x77, %al
jne 0x3d1d5
cmpb $0x50, %sil
jne 0x3d1d5
cmpb $0x4e, %dil
jne 0x3d1d5
cmpb $0x47, %r9b
jne 0x3d1d5
cmpb $0xd, 0x14(%rsp)
jne 0x3d1d5
cmpb $0xa, %r8b
jne 0x3d1d5
cmpb $0x1a, 0x16(%rsp)
jne 0x3d1d5
cmpb $0xa, 0x17(%rsp)
jne 0x3d1d5
leaq 0x57aae(%rip), %r15     # 0x94c7e
jmp 0x3d2c0
movl %eax, %esi
xorb $0x49, %sil
xorb $0x4d, %al
orb %cl, %al
sete %al
orb %dl, %sil
leaq 0x56b05(%rip), %r15     # 0x93cf1
je 0x3d2c0
testb %al, %al
jne 0x3d2c0
movl %r14d, %eax
testq %rax, %rax
je 0x3d25e
leaq (%rsp,%rax), %r12
addq $0x10, %r12
leaq 0x58ab8(%rip), %r14     # 0x95cc9
leaq 0x810(%rsp), %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4530
movl %eax, 0xc(%rsp)
cmpl $-0x1, %eax
je 0x3d25e
testl %eax, %eax
je 0x3d240
cmpb $0x23, 0x810(%rsp)
jne 0x3d25e
testl %eax, %eax
je 0x3d251
movq %r15, %rdi
callq 0x41e0
incq %rax
jmp 0x3d256
movl $0x1, %eax
addq %rax, %rbx
cmpq %r12, %rbx
jb 0x3d219
leaq 0x58a6e(%rip), %rsi     # 0x95cd3
leaq 0x810(%rsp), %rdi
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x4530
cmpl $0x1, %eax
jne 0x3d287
leaq 0x58d53(%rip), %r15     # 0x95fd8
jmp 0x3d2c0
leaq 0x575aa(%rip), %rsi     # 0x94838
xorl %r15d, %r15d
leaq 0x810(%rsp), %rdi
leaq 0xb(%rsp), %rdx
xorl %eax, %eax
callq 0x4530
cmpl $0x1, %eax
jne 0x3d2c0
movb 0xb(%rsp), %al
andb $-0x21, %al
xorl %r15d, %r15d
cmpb $0x46, %al
leaq 0x56a31(%rip), %rax     # 0x93ced
cmoveq %rax, %r15
movq %r15, %rax
addq $0xc10, %rsp            # imm = 0xC10
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %rbx
leaq 0x589a3(%rip), %rsi     # 0x95c8a
movq %rax, %rdi
xorl %eax, %eax
callq 0xc196
leaq 0x6f928(%rip), %rsi     # 0xacc20
movq 0x6fcd1(%rip), %rdx     # 0xacfd0
movq %rbx, %rdi
callq 0x4900
movq %rax, %r14
movq %rbx, %rdi
callq 0x43b0
movq %r14, %rdi
callq 0x4950