// File: /workspace/github_c_makefile_star2_O1/hfiguiere[P]exifprobe/print.c
// Function: print_value
void
print_value(struct ifd_entry *entry_ptr,char *prefix)
{
    unsigned long byte;
    unsigned short ushort_val;
    unsigned long i;
    int chpr = 0;

    if(entry_ptr && (PRINT_VALUE))
    {
        if(prefix)
            chpr += printf("%s",prefix);
        switch(entry_ptr->value_type)
        {
            case SBYTE:
                byte = entry_ptr->value;
                for(i = 0; i < entry_ptr->count; ++i)
                {
                    if(PRINT_BOTH_VALUE)
                        chpr += printf("%#x=%d",(unsigned int)((char)byte & 0xff),
                                    (int)((char)byte & 0xff));
                    else if(PRINT_HEX_VALUE)
                        chpr += printf("%#x",(unsigned int)((char)byte & 0xff));
                    else if(PRINT_DEC_VALUE)
                        chpr += printf("%d",(int)((char)byte & 0xff));
                    byte >>= 8;
                }
                break;
            case SHORT:
                ushort_val = entry_ptr->value ;
                if(PRINT_BOTH_VALUE)
                    chpr += printf("%#x=%u",ushort_val,ushort_val);
                else if(PRINT_HEX_VALUE)
                    chpr += printf("%#x",ushort_val);
                else if(PRINT_DEC_VALUE)
                    chpr += printf("%u",ushort_val);
                if(entry_ptr->count > 1)
                {
                    (void)putchar(','); ++chpr;
                    ushort_val = (entry_ptr->value & 0xffff0000) >> 16;
                    if(PRINT_BOTH_VALUE)
                        chpr += printf("%#x=%u",ushort_val,ushort_val);
                    else if(PRINT_HEX_VALUE)
                        chpr += printf("%#x",ushort_val);
                    else if(PRINT_DEC_VALUE)
                        chpr += printf("%u",ushort_val);
                }
                break;
            case SSHORT:
                ushort_val = entry_ptr->value & 0xffff;
                if(PRINT_BOTH_VALUE)
                    chpr += printf("%#x=%d",(unsigned int)ushort_val,
                                (int)ushort_val);
                else if(PRINT_HEX_VALUE)
                    chpr += printf("%#x",(unsigned int)ushort_val);
                else if(PRINT_DEC_VALUE)
                    chpr += printf("%d",(int)ushort_val);
                if(entry_ptr->count > 1)
                {
                    (void)putchar(',');
                    ushort_val = (entry_ptr->value & 0xffff0000) >> 16;
                    if(PRINT_BOTH_VALUE)
                        chpr += printf("%#x=%d",(unsigned int)ushort_val,
                                    (int)ushort_val);
                    else if(PRINT_HEX_VALUE)
                        chpr += printf("%#x",(unsigned int)ushort_val);
                    else if(PRINT_DEC_VALUE)
                        chpr += printf("%d",(int)ushort_val);
                }
                break;
            case LONG:
                if(PRINT_BOTH_VALUE)
                    chpr += printf("0x%08lx=%lu",entry_ptr->value,
                                entry_ptr->value);
                else if(PRINT_HEX_VALUE)
                    chpr += printf("0x%08lx",entry_ptr->value);
                else if(PRINT_DEC_VALUE)
                    chpr += printf("%lu",entry_ptr->value);
                break;
            case SLONG:
                if(PRINT_BOTH_VALUE)
                    chpr += printf("%#lx=%ld",(unsigned long)entry_ptr->value,
                                (long)entry_ptr->value);
                else if(PRINT_HEX_VALUE)
                    chpr += printf("%#lx",(unsigned long)entry_ptr->value);
                else if(PRINT_DEC_VALUE)
                    chpr += printf("%ld",(long)entry_ptr->value);
                break;
            case ASCII:
                byte = entry_ptr->value;
                if(entry_ptr->count <= 4)
                {
                    chpr += printf("\'");
                    for(i = 0; i < entry_ptr->count; ++i)
                    {
                        if(isprint(byte & 0xff))
                            (void)putchar(byte & 0xff);
                        else
                            chpr += printf("\\%03ld",byte & 0xff);
                        byte >>= 8;
                        ++chpr;
                    }
                    chpr += printf("\'");
                }
                break;
            case FLOAT:
                chpr += printf("%g",(float)entry_ptr->value);
                break;
            case DOUBLE: /* double is not possible in a direct ifd entry  */
                chpr += printf("# DOUBLE TYPE IS INVALID HERE");
                break;
            case UNDEFINED: /* fall through; handle these as BYTE         */
            case BYTE:
        default:
                byte = entry_ptr->value;
                for(i = 0; i < entry_ptr->count; ++i)
                {
                    if(i)
                        (void)putchar(',');
                    if(PRINT_BOTH_VALUE)
                        chpr += printf("%#lx=%lu",byte & 0xff,byte & 0xff);
                    else if(PRINT_HEX_VALUE)
                        chpr += printf("%#lx",byte & 0xff);
                    else if(PRINT_DEC_VALUE)
                        chpr += printf("%lu",byte & 0xff);
                    byte >>= 8;
                }
                /* UNDEFINED stuff may be ascii                   */
                byte = entry_ptr->value;
                if((entry_ptr->value_type == UNDEFINED) &&
                    (entry_ptr->count == 4) &&
                        isprint(byte & 0xff))   
                        
                {
                    chpr += printf(" = \'");
                    for(i = 0; i < entry_ptr->count; ++i)
                    {
                        if(isprint(byte & 0xff))
                            (void)putchar(byte & 0xff);
                        else
                            (void)putchar('.');
                        byte >>= 8;
                        ++chpr;
                    }
                    (void)putchar('\'');
                    ++chpr;
                }
                break;
        }
    }
    setcharsprinted(chpr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x67be
leaq 0x51e9c(%rip), %rbp     # 0x58180
testb $0x30, (%rbp)
je 0x67be
movq %rdi, %r14
testq %rsi, %rsi
je 0x6308
leaq 0x3ad9a(%rip), %rdi     # 0x41097
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
jmp 0x630a
xorl %ebx, %ebx
movzwl 0x2(%r14), %eax
addl $-0x2, %eax
cmpl $0xa, %eax
ja 0x63b0
leaq 0x3b0fe(%rip), %rcx     # 0x41420
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x4, 0x8(%r14)
ja 0x67be
movq 0x10(%r14), %r12
leaq 0x3ec50(%rip), %rdi     # 0x44f91
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %ebx, %ebp
cmpq $0x0, 0x8(%r14)
je 0x6399
callq 0x32d0
movq %rax, %rbx
leaq 0x3b321(%rip), %r15     # 0x41683
xorl %r13d, %r13d
movq (%rbx), %rax
movzbl %r12b, %esi
movl %esi, %ecx
testb $0x40, 0x1(%rax,%rcx,2)
jne 0x6383
movq %r15, %rdi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
jmp 0x638a
movl %esi, %edi
callq 0x3060
shrq $0x8, %r12
incl %ebp
incq %r13
cmpq 0x8(%r14), %r13
jb 0x6365
leaq 0x3ebf1(%rip), %rdi     # 0x44f91
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
addl %ebp, %ebx
jmp 0x67be
cmpq $0x0, 0x8(%r14)
je 0x662b
movq 0x10(%r14), %r12
leaq 0x3b7fe(%rip), %r15     # 0x41bc4
xorl %r13d, %r13d
testq %r13, %r13
je 0x63d8
movl $0x2c, %edi
callq 0x3060
movq (%rbp), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x63f8
movzbl %r12b, %edx
movq %r15, %rdi
movq %rdx, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x641f
testb $0x10, %al
jne 0x640d
testb $0x20, %al
je 0x6421
movzbl %r12b, %esi
leaq 0x424ea(%rip), %rdi     # 0x488f5
jmp 0x6418
movzbl %r12b, %esi
leaq 0x45a68(%rip), %rdi     # 0x4be80
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
shrq $0x8, %r12
incq %r13
movq 0x8(%r14), %rax
cmpq %rax, %r13
jb 0x63c9
cmpq $0x4, %rax
sete %al
jmp 0x662d
movq (%rbp), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x657d
movq 0x10(%r14), %rdx
leaq 0x3b221(%rip), %rdi     # 0x4167a
jmp 0x64ce
movq 0x10(%r14), %rax
movq (%rbp), %rcx
movl %ecx, %edx
notl %edx
testb $0x30, %dl
jne 0x659d
movzwl %ax, %edx
leaq 0x3b1e5(%rip), %rdi     # 0x4165f
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x66d8
movq 0x10(%r14), %rax
testq %rax, %rax
js 0x65be
cvtsi2ss %rax, %xmm0
jmp 0x65d3
leaq 0x3b1e4(%rip), %rdi     # 0x4168a
xorl %eax, %eax
callq 0x3120
jmp 0x67bc
movq (%rbp), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x65ea
movq 0x10(%r14), %rdx
leaq 0x3b198(%rip), %rdi     # 0x41666
movq %rdx, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x67bc
cmpq $0x0, 0x8(%r14)
je 0x67be
movq 0x10(%r14), %r12
leaq 0x3b165(%rip), %r15     # 0x41658
xorl %r13d, %r13d
movq (%rbp), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x6515
movzbl %r12b, %edx
movq %r15, %rdi
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x653c
testb $0x10, %al
jne 0x652a
testb $0x20, %al
je 0x653e
movzbl %r12b, %esi
leaq 0x3f165(%rip), %rdi     # 0x4568d
jmp 0x6535
movzbl %r12b, %esi
leaq 0x42b92(%rip), %rdi     # 0x490c7
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
shrq $0x8, %r12
incq %r13
cmpq 0x8(%r14), %r13
jb 0x64f6
jmp 0x67be
movq 0x10(%r14), %rax
movq (%rbp), %rcx
movl %ecx, %edx
notl %edx
testb $0x30, %dl
jne 0x660a
movzwl %ax, %edx
leaq 0x3b0e9(%rip), %rdi     # 0x41658
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x6758
testb $0x10, %al
jne 0x66ba
testb $0x20, %al
je 0x67be
movq 0x10(%r14), %rsi
leaq 0x43ae0(%rip), %rdi     # 0x4a078
jmp 0x673e
testb $0x10, %cl
jne 0x66c7
testb $0x20, %cl
je 0x66da
movzwl %ax, %esi
leaq 0x3e9a4(%rip), %rdi     # 0x44f5d
jmp 0x66d1
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x42bfa(%rip), %rdi     # 0x491d8
movb $0x1, %al
callq 0x3120
jmp 0x67bc
testb $0x10, %al
jne 0x6733
testb $0x20, %al
je 0x67be
movq 0x10(%r14), %rsi
leaq 0x422f0(%rip), %rdi     # 0x488f5
jmp 0x673e
testb $0x10, %cl
jne 0x6747
testb $0x20, %cl
je 0x675a
movzwl %ax, %esi
leaq 0x3f067(%rip), %rdi     # 0x4568d
jmp 0x6751
xorl %eax, %eax
testb %al, %al
je 0x67be
cmpw $0x7, 0x2(%r14)
jne 0x67be
movq 0x10(%r14), %r12
callq 0x32d0
movq %rax, %r15
movq (%rax), %rax
movzbl %r12b, %ecx
testb $0x40, 0x1(%rax,%rcx,2)
je 0x67be
leaq 0x3b042(%rip), %rdi     # 0x416a8
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %ebx, %ebp
cmpq $0x0, 0x8(%r14)
je 0x66a7
xorl %ebx, %ebx
movl $0x2e, %r13d
movq (%r15), %rax
movzbl %r12b, %edi
movzwl (%rax,%rdi,2), %eax
btl $0xe, %eax
cmovael %r13d, %edi
callq 0x3060
shrq $0x8, %r12
incq %rbx
cmpq 0x8(%r14), %rbx
jb 0x6680
addl %ebx, %ebp
movl $0x27, %edi
callq 0x3060
incl %ebp
movl %ebp, %ebx
jmp 0x67be
movq 0x10(%r14), %rsi
leaq 0x457bb(%rip), %rdi     # 0x4be80
jmp 0x673e
movzwl %ax, %esi
leaq 0x429f6(%rip), %rdi     # 0x490c7
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
cmpq $0x2, 0x8(%r14)
jb 0x67be
movl $0x2c, %edi
callq 0x3060
incl %ebx
movq 0x10(%r14), %rax
shrq $0x10, %rax
movq (%rbp), %rcx
movl %ecx, %edx
notl %edx
testb $0x30, %dl
jne 0x6712
movzwl %ax, %edx
leaq 0x3af4f(%rip), %rdi     # 0x4165f
jmp 0x678a
testb $0x10, %cl
jne 0x67ab
testb $0x20, %cl
je 0x67be
movzwl %ax, %esi
leaq 0x3e82f(%rip), %rdi     # 0x44f5d
jmp 0x67b5
movq 0x10(%r14), %rsi
leaq 0x3af34(%rip), %rdi     # 0x41672
xorl %eax, %eax
callq 0x3120
jmp 0x67bc
movzwl %ax, %esi
leaq 0x42976(%rip), %rdi     # 0x490c7
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
cmpq $0x2, 0x8(%r14)
jb 0x67be
movl $0x2c, %edi
callq 0x3060
movq 0x10(%r14), %rax
shrq $0x10, %rax
movq (%rbp), %rcx
movl %ecx, %edx
notl %edx
testb $0x30, %dl
jne 0x6795
movzwl %ax, %edx
leaq 0x3aece(%rip), %rdi     # 0x41658
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x67bc
testb $0x10, %cl
jne 0x67ab
testb $0x20, %cl
je 0x67be
movzwl %ax, %esi
leaq 0x3eee4(%rip), %rdi     # 0x4568d
jmp 0x67b5
movzwl %ax, %esi
leaq 0x42912(%rip), %rdi     # 0x490c7
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17530