#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 cdflib_eval_pol(double const *, int const *, double *);
double log(double);
double sqrt(double);
double cdflib_stvaln(double *p) {
  static const double xden[5] = {0.993484626060e-1, 0.588581570495e0,
                                 0.531103462366e0, 0.103537752850e0,
                                 0.38560700634e-2};
  static const double xnum[5] = {-0.322232431088e0, -1.000000000000e0,
                                 -0.342242088547e0, -0.204231210245e-1,
                                 -0.453642210148e-4};
  static const int K1 = 5;
  double stvaln, sign, y, z;
  if (!(*p <= 0.5e0)) {
    goto S10;
  }
  sign = -1.0e0;
  z = *p;
  goto S20;
S10:
  sign = 1.0e0;
  z = 1.0e0 - *p;
S20:
  y = sqrt(-(2.0e0 * log(z)));
  stvaln = y + cdflib_eval_pol(xnum, &K1, &y) / cdflib_eval_pol(xden, &K1, &y);
  stvaln = sign * stvaln;
  return stvaln;
}


x86 assembly (clang, -O0):
<cdflib_stvaln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeb8(%rip),%xmm0
ucomisd (%rax),%xmm0
jae    1157 <cdflib_stvaln+0x27>
jmp    1176 <cdflib_stvaln+0x46>
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1198 <cdflib_stvaln+0x68>
movsd  0xe8a(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xe79(%rip),%xmm0
subsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  0xe6b(%rip),%xmm0
mulsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    0xe6d(%rip),%rdi
lea    0xe8e(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <cdflib_eval_pol@plt>
movsd  %xmm0,-0x38(%rbp)
lea    0xe21(%rip),%rdi
lea    0xe72(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <cdflib_eval_pol@plt>
movsd  -0x38(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_stvaln>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movsd  (%rdi),%xmm1
movsd  0xebd(%rip),%xmm2
movapd %xmm1,%xmm0
cmpnlesd 0xeb8(%rip),%xmm0
subsd  %xmm1,%xmm2
andpd  %xmm0,%xmm2
movapd %xmm0,0x20(%rsp)
andnpd %xmm1,%xmm0
orpd   %xmm2,%xmm0
call   1040 <log@plt>
mulsd  0xe9d(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1183 <cdflib_stvaln+0x53>
sqrtsd %xmm0,%xmm0
jmp    1188 <cdflib_stvaln+0x58>
call   1050 <sqrt@plt>
movsd  %xmm0,(%rsp)
movsd  %xmm0,0x8(%rsp)
lea    0xec6(%rip),%rdi
lea    0xee7(%rip),%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <cdflib_eval_pol@plt>
movapd %xmm0,0x10(%rsp)
lea    0xe72(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <cdflib_eval_pol@plt>
movapd 0x10(%rsp),%xmm2
divsd  %xmm0,%xmm2
addsd  (%rsp),%xmm2
movapd 0x20(%rsp),%xmm0
movapd %xmm0,%xmm1
andpd  %xmm2,%xmm1
xorpd  0xe32(%rip),%xmm2
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@cdflib_stvaln.xden = internal constant [5 x double] [double 0x3FB96EE69DCCF754, double 0x3FE2D5A90489BD2F, double 0x3FE0FECCB034F054, double 0x3FBA81733E645F68, double 0x3F6F96C3DA074588]
@cdflib_stvaln.xnum = internal constant [5 x double] [double 0xBFD49F74C64EF237, double -1.000000e+00, double 0xBFD5E74B5C67F146, double 0xBF94E9CC7387A830, double 0xBF07C8AEC3ED1A62]
@cdflib_stvaln.K1 = internal constant i32 5
define double @cdflib_stvaln(double* %0) {
%2 = alloca double*
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double* %0, double** %2
%7 = load double*, double** %2
%8 = load double, double* %7
%9 = fcmp ole double %8, 5.000000e-01
br i1 %9, label %11, label %10
10: ; preds = %1
br label %14
11: ; preds = %1
store double -1.000000e+00, double* %4
%12 = load double*, double** %2
%13 = load double, double* %12
store double %13, double* %6
br label %18
14: ; preds = %10
store double 1.000000e+00, double* %4
%15 = load double*, double** %2
%16 = load double, double* %15
%17 = fsub double 1.000000e+00, %16
store double %17, double* %6
br label %18
18: ; preds = %14, %11
%19 = load double, double* %6
%20 = call double @log(double %19)
%21 = fmul double 2.000000e+00, %20
%22 = fneg double %21
%23 = call double @sqrt(double %22)
store double %23, double* %5
%24 = load double, double* %5
%25 = call double @cdflib_eval_pol(double* getelementptr inbounds ([5 x double], [5 x double]* @cdflib_stvaln.xnum, i64 0, i64 0), i32* @cdflib_stvaln.K1, double* %5)
%26 = call double @cdflib_eval_pol(double* getelementptr inbounds ([5 x double], [5 x double]* @cdflib_stvaln.xden, i64 0, i64 0), i32* @cdflib_stvaln.K1, double* %5)
%27 = fdiv double %25, %26
%28 = fadd double %24, %27
store double %28, double* %3
%29 = load double, double* %4
%30 = load double, double* %3
%31 = fmul double %29, %30
store double %31, double* %3
%32 = load double, double* %3
ret double %32
}

LLVM IR (-O2):
@cdflib_stvaln.xden = internal constant [5 x double] [double 0x3FB96EE69DCCF754, double 0x3FE2D5A90489BD2F, double 0x3FE0FECCB034F054, double 0x3FBA81733E645F68, double 0x3F6F96C3DA074588]
@cdflib_stvaln.xnum = internal constant [5 x double] [double 0xBFD49F74C64EF237, double -1.000000e+00, double 0xBFD5E74B5C67F146, double 0xBF94E9CC7387A830, double 0xBF07C8AEC3ED1A62]
@cdflib_stvaln.K1 = internal constant i32 5
define double @cdflib_stvaln(double* nocapture %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = load double, double* %0
%5 = fcmp ugt double %4, 5.000000e-01
%6 = fsub double 1.000000e+00, %4
%7 = select i1 %5, double %6, double %4
%8 = tail call double @log(double %7)
%9 = fmul double %8, -2.000000e+00
%10 = tail call double @sqrt(double %9)
store double %10, double* %2
%11 = call double @cdflib_eval_pol(double* getelementptr inbounds ([5 x double], [5 x double]* @cdflib_stvaln.xnum, i64 0, i64 0), i32* @cdflib_stvaln.K1, double* %2)
%12 = call double @cdflib_eval_pol(double* getelementptr inbounds ([5 x double], [5 x double]* @cdflib_stvaln.xden, i64 0, i64 0), i32* @cdflib_stvaln.K1, double* %2)
%13 = fdiv double %11, %12
%14 = fadd double %10, %13
%15 = fneg double %14
%16 = select i1 %5, double %14, double %15
ret double %16
}