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

    if(count)
    {
        byte = read_ubyte(inptr,offset);
        if(feof(inptr) || ferror(inptr))
        {
            clearerr(inptr);
            setcharsprinted(chpr);
            return;
        }
        chpr += printf("%02x",(unsigned int)byte & 0xff);
    }
    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(",%02x",(unsigned int)byte & 0xff);
        }
    }
    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(",%02x",(unsigned int)byte & 0xff);
        }
        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(",%02x (%lu)",(unsigned int)byte & 0xff,count);
            if(PRINT_ADDRESS)
                chpr += printf(" -> @%lu",offset);
        }
#undef MAX
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x79df
movq %r14, %rdi
movq %r15, %rsi
callq 0x4d44
movl %eax, %ebp
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x79d0
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x7b43
movq %r14, %rdi
callq 0x31b0
xorl %edi, %edi
jmp 0x7b30
xorl %ebp, %ebp
leaq 0x50798(%rip), %rax     # 0x58180
testb $0x8, 0x3(%rax)
jne 0x7aca
movq %r15, (%rsp)
cmpq $0xd, %rbx
movl $0xa, %r12d
cmovbl %ebx, %r12d
cmpl $0x2, %r12d
jl 0x7a58
leal -0x1(%r12), %r15d
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r14, %rdi
callq 0x4d44
movl %eax, %r13d
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7b26
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7b26
movzbl %r13b, %esi
leaq 0x39cfb(%rip), %rdi     # 0x41745
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
decl %r15d
jne 0x7a0f
movslq %r12d, %rax
cmpq %rbx, %rax
jae 0x7b17
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7b17
leaq 0x39cd0(%rip), %rdi     # 0x4174b
xorl %eax, %eax
callq 0x3120
movl %eax, %r12d
movq (%rsp), %rax
leaq (%rbx,%rax), %r15
decq %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x4d44
movl %eax, %r13d
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7aba
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x7b5c
addl %ebp, %r12d
movq %r14, %rdi
callq 0x31b0
movl %r12d, %edi
jmp 0x7b30
cmpq $0x2, %rbx
jb 0x7b17
decq %rbx
leaq 0x39c6b(%rip), %r15     # 0x41745
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r14, %rdi
callq 0x4d44
movl %eax, %r12d
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x7b26
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x7b26
movzbl %r12b, %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
decq %rbx
jne 0x7ada
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x31b0
movl %ebp, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17530
movzbl %bpl, %esi
leaq 0x39bf8(%rip), %rdi     # 0x41746
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
jmp 0x79e1
movzbl %r13b, %esi
leaq 0x39bea(%rip), %rdi     # 0x41751
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3120
leaq 0x50608(%rip), %rax     # 0x58180
testb $0x3, 0x2(%rax)
je 0x7b17
leaq 0x39bd8(%rip), %rdi     # 0x4175d
movq %r15, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3120