// File: /workspace/github_c_makefile_star2_O1/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 0x17aa7
leaq 0x410d1(%rip), %rax     # 0x58180
testb $0x40, (%rax)
leaq 0x2e7d3(%rip), %rax     # 0x4588c
leaq 0x2e7be(%rip), %rdi     # 0x4587e
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
testq %r14, %r14
je 0x1747b
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 0x54af
testb $0x4, 0x18(%r14)
je 0x1710e
leaq 0x2e7b2(%rip), %rdi     # 0x458b7
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
xorl %eax, %eax
cmpl $0x2a, 0x14(%r14)
movl 0x18(%r14), %r12d
sete %al
andl $0x4, %r12d
orl %eax, %r12d
movl %ebp, %ebx
xorl %r15d, %r15d
xorl %r13d, %r13d
testb $0x3, 0x18(%r14)
je 0x17156
movl %r12d, %eax
andl $0x3, %eax
leaq 0x2e75c(%rip), %rbp     # 0x4589b
jne 0x1715d
leaq 0x2e755(%rip), %rdi     # 0x4589d
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
jmp 0x1715d
leaq 0x2e73e(%rip), %rbp     # 0x4589b
testb $0x8, 0x18(%r14)
je 0x1717f
movl %r12d, %eax
andl $0x8, %eax
jne 0x1717f
leaq 0x2e731(%rip), %rdi     # 0x458a4
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
testb $0x8, 0x19(%r14)
je 0x171a3
movl %r12d, %eax
andl $0x800, %eax            # imm = 0x800
jne 0x171a3
leaq 0x2e714(%rip), %rdi     # 0x458ab
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
testb $0x4, 0x18(%r14)
je 0x171c5
movl %r12d, %eax
andl $0x4, %eax
jne 0x171c5
leaq 0x2e6fc(%rip), %rdi     # 0x458b5
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
testb $-0x80, 0x19(%r14)
je 0x17308
movl %r12d, %eax
andl $0x8000, %eax           # imm = 0x8000
jne 0x17308
cmpl $0x0, 0x1c(%r14)
je 0x1723f
leaq 0x2e6ce(%rip), %rdi     # 0x458ba
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
movq %rbp, %rsi
movl %eax, %ebp
addl %ebx, %ebp
testb $0x10, 0x19(%r14)
je 0x17214
leaq 0x2e6b6(%rip), %rdi     # 0x458c1
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
testb $0x20, 0x19(%r14)
jne 0x1721f
movl %ebp, %ebx
jmp 0x17238
leaq 0x2e6a2(%rip), %rdi     # 0x458c8
leaq 0x2e66e(%rip), %rsi     # 0x4589b
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
addl %ebp, %ebx
leaq 0x2e65c(%rip), %rbp     # 0x4589b
cmpl $0x0, 0x20(%r14)
je 0x172b0
leaq 0x2e682(%rip), %rdi     # 0x458cf
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 0x1727d
andl $-0x4, %eax
movl %eax, 0x18(%r14)
leaq 0x2e629(%rip), %rdi     # 0x4589d
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl 0x18(%r14), %eax
testb $0x10, %al
jne 0x17289
movl %ebp, %ebx
jmp 0x172a9
andl $-0x11, %eax
movl %eax, 0x18(%r14)
leaq 0x2e63f(%rip), %rdi     # 0x458d6
leaq 0x2e5fd(%rip), %rsi     # 0x4589b
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
addl %ebp, %ebx
leaq 0x2e5eb(%rip), %rbp     # 0x4589b
cmpl $0x0, 0x24(%r14)
je 0x172f0
leaq 0x2e61f(%rip), %rdi     # 0x458dd
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl 0x18(%r14), %eax
btl $0xe, %eax
jae 0x172f0
andl $0xffffbfff, %eax       # imm = 0xFFFFBFFF
movl %eax, 0x18(%r14)
leaq 0x2e600(%rip), %rdi     # 0x458e4
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
xorl %eax, %eax
movl 0x28(%r14,%rax,4), %ecx
testl %ecx, %ecx
je 0x172ff
movl %ecx, 0xc(%rsp,%rax,4)
incq %rax
cmpq $0xd, %rax
jne 0x172f2
testb $0x4, 0x19(%r14)
je 0x1732c
movl %r12d, %eax
andl $0x400, %eax            # imm = 0x400
jne 0x1732c
leaq 0x2e5cb(%rip), %rdi     # 0x458eb
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
testb $0x10, 0x18(%r14)
je 0x1734e
movl %r12d, %eax
andl $0x10, %eax
jne 0x1734e
leaq 0x2e594(%rip), %rdi     # 0x458d6
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
testb $0x40, 0x19(%r14)
je 0x17372
movl %r12d, %eax
andl $0x4000, %eax           # imm = 0x4000
jne 0x17372
leaq 0x2e57e(%rip), %rdi     # 0x458e4
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 0x1712b
movl $0x3, %r14d
leaq 0x2e554(%rip), %rbp     # 0x458f2
leaq 0x2e4f6(%rip), %r12     # 0x4589b
cmpl $0x0, (%rsp,%r14,4)
je 0x173be
movq %rbp, %rdi
movq %r12, %rsi
movl %r14d, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
incq %r14
cmpq $0x10, %r14
jne 0x173a5
testb $0x20, %r15b
je 0x173dd
leaq 0x2e526(%rip), %rdi     # 0x458fa
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
testb $0x40, %r15b
je 0x173f3
leaq 0x2e517(%rip), %rdi     # 0x45901
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
testb %r15b, %r15b
jns 0x17408
leaq 0x2e509(%rip), %rdi     # 0x45908
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
testl %r13d, %r13d
je 0x1741d
leaq 0x2e4fb(%rip), %rdi     # 0x4590f
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
btl $0x8, %r13d
jae 0x174cd
leaq 0x2e4e3(%rip), %rdi     # 0x45912
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
xorl %eax, %eax
callq 0x1c005
movl 0x38(%rax), %ecx
testl %ecx, %ecx
je 0x174ae
leaq 0x41d53(%rip), %rdi     # 0x591a0
movq (%rdi), %rsi
leaq 0x2e515(%rip), %rdx     # 0x4596c
testq %rsi, %rsi
je 0x17484
cmpl %ecx, 0xc(%rdi)
je 0x17487
addq $0x24, %rdi
movq -0xc(%rdi), %rsi
testq %rsi, %rsi
je 0x17484
leaq 0x18(%rdi), %r8
cmpl %ecx, (%rdi)
movq %r8, %rdi
jne 0x17465
jmp 0x17487
leaq 0x2e4e2(%rip), %rdi     # 0x45964
jmp 0x174c2
movq %rdx, %rsi
cmpq $0x0, (%rax)
je 0x174a0
movl 0x40(%rax), %edx
leaq 0x2e48b(%rip), %rdi     # 0x45922
xorl %eax, %eax
callq 0x3120
jmp 0x174ae
leaq 0x2e486(%rip), %rdi     # 0x4592d
xorl %eax, %eax
callq 0x3120
addl %ebx, %ebp
btl $0x9, %r13d
jb 0x174bb
movl %ebp, %ebx
jmp 0x174cd
leaq 0x2e48c(%rip), %rdi     # 0x4594e
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
addl %ebp, %ebx
orl 0x46075(%rip), %ebx     # 0x5d548
je 0x174df
movl $0xa, %edi
callq 0x3060
movl $0x0, 0x4605f(%rip)     # 0x5d548
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq