// File: /workspace/github_c_makefile_star2_O1/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 0x1f748
leaq 0x38b75(%rip), %r12     # 0x58180
movq (%r12), %rax
testl $0x4003333, %eax        # imm = 0x4003333
je 0x1f748
movq %rdi, %rbx
movzwl (%rdi), %r13d
movl %r13d, %r14d
andl $0x3fff, %r14d          # imm = 0x3FFF
movl %eax, %ecx
notl %ecx
testb $0x3, %cl
jne 0x1f64a
leaq 0x21fe6(%rip), %rdi     # 0x41621
movl %r14d, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x3120
jmp 0x1f673
testb $0x2, %al
jne 0x1f661
xorl %ebp, %ebp
testb $0x1, %al
je 0x1f675
movzwl %r14w, %esi
leaq 0x21fd6(%rip), %rdi     # 0x41635
jmp 0x1f66c
movzwl %r14w, %esi
leaq 0x21fc2(%rip), %rdi     # 0x4162e
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
testb $0x10, 0x1(%r12)
je 0x1f6b3
movzwl %r14w, %edi
callq 0xc3f4
testq %rax, %rax
je 0x1f6b3
movq %rax, %r14
leaq 0x2945c(%rip), %rdi     # 0x48af1
movl $0x17, %esi
movl $0x17, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq %r14, %rdi
callq 0x3050
testb $0x20, 0x1(%r12)
je 0x1f731
movl %r13d, %r15d
andl $0x3800, %r15d          # imm = 0x3800
leaq 0x29137(%rip), %rdi     # 0x48803
movl %r15d, %esi
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
addl %ebp, %r14d
shrl $0xb, %r15d
leaq 0x28f8d(%rip), %rax     # 0x48674
movslq (%rax,%r15,4), %rdi
addq %rax, %rdi
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
shrl $0xe, %r13d
leaq 0x28f92(%rip), %rax     # 0x48694
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 0x27122(%rip), %rdi     # 0x46848
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %ebx, %ebp
testb $0x30, (%r12)
je 0x1f748
leaq 0x2ae29(%rip), %rdi     # 0x4a568
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 0x17530