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

    if(count)
    {
        num = (long)read_ulong(inptr,byteorder,offset);
        if(feof(inptr) || ferror(inptr))
        {
            clearerr(inptr);
            setcharsprinted(chpr);
            return;
        }
        denom = (long)read_ulong(inptr,byteorder,HERE);
        if(feof(inptr) || ferror(inptr))
        {
            clearerr(inptr);
            setcharsprinted(chpr);
            return;
        }
        if(PRINT_RAW_VALUES)
            chpr += printf("%ld/%ld = ",num,denom);
        if(num == 0UL)
            chpr += printf("0");
        else
            chpr += printf("%g",(double)((double)num/(double)denom));
    }
    if(PRINT_MULTIVAL_ALL)
    {
        for(i = 1; i < count; ++i)
        {
            num = (long)read_ulong(inptr,byteorder,HERE);
            if(feof(inptr) || ferror(inptr))
            {
                clearerr(inptr);
                setcharsprinted(chpr);
                return;
            }
            denom = (long)read_ulong(inptr,byteorder,HERE);
            if(feof(inptr) || ferror(inptr))
            {
                clearerr(inptr);
                setcharsprinted(chpr);
                return;
            }
            if(PRINT_RAW_VALUES)
                chpr += printf("%ld/%ld = ",num,denom);
            if(num == 0UL)
                chpr += printf(",0");
            else
                chpr += printf(",%g",(double)((double)num/(double)denom));
        }
    }
    else
    {
#define MAX 3UL
        j = count > MAX + 2 ? MAX : count;
        for(i = 1; i < j; ++i)
        {
            num = (long)read_ulong(inptr,byteorder,HERE);
            if(feof(inptr) || ferror(inptr))
            {
                clearerr(inptr);
                setcharsprinted(chpr);
                return;
            }
            denom = (long)read_ulong(inptr,byteorder,HERE);
            if(feof(inptr) || ferror(inptr))
            {
                clearerr(inptr);
                setcharsprinted(chpr);
                return;
            }
            if(PRINT_RAW_VALUES)
                chpr += printf("%ld/%ld = ",num,denom);
            if(num == 0UL)
                chpr += printf(",0");
            else
                chpr += printf(",%g",(double)((double)num/(double)denom));
        }
        if(count > j)
        {
            chpr += printf(" ... ");
            offset += (unsigned long)(count - j) * 8UL;
            fseek(inptr,offset,SEEK_SET);
            num = (long)read_ulong(inptr,byteorder,HERE);
            if(feof(inptr) || ferror(inptr))
            {
                clearerr(inptr);
                setcharsprinted(chpr);
                return;
            }
            denom = (long)read_ulong(inptr,byteorder,HERE);
            if(feof(inptr) || ferror(inptr))
            {
                clearerr(inptr);
                setcharsprinted(chpr);
                return;
            }
            if(PRINT_RAW_VALUES)
                chpr += printf("%ld/%ld = ",num,denom);
            if(num == 0UL)
                chpr += printf(",0 (%lu)",count);
            else
                chpr += printf(",%g (%lu)",(double)((double)num/(double)denom),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 $0x28, %rsp
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
testq %rsi, %rsi
je 0x8da7
movzwl %bx, %r13d
movq %r14, %rdi
movl %r13d, %esi
movq %rcx, %r12
movq %rcx, %rdx
callq 0x4707
movq %rax, %rbp
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x8d98
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x8d98
movl %ebx, 0xc(%rsp)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %r13d, %esi
callq 0x4707
movq %rax, %rbx
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x8d98
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x8f69
movq %r14, %rdi
callq 0x31b0
xorl %ebp, %ebp
jmp 0x8f54
leaq 0x4f3d2(%rip), %rax     # 0x58180
xorl %ebp, %ebp
testb $0x8, 0x3(%rax)
jne 0x8f54
movq %rcx, 0x18(%rsp)
cmpq $0x6, %r15
movl $0x3, %eax
movq %r15, 0x10(%rsp)
cmovbl %r15d, %eax
cmpl $0x2, %eax
movl %ebx, 0xc(%rsp)
movq %rax, 0x20(%rsp)
jl 0x8eb6
leal -0x1(%rax), %r15d
movzwl %bx, %r13d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %r13d, %esi
callq 0x4707
movq %rax, %rbx
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x8f4c
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x8f4c
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %r13d, %esi
callq 0x4707
movq %rax, %r12
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x8f4c
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x8f4c
leaq 0x4f328(%rip), %rax     # 0x58180
testb $0x2, 0x3(%rax)
je 0x8e74
leaq 0x389af(%rip), %rdi     # 0x41814
movq %rbx, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
testq %rbx, %rbx
je 0x8e9d
xorps %xmm0, %xmm0
cvtsi2sd %rbx, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r12, %xmm1
divsd %xmm1, %xmm0
leaq 0x38969(%rip), %rdi     # 0x417fd
movb $0x1, %al
callq 0x3120
jmp 0x8eab
leaq 0x38956(%rip), %rdi     # 0x417fa
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
decl %r15d
jne 0x8deb
movslq 0x20(%rsp), %rax
movq 0x10(%rsp), %rbx
subq %rax, %rbx
jbe 0x8f54
leaq 0x3887b(%rip), %rdi     # 0x4174b
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq 0x18(%rsp), %rax
leaq (%rax,%rbx,8), %r12
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x3210
movzwl 0xc(%rsp), %ebx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %ebx, %esi
callq 0x4707
movq %rax, %r15
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x8f4c
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x8f4c
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %ebx, %esi
callq 0x4707
movq %rax, %rbx
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x8f4c
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x90c3
movq %r14, %rdi
callq 0x31b0
movl %ebp, %edi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17a82
leaq 0x4f210(%rip), %rcx     # 0x58180
xorl %eax, %eax
testb $0x2, 0x3(%rcx)
je 0x8f8c
leaq 0x38895(%rip), %rdi     # 0x41814
movq %rbp, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, 0x10(%rsp)
testq %rbp, %rbp
je 0x8fb3
cvtsi2sd %rbp, %xmm0
cvtsi2sd %rbx, %xmm1
divsd %xmm1, %xmm0
leaq 0x4026e(%rip), %rdi     # 0x49218
movb $0x1, %al
callq 0x3120
jmp 0x8fc1
leaq 0x38c69(%rip), %rdi     # 0x41c23
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
movl 0xc(%rsp), %ebx
addl 0x10(%rsp), %ebp
leaq 0x4f1ae(%rip), %rax     # 0x58180
testb $0x8, 0x3(%rax)
jne 0x8fe0
movq %r12, %rcx
jmp 0x8dba
cmpq $0x1, %r15
je 0x8f54
decq %r15
movq %r15, %r12
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %r13d, %esi
callq 0x4707
movq %rax, %r15
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x8f4c
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x8f4c
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %r13d, %esi
callq 0x4707
movq %rax, %rbx
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x8f4c
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x8f4c
leaq 0x4f123(%rip), %rax     # 0x58180
testb $0x2, 0x3(%rax)
je 0x9079
leaq 0x387aa(%rip), %rdi     # 0x41814
movq %r15, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
testq %r15, %r15
je 0x90a2
xorps %xmm0, %xmm0
cvtsi2sd %r15, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %rbx, %xmm1
divsd %xmm1, %xmm0
leaq 0x38764(%rip), %rdi     # 0x417fd
movb $0x1, %al
callq 0x3120
jmp 0x90b0
leaq 0x38751(%rip), %rdi     # 0x417fa
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq %r12, %r15
decq %r15
jne 0x8fed
jmp 0x8f54
leaq 0x4f0b6(%rip), %r14     # 0x58180
testb $0x2, 0x3(%r14)
je 0x90e7
leaq 0x3873c(%rip), %rdi     # 0x41814
movq %r15, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
testq %r15, %r15
je 0x9115
xorps %xmm0, %xmm0
cvtsi2sd %r15, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %rbx, %xmm1
divsd %xmm1, %xmm0
leaq 0x38703(%rip), %rdi     # 0x4180a
movq 0x10(%rsp), %rsi
movb $0x1, %al
callq 0x3120
jmp 0x9128
leaq 0x386e5(%rip), %rdi     # 0x41801
movq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
testb $0x3, 0x2(%r14)
je 0x8f54
leaq 0x38621(%rip), %rdi     # 0x4175d
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
jmp 0x8f54