// File: /workspace/github_c_makefile_star2_O2/hfiguiere[P]exifprobe/ciff.c
// Function: print_ciff_taginfo
void
print_ciff_taginfo(struct ciff_direntry *entry,unsigned long fileoffset_base)
{
    char *nameoftag = NULL;
    int tagwidth = CIFFTAGWIDTH;
    unsigned short tag,format,location;
    int chpr = 0;

    if(entry && (PRINT_ENTRY))
    {
        tag = entry->type & CIFF_TYPEMASK;
        format = entry->type & CIFF_FORMATMASK;
        location = entry->type & CIFF_LOCATIONMASK;
        if(PRINT_BOTH_TAGNO)
            chpr += printf("<%#06x=%5u> ",tag,tag);
        else if(PRINT_DEC_TAGNO)
            chpr += printf("<%5u> ",tag);
        else if(PRINT_HEX_TAGNO)
            chpr += printf("<%#06x> ",tag);
        if((PRINT_TAGNAME))
        {
            nameoftag = cifftagname(tag);
            if(nameoftag)
            {
                chpr += printf("%-*.*s",tagwidth,tagwidth,nameoftag);
                free(nameoftag);
            }
        }
        if(PRINT_TYPE)
        {
            chpr += printf(" [%#06x ",format);
            switch(format)
            {
                case 0x0000: chpr += printf("BYTE  "); break;
                case 0x0800: chpr += printf("ASCII "); break;
                case 0x1000: chpr += printf("SHORT "); break;
                case 0x1800: chpr += printf("LONG  "); break;
                case 0x2000: chpr += printf("STRUCT"); break;
                case 0x2800: chpr += printf("SUBDIR"); break;
                case 0x3000: chpr += printf("SUBDIR"); break;
                case 0x3800:
                default:
                    chpr += printf("UNDEFINED");
                    break;
            }
            switch(location)
            {
                case 0x0000: chpr += printf(" INHEAP %10lu %10lu",entry->length,entry->offset); break;
                case 0x4000: chpr += printf(" INREC  %10lu %10lu",entry->length,entry->offset); break;
                case 0x8000: chpr += printf(" X8000  %10lu %10lu",entry->length,entry->offset); break;
                case 0xc000: chpr += printf(" XC000  %10lu %10lu",entry->length,entry->offset); break;
                default:
                    chpr += printf(" UNKNOWNLOC");
                    break;
            }
            chpr += printf("] ");
        }
        /* ###%%% should be done immediately before value is printed; */
        /* not here                                                   */
        if(PRINT_VALUE)
            chpr += printf(" = "); 
    }
    setcharsprinted(chpr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebp, %ebp
testq %rdi, %rdi
je 0x1ea59
leaq 0x3885b(%rip), %r12     # 0x57180
movq (%r12), %rax
testl $0x4003333, %eax        # imm = 0x4003333
je 0x1ea59
movq %rdi, %rbx
movzwl (%rdi), %r13d
movl %r13d, %edx
andl $0x3fff, %edx           # imm = 0x3FFF
movl %eax, %ecx
notl %ecx
movzwl %dx, %r14d
testb $0x3, %cl
jne 0x1e963
leaq 0x20cc9(%rip), %rdi     # 0x3f621
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x1e987
testb $0x2, %al
jne 0x1e976
xorl %ebp, %ebp
testb $0x1, %al
je 0x1e989
leaq 0x20cc1(%rip), %rdi     # 0x3f635
jmp 0x1e97d
leaq 0x20cb1(%rip), %rdi     # 0x3f62e
movl %r14d, %esi
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
testb $0x10, 0x1(%r12)
je 0x1e9c1
movl %r14d, %edi
callq 0xbadb
testq %rax, %rax
je 0x1e9c1
movq %rax, %r14
leaq 0x28139(%rip), %rdi     # 0x46ae1
pushq $0x17
popq %rdx
movl %edx, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq %r14, %rdi
callq 0x3050
movq (%r12), %rax
btl $0xd, %eax
jae 0x1ea45
movl %r13d, %r15d
andl $0x3800, %r15d          # imm = 0x3800
leaq 0x27e17(%rip), %rdi     # 0x467f3
movl %r15d, %esi
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
addl %ebp, %r14d
shrl $0xb, %r15d
leaq 0x27c6d(%rip), %rax     # 0x46664
movslq (%rax,%r15,4), %rdi
addq %rax, %rdi
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
shrl $0xe, %r13d
leaq 0x27c72(%rip), %rax     # 0x46684
movslq (%rax,%r13,4), %rdi
addq %rax, %rdi
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
addl %r14d, %ebx
addl %ebp, %ebx
leaq 0x25e02(%rip), %rdi     # 0x44838
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %ebx, %ebp
movq (%r12), %rax
testb $0x30, %al
je 0x1ea59
leaq 0x29b08(%rip), %rdi     # 0x48558
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x16a4f