// File: /workspace/github_c_makefile_star2_O1/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
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x8cc2
movl %edx, %r15d
movzwl %dx, %ebp
movq %r14, %rdi
movl %ebp, %esi
movq %rcx, %r12
movq %rcx, %rdx
callq 0x46cc
movq %rax, %r13
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x8cb3
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x8cb3
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %ebp, %esi
callq 0x46cc
movq %rax, %rbp
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x8cb3
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x8f60
movq %r14, %rdi
callq 0x31b0
xorl %ebp, %ebp
jmp 0x8f4b
xorl %ebp, %ebp
leaq 0x4f4b5(%rip), %rax     # 0x58180
testb $0x8, 0x3(%rax)
jne 0x8e7f
movq %rcx, 0x18(%rsp)
cmpq $0x6, %rbx
movl $0x3, %eax
cmovbl %ebx, %eax
cmpl $0x2, %eax
movl %edx, 0x14(%rsp)
movq %rax, 0x8(%rsp)
jl 0x8ddb
leal -0x1(%rax), %r13d
movzwl %dx, %r15d
movq %rbx, 0x20(%rsp)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %r15d, %esi
callq 0x46cc
movq %rax, %r12
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x8e72
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x8e72
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %r15d, %ebx
movl %r15d, %esi
callq 0x46cc
movq %rax, %r15
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x8e72
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x8e72
leaq 0x4f40b(%rip), %rax     # 0x58180
testb $0x2, 0x3(%rax)
je 0x8d91
leaq 0x38a92(%rip), %rdi     # 0x41814
movq %r12, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
testq %r12, %r12
je 0x8dba
xorps %xmm0, %xmm0
cvtsi2sd %r12, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r15, %xmm1
divsd %xmm1, %xmm0
leaq 0x38a4c(%rip), %rdi     # 0x417fd
movb $0x1, %al
callq 0x3120
jmp 0x8dc8
leaq 0x38a39(%rip), %rdi     # 0x417fa
xorl %eax, %eax
callq 0x3120
movl %ebx, %r15d
addl %eax, %ebp
decl %r13d
movq 0x20(%rsp), %rbx
jne 0x8d05
movslq 0x8(%rsp), %rax
movq %rbx, %r15
subq %rax, %r15
jbe 0x8f4b
leaq 0x38958(%rip), %rdi     # 0x4174b
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq 0x18(%rsp), %rax
leaq (%rax,%r15,8), %r12
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x3210
movzwl 0x14(%rsp), %r13d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %r13d, %esi
callq 0x46cc
movq %rax, %r15
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x8e72
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x8e72
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %r13d, %esi
callq 0x46cc
movq %rax, %r13
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x8e72
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x8fc9
movq %r14, %rdi
callq 0x31b0
jmp 0x8f4b
cmpq $0x2, %rbx
jb 0x8f4b
decq %rbx
movzwl %dx, %r15d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %r15d, %esi
callq 0x46cc
movq %rax, %r12
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x8e72
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x8e72
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %r15d, %esi
callq 0x46cc
movq %rax, %r13
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x8e72
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x8e72
leaq 0x4f293(%rip), %rax     # 0x58180
testb $0x2, 0x3(%rax)
je 0x8f09
leaq 0x3891a(%rip), %rdi     # 0x41814
movq %r12, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
testq %r12, %r12
je 0x8f32
xorps %xmm0, %xmm0
cvtsi2sd %r12, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r13, %xmm1
divsd %xmm1, %xmm0
leaq 0x388d4(%rip), %rdi     # 0x417fd
movb $0x1, %al
callq 0x3120
jmp 0x8f40
leaq 0x388c1(%rip), %rdi     # 0x417fa
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
decq %rbx
jne 0x8e90
movl %ebp, %edi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17530
leaq 0x4f219(%rip), %rcx     # 0x58180
xorl %eax, %eax
testb $0x2, 0x3(%rcx)
je 0x8f83
leaq 0x3889e(%rip), %rdi     # 0x41814
movq %r13, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, 0x8(%rsp)
testq %r13, %r13
je 0x8faa
cvtsi2sd %r13, %xmm0
cvtsi2sd %rbp, %xmm1
divsd %xmm1, %xmm0
leaq 0x40237(%rip), %rdi     # 0x491d8
movb $0x1, %al
callq 0x3120
jmp 0x8fb8
leaq 0x38c72(%rip), %rdi     # 0x41c23
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl 0x8(%rsp), %ebp
movl %r15d, %edx
movq %r12, %rcx
jmp 0x8cc4
leaq 0x4f1b0(%rip), %rax     # 0x58180
testb $0x2, 0x3(%rax)
je 0x8fec
leaq 0x38837(%rip), %rdi     # 0x41814
movq %r15, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
testq %r15, %r15
je 0x9018
xorps %xmm0, %xmm0
cvtsi2sd %r15, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r13, %xmm1
divsd %xmm1, %xmm0
leaq 0x387fe(%rip), %rdi     # 0x4180a
movq %rbx, %rsi
movb $0x1, %al
callq 0x3120
jmp 0x9029
leaq 0x387e2(%rip), %rdi     # 0x41801
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x4f14e(%rip), %rax     # 0x58180
testb $0x3, 0x2(%rax)
je 0x8f4b
leaq 0x3871a(%rip), %rdi     # 0x4175d
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
jmp 0x8f4b