// File: /workspace/github_c_makefile_star2_O3/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 0x6836
leaq 0x51e18(%rip), %rbp     # 0x58180
testb $0x30, (%rbp)
je 0x6836
movq %rdi, %r14
testq %rsi, %rsi
je 0x638c
leaq 0x3ad16(%rip), %rdi     # 0x41097
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
jmp 0x638e
xorl %ebx, %ebx
movzwl 0x2(%r14), %eax
addl $-0x2, %eax
cmpl $0xa, %eax
ja 0x6434
leaq 0x3b07a(%rip), %rcx     # 0x41420
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x4, 0x8(%r14)
ja 0x6836
movq 0x10(%r14), %r12
leaq 0x3ec10(%rip), %rdi     # 0x44fd5
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %ebx, %ebp
cmpq $0x0, 0x8(%r14)
je 0x641d
callq 0x32d0
movq %rax, %rbx
leaq 0x3b29d(%rip), %r15     # 0x41683
xorl %r13d, %r13d
movq (%rbx), %rax
movzbl %r12b, %esi
movl %esi, %ecx
testb $0x40, 0x1(%rax,%rcx,2)
jne 0x6407
movq %r15, %rdi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
jmp 0x640e
movl %esi, %edi
callq 0x3060
shrq $0x8, %r12
incl %ebp
incq %r13
cmpq 0x8(%r14), %r13
jb 0x63e9
leaq 0x3ebb1(%rip), %rdi     # 0x44fd5
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
addl %ebp, %ebx
jmp 0x6836
cmpq $0x0, 0x8(%r14)
je 0x6836
movq 0x10(%r14), %r12
leaq 0x3b77a(%rip), %r15     # 0x41bc4
xorl %r13d, %r13d
testq %r13, %r13
je 0x645c
movl $0x2c, %edi
callq 0x3060
movq (%rbp), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x647c
movzbl %r12b, %edx
movq %r15, %rdi
movq %rdx, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x64a3
testb $0x10, %al
jne 0x6491
testb $0x20, %al
je 0x64a5
movzbl %r12b, %esi
leaq 0x424a6(%rip), %rdi     # 0x48935
jmp 0x649c
movzbl %r12b, %esi
leaq 0x45a24(%rip), %rdi     # 0x4bec0
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
shrq $0x8, %r12
incq %r13
movq 0x8(%r14), %rax
cmpq %rax, %r13
jb 0x644d
cmpq $0x4, %rax
jne 0x6836
cmpw $0x7, 0x2(%r14)
jne 0x6836
movq 0x10(%r14), %r12
callq 0x32d0
movq %rax, %r15
movq (%rax), %rax
movzbl %r12b, %ecx
testb $0x40, 0x1(%rax,%rcx,2)
je 0x6836
leaq 0x3b1b8(%rip), %rdi     # 0x416a8
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %ebx, %ebp
cmpq $0x0, 0x8(%r14)
je 0x6531
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 0x650a
addl %ebx, %ebp
movl $0x27, %edi
callq 0x3060
incl %ebp
movl %ebp, %ebx
jmp 0x6836
movq (%rbp), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x6684
movq 0x10(%r14), %rdx
leaq 0x3b11a(%rip), %rdi     # 0x4167a
jmp 0x65d5
movq 0x10(%r14), %rax
movq (%rbp), %rcx
movl %ecx, %edx
notl %edx
testb $0x30, %dl
jne 0x66a4
movzwl %ax, %edx
leaq 0x3b0de(%rip), %rdi     # 0x4165f
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x6750
movq 0x10(%r14), %rax
testq %rax, %rax
js 0x66c5
cvtsi2ss %rax, %xmm0
jmp 0x66da
leaq 0x3b0dd(%rip), %rdi     # 0x4168a
xorl %eax, %eax
callq 0x3120
jmp 0x6834
movq (%rbp), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x66f1
movq 0x10(%r14), %rdx
leaq 0x3b091(%rip), %rdi     # 0x41666
movq %rdx, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x6834
cmpq $0x0, 0x8(%r14)
je 0x6836
movq 0x10(%r14), %r12
leaq 0x3b05e(%rip), %r15     # 0x41658
xorl %r13d, %r13d
movq (%rbp), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x661c
movzbl %r12b, %edx
movq %r15, %rdi
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x6643
testb $0x10, %al
jne 0x6631
testb $0x20, %al
je 0x6645
movzbl %r12b, %esi
leaq 0x3f0a2(%rip), %rdi     # 0x456d1
jmp 0x663c
movzbl %r12b, %esi
leaq 0x42acb(%rip), %rdi     # 0x49107
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
shrq $0x8, %r12
incq %r13
cmpq 0x8(%r14), %r13
jb 0x65fd
jmp 0x6836
movq 0x10(%r14), %rax
movq (%rbp), %rcx
movl %ecx, %edx
notl %edx
testb $0x30, %dl
jne 0x6711
movzwl %ax, %edx
leaq 0x3afe2(%rip), %rdi     # 0x41658
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x67d0
testb $0x10, %al
jne 0x6732
testb $0x20, %al
je 0x6836
movq 0x10(%r14), %rsi
leaq 0x43a19(%rip), %rdi     # 0x4a0b8
jmp 0x67b6
testb $0x10, %cl
jne 0x673f
testb $0x20, %cl
je 0x6752
movzwl %ax, %esi
leaq 0x3e8e1(%rip), %rdi     # 0x44fa1
jmp 0x6749
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x42b33(%rip), %rdi     # 0x49218
movb $0x1, %al
callq 0x3120
jmp 0x6834
testb $0x10, %al
jne 0x67ab
testb $0x20, %al
je 0x6836
movq 0x10(%r14), %rsi
leaq 0x42229(%rip), %rdi     # 0x48935
jmp 0x67b6
testb $0x10, %cl
jne 0x67bf
testb $0x20, %cl
je 0x67d2
movzwl %ax, %esi
leaq 0x3efa4(%rip), %rdi     # 0x456d1
jmp 0x67c9
movq 0x10(%r14), %rsi
leaq 0x45783(%rip), %rdi     # 0x4bec0
jmp 0x67b6
movzwl %ax, %esi
leaq 0x429be(%rip), %rdi     # 0x49107
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
cmpq $0x2, 0x8(%r14)
jb 0x6836
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 0x678a
movzwl %ax, %edx
leaq 0x3aed7(%rip), %rdi     # 0x4165f
jmp 0x6802
testb $0x10, %cl
jne 0x6823
testb $0x20, %cl
je 0x6836
movzwl %ax, %esi
leaq 0x3e7fb(%rip), %rdi     # 0x44fa1
jmp 0x682d
movq 0x10(%r14), %rsi
leaq 0x3aebc(%rip), %rdi     # 0x41672
xorl %eax, %eax
callq 0x3120
jmp 0x6834
movzwl %ax, %esi
leaq 0x4293e(%rip), %rdi     # 0x49107
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
cmpq $0x2, 0x8(%r14)
jb 0x6836
movl $0x2c, %edi
callq 0x3060
movq 0x10(%r14), %rax
shrq $0x10, %rax
movq (%rbp), %rcx
movl %ecx, %edx
notl %edx
testb $0x30, %dl
jne 0x680d
movzwl %ax, %edx
leaq 0x3ae56(%rip), %rdi     # 0x41658
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x6834
testb $0x10, %cl
jne 0x6823
testb $0x20, %cl
je 0x6836
movzwl %ax, %esi
leaq 0x3eeb0(%rip), %rdi     # 0x456d1
jmp 0x682d
movzwl %ax, %esi
leaq 0x428da(%rip), %rdi     # 0x49107
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 0x17a82