// File: /workspace/github_c_makefile_star2_O3/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 0x1fd20
leaq 0x385a0(%rip), %r12     # 0x58180
movq (%r12), %rax
testl $0x4003333, %eax        # imm = 0x4003333
je 0x1fd20
movq %rdi, %rbx
movzwl (%rdi), %r13d
movl %r13d, %r14d
andl $0x3fff, %r14d          # imm = 0x3FFF
movl %eax, %ecx
notl %ecx
testb $0x3, %cl
jne 0x1fc1f
leaq 0x21a11(%rip), %rdi     # 0x41621
movl %r14d, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x3120
jmp 0x1fc48
testb $0x2, %al
jne 0x1fc36
xorl %ebp, %ebp
testb $0x1, %al
je 0x1fc4a
movzwl %r14w, %esi
leaq 0x21a01(%rip), %rdi     # 0x41635
jmp 0x1fc41
movzwl %r14w, %esi
leaq 0x219ed(%rip), %rdi     # 0x4162e
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
testb $0x10, 0x1(%r12)
je 0x1fc88
movzwl %r14w, %edi
callq 0xc574
testq %rax, %rax
je 0x1fc88
movq %rax, %r14
leaq 0x28ec7(%rip), %rdi     # 0x48b31
movl $0x17, %esi
movl $0x17, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq %r14, %rdi
callq 0x3050
movq (%r12), %rax
btl $0xd, %eax
jae 0x1fd0c
movl %r13d, %r15d
andl $0x3800, %r15d          # imm = 0x3800
leaq 0x28ba0(%rip), %rdi     # 0x48843
movl %r15d, %esi
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
addl %ebp, %r14d
shrl $0xb, %r15d
leaq 0x289f6(%rip), %rax     # 0x486b4
movslq (%rax,%r15,4), %rdi
addq %rax, %rdi
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
shrl $0xe, %r13d
leaq 0x289fb(%rip), %rax     # 0x486d4
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 0x26b8b(%rip), %rdi     # 0x46888
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %ebx, %ebp
movq (%r12), %rax
testb $0x30, %al
je 0x1fd20
leaq 0x2a891(%rip), %rdi     # 0x4a5a8
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 0x17a82