// File: /workspace/github_c_makefile_star2_O1/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, %r14
movq %rdi, %r15
xorl %ebx, %ebx
testq %rsi, %rsi
je 0x7e28
movzwl %bp, %esi
movq %r15, %rdi
movq %r12, %rdx
callq 0x4574
movl %eax, %r13d
movq %r15, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7dc7
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x7dd6
movq %r15, %rdi
callq 0x31b0
xorl %ebx, %ebx
jmp 0x7ff6
leaq 0x503a3(%rip), %rax     # 0x58180
movq (%rax), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x7dff
movzwl %r13w, %edx
leaq 0x4555a(%rip), %rdi     # 0x4d34e
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x7e26
testb $0x10, %al
jne 0x7e14
testb $0x20, %al
je 0x7e28
movzwl %r13w, %esi
leaq 0x3d14b(%rip), %rdi     # 0x44f5d
jmp 0x7e1f
movzwl %r13w, %esi
leaq 0x412a8(%rip), %rdi     # 0x490c7
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
leaq 0x50351(%rip), %rax     # 0x58180
testb $0x8, 0x3(%rax)
jne 0x7f62
cmpq $0x8, %r14
movl $0x5, %eax
cmovbl %r14d, %eax
cmpl $0x2, %eax
movl %ebp, 0x8(%rsp)
movq %rax, 0x10(%rsp)
jl 0x7ef2
leal -0x1(%rax), %r13d
movzwl %bp, %eax
movl %eax, 0xc(%rsp)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r15, %rdi
movl 0xc(%rsp), %esi
callq 0x4574
movl %eax, %ebp
movq %r15, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7f55
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7f55
leaq 0x502e3(%rip), %rax     # 0x58180
movq (%rax), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x7ebe
movzwl %bp, %edx
leaq 0x398c1(%rip), %rdi     # 0x41774
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x7ee3
testb $0x10, %al
jne 0x7ed2
testb $0x20, %al
je 0x7ee5
movzwl %bp, %esi
leaq 0x398ac(%rip), %rdi     # 0x4177c
jmp 0x7edc
movzwl %bp, %esi
leaq 0x432a6(%rip), %rdi     # 0x4b182
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
addq $0x2, %r12
decl %r13d
jne 0x7e63
movslq 0x10(%rsp), %rax
movq %r14, %r13
subq %rax, %r13
jbe 0x7ff6
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7ff6
leaq 0x39831(%rip), %rdi     # 0x4174b
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
leaq (%r12,%r13,2), %r12
movzwl 0x8(%rsp), %esi
movq %r15, %rdi
movq %r12, %rdx
callq 0x4574
movl %eax, %ebp
movq %r15, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7f55
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x800b
movq %r15, %rdi
callq 0x31b0
jmp 0x7ff6
cmpq $0x2, %r14
jb 0x7ff6
decq %r14
movzwl %bp, %ebp
leaq 0x397fb(%rip), %r12     # 0x41774
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r15, %rdi
movl %ebp, %esi
callq 0x4574
movl %eax, %r13d
movq %r15, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7f55
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7f55
leaq 0x501d6(%rip), %rax     # 0x58180
movq (%rax), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x7fc8
movzwl %r13w, %edx
movq %r12, %rdi
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x7fef
testb $0x10, %al
jne 0x7fdd
testb $0x20, %al
je 0x7ff1
movzwl %r13w, %esi
leaq 0x397a1(%rip), %rdi     # 0x4177c
jmp 0x7fe8
movzwl %r13w, %esi
leaq 0x4319a(%rip), %rdi     # 0x4b182
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
decq %r14
jne 0x7f79
movl %ebx, %edi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17530
leaq 0x5016e(%rip), %rax     # 0x58180
movq (%rax), %rax
movl %eax, %ecx
notl %ecx
testb $0x30, %cl
jne 0x8036
movzwl %bp, %edx
leaq 0x39758(%rip), %rdi     # 0x41780
movl %edx, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0x3120
jmp 0x805e
testb $0x10, %al
jne 0x804a
testb $0x20, %al
je 0x8060
movzwl %bp, %esi
leaq 0x39751(%rip), %rdi     # 0x41799
jmp 0x8054
movzwl %bp, %esi
leaq 0x3973a(%rip), %rdi     # 0x4178e
movq %r14, %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
leaq 0x50119(%rip), %rax     # 0x58180
testb $0x3, 0x2(%rax)
je 0x7ff6
leaq 0x396e9(%rip), %rdi     # 0x4175d
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
jmp 0x7ff6