// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../lib/datastruct/onlinequantile.c
// Function: onlinequantile_get
int
onlinequantile_get(struct onlinequantile * Q, double * x)
{
	size_t i;
	double r;

	/* If empty, return 1. */
	if (Q->N == 0)
		return (1);

	/* Figure out the necessary averaging. */
	hazenquantile(Q->N, Q->q, &i, &r);

	/* Sanity-check. */
	assert(Q->N_smaller - 1 == i);

	/* Are we averaging two values? */
	if (r != 0.0) {
		/* Sanity-check. */
		assert(Q->N_smaller < Q->N);

		/* Compute the average. */
		*x = Q->smaller_max + (Q->larger_min - Q->smaller_max) * r;
	} else {
		/* The median is just a single value. */
		*x = Q->smaller_max;
	}

	/* Success! */
	return (0);
}

// Assembly:
pushq %rax
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x1b9b
movsd 0x30(%rdi), %xmm2
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jb 0x1c8c
movsd 0x1660(%rip), %xmm0     # 0x3190
ucomisd %xmm2, %xmm0
jb 0x1c8c
movq %rax, %xmm1
punpckldq 0x1669(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1671(%rip), %xmm1     # 0x31c0
movapd %xmm1, %xmm3
unpckhpd %xmm1, %xmm3            # xmm3 = xmm3[1],xmm1[1]
addsd %xmm1, %xmm3
mulsd %xmm3, %xmm2
addsd 0x1631(%rip), %xmm2     # 0x3198
cvttsd2si %xmm2, %rdx
movq %rdx, %r8
movapd %xmm2, %xmm1
subsd 0x1625(%rip), %xmm1     # 0x31a0
cvttsd2si %xmm1, %rcx
sarq $0x3f, %r8
andq %r8, %rcx
orq %rdx, %rcx
xorpd %xmm1, %xmm1
je 0x1ba5
cmpq %rcx, %rax
jne 0x1ba9
leaq -0x1(%rax), %rcx
jmp 0x1bd5
movl $0x1, %eax
jmp 0x1c8a
xorl %ecx, %ecx
jmp 0x1bd5
movq %rcx, %xmm1
punpckldq 0x15fa(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1602(%rip), %xmm1     # 0x31c0
movapd %xmm1, %xmm3
unpckhpd %xmm1, %xmm3            # xmm3 = xmm3[1],xmm1[1]
addsd %xmm1, %xmm3
subsd %xmm3, %xmm2
decq %rcx
movapd %xmm2, %xmm1
movq %rcx, %xmm2
movq 0x15ce(%rip), %xmm3     # 0x31b0
punpckldq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movapd 0x15d2(%rip), %xmm4     # 0x31c0
subpd %xmm4, %xmm2
movapd %xmm2, %xmm5
unpckhpd %xmm2, %xmm5            # xmm5 = xmm5[1],xmm2[1]
addsd %xmm2, %xmm5
addsd %xmm1, %xmm5
leaq -0x1(%rax), %rdx
movq %rdx, %xmm2
punpckldq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
subpd %xmm4, %xmm2
movapd %xmm2, %xmm3
unpckhpd %xmm2, %xmm3            # xmm3 = xmm3[1],xmm2[1]
addsd %xmm2, %xmm3
ucomisd %xmm5, %xmm3
jb 0x1cab
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jb 0x1cca
ucomisd %xmm1, %xmm0
jbe 0x1cca
movq 0x28(%rdi), %rdx
leaq -0x1(%rdx), %r8
cmpq %rcx, %r8
jne 0x1ce9
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x1c5e
jnp 0x1c7f
cmpq %rax, %rdx
jae 0x1d08
movsd 0x10(%rdi), %xmm0
movsd 0x18(%rdi), %xmm2
subsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
jmp 0x1c84
movsd 0x18(%rdi), %xmm0
movsd %xmm0, (%rsi)
xorl %eax, %eax
popq %rcx
retq
leaq 0x168e(%rip), %rdi      # 0x3321
leaq 0x162e(%rip), %rsi      # 0x32c8
leaq 0x1649(%rip), %rcx      # 0x32ea
movl $0x26, %edx
callq 0x10c0
leaq 0x1684(%rip), %rdi      # 0x3336
leaq 0x160f(%rip), %rsi      # 0x32c8
leaq 0x162a(%rip), %rcx      # 0x32ea
movl $0x3d, %edx
callq 0x10c0
leaq 0x1686(%rip), %rdi      # 0x3357
leaq 0x15f0(%rip), %rsi      # 0x32c8
leaq 0x160b(%rip), %rcx      # 0x32ea
movl $0x3e, %edx
callq 0x10c0
leaq 0x14f0(%rip), %rdi      # 0x31e0
leaq 0x14ff(%rip), %rsi      # 0x31f6
leaq 0x151b(%rip), %rcx      # 0x3219
movl $0x56, %edx
callq 0x10c0
leaq 0x1544(%rip), %rdi      # 0x3253
leaq 0x14e0(%rip), %rsi      # 0x31f6
leaq 0x14fc(%rip), %rcx      # 0x3219
movl $0x5b, %edx
callq 0x10c0