// File: /workspace/github_c_makefile_star2_O2/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 0x629d
leaq 0x51390(%rip), %r12     # 0x57180
testb $0x30, (%r12)
je 0x629d
movq %rdi, %r14
testq %rsi, %rsi
je 0x5e15
leaq 0x3928d(%rip), %rdi     # 0x3f097
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
jmp 0x5e17
xorl %ebx, %ebx
movzwl 0x2(%r14), %eax
addl $-0x2, %eax
cmpl $0xa, %eax
ja 0x5e9e
leaq 0x395f5(%rip), %rcx     # 0x3f420
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x4, 0x8(%r14)
ja 0x629d
movq 0x10(%r14), %r15
leaq 0x3d147(%rip), %rdi     # 0x42f91
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %ebx, %ebp
leaq 0x39827(%rip), %rbx     # 0x3f683
xorl %r12d, %r12d
cmpq 0x8(%r14), %r12
jae 0x614d
callq 0x32d0
movq (%rax), %rax
movzbl %r15b, %esi
movl %esi, %ecx
testb $0x40, 0x1(%rax,%rcx,2)
jne 0x5e8c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
jmp 0x5e93
movl %esi, %edi
callq 0x3060
shrq $0x8, %r15
incl %ebp
incq %r12
jmp 0x5e5f
movq 0x10(%r14), %r13
pushq $0x2c
popq %rbp
xorl %r15d, %r15d
movq 0x8(%r14), %rax
cmpq %rax, %r15
jae 0x5f13
testq %r15, %r15
je 0x5ebd
movl %ebp, %edi
callq 0x3060
movq (%r12), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x5ee1
movzbl %r13b, %edx
leaq 0x39cef(%rip), %rdi     # 0x3fbc4
movq %rdx, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x5f08
testb $0x10, %al
jne 0x5ef6
testb $0x20, %al
je 0x5f0a
movzbl %r13b, %esi
leaq 0x409f1(%rip), %rdi     # 0x468e5
jmp 0x5f01
movzbl %r13b, %esi
leaq 0x43f6f(%rip), %rdi     # 0x49e70
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
shrq $0x8, %r13
incq %r15
jmp 0x5ea8
cmpq $0x4, %rax
jne 0x629d
cmpw $0x7, 0x2(%r14)
jne 0x629d
movq 0x10(%r14), %r13
callq 0x32d0
movq %rax, %r15
movq (%rax), %rax
movzbl %r13b, %ecx
testb $0x40, 0x1(%rax,%rcx,2)
je 0x629d
leaq 0x3975a(%rip), %rdi     # 0x3f6a8
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x3120
movq %rax, (%rsp)
pushq $0x2e
popq %r12
cmpq 0x8(%r14), %rbp
jae 0x6185
movq (%r15), %rax
movzbl %r13b, %edi
movzwl (%rax,%rdi,2), %eax
btl $0xe, %eax
cmovael %r12d, %edi
callq 0x3060
shrq $0x8, %r13
incq %rbp
jmp 0x5f5f
movq (%r12), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x60c0
movq 0x10(%r14), %rdx
leaq 0x396d4(%rip), %rdi     # 0x3f67a
jmp 0x601b
movq 0x10(%r14), %rax
movq (%r12), %rcx
movl %ecx, %edx
notl %edx
testb $0x30, %dl
jne 0x60e0
movzwl %ax, %edx
leaq 0x39698(%rip), %rdi     # 0x3f65f
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x61bb
movq 0x10(%r14), %rax
testq %rax, %rax
js 0x6101
cvtsi2ss %rax, %xmm0
jmp 0x6116
leaq 0x39697(%rip), %rdi     # 0x3f68a
xorl %eax, %eax
callq 0x3120
jmp 0x629b
movq (%r12), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x612d
movq 0x10(%r14), %rdx
leaq 0x3964b(%rip), %rdi     # 0x3f666
movq %rdx, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x629b
movq 0x10(%r14), %rbp
leaq 0x39623(%rip), %r15     # 0x3f658
xorl %r13d, %r13d
cmpq 0x8(%r14), %r13
jae 0x629d
movq (%r12), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x6061
movzbl %bpl, %edx
movq %r15, %rdi
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x6088
testb $0x10, %al
jne 0x6076
testb $0x20, %al
je 0x608a
movzbl %bpl, %esi
leaq 0x3d619(%rip), %rdi     # 0x4368d
jmp 0x6081
movzbl %bpl, %esi
leaq 0x41036(%rip), %rdi     # 0x470b7
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
shrq $0x8, %rbp
incq %r13
jmp 0x6038
movq 0x10(%r14), %rax
movq (%r12), %rcx
movl %ecx, %edx
notl %edx
testb $0x30, %dl
jne 0x6164
movzwl %ax, %edx
leaq 0x395a6(%rip), %rdi     # 0x3f658
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x6239
testb $0x10, %al
jne 0x619d
testb $0x20, %al
je 0x629d
movq 0x10(%r14), %rsi
leaq 0x41f8d(%rip), %rdi     # 0x48068
jmp 0x621f
testb $0x10, %cl
jne 0x61aa
testb $0x20, %cl
je 0x61bd
movzwl %ax, %esi
leaq 0x3ce61(%rip), %rdi     # 0x42f5d
jmp 0x61b4
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x410a7(%rip), %rdi     # 0x471c8
movb $0x1, %al
callq 0x3120
jmp 0x629b
testb $0x10, %al
jne 0x6214
testb $0x20, %al
je 0x629d
movq 0x10(%r14), %rsi
leaq 0x4079d(%rip), %rdi     # 0x468e5
jmp 0x621f
leaq 0x3ce3d(%rip), %rdi     # 0x42f91
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
addl %ebp, %ebx
jmp 0x629d
testb $0x10, %cl
jne 0x6228
testb $0x20, %cl
je 0x623b
movzwl %ax, %esi
leaq 0x3d50d(%rip), %rdi     # 0x4368d
jmp 0x6232
pushq $0x27
popq %rdi
callq 0x3060
movq (%rsp), %rax
addl %ebx, %eax
leal (%rax,%rbp), %ebx
incl %ebx
jmp 0x629d
movq 0x10(%r14), %rsi
leaq 0x43cc8(%rip), %rdi     # 0x49e70
jmp 0x621f
movzwl %ax, %esi
leaq 0x40f03(%rip), %rdi     # 0x470b7
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
cmpq $0x2, 0x8(%r14)
jb 0x629d
pushq $0x2c
popq %rdi
callq 0x3060
incl %ebx
movq 0x10(%r14), %rax
shrq $0x10, %rax
movq (%r12), %rcx
movl %ecx, %edx
notl %edx
testb $0x30, %dl
jne 0x61f3
movzwl %ax, %edx
leaq 0x3946e(%rip), %rdi     # 0x3f65f
jmp 0x6269
testb $0x10, %cl
jne 0x628a
testb $0x20, %cl
je 0x629d
movzwl %ax, %esi
leaq 0x3cd4e(%rip), %rdi     # 0x42f5d
jmp 0x6294
movq 0x10(%r14), %rsi
leaq 0x39453(%rip), %rdi     # 0x3f672
xorl %eax, %eax
callq 0x3120
jmp 0x629b
movzwl %ax, %esi
leaq 0x40e85(%rip), %rdi     # 0x470b7
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
cmpq $0x2, 0x8(%r14)
jb 0x629d
pushq $0x2c
popq %rdi
callq 0x3060
movq 0x10(%r14), %rax
shrq $0x10, %rax
movq (%r12), %rcx
movl %ecx, %edx
notl %edx
testb $0x30, %dl
jne 0x6274
movzwl %ax, %edx
leaq 0x393ef(%rip), %rdi     # 0x3f658
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x629b
testb $0x10, %cl
jne 0x628a
testb $0x20, %cl
je 0x629d
movzwl %ax, %esi
leaq 0x3d405(%rip), %rdi     # 0x4368d
jmp 0x6294
movzwl %ax, %esi
leaq 0x40e23(%rip), %rdi     # 0x470b7
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 0x16a4f