// File: /workspace/github_c_makefile_star2_O3/hfiguiere[P]exifprobe/print.c
// Function: print_ushort
void
print_ushort(FILE *inptr,unsigned long count,unsigned short byteorder,
                unsigned long offset)
{
    int i,j;
    unsigned short value;
    int chpr = 0;

    if(count)
    {
        value = read_ushort(inptr,byteorder,offset);
        if(feof(inptr) || ferror(inptr))
        {
            clearerr(inptr);
            setcharsprinted(chpr);
            return;
        }
        if(PRINT_BOTH_VALUE)
            chpr += printf("%#x/%u",value,value);
        else if(PRINT_HEX_VALUE)
            chpr += printf("%#x",value);
        else if(PRINT_DEC_VALUE)
            chpr += printf("%u",value);
    }
    if(PRINT_MULTIVAL_ALL)
    {
        for(i = 1; i < count; ++i,offset += 2L)
        {
            value = read_ushort(inptr,byteorder,HERE);
            if(feof(inptr) || ferror(inptr))
            {
                clearerr(inptr);
                setcharsprinted(chpr);
                return;
            }
            if(PRINT_BOTH_VALUE)
                chpr += printf(",%#x/%u",value,value);
            else if(PRINT_HEX_VALUE)
                chpr += printf(",%#x",value);
            else if(PRINT_DEC_VALUE)
                chpr += printf(",%u",value);
        }
    }
    else
    {
#define MAX 5UL
        j = count > MAX + 2 ? MAX : count;
        for(i = 1; i < j; ++i,offset += 2L)
        {
            value = read_ushort(inptr,byteorder,HERE);
            if(feof(inptr) || ferror(inptr))
            {
                clearerr(inptr);
                setcharsprinted(chpr);
                return;
            }
            if(PRINT_BOTH_VALUE)
                chpr += printf(",%#x/%u",value,value);
            else if(PRINT_HEX_VALUE)
                chpr += printf(",%#x",value);
            else if(PRINT_DEC_VALUE)
                chpr += printf(",%u",value);
        }
        if((count > j) && (ferror(inptr) == 0))
        {
            chpr += printf(" ... ");
            offset += (unsigned long)(count - j) * 2L;
            value = read_ushort(inptr,byteorder,offset);
            if(feof(inptr) || ferror(inptr))
            {
                clearerr(inptr);
                setcharsprinted(chpr);
                return;
            }
            if(PRINT_BOTH_VALUE)
                chpr += printf(",%#x/%u (%lu)",value,value,count);
            else if(PRINT_HEX_VALUE)
                chpr += printf(",%#x (%lu)",value,count);
            else if(PRINT_DEC_VALUE)
                chpr += printf(",%u (%lu)",value,count);
            if(PRINT_ADDRESS)
                chpr += printf(" -> @%lu",offset);
        }
#undef MAX
    }
    setcharsprinted(chpr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r12
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x7e29
movzwl %bp, %r13d
movq %r14, %rdi
movl %r13d, %esi
movq %r12, %rdx
callq 0x45af
movl %eax, %r15d
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7e1a
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x7f74
movq %r14, %rdi
callq 0x31b0
xorl %ebp, %ebp
jmp 0x7f5f
movl %ebp, 0x4(%rsp)
leaq 0x5034c(%rip), %rax     # 0x58180
xorl %ebp, %ebp
testb $0x8, 0x3(%rax)
jne 0x7f5f
cmpq $0x8, %rbx
movl $0x5, %eax
movq %rbx, 0x8(%rsp)
cmovbl %ebx, %eax
cmpl $0x2, %eax
movq %rax, 0x10(%rsp)
jl 0x7ef9
leal -0x1(%rax), %ebx
movzwl 0x4(%rsp), %r13d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %r13d, %esi
callq 0x45af
movl %eax, %r15d
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7f57
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7f57
leaq 0x502de(%rip), %rax     # 0x58180
movq (%rax), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x7ec4
movzwl %r15w, %edx
leaq 0x398bb(%rip), %rdi     # 0x41774
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x7eeb
testb $0x10, %al
jne 0x7ed9
testb $0x20, %al
je 0x7eed
movzwl %r15w, %esi
leaq 0x398a5(%rip), %rdi     # 0x4177c
jmp 0x7ee4
movzwl %r15w, %esi
leaq 0x432de(%rip), %rdi     # 0x4b1c2
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
addq $0x2, %r12
decl %ebx
jne 0x7e68
movslq 0x10(%rsp), %rax
movq 0x8(%rsp), %rbx
subq %rax, %rbx
jbe 0x7f5f
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7f5f
leaq 0x39830(%rip), %rdi     # 0x4174b
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq (%r12,%rbx,2), %r12
movzwl 0x4(%rsp), %esi
movq %r14, %rdi
movq %r12, %rdx
callq 0x45af
movl %eax, %r15d
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7f57
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x8080
movq %r14, %rdi
callq 0x31b0
movl %ebp, %edi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17a82
leaq 0x50205(%rip), %rax     # 0x58180
movq (%rax), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
movl %ebp, 0x4(%rsp)
jne 0x7fa1
movzwl %r15w, %edx
leaq 0x453f8(%rip), %rdi     # 0x4d38e
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x7fca
testb $0x10, %al
jne 0x7fb8
xorl %ebp, %ebp
testb $0x20, %al
je 0x7fcc
movzwl %r15w, %esi
leaq 0x3cfeb(%rip), %rdi     # 0x44fa1
jmp 0x7fc3
movzwl %r15w, %esi
leaq 0x41144(%rip), %rdi     # 0x49107
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
leaq 0x501ad(%rip), %rax     # 0x58180
testb $0x8, 0x3(%rax)
je 0x7e40
cmpq $0x1, %rbx
je 0x7f5f
decq %rbx
leaq 0x39783(%rip), %r15     # 0x41774
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %r13d, %esi
callq 0x45af
movl %eax, %r12d
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7f57
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7f57
leaq 0x50155(%rip), %rax     # 0x58180
movq (%rax), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x8049
movzwl %r12w, %edx
movq %r15, %rdi
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x8070
testb $0x10, %al
jne 0x805e
testb $0x20, %al
je 0x8072
movzwl %r12w, %esi
leaq 0x39720(%rip), %rdi     # 0x4177c
jmp 0x8069
movzwl %r12w, %esi
leaq 0x43159(%rip), %rdi     # 0x4b1c2
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
decq %rbx
jne 0x7ff1
jmp 0x7f5f
leaq 0x500f9(%rip), %rbx     # 0x58180
movq (%rbx), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x80ae
movzwl %r15w, %edx
leaq 0x396e2(%rip), %rdi     # 0x41780
movl %edx, %esi
movq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x3120
jmp 0x80da
testb $0x10, %al
jne 0x80c3
testb $0x20, %al
je 0x80dc
movzwl %r15w, %esi
leaq 0x396d8(%rip), %rdi     # 0x41799
jmp 0x80ce
movzwl %r15w, %esi
leaq 0x396c0(%rip), %rdi     # 0x4178e
movq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
testb $0x3, 0x2(%rbx)
je 0x7f5f
leaq 0x39670(%rip), %rdi     # 0x4175d
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
jmp 0x7f5f