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

    if(count)
    {
        value = (short)read_ushort(inptr,byteorder,offset);
        if(feof(inptr) || ferror(inptr))
        {
            clearerr(inptr);
            setcharsprinted(chpr);
            return;
        }
        chpr += printf("%d",value);
    }
    if(PRINT_MULTIVAL_ALL)
    {
        for(i = 1; i < count; ++i,offset += 2L)
        {
            value = (short)read_ushort(inptr,byteorder,HERE);
            if(feof(inptr) || ferror(inptr))
            {
                clearerr(inptr);
                setcharsprinted(chpr);
                return;
            }
            chpr += printf(",%d",value);
        }
    }
    else
    {
#define MAX 5UL
        j = count > MAX + 2 ? MAX : count;
        for(i = 1; i < j; ++i,offset += 2L)
        {
            value = (short)read_ushort(inptr,byteorder,HERE);
            if(feof(inptr) || ferror(inptr))
            {
                clearerr(inptr);
                setcharsprinted(chpr);
                return;
            }
            chpr += printf(",%d",value);
        }
        if(count > j)
        {
            chpr += printf(" ... ");
            offset += (unsigned long)(count - j) * 2L;
            value = (short)read_ushort(inptr,byteorder,offset);
            if(feof(inptr) || ferror(inptr))
            {
                clearerr(inptr);
                setcharsprinted(chpr);
                return;
            }
            chpr += printf(",%d (%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
movzwl %dx, %r13d
testq %rsi, %rsi
je 0x7b04
movq %r15, %rdi
movl %r13d, %esi
movq %r12, %rdx
callq 0x416a
movl %eax, %ebx
movq %r15, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7af5
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x7bfc
movq %r15, %rdi
callq 0x31b0
xorl %ebx, %ebx
jmp 0x7c60
xorl %ebx, %ebx
leaq 0x4f673(%rip), %rax     # 0x57180
testb $0x8, 0x3(%rax)
movl %r13d, 0x4(%rsp)
jne 0x7b9f
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 0x7c14
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 0x7c58
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7c58
movswl %r13w, %esi
leaq 0x37bdd(%rip), %rdi     # 0x3f766
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
incl %ebp
addq $0x2, %r12
movl 0x4(%rsp), %r13d
jmp 0x7b42
pushq $0x1
popq %r14
leaq 0x37bbc(%rip), %r12     # 0x3f766
cmpq %rbp, %r14
jae 0x7c60
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 0x7c58
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7c58
movswl %r13w, %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
incq %r14
movl 0x4(%rsp), %r13d
jmp 0x7baa
movswl %bx, %esi
leaq 0x3ba87(%rip), %rdi     # 0x4368d
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
jmp 0x7b06
movq 0x10(%rsp), %rax
cmpq 0x8(%rsp), %rax
jae 0x7c60
leaq 0x37b24(%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 0x7c58
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x7c75
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
movswl %bp, %esi
leaq 0x37aeb(%rip), %rdi     # 0x3f76a
movq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
leaq 0x4f4ec(%rip), %rax     # 0x57180
testb $0x3, 0x2(%rax)
je 0x7c60
leaq 0x37abc(%rip), %rdi     # 0x3f75d
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
jmp 0x7c60