// File: /workspace/github_c_makefile_star2_O3/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 0x1ba2
movsd 0x30(%rdi), %xmm2
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jb 0x1c93
movsd 0x1699(%rip), %xmm0     # 0x31d0
ucomisd %xmm2, %xmm0
jb 0x1c93
movq %rax, %xmm1
punpckldq 0x1652(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x165a(%rip), %xmm1     # 0x31b0
movapd %xmm1, %xmm3
unpckhpd %xmm1, %xmm3            # xmm3 = xmm3[1],xmm1[1]
addsd %xmm1, %xmm3
mulsd %xmm3, %xmm2
addsd 0x166a(%rip), %xmm2     # 0x31d8
cvttsd2si %xmm2, %rdx
movq %rdx, %r8
movapd %xmm2, %xmm1
subsd 0x165e(%rip), %xmm1     # 0x31e0
cvttsd2si %xmm1, %rcx
sarq $0x3f, %r8
andq %r8, %rcx
orq %rdx, %rcx
xorpd %xmm1, %xmm1
je 0x1bac
cmpq %rcx, %rax
jne 0x1bb0
leaq -0x1(%rax), %rcx
jmp 0x1bdc
movl $0x1, %eax
jmp 0x1c91
xorl %ecx, %ecx
jmp 0x1bdc
movq %rcx, %xmm1
punpckldq 0x15e3(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x15eb(%rip), %xmm1     # 0x31b0
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 0x15b7(%rip), %xmm3     # 0x31a0
punpckldq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movapd 0x15bb(%rip), %xmm4     # 0x31b0
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 0x1cb2
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jb 0x1cd1
ucomisd %xmm1, %xmm0
jbe 0x1cd1
movq 0x28(%rdi), %rdx
leaq -0x1(%rdx), %r8
cmpq %rcx, %r8
jne 0x1cf0
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x1c65
jnp 0x1c86
cmpq %rax, %rdx
jae 0x1d0f
movsd 0x10(%rdi), %xmm0
movsd 0x18(%rdi), %xmm2
subsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
jmp 0x1c8b
movsd 0x18(%rdi), %xmm0
movsd %xmm0, (%rsi)
xorl %eax, %eax
popq %rcx
retq
leaq 0x167e(%rip), %rdi      # 0x3318
leaq 0x161e(%rip), %rsi      # 0x32bf
leaq 0x1639(%rip), %rcx      # 0x32e1
movl $0x26, %edx
callq 0x10c0
leaq 0x1674(%rip), %rdi      # 0x332d
leaq 0x15ff(%rip), %rsi      # 0x32bf
leaq 0x161a(%rip), %rcx      # 0x32e1
movl $0x3d, %edx
callq 0x10c0
leaq 0x1676(%rip), %rdi      # 0x334e
leaq 0x15e0(%rip), %rsi      # 0x32bf
leaq 0x15fb(%rip), %rcx      # 0x32e1
movl $0x3e, %edx
callq 0x10c0
leaq 0x14f1(%rip), %rdi      # 0x31e8
leaq 0x1500(%rip), %rsi      # 0x31fe
leaq 0x151c(%rip), %rcx      # 0x3221
movl $0x56, %edx
callq 0x10c0
leaq 0x1545(%rip), %rdi      # 0x325b
leaq 0x14e1(%rip), %rsi      # 0x31fe
leaq 0x14fd(%rip), %rcx      # 0x3221
movl $0x5b, %edx
callq 0x10c0