// File: /workspace/github_c_makefile_star2_O3/hfiguiere[P]exifprobe/misc.c
// Function: print_fileformat
void
print_fileformat(struct image_summary *entry)
{
    struct maker_scheme *scheme;
    char *sep,*camera_name;
    int chpr = 0;
    int filesubformat_shown = 0;
    int with_filesubformat = 0;
    int vendor_filesubformat = 0;
    int has_appn[16];
    int i;

    print_filename();
    if((PRINT_LONGNAMES))
        chpr += printf("FileFormat = ");
    else
        chpr += printf("File Format = ");

    if(entry)
    {
        memset(has_appn,0,sizeof(has_appn));
        print_filetype(entry->fileformat,0);
        if(entry->filesubformat & FILESUBFMT_TIFFEP)
            chpr += printf("EP");

        if(entry->fileformat == FILEFMT_TIFF)
            filesubformat_shown |= FILESUBFMT_TIFF;
        if(entry->filesubformat & FILESUBFMT_TIFFEP)
            filesubformat_shown |= FILESUBFMT_TIFFEP;

        sep = "/";
        for( ; entry; entry = entry->next_entry)
        {
            if((entry->filesubformat & (FILESUBFMT_TIFF|FILESUBFMT_TIFFOLD)) &&
                        !(filesubformat_shown & (FILESUBFMT_TIFF|FILESUBFMT_TIFFOLD)))
                chpr += printf("%sTIFF",sep);
            if((entry->filesubformat & FILESUBFMT_JPEG) &&
                        !(filesubformat_shown & FILESUBFMT_JPEG))
                chpr += printf("%sJPEG",sep);
            if((entry->filesubformat & FILESUBFMT_GEOTIFF) &&
                        !(filesubformat_shown & FILESUBFMT_GEOTIFF))
                chpr += printf("%sGEOTIFF",sep);
            if((entry->filesubformat & FILESUBFMT_TIFFEP) &&
                        !(filesubformat_shown & FILESUBFMT_TIFFEP))
                chpr += printf("%sEP",sep);
            if((entry->filesubformat & FILESUBFMT_APPN) &&
                        !(filesubformat_shown & FILESUBFMT_APPN))
            {
                if(entry->filesubformatAPPN[0])
                {
                    chpr += printf("%sAPP0",sep);
                    if(entry->filesubformat & FILESUBFMT_JFIF)
                        chpr += printf("%sJFIF",sep);
                    if(entry->filesubformat & FILESUBFMT_JFXX)
                        chpr += printf("%sJFXX",sep);
                }
                if(entry->filesubformatAPPN[1])
                {
                    chpr += printf("%sAPP1",sep);
                    if(entry->filesubformat & (FILESUBFMT_TIFF|FILESUBFMT_TIFFOLD))
                    {
                        entry->filesubformat &= ~(FILESUBFMT_TIFF|FILESUBFMT_TIFFOLD);
                        chpr += printf("%sTIFF",sep);
                    }
                    if(entry->filesubformat & FILESUBFMT_EXIF)
                    {
                        entry->filesubformat &= ~FILESUBFMT_EXIF;
                        chpr += printf("%sEXIF",sep);
                    }
                }
                if(entry->filesubformatAPPN[2])
                {
                    chpr += printf("%sAPP2",sep);
                    if(entry->filesubformat & FILESUBFMT_FPIX)
                    {
                        entry->filesubformat &= ~FILESUBFMT_FPIX;
                        chpr += printf("%sFPIX",sep);
                    }
                }
                for(i = 3; i < 16; ++i)
                {
                    if(entry->filesubformatAPPN[i])
                        has_appn[i] = entry->filesubformatAPPN[i];
                }
            }
            if((entry->filesubformat & FILESUBFMT_CIFF) &&
                        !(filesubformat_shown & FILESUBFMT_CIFF))
                chpr += printf("%sCIFF",sep);
            if((entry->filesubformat & FILESUBFMT_EXIF) &&
                        !(filesubformat_shown & FILESUBFMT_EXIF))
                chpr += printf("%sEXIF",sep);
            if((entry->filesubformat & FILESUBFMT_FPIX) &&
                        !(filesubformat_shown & FILESUBFMT_FPIX))
                chpr += printf("%sFPIX",sep);

            filesubformat_shown |= entry->filesubformat;

            if(entry->filesubformat & FILESUBFMT_NEF)
                vendor_filesubformat |= FILESUBFMT_NEF;
            if(entry->filesubformat & FILESUBFMT_CR2)
                vendor_filesubformat |= FILESUBFMT_CR2;
            if(entry->filesubformat & FILESUBFMT_DNG)
                vendor_filesubformat |= FILESUBFMT_DNG;
            if(entry->filesubformat & FILESUBFMT_MNOTE)
                with_filesubformat |= FILESUBFMT_MNOTE;
            if(entry->filesubformat & FILESUBFMT_MNSUBIFD)
                with_filesubformat |= FILESUBFMT_MNSUBIFD;
        }
        for(i = 3; i < 16; ++i)
        {
            if(has_appn[i])
                chpr += printf("%sAPP%d",sep,i);
        }
        if(vendor_filesubformat & FILESUBFMT_NEF)
                chpr += printf(" [NEF]");
        if(vendor_filesubformat & FILESUBFMT_CR2)
                chpr += printf(" [CR2]");
        if(vendor_filesubformat & FILESUBFMT_DNG)
                chpr += printf(" [DNG]");
        if(with_filesubformat)
            chpr += printf(" #");
        if(with_filesubformat & FILESUBFMT_MNOTE)
        {
            chpr += printf(" with MakerNote");
            scheme = retrieve_makerscheme();
            if(scheme->make)
            {
                camera_name = find_camera_name(scheme->make);
                if(scheme->scheme_type != UNKNOWN_SCHEME)
                    printf(" (%s [%d])",camera_name,scheme->note_version);
                else
                    printf(" (%s - unknown makernote format)",camera_name);
            }
            if(with_filesubformat & FILESUBFMT_MNSUBIFD)
                chpr += printf(" and MakerNote-SubIFD");
        }
    }
    else
        chpr += printf("unknown");
    chpr = newline(chpr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r14
callq 0x17ff9
leaq 0x40b9f(%rip), %rax     # 0x58180
testb $0x40, (%rax)
leaq 0x2e2e5(%rip), %rax     # 0x458d0
leaq 0x2e2d0(%rip), %rdi     # 0x458c2
cmoveq %rax, %rdi
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
testq %r14, %r14
je 0x179cd
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movslq 0x14(%r14), %rdi
xorl %esi, %esi
callq 0x5495
testb $0x4, 0x18(%r14)
je 0x17649
leaq 0x2e2c2(%rip), %rdi     # 0x458fb
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl 0x18(%r14), %ebx
andl $0x4, %ebx
xorl %r12d, %r12d
cmpl $0x2a, 0x14(%r14)
sete %r12b
orl %ebx, %r12d
movl %ebp, %ebx
xorl %r15d, %r15d
xorl %r13d, %r13d
movl 0x18(%r14), %eax
testb $0x3, %al
je 0x17690
movl %r12d, %ecx
andl $0x3, %ecx
leaq 0x2e26a(%rip), %rbp     # 0x458df
jne 0x17697
leaq 0x2e263(%rip), %rdi     # 0x458e1
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl 0x18(%r14), %eax
jmp 0x17697
leaq 0x2e248(%rip), %rbp     # 0x458df
testb $0x8, %al
je 0x176ba
movl %r12d, %ecx
andl $0x8, %ecx
jne 0x176ba
leaq 0x2e23e(%rip), %rdi     # 0x458e8
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl 0x18(%r14), %eax
btl $0xb, %eax
jae 0x176e2
movl %r12d, %ecx
andl $0x800, %ecx            # imm = 0x800
jne 0x176e2
leaq 0x2e21d(%rip), %rdi     # 0x458ef
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl 0x18(%r14), %eax
testb $0x4, %al
je 0x17705
movl %r12d, %ecx
andl $0x4, %ecx
jne 0x17705
leaq 0x2e204(%rip), %rdi     # 0x458f9
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl 0x18(%r14), %eax
testw %ax, %ax
jns 0x17851
movl %r12d, %ecx
andl $0x8000, %ecx           # imm = 0x8000
jne 0x17851
cmpl $0x0, 0x1c(%r14)
je 0x17784
leaq 0x2e1d3(%rip), %rdi     # 0x458fe
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
movq %rbp, %rsi
movl %eax, %ebp
addl %ebx, %ebp
movl 0x18(%r14), %eax
btl $0xc, %eax
jae 0x1775a
leaq 0x2e1b8(%rip), %rdi     # 0x45905
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl 0x18(%r14), %eax
btl $0xd, %eax
jb 0x17764
movl %ebp, %ebx
jmp 0x1777d
leaq 0x2e1a1(%rip), %rdi     # 0x4590c
leaq 0x2e16d(%rip), %rsi     # 0x458df
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
addl %ebp, %ebx
leaq 0x2e15b(%rip), %rbp     # 0x458df
cmpl $0x0, 0x20(%r14)
je 0x177f5
leaq 0x2e181(%rip), %rdi     # 0x45913
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
movq %rbp, %rsi
movl %eax, %ebp
addl %ebx, %ebp
movl 0x18(%r14), %eax
testb $0x3, %al
je 0x177c6
andl $-0x4, %eax
movl %eax, 0x18(%r14)
leaq 0x2e128(%rip), %rdi     # 0x458e1
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl 0x18(%r14), %eax
testb $0x10, %al
jne 0x177ce
movl %ebp, %ebx
jmp 0x177ee
andl $-0x11, %eax
movl %eax, 0x18(%r14)
leaq 0x2e13e(%rip), %rdi     # 0x4591a
leaq 0x2e0fc(%rip), %rsi     # 0x458df
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
addl %ebp, %ebx
leaq 0x2e0ea(%rip), %rbp     # 0x458df
cmpl $0x0, 0x24(%r14)
je 0x17835
leaq 0x2e11e(%rip), %rdi     # 0x45921
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl 0x18(%r14), %eax
btl $0xe, %eax
jae 0x17835
andl $0xffffbfff, %eax       # imm = 0xFFFFBFFF
movl %eax, 0x18(%r14)
leaq 0x2e0ff(%rip), %rdi     # 0x45928
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
xorl %eax, %eax
movl 0x28(%r14,%rax,4), %ecx
testl %ecx, %ecx
je 0x17844
movl %ecx, 0xc(%rsp,%rax,4)
incq %rax
cmpq $0xd, %rax
jne 0x17837
movl 0x18(%r14), %eax
btl $0xa, %eax
jae 0x17879
movl %r12d, %ecx
andl $0x400, %ecx            # imm = 0x400
jne 0x17879
leaq 0x2e0c6(%rip), %rdi     # 0x4592f
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl 0x18(%r14), %eax
testb $0x10, %al
je 0x1789c
movl %r12d, %ecx
andl $0x10, %ecx
jne 0x1789c
leaq 0x2e08e(%rip), %rdi     # 0x4591a
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl 0x18(%r14), %eax
btl $0xe, %eax
jae 0x178c4
movl %r12d, %ecx
andl $0x4000, %ecx           # imm = 0x4000
jne 0x178c4
leaq 0x2e074(%rip), %rdi     # 0x45928
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl 0x18(%r14), %eax
orl %eax, %r12d
orl %eax, %r15d
andl $0x300, %eax            # imm = 0x300
orl %eax, %r13d
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0x17660
movl $0x3, %r14d
leaq 0x2e04a(%rip), %rbp     # 0x45936
leaq 0x2dfec(%rip), %r12     # 0x458df
cmpl $0x0, (%rsp,%r14,4)
je 0x1790c
movq %rbp, %rdi
movq %r12, %rsi
movl %r14d, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
incq %r14
cmpq $0x10, %r14
jne 0x178f3
testb $0x20, %r15b
je 0x1792b
leaq 0x2e01c(%rip), %rdi     # 0x4593e
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
testb $0x40, %r15b
je 0x17941
leaq 0x2e00d(%rip), %rdi     # 0x45945
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
testb %r15b, %r15b
jns 0x17956
leaq 0x2dfff(%rip), %rdi     # 0x4594c
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
testl %r13d, %r13d
je 0x17a1f
leaq 0x2dfed(%rip), %rdi     # 0x45953
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
btl $0x8, %r13d
jae 0x17a1f
leaq 0x2dfd5(%rip), %rdi     # 0x45956
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
xorl %eax, %eax
callq 0x1c4fe
movl 0x38(%rax), %ecx
testl %ecx, %ecx
je 0x17a00
leaq 0x41801(%rip), %rdi     # 0x591a0
movq (%rdi), %rsi
leaq 0x2e007(%rip), %rdx     # 0x459b0
testq %rsi, %rsi
je 0x179d6
cmpl %ecx, 0xc(%rdi)
je 0x179d9
addq $0x24, %rdi
movq -0xc(%rdi), %rsi
testq %rsi, %rsi
je 0x179d6
leaq 0x18(%rdi), %r8
cmpl %ecx, (%rdi)
movq %r8, %rdi
jne 0x179b7
jmp 0x179d9
leaq 0x2dfd4(%rip), %rdi     # 0x459a8
jmp 0x17a14
movq %rdx, %rsi
cmpq $0x0, (%rax)
je 0x179f2
movl 0x40(%rax), %edx
leaq 0x2df7d(%rip), %rdi     # 0x45966
xorl %eax, %eax
callq 0x3120
jmp 0x17a00
leaq 0x2df78(%rip), %rdi     # 0x45971
xorl %eax, %eax
callq 0x3120
addl %ebx, %ebp
btl $0x9, %r13d
jb 0x17a0d
movl %ebp, %ebx
jmp 0x17a1f
leaq 0x2df7e(%rip), %rdi     # 0x45992
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
addl %ebp, %ebx
orl 0x45b23(%rip), %ebx     # 0x5d548
je 0x17a31
movl $0xa, %edi
callq 0x3060
movl $0x0, 0x45b0d(%rip)     # 0x5d548
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq