// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movw %si, %ax
movl 0x28(%rbp), %esi
movl 0x20(%rbp), %esi
movl 0x18(%rbp), %esi
movl 0x10(%rbp), %esi
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x18(%rbp), %rdi
callq 0x158d0
movl %eax, -0x34(%rbp)
leaq 0x70ff8(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x4003333, %rax        # imm = 0x4003333
cmpq $0x0, %rax
je 0x65d1
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl 0x28(%rbp), %edx
movl 0x10(%rbp), %ecx
movl 0x18(%rbp), %r8d
movl 0x20(%rbp), %r9d
callq 0x65e0
movq -0x18(%rbp), %rax
movzwl 0x2(%rax), %eax
cmpl $0x0, %eax
je 0x61ec
movq -0x18(%rbp), %rax
movzwl 0x2(%rax), %eax
cmpl $0xc, %eax
jg 0x61ec
movq -0x8(%rbp), %rdi
callq 0x30a0
cmpl $0x0, %eax
jne 0x61ec
movq -0x8(%rbp), %rdi
callq 0x3190
cmpl $0x0, %eax
je 0x6213
movq -0x8(%rbp), %rdi
callq 0x31a0
leaq 0x5e390(%rip), %rdi     # 0x6458c
callq 0x6860
movq -0x8(%rbp), %rdi
callq 0x3180
movq %rax, -0x40(%rbp)
jmp 0x65c6
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x6260
leaq 0x70f5b(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x624e
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x5e35b(%rip), %rdi     # 0x6459c
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3180
movq %rax, -0x40(%rbp)
jmp 0x65c4
cmpl $0x0, -0x34(%rbp)
je 0x63ba
leaq 0x70f0f(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x300, %rax            # imm = 0x300
cmpq $0x300, %rax            # imm = 0x300
jne 0x62b0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
addq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdx
addq -0x20(%rbp), %rdx
leaq 0x6163e(%rip), %rdi     # 0x678df
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x6322
leaq 0x70ec9(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x100, %rax            # imm = 0x100
cmpq $0x0, %rax
je 0x62e8
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
addq -0x20(%rbp), %rsi
leaq 0x61613(%rip), %rdi     # 0x678ec
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x6320
leaq 0x70e91(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x200, %rax            # imm = 0x200
cmpq $0x0, %rax
je 0x631e
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
addq -0x20(%rbp), %rsi
leaq 0x64a7a(%rip), %rdi     # 0x6ad8b
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x6320
jmp 0x6322
cmpq $0x0, -0x20(%rbp)
je 0x635b
leaq 0x70e50(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x4000000, %rax        # imm = 0x4000000
cmpq $0x0, %rax
je 0x635b
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x5e262(%rip), %rdi     # 0x645b0
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq 0x70e1e(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x1000000, %rax        # imm = 0x1000000
cmpq $0x0, %rax
jne 0x63b5
movl -0x44(%rbp), %edi
callq 0x1ff00
movl $0x0, -0x44(%rbp)
movq -0x8(%rbp), %rdi
movw -0xa(%rbp), %si
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %r8
movl 0x10(%rbp), %r9d
movl 0x28(%rbp), %eax
xorl %r10d, %r10d
movzwl %si, %esi
movl %eax, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x68a0
movq %rax, -0x40(%rbp)
jmp 0x65c2
leaq 0x70dbf(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x65c0
movq -0x18(%rbp), %rax
movzwl (%rax), %eax
movl %eax, -0x48(%rbp)
decl %eax
subl $0x2, %eax
jb 0x6430
jmp 0x63e5
movl -0x48(%rbp), %eax
subl $0x201, %eax            # imm = 0x201
je 0x6458
jmp 0x63f1
movl -0x48(%rbp), %eax
subl $0x8769, %eax           # imm = 0x8769
je 0x6458
jmp 0x63fd
movl -0x48(%rbp), %eax
subl $0x8825, %eax           # imm = 0x8825
je 0x6458
jmp 0x6409
movl -0x48(%rbp), %eax
subl $0x9000, %eax           # imm = 0x9000
je 0x6430
jmp 0x6415
movl -0x48(%rbp), %eax
subl $0xa000, %eax           # imm = 0xA000
je 0x6430
jmp 0x6421
movl -0x48(%rbp), %eax
subl $0xa005, %eax           # imm = 0xA005
je 0x6458
jmp 0x655c
movq -0x18(%rbp), %rdx
addq $0x10, %rdx
leaq 0x5e179(%rip), %rdi     # 0x645b8
leaq 0x63ed4(%rip), %rsi     # 0x6a31a
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x65be
leaq 0x70d21(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x300, %rax            # imm = 0x300
cmpq $0x300, %rax            # imm = 0x300
jne 0x64a1
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
addq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdx
addq -0x20(%rbp), %rdx
leaq 0x61450(%rip), %rdi     # 0x678df
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x6521
leaq 0x70cd8(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x100, %rax            # imm = 0x100
cmpq $0x0, %rax
je 0x64d9
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
addq -0x20(%rbp), %rsi
leaq 0x61422(%rip), %rdi     # 0x678ec
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x651f
leaq 0x70ca0(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x200, %rax            # imm = 0x200
cmpq $0x0, %rax
jne 0x64fd
movq -0x18(%rbp), %rdi
callq 0x7160
cmpl $0x0, %eax
je 0x651d
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
addq -0x20(%rbp), %rsi
leaq 0x6487b(%rip), %rdi     # 0x6ad8b
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x651f
jmp 0x6521
cmpq $0x0, -0x20(%rbp)
je 0x655a
leaq 0x70c51(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x4000000, %rax        # imm = 0x4000000
cmpq $0x0, %rax
je 0x655a
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x5e276(%rip), %rdi     # 0x647c3
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x65be
movq -0x18(%rbp), %rax
movzwl (%rax), %eax
cmpl $0x111, %eax            # imm = 0x111
jne 0x657c
movq -0x18(%rbp), %rdi
leaq 0x5db67(%rip), %rsi     # 0x640dc
callq 0x71d0
jmp 0x658c
movq -0x18(%rbp), %rdi
leaq 0x63d93(%rip), %rsi     # 0x6a31a
callq 0x71d0
movq -0x18(%rbp), %rax
movzwl (%rax), %eax
cmpl $0x111, %eax            # imm = 0x111
jne 0x65b1
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x65b1
leaq 0x5e013(%rip), %rdi     # 0x645bf
callq 0x6860
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x20a90
jmp 0x65c0
jmp 0x65c2
jmp 0x65c4
jmp 0x65c6
movl -0x44(%rbp), %edi
callq 0x1ef50
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)