// File: /workspace/github_c_makefile_star2_O2/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
movq %rsi, %rbp
movq %rdi, %r15
xorl %ebx, %ebx
movzwl %dx, %r13d
testq %rsi, %rsi
movl %r13d, 0x4(%rsp)
je 0x7849
movq %r15, %rdi
movl %r13d, %esi
movq %r12, %rdx
callq 0x416a
movl %eax, %r13d
movq %r15, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x77e4
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x77f3
movq %r15, %rdi
callq 0x31b0
xorl %ebx, %ebx
jmp 0x7a16
leaq 0x4f986(%rip), %rax     # 0x57180
movq (%rax), %rax
movl %eax, %ecx
notl %ecx
movzwl %r13w, %esi
testb $0x30, %cl
jne 0x7823
leaq 0x43b2d(%rip), %rdi     # 0x4b33e
movl %esi, %edx
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
movl 0x4(%rsp), %r13d
jmp 0x7849
testb $0x10, %al
movl 0x4(%rsp), %r13d
jne 0x7839
testb $0x20, %al
je 0x7849
leaq 0x3b726(%rip), %rdi     # 0x42f5d
jmp 0x7840
leaq 0x3f877(%rip), %rdi     # 0x470b7
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
leaq 0x4f930(%rip), %rax     # 0x57180
testb $0x8, 0x3(%rax)
jne 0x791d
cmpq $0x8, %rbp
pushq $0x5
popq %r14
cmovbl %ebp, %r14d
movq %rbp, 0x8(%rsp)
leaq (%r12,%rbp,2), %r12
movslq %r14d, %rax
movq %rax, 0x10(%rsp)
addq %rax, %rax
subq %rax, %r12
pushq $0x1
popq %rbp
cmpl %r14d, %ebp
jge 0x79be
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r15, %rdi
movl %r13d, %esi
callq 0x416a
movl %eax, %r13d
movq %r15, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7a0e
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7a0e
leaq 0x4f8bd(%rip), %rax     # 0x57180
movq (%rax), %rax
movl %eax, %ecx
notl %ecx
movzwl %r13w, %esi
testb $0x30, %cl
jne 0x78ec
leaq 0x37e9a(%rip), %rdi     # 0x3f774
movl %esi, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl 0x4(%rsp), %r13d
jmp 0x7912
testb $0x10, %al
movl 0x4(%rsp), %r13d
jne 0x7902
testb $0x20, %al
je 0x7912
leaq 0x37e7c(%rip), %rdi     # 0x3f77c
jmp 0x7909
leaq 0x41869(%rip), %rdi     # 0x49172
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
incl %ebp
addq $0x2, %r12
jmp 0x7880
pushq $0x1
popq %r14
leaq 0x37e4c(%rip), %r12     # 0x3f774
cmpq %rbp, %r14
jae 0x7a16
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r15, %rdi
movl %r13d, %esi
callq 0x416a
movl %eax, %r13d
movq %r15, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7a0e
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7a0e
leaq 0x4f815(%rip), %rax     # 0x57180
movq (%rax), %rax
movl %eax, %ecx
notl %ecx
movzwl %r13w, %esi
testb $0x30, %cl
jne 0x7990
movq %r12, %rdi
movl %esi, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl 0x4(%rsp), %r13d
jmp 0x79b6
testb $0x10, %al
movl 0x4(%rsp), %r13d
jne 0x79a6
testb $0x20, %al
je 0x79b6
leaq 0x37dd8(%rip), %rdi     # 0x3f77c
jmp 0x79ad
leaq 0x417c5(%rip), %rdi     # 0x49172
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
incq %r14
jmp 0x7928
movq 0x10(%rsp), %rax
cmpq 0x8(%rsp), %rax
jae 0x7a16
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7a16
leaq 0x37d6e(%rip), %rdi     # 0x3f74b
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movq %r15, %rdi
movl %r13d, %esi
movq %r12, %rdx
callq 0x416a
movl %eax, %ebp
movq %r15, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7a0e
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x7a2b
movq %r15, %rdi
callq 0x31b0
movl %ebx, %edi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x16a4f
leaq 0x4f74e(%rip), %rax     # 0x57180
movq (%rax), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x7a58
movzwl %bp, %edx
leaq 0x37d38(%rip), %rdi     # 0x3f780
movl %edx, %esi
movq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x3120
jmp 0x7a82
testb $0x10, %al
jne 0x7a6c
testb $0x20, %al
je 0x7a84
movzwl %bp, %esi
leaq 0x37d2f(%rip), %rdi     # 0x3f799
jmp 0x7a76
movzwl %bp, %esi
leaq 0x37d18(%rip), %rdi     # 0x3f78e
movq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
leaq 0x4f6f5(%rip), %rax     # 0x57180
testb $0x3, 0x2(%rax)
je 0x7a16
leaq 0x37cc5(%rip), %rdi     # 0x3f75d
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
jmp 0x7a16