#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double cos(double);
double exp(double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double, long);
double pow(double, double);
double qnorm(double, int /*<<< orphan*/, int);
double sin(double);
double sqrt(double);
int /*<<< orphan*/ stderr;
double qt(double p, long n) {
  double a, b, c, d, x, y;
  if (n < 1) {
    fprintf(stderr, "tquantile(%f, %ld): error: second argument must be >= 1 !",
            p, n);
    return 0.0;
  } else if (p > 1.0 || p <= 0.0) {
    fprintf(stderr,
            "tquantile(%f, %ld): error: first argument must be in (0.0, 1.0] !",
            p, n);
    return 0.0;
  }
  if (n == 1) {
    p *= 1.57079632679489661923;
    return cos(p) / sin(p);
  }
  a = 1.0 / (n - 0.5);
  b = pow(48.0 / a, 2.0);
  c = ((20700.0 * a / b - 98.0) * a - 16.0) * a + 96.36;
  d = ((94.5 / (b + c) - 3.0) / b + 1.0) * sqrt(a * 1.57079632679489661923) *
      (double)n;
  x = d * p;
  y = pow(x, 2.0 / (double)n);
  if (y > 0.05 + a) {
    x = qnorm(p * 0.5, 0, 1);
    y = x * x;
    if (n < 5) {
      c += 0.3 * ((double)n - 4.5) * (x + 0.6);
      c = (((0.5 * d * x - 0.5) * x - 7.0) * x - 2.0) * x + b + c;
      y = (((((0.4 * y + 6.3) * y + 36.0) * y + 94.5) / c - y - 3.0) / b +
           1.0) *
          x;
      y *= a * y;
      if (y > 0.002)
        y = exp(y) - 1.0;
      else
        y += 0.5 * y * y;
    }
  } else
    y = ((1.0 / ((((double)n + 6.0) / ((double)n * y) - 0.089 * d - 0.822) *
                 ((double)n + 2.0) * 3.0) +
          0.5 / ((double)n + 4.0)) *
             y -
         1.0) *
            ((double)n + 1.0) / ((double)n + 2.0) +
        1.0 / y;
  return sqrt((double)n * y);
}


