// File: /workspace/github_c_makefile_star2_O2/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, %r13
movq %rcx, (%rsp)
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r15
movq %rdx, %rdi
callq 0xf1c7
movl %eax, %r14d
leaq 0x51f07(%rip), %rax     # 0x57180
testl $0x4003333, (%rax)      # imm = 0x4003333
je 0x52e1
movl 0x40(%rsp), %ecx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x559b
movzwl 0x2(%rbx), %eax
addl $-0xd, %eax
cmpw $-0xc, %ax
jb 0x52b5
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x52b5
movq %r15, %rdi
callq 0x31a0
testl %eax, %eax
je 0x52f6
movq %r15, %rdi
callq 0x31b0
leaq 0x3a308(%rip), %rdi     # 0x3f5cc
callq 0x56e2
movq %r15, %rdi
callq 0x3190
movq %rax, %r14
xorl %r13d, %r13d
movl %r13d, %edi
callq 0x160f7
jmp 0x52e4
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 0x533c
leaq 0x51e7c(%rip), %rsi     # 0x57180
movq (%rsi), %rax
testl %r14d, %r14d
je 0x5366
movl %eax, %ecx
notl %ecx
testw $0x300, %cx             # imm = 0x300
movq (%rsp), %r14
jne 0x53f4
movq 0x10(%rbx), %rdx
addq %r14, %rdx
leaq 0x3dee0(%rip), %rdi     # 0x4320d
movq %rdx, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x543b
leaq 0x51e3d(%rip), %rax     # 0x57180
testb $0x30, (%rax)
je 0x5413
movq 0x10(%rbx), %rsi
leaq 0x3a285(%rip), %rdi     # 0x3f5dc
xorl %eax, %eax
callq 0x3120
movl %eax, %r13d
jmp 0x5416
testb $0x30, %al
movq (%rsp), %r14
je 0x558b
movzwl (%rbx), %ecx
leal -0x1(%rcx), %edx
cmpl $0x2, %edx
jb 0x53cd
cmpl $0x111, %ecx            # imm = 0x111
je 0x554e
cmpl $0x201, %ecx            # imm = 0x201
je 0x54ae
cmpl $0x8769, %ecx           # imm = 0x8769
je 0x54ae
cmpl $0x8825, %ecx           # imm = 0x8825
je 0x54ae
cmpl $0x9000, %ecx           # imm = 0x9000
je 0x53cd
cmpl $0xa005, %ecx           # imm = 0xA005
je 0x54ae
cmpl $0xa000, %ecx           # imm = 0xA000
jne 0x5557
addq $0x10, %rbx
leaq 0x3a220(%rip), %rdi     # 0x3f5f8
leaq 0x408a7(%rip), %rsi     # 0x45c86
xorl %r14d, %r14d
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %r13d
jmp 0x52d7
btl $0x8, %eax
jb 0x5426
xorl %r13d, %r13d
btl $0x9, %eax
jae 0x5445
movq 0x10(%rbx), %rsi
addq %r14, %rsi
leaq 0x413cb(%rip), %rdi     # 0x467dc
jmp 0x5434
xorl %r13d, %r13d
movq %r15, %rdi
callq 0x3190
movq %rax, %r14
jmp 0x52d7
movq 0x10(%rbx), %rsi
addq %r14, %rsi
leaq 0x3dde6(%rip), %rdi     # 0x4321a
xorl %eax, %eax
callq 0x3120
leaq 0x51d3e(%rip), %rsi     # 0x57180
movl %eax, %r13d
testq %r14, %r14
sete %cl
movq (%rsi), %rax
btl $0x1a, %eax
setae %dl
orb %cl, %dl
jne 0x5474
movq %rsi, %r14
movq 0x10(%rbx), %rsi
leaq 0x3a189(%rip), %rdi     # 0x3f5f0
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%r14), %rax
xorl %r14d, %r14d
btl $0x18, %eax
jb 0x52d7
movl 0x58(%rsp), %r14d
movl %r13d, %edi
callq 0x16a4f
movzwl %bp, %esi
movq %r15, %rdi
movq %rbx, %rdx
movq (%rsp), %rcx
movq %r12, %r8
pushq $0x0
pushq %r14
callq 0x56fc
popq %rcx
popq %rdx
jmp 0x52d1
movl %eax, %ecx
notl %ecx
testw $0x300, %cx             # imm = 0x300
jne 0x54d3
movq 0x10(%rbx), %rdx
addq %r14, %rdx
leaq 0x3dd46(%rip), %rdi     # 0x4320d
movq %rdx, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x5514
btl $0x8, %eax
jb 0x54ff
btl $0x9, %eax
jb 0x54ef
movq %rbx, %rdi
callq 0x5da5
testl %eax, %eax
je 0x5593
movq 0x10(%rbx), %rsi
addq %r14, %rsi
leaq 0x412df(%rip), %rdi     # 0x467dc
jmp 0x550d
movq 0x10(%rbx), %rsi
addq %r14, %rsi
leaq 0x3dd0d(%rip), %rdi     # 0x4321a
xorl %eax, %eax
callq 0x3120
movl %eax, %r13d
testq %r14, %r14
leaq 0x51c5f(%rip), %rax     # 0x57180
je 0x5529
testb $0x4, 0x3(%rax)
jne 0x5531
xorl %r14d, %r14d
jmp 0x52d7
movq 0x10(%rbx), %rsi
leaq 0x3a2c7(%rip), %rdi     # 0x3f803
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
jmp 0x52d7
leaq 0x39b87(%rip), %rsi     # 0x3f0dc
jmp 0x555e
leaq 0x40728(%rip), %rsi     # 0x45c86
movq %rbx, %rdi
callq 0x5dd3
cmpw $0x111, (%rbx)          # imm = 0x111
jne 0x5580
cmpq $0x0, 0x10(%rbx)
jne 0x5580
leaq 0x3a084(%rip), %rdi     # 0x3f5ff
callq 0x56e2
movq %rbx, %rdi
movq %r13, %rsi
callq 0x16fbc
xorl %r14d, %r14d
jmp 0x52d4
xorl %r13d, %r13d
jmp 0x5517