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

    if(count)
    {
        byte = read_ubyte(inptr,offset);
        if(feof(inptr) || ferror(inptr))
        {
            clearerr(inptr);
            setcharsprinted(chpr);
            return;
        }
        chpr += printf("%d",byte);
    }
    if(PRINT_MULTIVAL_ALL)
    {
        for(i = 1; i < count; ++i,offset += 2L)
        {
            byte = read_ubyte(inptr,HERE);
            if(feof(inptr) || ferror(inptr))
            {
                clearerr(inptr);
                setcharsprinted(chpr);
                return;
            }
            chpr += printf(",%d",byte);
        }
    }
    else
    {
#define MAX 10UL
        j = count > MAX + 2 ? MAX : count;
        for(i = 1; i < j; ++i)
        {
            byte = read_ubyte(inptr,HERE);
            if(feof(inptr) || ferror(inptr))
            {
                clearerr(inptr);
                setcharsprinted(chpr);
                return;
            }
            chpr += printf(",%d",byte);
        }
        if((count > j) && (ferror(inptr) == 0))
        {
            chpr += printf(" ... ");
            offset += (unsigned long)(count - 1);
            byte = read_ubyte(inptr,offset);
            if(feof(inptr) || ferror(inptr))
            {
                clearerr(inptr);
                setcharsprinted(chpr);
                return;
            }
            chpr += printf(",%d (%lu)",byte,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
pushq %rax
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
testq %rsi, %rsi
je 0x7c35
movq %r15, %rdi
movq %r12, %rsi
callq 0x4d48
movl %eax, %ebx
movq %r15, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7c26
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x7d18
movq %r15, %rdi
callq 0x31b0
xorl %ebx, %ebx
jmp 0x7d03
leaq 0x50544(%rip), %rax     # 0x58180
xorl %ebx, %ebx
testb $0x8, 0x3(%rax)
jne 0x7d03
movq %r12, (%rsp)
cmpq $0xd, %r14
movl $0xa, %r13d
cmovbl %r14d, %r13d
cmpl $0x2, %r13d
jl 0x7ca3
leal -0x1(%r13), %r12d
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r15, %rdi
callq 0x4d48
movl %eax, %ebp
movq %r15, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7cfb
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7cfb
movswl %bp, %esi
leaq 0x39ad1(%rip), %rdi     # 0x41766
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
decl %r12d
jne 0x7c64
movslq %r13d, %rax
cmpq %r14, %rax
jae 0x7d03
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7d03
leaq 0x39a8d(%rip), %rdi     # 0x4174b
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movq (%rsp), %rax
leaq (%r14,%rax), %r12
decq %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x4d48
movl %eax, %ebp
movq %r15, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7cfb
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x7d8c
movq %r15, %rdi
callq 0x31b0
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17a82
movswl %bx, %esi
leaq 0x3d9af(%rip), %rdi     # 0x456d1
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
leaq 0x5044e(%rip), %rax     # 0x58180
testb $0x8, 0x3(%rax)
je 0x7c48
cmpq $0x1, %r14
je 0x7d03
decq %r14
leaq 0x39a1a(%rip), %r12     # 0x41766
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r15, %rdi
callq 0x4d48
movl %eax, %ebp
movq %r15, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7cfb
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7cfb
movswl %bp, %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
decq %r14
jne 0x7d4c
jmp 0x7d03
movswl %bp, %esi
leaq 0x399d4(%rip), %rdi     # 0x4176a
movq %r14, %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
leaq 0x503d7(%rip), %rax     # 0x58180
testb $0x3, 0x2(%rax)
je 0x7d03
leaq 0x399a3(%rip), %rdi     # 0x4175d
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
jmp 0x7d03