x86 assembly (clang, -O0):
<qt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
jge    11b7 <qt+0x47>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rdx
lea    0xf33(%rip),%rsi
call   1030 <fprintf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1664 <qt+0x4f4>
movsd  -0x10(%rbp),%xmm0
movsd  0xe3c(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     11dc <qt+0x6c>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1207 <qt+0x97>
mov    0x2dfd(%rip),%rax
mov    (%rax),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rdx
lea    0xf1d(%rip),%rsi
call   1030 <fprintf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1664 <qt+0x4f4>
jmp    120c <qt+0x9c>
cmpq   $0x1,-0x18(%rbp)
jne    1258 <qt+0xe8>
movsd  0xdf9(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1664 <qt+0x4f4>
cvtsi2sdq -0x18(%rbp),%xmm1
movsd  0xdf2(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xd8e(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xdcd(%rip),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  0xd80(%rip),%xmm1
call   1080 <pow@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0xda6(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  0xd8c(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd6f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd52(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm1
addsd  -0x30(%rbp),%xmm1
movsd  0xd2f(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xd1b(%rip),%xmm1
subsd  %xmm1,%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  0xcea(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xcf1(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdq -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
cvtsi2sdq -0x18(%rbp),%xmm2
movsd  0xca2(%rip),%xmm1
divsd  %xmm2,%xmm1
call   1080 <pow@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xc7f(%rip),%xmm1
addsd  -0x20(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    1566 <qt+0x3f6>
movsd  0xcb8(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
call   1060 <qnorm@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
cmpq   $0x5,-0x18(%rbp)
jge    1561 <qt+0x3f1>
cvtsi2sdq -0x18(%rbp),%xmm1
movsd  0xcf2(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xcde(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xcca(%rip),%xmm2
addsd  -0x40(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xc43(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc8d(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc70(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc53(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xc16(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc12(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xbed(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb70(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  -0x30(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  0xb52(%rip),%xmm1
subsd  %xmm1,%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  0xb21(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xb7a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1538 <qt+0x3c8>
movsd  -0x48(%rbp),%xmm0
call   1050 <exp@plt>
movsd  0xad6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    155c <qt+0x3ec>
movsd  0xb18(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1561 <qt+0x3f1>
jmp    164f <qt+0x4df>
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  0xb0c(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdq -0x18(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  0xae4(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xacc(%rip),%xmm0
subsd  %xmm0,%xmm1
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  0xa5a(%rip),%xmm2
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xa5a(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xa2e(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsi2sdq -0x18(%rbp),%xmm2
movsd  0xa84(%rip),%xmm1
addsd  %xmm1,%xmm2
movsd  0xa68(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xa57(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdq -0x18(%rbp),%xmm1
movsd  0x9e5(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdq -0x18(%rbp),%xmm1
movsd  0x9df(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0x9bf(%rip),%xmm1
divsd  -0x48(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdq -0x18(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
call   1090 <sqrt@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qt>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rbx
movapd %xmm0,%xmm6
test   %rdi,%rdi
jle    11d3 <qt+0x63>
ucomisd 0xe77(%rip),%xmm6
ja     11e5 <qt+0x75>
xorpd  %xmm0,%xmm0
ucomisd %xmm6,%xmm0
jae    11e5 <qt+0x75>
cmp    $0x1,%rbx
jne    120b <qt+0x9b>
mulsd  0xea5(%rip),%xmm6
movsd  %xmm6,0x8(%rsp)
movapd %xmm6,%xmm0
call   1070 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <sin@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1205 <qt+0x95>
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
lea    0xf2d(%rip),%rsi
jmp    11f5 <qt+0x85>
mov    0x2df4(%rip),%rax
mov    (%rax),%edi
lea    0xf55(%rip),%rsi
movapd %xmm6,%xmm0
mov    %rbx,%rdx
call   1030 <fprintf@plt>
xorpd  %xmm0,%xmm0
add    $0x40,%rsp
pop    %rbx
ret
cvtsi2sd %rbx,%xmm2
movsd  0xdf0(%rip),%xmm1
addsd  %xmm2,%xmm1
movsd  0xddc(%rip),%xmm0
movapd %xmm0,%xmm3
divsd  %xmm1,%xmm3
movsd  0xddc(%rip),%xmm4
divsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm4
movsd  0xdd4(%rip),%xmm7
mulsd  %xmm3,%xmm7
divsd  %xmm4,%xmm7
addsd  0xdcc(%rip),%xmm7
mulsd  %xmm3,%xmm7
addsd  0xdc8(%rip),%xmm7
mulsd  %xmm3,%xmm7
addsd  0xdc4(%rip),%xmm7
movapd %xmm4,%xmm1
addsd  %xmm7,%xmm1
movsd  0xdbc(%rip),%xmm5
divsd  %xmm1,%xmm5
addsd  0xdb8(%rip),%xmm5
divsd  %xmm4,%xmm5
addsd  %xmm0,%xmm5
movsd  0xdb0(%rip),%xmm0
mulsd  %xmm3,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  %xmm2,(%rsp)
movsd  %xmm3,0x28(%rsp)
movsd  %xmm4,0x38(%rsp)
movsd  %xmm6,0x8(%rsp)
movsd  %xmm7,0x30(%rsp)
jb     12c9 <qt+0x159>
sqrtsd %xmm0,%xmm0
jmp    12e5 <qt+0x175>
movapd %xmm5,0x10(%rsp)
call   1090 <sqrt@plt>
movsd  0x8(%rsp),%xmm6
movapd 0x10(%rsp),%xmm5
movsd  (%rsp),%xmm2
mulsd  %xmm0,%xmm5
mulsd  %xmm2,%xmm5
movapd %xmm5,0x10(%rsp)
movapd %xmm5,%xmm0
mulsd  %xmm6,%xmm0
movsd  0xd4d(%rip),%xmm1
divsd  %xmm2,%xmm1
call   1080 <pow@plt>
movsd  0xd44(%rip),%xmm1
movsd  0x28(%rsp),%xmm2
addsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    144a <qt+0x2da>
movsd  0x8(%rsp),%xmm0
mulsd  0xd52(%rip),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
call   1060 <qnorm@plt>
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm0
cmp    $0x4,%rbx
ja     1503 <qt+0x393>
movsd  0xd34(%rip),%xmm2
movsd  (%rsp),%xmm4
addsd  %xmm4,%xmm2
mulsd  0xd2b(%rip),%xmm2
movsd  0xd2b(%rip),%xmm3
addsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm3
movapd 0x10(%rsp),%xmm6
mulsd  0xcfd(%rip),%xmm6
addsd  0x30(%rsp),%xmm3
mulsd  %xmm1,%xmm6
addsd  0xc6b(%rip),%xmm6
mulsd  %xmm1,%xmm6
addsd  0xcff(%rip),%xmm6
mulsd  %xmm1,%xmm6
addsd  0xcfb(%rip),%xmm6
mulsd  %xmm1,%xmm6
movsd  0x38(%rsp),%xmm5
addsd  %xmm5,%xmm6
movsd  0xced(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xce9(%rip),%xmm2
addsd  %xmm3,%xmm6
mulsd  %xmm0,%xmm2
addsd  0xce1(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xc45(%rip),%xmm2
divsd  %xmm6,%xmm2
subsd  %xmm0,%xmm2
addsd  0xc3d(%rip),%xmm2
divsd  %xmm5,%xmm2
addsd  0xbf1(%rip),%xmm2
mulsd  %xmm1,%xmm2
movsd  0x28(%rsp),%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
ucomisd 0xca7(%rip),%xmm1
jbe    150a <qt+0x39a>
movapd %xmm1,%xmm0
call   1050 <exp@plt>
movsd  (%rsp),%xmm4
addsd  0xc3b(%rip),%xmm0
jmp    151e <qt+0x3ae>
movsd  0xc0e(%rip),%xmm1
movsd  (%rsp),%xmm4
addsd  %xmm4,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm4,%xmm2
divsd  %xmm2,%xmm1
movapd 0x10(%rsp),%xmm2
mulsd  0xbf3(%rip),%xmm2
addsd  %xmm1,%xmm2
addsd  0xbef(%rip),%xmm2
movsd  0xbc7(%rip),%xmm1
addsd  %xmm4,%xmm1
mulsd  %xmm1,%xmm2
unpcklpd %xmm2,%xmm2
movsd  0xbdb(%rip),%xmm3
addsd  %xmm4,%xmm3
mulpd  0xc37(%rip),%xmm2
movsd  %xmm3,%xmm2
movapd 0xc3b(%rip),%xmm3
divpd  %xmm2,%xmm3
movapd %xmm3,%xmm2
unpckhpd %xmm3,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm0,%xmm2
addsd  0xbaf(%rip),%xmm2
movsd  0xb27(%rip),%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm2,%xmm3
movapd 0xc17(%rip),%xmm2
unpcklpd %xmm3,%xmm2
unpcklpd %xmm1,%xmm0
divpd  %xmm0,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
addsd  %xmm2,%xmm0
jmp    151e <qt+0x3ae>
movsd  (%rsp),%xmm4
jmp    151e <qt+0x3ae>
movsd  0xb76(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm4,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1535 <qt+0x3c5>
sqrtsd %xmm0,%xmm0
jmp    1205 <qt+0x95>
add    $0x40,%rsp
pop    %rbx
jmp    1090 <sqrt@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"tquantile(%f, %ld): error: second argument must be >= 1 !\00"
@.str.1 = [66 x i8] c"tquantile(%f, %ld): error: first argument must be in (0.0, 1.0] !\00"
define double @qt(double %0, i64 %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i64
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %4
store i64 %1, i64* %5
%12 = load i64, i64* %5
%13 = icmp slt i64 %12, 1
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = load double, double* %4
%17 = load i64, i64* %5
%18 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), double %16, i64 %17)
store double 0.000000e+00, double* %3
br label %194
19: ; preds = %2
%20 = load double, double* %4
%21 = fcmp ogt double %20, 1.000000e+00
br i1 %21, label %25, label %22
22: ; preds = %19
%23 = load double, double* %4
%24 = fcmp ole double %23, 0.000000e+00
br i1 %24, label %25, label %30
25: ; preds = %22, %19
%26 = load i32, i32* @stderr
%27 = load double, double* %4
%28 = load i64, i64* %5
%29 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0), double %27, i64 %28)
store double 0.000000e+00, double* %3
br label %194
30: ; preds = %22
br label %31
31: ; preds = %30
%32 = load i64, i64* %5
%33 = icmp eq i64 %32, 1
br i1 %33, label %34, label %42
34: ; preds = %31
%35 = load double, double* %4
%36 = fmul double %35, 0x3FF921FB54442D18
store double %36, double* %4
%37 = load double, double* %4
%38 = call double @cos(double %37)
%39 = load double, double* %4
%40 = call double @sin(double %39)
%41 = fdiv double %38, %40
store double %41, double* %3
br label %194
42: ; preds = %31
%43 = load i64, i64* %5
%44 = sitofp i64 %43 to double
%45 = fsub double %44, 5.000000e-01
%46 = fdiv double 1.000000e+00, %45
store double %46, double* %6
%47 = load double, double* %6
%48 = fdiv double 4.800000e+01, %47
%49 = call double @pow(double %48, double 2.000000e+00)
store double %49, double* %7
%50 = load double, double* %6
%51 = fmul double 2.070000e+04, %50
%52 = load double, double* %7
%53 = fdiv double %51, %52
%54 = fsub double %53, 9.800000e+01
%55 = load double, double* %6
%56 = call double @llvm.fmuladd.f64(double %54, double %55, double -1.600000e+01)
%57 = load double, double* %6
%58 = call double @llvm.fmuladd.f64(double %56, double %57, double 0x4058170A3D70A3D7)
store double %58, double* %8
%59 = load double, double* %7
%60 = load double, double* %8
%61 = fadd double %59, %60
%62 = fdiv double 9.450000e+01, %61
%63 = fsub double %62, 3.000000e+00
%64 = load double, double* %7
%65 = fdiv double %63, %64
%66 = fadd double %65, 1.000000e+00
%67 = load double, double* %6
%68 = fmul double %67, 0x3FF921FB54442D18
%69 = call double @sqrt(double %68)
%70 = fmul double %66, %69
%71 = load i64, i64* %5
%72 = sitofp i64 %71 to double
%73 = fmul double %70, %72
store double %73, double* %9
%74 = load double, double* %9
%75 = load double, double* %4
%76 = fmul double %74, %75
store double %76, double* %10
%77 = load double, double* %10
%78 = load i64, i64* %5
%79 = sitofp i64 %78 to double
%80 = fdiv double 2.000000e+00, %79
%81 = call double @pow(double %77, double %80)
store double %81, double* %11
%82 = load double, double* %11
%83 = load double, double* %6
%84 = fadd double 5.000000e-02, %83
%85 = fcmp ogt double %82, %84
br i1 %85, label %86, label %152
86: ; preds = %42
%87 = load double, double* %4
%88 = fmul double %87, 5.000000e-01
%89 = call double @qnorm(double %88, i32 0, i32 1)
store double %89, double* %10
%90 = load double, double* %10
%91 = load double, double* %10
%92 = fmul double %90, %91
store double %92, double* %11
%93 = load i64, i64* %5
%94 = icmp slt i64 %93, 5
br i1 %94, label %95, label %151
95: ; preds = %86
%96 = load i64, i64* %5
%97 = sitofp i64 %96 to double
%98 = fsub double %97, 4.500000e+00
%99 = fmul double 3.000000e-01, %98
%100 = load double, double* %10
%101 = fadd double %100, 6.000000e-01
%102 = load double, double* %8
%103 = call double @llvm.fmuladd.f64(double %99, double %101, double %102)
store double %103, double* %8
%104 = load double, double* %9
%105 = fmul double 5.000000e-01, %104
%106 = load double, double* %10
%107 = call double @llvm.fmuladd.f64(double %105, double %106, double -5.000000e-01)
%108 = load double, double* %10
%109 = call double @llvm.fmuladd.f64(double %107, double %108, double -7.000000e+00)
%110 = load double, double* %10
%111 = call double @llvm.fmuladd.f64(double %109, double %110, double -2.000000e+00)
%112 = load double, double* %10
%113 = load double, double* %7
%114 = call double @llvm.fmuladd.f64(double %111, double %112, double %113)
%115 = load double, double* %8
%116 = fadd double %114, %115
store double %116, double* %8
%117 = load double, double* %11
%118 = call double @llvm.fmuladd.f64(double 4.000000e-01, double %117, double 6.300000e+00)
%119 = load double, double* %11
%120 = call double @llvm.fmuladd.f64(double %118, double %119, double 3.600000e+01)
%121 = load double, double* %11
%122 = call double @llvm.fmuladd.f64(double %120, double %121, double 9.450000e+01)
%123 = load double, double* %8
%124 = fdiv double %122, %123
%125 = load double, double* %11
%126 = fsub double %124, %125
%127 = fsub double %126, 3.000000e+00
%128 = load double, double* %7
%129 = fdiv double %127, %128
%130 = fadd double %129, 1.000000e+00
%131 = load double, double* %10
%132 = fmul double %130, %131
store double %132, double* %11
%133 = load double, double* %6
%134 = load double, double* %11
%135 = fmul double %133, %134
%136 = load double, double* %11
%137 = fmul double %136, %135
store double %137, double* %11
%138 = load double, double* %11
%139 = fcmp ogt double %138, 2.000000e-03
br i1 %139, label %140, label %144
140: ; preds = %95
%141 = load double, double* %11
%142 = call double @exp(double %141)
%143 = fsub double %142, 1.000000e+00
store double %143, double* %11
br label %150
144: ; preds = %95
%145 = load double, double* %11
%146 = fmul double 5.000000e-01, %145
%147 = load double, double* %11
%148 = load double, double* %11
%149 = call double @llvm.fmuladd.f64(double %146, double %147, double %148)
store double %149, double* %11
br label %150
150: ; preds = %144, %140
br label %151
151: ; preds = %150, %86
br label %188
152: ; preds = %42
%153 = load i64, i64* %5
%154 = sitofp i64 %153 to double
%155 = fadd double %154, 6.000000e+00
%156 = load i64, i64* %5
%157 = sitofp i64 %156 to double
%158 = load double, double* %11
%159 = fmul double %157, %158
%160 = fdiv double %155, %159
%161 = load double, double* %9
%162 = call double @llvm.fmuladd.f64(double 0xBFB6C8B439581062, double %161, double %160)
%163 = fsub double %162, 8.220000e-01
%164 = load i64, i64* %5
%165 = sitofp i64 %164 to double
%166 = fadd double %165, 2.000000e+00
%167 = fmul double %163, %166
%168 = fmul double %167, 3.000000e+00
%169 = fdiv double 1.000000e+00, %168
%170 = load i64, i64* %5
%171 = sitofp i64 %170 to double
%172 = fadd double %171, 4.000000e+00
%173 = fdiv double 5.000000e-01, %172
%174 = fadd double %169, %173
%175 = load double, double* %11
%176 = call double @llvm.fmuladd.f64(double %174, double %175, double -1.000000e+00)
%177 = load i64, i64* %5
%178 = sitofp i64 %177 to double
%179 = fadd double %178, 1.000000e+00
%180 = fmul double %176, %179
%181 = load i64, i64* %5
%182 = sitofp i64 %181 to double
%183 = fadd double %182, 2.000000e+00
%184 = fdiv double %180, %183
%185 = load double, double* %11
%186 = fdiv double 1.000000e+00, %185
%187 = fadd double %184, %186
store double %187, double* %11
br label %188
188: ; preds = %152, %151
%189 = load i64, i64* %5
%190 = sitofp i64 %189 to double
%191 = load double, double* %11
%192 = fmul double %190, %191
%193 = call double @sqrt(double %192)
store double %193, double* %3
br label %194
194: ; preds = %188, %34, %25, %14
%195 = load double, double* %3
ret double %195
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"tquantile(%f, %ld): error: second argument must be >= 1 !\00"
@.str.1 = [66 x i8] c"tquantile(%f, %ld): error: first argument must be in (0.0, 1.0] !\00"
define double @qt(double %0, i64 %1) {
%3 = icmp slt i64 %1, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), double %0, i64 %1)
br label %111
7: ; preds = %2
%8 = fcmp ogt double %0, 1.000000e+00
%9 = fcmp ole double %0, 0.000000e+00
%10 = or i1 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* @stderr
%13 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0), double %0, i64 %1)
br label %111
14: ; preds = %7
%15 = icmp eq i64 %1, 1
br i1 %15, label %16, label %21
16: ; preds = %14
%17 = fmul double %0, 0x3FF921FB54442D18
%18 = tail call double @cos(double %17)
%19 = tail call double @sin(double %17)
%20 = fdiv double %18, %19
br label %111
21: ; preds = %14
%22 = sitofp i64 %1 to double
%23 = fadd double %22, -5.000000e-01
%24 = fdiv double 1.000000e+00, %23
%25 = fdiv double 4.800000e+01, %24
%26 = fmul double %25, %25
%27 = fmul double %24, 2.070000e+04
%28 = fdiv double %27, %26
%29 = fadd double %28, -9.800000e+01
%30 = tail call double @llvm.fmuladd.f64(double %29, double %24, double -1.600000e+01)
%31 = tail call double @llvm.fmuladd.f64(double %30, double %24, double 0x4058170A3D70A3D7)
%32 = fadd double %26, %31
%33 = fdiv double 9.450000e+01, %32
%34 = fadd double %33, -3.000000e+00
%35 = fdiv double %34, %26
%36 = fadd double %35, 1.000000e+00
%37 = fmul double %24, 0x3FF921FB54442D18
%38 = tail call double @sqrt(double %37)
%39 = fmul double %36, %38
%40 = fmul double %39, %22
%41 = fmul double %40, %0
%42 = fdiv double 2.000000e+00, %22
%43 = tail call double @pow(double %41, double %42)
%44 = fadd double %24, 5.000000e-02
%45 = fcmp ogt double %43, %44
br i1 %45, label %46, label %80
46: ; preds = %21
%47 = fmul double %0, 5.000000e-01
%48 = tail call double @qnorm(double %47, i32 0, i32 1)
%49 = fmul double %48, %48
%50 = icmp ult i64 %1, 5
br i1 %50, label %51, label %107
51: ; preds = %46
%52 = fadd double %22, -4.500000e+00
%53 = fmul double %52, 3.000000e-01
%54 = fadd double %48, 6.000000e-01
%55 = tail call double @llvm.fmuladd.f64(double %53, double %54, double %31)
%56 = fmul double %40, 5.000000e-01
%57 = tail call double @llvm.fmuladd.f64(double %56, double %48, double -5.000000e-01)
%58 = tail call double @llvm.fmuladd.f64(double %57, double %48, double -7.000000e+00)
%59 = tail call double @llvm.fmuladd.f64(double %58, double %48, double -2.000000e+00)
%60 = tail call double @llvm.fmuladd.f64(double %59, double %48, double %26)
%61 = fadd double %55, %60
%62 = tail call double @llvm.fmuladd.f64(double %49, double 4.000000e-01, double 6.300000e+00)
%63 = tail call double @llvm.fmuladd.f64(double %62, double %49, double 3.600000e+01)
%64 = tail call double @llvm.fmuladd.f64(double %63, double %49, double 9.450000e+01)
%65 = fdiv double %64, %61
%66 = fsub double %65, %49
%67 = fadd double %66, -3.000000e+00
%68 = fdiv double %67, %26
%69 = fadd double %68, 1.000000e+00
%70 = fmul double %48, %69
%71 = fmul double %24, %70
%72 = fmul double %70, %71
%73 = fcmp ogt double %72, 2.000000e-03
br i1 %73, label %74, label %77
74: ; preds = %51
%75 = tail call double @exp(double %72)
%76 = fadd double %75, -1.000000e+00
br label %107
77: ; preds = %51
%78 = fmul double %72, 5.000000e-01
%79 = tail call double @llvm.fmuladd.f64(double %78, double %72, double %72)
br label %107
80: ; preds = %21
%81 = fadd double %22, 6.000000e+00
%82 = fmul double %43, %22
%83 = fdiv double %81, %82
%84 = tail call double @llvm.fmuladd.f64(double %40, double 0xBFB6C8B439581062, double %83)
%85 = fadd double %84, -8.220000e-01
%86 = fadd double %22, 2.000000e+00
%87 = fmul double %86, %85
%88 = insertelement <2 x double> poison, double %22, i64 0
%89 = insertelement <2 x double> %88, double %87, i64 1
%90 = fadd <2 x double> %89, <double 4.000000e+00, double poison>
%91 = fmul <2 x double> %89, <double poison, double 3.000000e+00>
%92 = shufflevector <2 x double> %90, <2 x double> %91, <2 x i32> <i32 0, i32 3>
%93 = fdiv <2 x double> <double 5.000000e-01, double 1.000000e+00>, %92
%94 = shufflevector <2 x double> %93, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%95 = fadd <2 x double> %93, %94
%96 = extractelement <2 x double> %95, i64 0
%97 = tail call double @llvm.fmuladd.f64(double %96, double %43, double -1.000000e+00)
%98 = fadd double %22, 1.000000e+00
%99 = fmul double %98, %97
%100 = insertelement <2 x double> <double 1.000000e+00, double poison>, double %99, i64 1
%101 = insertelement <2 x double> poison, double %43, i64 0
%102 = insertelement <2 x double> %101, double %86, i64 1
%103 = fdiv <2 x double> %100, %102
%104 = shufflevector <2 x double> %103, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%105 = fadd <2 x double> %103, %104
%106 = extractelement <2 x double> %105, i64 0
br label %107
107: ; preds = %46, %77, %74, %80
%108 = phi double [ %76, %74 ], [ %79, %77 ], [ %49, %46 ], [ %106, %80 ]
%109 = fmul double %108, %22
%110 = tail call double @sqrt(double %109)
br label %111
111: ; preds = %107, %16, %11, %4
%112 = phi double [ 0.000000e+00, %4 ], [ 0.000000e+00, %11 ], [ %20, %16 ], [ %110, %107 ]
ret double %112
}