// File: /workspace/github_c_makefile_star2_O3/hfiguiere[P]exifprobe/print.c
// Function: print_entry
unsigned long
print_entry(FILE *inptr,unsigned short byteorder,struct ifd_entry *entry_ptr,
            unsigned long fileoffset_base,struct image_summary *summary_entry,
            char *parent_name,int ifdtype,int ifdnum,int subifdnum,int indent)
{
    int value_is_offset = 0;
    unsigned long endoffset = 0UL;
    int chpr = 0;

    value_is_offset = is_offset(entry_ptr);
    if((PRINT_ENTRY))
    {
        print_taginfo(entry_ptr,parent_name,indent,ifdtype,ifdnum,subifdnum);
        if((entry_ptr->value_type == 0) || (entry_ptr->value_type > DOUBLE) ||
            ferror(inptr) || feof(inptr))
        {
            clearerr(inptr);
            printred("# INVALID ENTRY");
            endoffset = ftell(inptr);
        }
        else if(entry_ptr->count == 0)
        {
            if(PRINT_VALUE)
                chpr += printf(" EMPTY (value=%#lx)",entry_ptr->value);
            endoffset = ftell(inptr);
        }
        else if(value_is_offset)
        {
            /* Offsets read from the file are printed relative to the */
            /* beginning of the file (with fileoffset_base added) so  */
            /* that the values, printed later, will be easy to find.  */
            if(PRINT_BOTH_OFFSET)
                chpr += printf("@%#lx=%lu",entry_ptr->value + fileoffset_base,
                        entry_ptr->value + fileoffset_base);
            else if(PRINT_HEX_OFFSET)
                chpr += printf("@%#lx",entry_ptr->value + fileoffset_base);
            else if(PRINT_DEC_OFFSET)
                chpr += printf("@%lu",entry_ptr->value + fileoffset_base);

            if(fileoffset_base && (PRINT_ENTRY_RELOFFSET))
                chpr += printf(" (%lu) ",entry_ptr->value);

            /* Print "inline" in REPORT & LIST modes                      */
            if(!(PRINT_VALUE_AT_OFFSET))
            {
                setcharsprinted(chpr);
                chpr = 0;
                endoffset = print_offset_value(inptr,byteorder,entry_ptr,
                                            fileoffset_base,parent_name,
                                            ifdtype,indent,0);
            }
        }
        else if(PRINT_VALUE)
        {
            /* Intercept some EXIF values which print_value() would   */
            /* not handle properly, possibly because they are ascii   */
            /* items tagged as UNDEFINED. A few items given as LONG   */
            /* type are actually offsets, and are printed as such     */
            /* here, with fileoffset_base added.                      */
            switch(entry_ptr->tag)
            {
                case EXIFTAG_ExifVersion:
                case EXIFTAG_FlashPixVersion:
                case INTEROPTAG_Version:
                case INTEROPTAG_Index:
                    /* ASCII                                          */
                    /* ###%%% show_string()?                          */
                    chpr += printf("%s\'%s\'",PREFIX,(char *)&entry_ptr->value);
                    break;
                case EXIFTAG_ExifIFDPointer:
                case EXIFTAG_GPSInfoIFDPointer:
                case EXIFTAG_Interoperability:
                case TIFFTAG_JPEGInterchangeFormat:
                    /* OFFSETS                                        */
                    if(PRINT_BOTH_OFFSET)
                    {
                        chpr += printf("@%#lx=%lu",entry_ptr->value + fileoffset_base,
                                entry_ptr->value + fileoffset_base);
                    }
                    else if(PRINT_HEX_OFFSET)
                        chpr += printf("@%#lx",entry_ptr->value + fileoffset_base);
                    else if((PRINT_DEC_OFFSET) || is_a_long_offset(entry_ptr)) 
                        chpr += printf("@%lu",entry_ptr->value + fileoffset_base);

                    if(fileoffset_base && (PRINT_ENTRY_RELOFFSET))
                        chpr += printf(" (%lu)",entry_ptr->value);
                    break;
                default:
                    /* VALUES                                         */
                    if(entry_ptr->tag == TIFFTAG_StripOffsets)
                        print_value(entry_ptr,"@");
                    else
                        print_value(entry_ptr,PREFIX);
                    /* This one is worth flagging...                  */
                    if((entry_ptr->tag == TIFFTAG_StripOffsets) &&
                                                (entry_ptr->value == 0))
                    {
                            printred(" (BAD START OFFSET)");
                    }
                    interpret_value(entry_ptr,summary_entry);
                    break;
            }
        }
        chpr = newline(chpr);
    }
    return(endoffset);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r12
movq %r8, %rbp
movq %rcx, (%rsp)
movq %rdx, %rbx
movl %esi, %r13d
movq %rdi, %r15
movq %rdx, %rdi
callq 0xff89
movl %eax, %r14d
leaq 0x52a07(%rip), %rax     # 0x58180
testl $0x4003333, (%rax)      # imm = 0x4003333
je 0x57ef
movl 0x40(%rsp), %ecx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5ada
movzwl 0x2(%rbx), %eax
addl $-0xd, %eax
cmpw $-0xc, %ax
jb 0x57b5
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x57b5
movq %r15, %rdi
callq 0x31a0
testl %eax, %eax
je 0x5804
movq %r15, %rdi
callq 0x31b0
leaq 0x3b8d3(%rip), %rdi     # 0x41097
leaq 0x3be01(%rip), %rsi     # 0x415cc
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x17a82
movq %r15, %rdi
callq 0x3190
movq %rax, %r14
movl %ebp, %edi
callq 0x1707a
jmp 0x57f2
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x8(%rbx)
je 0x584a
leaq 0x5296e(%rip), %rsi     # 0x58180
movq (%rsi), %rcx
testl %r14d, %r14d
je 0x5873
movl %ecx, %eax
notl %eax
testl $0x300, %eax            # imm = 0x300
movq (%rsp), %r14
jne 0x58bc
movq 0x10(%rbx), %rdx
addq %r14, %rdx
leaq 0x3fa16(%rip), %rdi     # 0x45251
movq %rdx, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x58f6
leaq 0x5292f(%rip), %rax     # 0x58180
testb $0x30, (%rax)
je 0x58da
movq 0x10(%rbx), %rsi
leaq 0x3bd77(%rip), %rdi     # 0x415dc
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
jmp 0x57db
testb $0x30, %cl
movq (%rsp), %r14
je 0x5a75
movzwl (%rbx), %eax
cmpl $0x8824, %eax           # imm = 0x8824
jg 0x596c
cmpl $0x200, %eax            # imm = 0x200
jg 0x59be
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0x5998
cmpl $0x111, %eax            # imm = 0x111
jne 0x5a31
leaq 0x3b825(%rip), %rsi     # 0x410dc
jmp 0x5a38
btl $0x8, %ecx
jb 0x58e1
xorl %ebp, %ebp
btl $0x9, %ecx
jae 0x58ff
movq 0x10(%rbx), %rsi
addq %r14, %rsi
leaq 0x42f54(%rip), %rdi     # 0x4882c
jmp 0x58ef
xorl %ebp, %ebp
jmp 0x57db
movq 0x10(%rbx), %rsi
addq %r14, %rsi
leaq 0x3f96f(%rip), %rdi     # 0x4525e
xorl %eax, %eax
callq 0x3120
leaq 0x52883(%rip), %rsi     # 0x58180
movl %eax, %ebp
testq %r14, %r14
sete %cl
movq (%rsi), %rax
btl $0x1a, %eax
setae %dl
orb %cl, %dl
jne 0x592d
movq %rsi, %r14
movq 0x10(%rbx), %rsi
leaq 0x3bccf(%rip), %rdi     # 0x415f0
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r14), %rax
xorl %r14d, %r14d
btl $0x18, %eax
jb 0x57e6
movl 0x58(%rsp), %r14d
movl %ebp, %edi
callq 0x17a82
movzwl %r13w, %esi
movq %r15, %rdi
movq %rbx, %rdx
movq (%rsp), %rcx
movq %r12, %r8
pushq $0x0
pushq %r14
callq 0x5c40
addq $0x10, %rsp
movq %rax, %r14
jmp 0x5a78
cmpl $0x9fff, %eax           # imm = 0x9FFF
jg 0x5986
cmpl $0x8825, %eax           # imm = 0x8825
je 0x59cc
cmpl $0x9000, %eax           # imm = 0x9000
je 0x5998
jmp 0x5a31
cmpl $0xa005, %eax           # imm = 0xA005
je 0x59cc
cmpl $0xa000, %eax           # imm = 0xA000
jne 0x5a31
addq $0x10, %rbx
leaq 0x3bc55(%rip), %rdi     # 0x415f8
leaq 0x4232c(%rip), %rsi     # 0x47cd6
xorl %r14d, %r14d
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
jmp 0x57e6
cmpl $0x201, %eax            # imm = 0x201
je 0x59cc
cmpl $0x8769, %eax           # imm = 0x8769
jne 0x5a31
movl %ecx, %edx
notl %edx
testl $0x300, %edx            # imm = 0x300
jne 0x59f5
movq 0x10(%rbx), %rdx
addq %r14, %rdx
leaq 0x3f86b(%rip), %rdi     # 0x45251
movq %rdx, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x5aa2
btl $0x8, %ecx
jb 0x5a21
btl $0x9, %ecx
jb 0x5a8d
xorl %ebp, %ebp
cmpl $0x8824, %eax           # imm = 0x8824
jg 0x5a7f
cmpl $0x201, %eax            # imm = 0x201
je 0x5a8d
cmpl $0x8769, %eax           # imm = 0x8769
je 0x5a8d
jmp 0x5aab
movq 0x10(%rbx), %rsi
addq %r14, %rsi
leaq 0x3f82f(%rip), %rdi     # 0x4525e
jmp 0x5a9b
leaq 0x4229e(%rip), %rsi     # 0x47cd6
movq %rbx, %rdi
callq 0x634b
cmpw $0x111, (%rbx)          # imm = 0x111
jne 0x5a6a
cmpq $0x0, 0x10(%rbx)
jne 0x5a6a
leaq 0x3b642(%rip), %rdi     # 0x41097
leaq 0x3bba3(%rip), %rsi     # 0x415ff
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x17a82
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x18038
xorl %r14d, %r14d
xorl %ebp, %ebp
jmp 0x57e6
cmpl $0xa005, %eax           # imm = 0xA005
je 0x5a8d
cmpl $0x8825, %eax           # imm = 0x8825
jne 0x5aab
movq 0x10(%rbx), %rsi
addq %r14, %rsi
leaq 0x42d91(%rip), %rdi     # 0x4882c
xorl %eax, %eax
callq 0x3120
leaq 0x526d7(%rip), %rsi     # 0x58180
movl %eax, %ebp
testq %r14, %r14
je 0x5ab6
testb $0x4, 0x3(%rsi)
jne 0x5abe
xorl %r14d, %r14d
jmp 0x57e6
movq 0x10(%rbx), %rsi
leaq 0x3bd3a(%rip), %rdi     # 0x41803
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
jmp 0x57e6