void cdflib_binomial_cdf_values(int *n_data, int *a, double *b, int *x,
                                double *fx) {
  enum { N_MAX = 17 };
  static const int a_vec[N_MAX] = {2,  2,  2,  2,  2,  4,  4,  4, 4,
                                   10, 10, 10, 10, 10, 10, 10, 10};
  static const double b_vec[N_MAX] = {
      0.05E+00, 0.05E+00, 0.05E+00, 0.50E+00, 0.50E+00, 0.25E+00,
      0.25E+00, 0.25E+00, 0.25E+00, 0.05E+00, 0.10E+00, 0.15E+00,
      0.20E+00, 0.25E+00, 0.30E+00, 0.40E+00, 0.50E+00};
  static const double fx_vec[N_MAX] = {
      0.9025E+00, 0.9975E+00, 1.0000E+00, 0.2500E+00, 0.7500E+00, 0.3164E+00,
      0.7383E+00, 0.9492E+00, 0.9961E+00, 0.9999E+00, 0.9984E+00, 0.9901E+00,
      0.9672E+00, 0.9219E+00, 0.8497E+00, 0.6331E+00, 0.3770E+00};
  static const int x_vec[N_MAX] = {0, 1, 2, 0, 1, 0, 1, 2, 3,
                                   4, 4, 4, 4, 4, 4, 4, 4};
  if (*n_data < 0) {
    *n_data = 0;
  }
  *n_data = *n_data + 1;
  if (N_MAX < *n_data) {
    *n_data = 0;
    *a = 0;
    *b = 0.0E+00;
    *x = 0;
    *fx = 0.0E+00;
  } else {
    *a = a_vec[*n_data - 1];
    *b = b_vec[*n_data - 1];
    *x = x_vec[*n_data - 1];
    *fx = fx_vec[*n_data - 1];
  }
  return;
}


x86 assembly (clang, -O0):
<cdflib_binomial_cdf_values>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jge    112f <cdflib_binomial_cdf_values+0x2f>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rcx
mov    $0x11,%eax
cmp    (%rcx),%eax
jge    1188 <cdflib_binomial_cdf_values+0x88>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1200 <cdflib_binomial_cdf_values+0x100>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0xe65(%rip),%rax
mov    (%rax,%rcx,4),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0xe99(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0xf99(%rip),%rax
mov    (%rax,%rcx,4),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0xeed(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_binomial_cdf_values>:
mov    (%rdi),%r9d
test   %r9d,%r9d
js     1136 <cdflib_binomial_cdf_values+0x36>
lea    0x1(%r9),%eax
mov    %eax,(%rdi)
cmp    $0x11,%r9d
jb     113f <cdflib_binomial_cdf_values+0x3f>
movl   $0x0,(%rdi)
movl   $0x0,(%rsi)
movq   $0x0,(%rdx)
movl   $0x0,(%rcx)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%r8)
ret
movl   $0x1,(%rdi)
xor    %r9d,%r9d
mov    %r9d,%r9d
lea    0xeb7(%rip),%rax
mov    (%rax,%r9,4),%eax
mov    %eax,(%rsi)
movslq (%rdi),%rax
lea    0xef7(%rip),%rsi
movsd  -0x8(%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rdx)
lea    0x1006(%rip),%rdx
mov    -0x4(%rdx,%rax,4),%eax
mov    %eax,(%rcx)
movslq (%rdi),%rax
lea    0xf66(%rip),%rcx
movsd  -0x8(%rcx,%rax,8),%xmm0
movsd  %xmm0,(%r8)
ret

LLVM IR (-O0):
@cdflib_binomial_cdf_values.a_vec = internal constant [17 x i32] [i32 2, i32 2, i32 2, i32 2, i32 2, i32 4, i32 4, i32 4, i32 4, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10]
@cdflib_binomial_cdf_values.b_vec = internal constant [17 x double] [double 5.000000e-02, double 5.000000e-02, double 5.000000e-02, double 5.000000e-01, double 5.000000e-01, double 2.500000e-01, double 2.500000e-01, double 2.500000e-01, double 2.500000e-01, double 5.000000e-02, double 1.000000e-01, double 1.500000e-01, double 2.000000e-01, double 2.500000e-01, double 3.000000e-01, double 4.000000e-01, double 5.000000e-01]
@cdflib_binomial_cdf_values.fx_vec = internal constant [17 x double] [double 9.025000e-01, double 9.975000e-01, double 1.000000e+00, double 2.500000e-01, double 7.500000e-01, double 3.164000e-01, double 0x3FE7A027525460AA, double 9.492000e-01, double 0x3FEFE00D1B71758E, double 9.999000e-01, double 0x3FEFF2E48E8A71DE, double 0x3FEFAEE631F8A090, double 0x3FEEF34D6A161E4F, double 9.219000e-01, double 8.497000e-01, double 0x3FE4425AEE631F8A, double 3.770000e-01]
@cdflib_binomial_cdf_values.x_vec = internal constant [17 x i32] [i32 0, i32 1, i32 2, i32 0, i32 1, i32 0, i32 1, i32 2, i32 3, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4]
define void @cdflib_binomial_cdf_values(i32* %0, i32* %1, double* %2, i32* %3, double* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca double*
%9 = alloca i32*
%10 = alloca double*
store i32* %0, i32** %6
store i32* %1, i32** %7
store double* %2, double** %8
store i32* %3, i32** %9
store double* %4, double** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %5
%15 = load i32*, i32** %6
store i32 0, i32* %15
br label %16
16: ; preds = %14, %5
%17 = load i32*, i32** %6
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1
%20 = load i32*, i32** %6
store i32 %19, i32* %20
%21 = load i32*, i32** %6
%22 = load i32, i32* %21
%23 = icmp slt i32 17, %22
br i1 %23, label %24, label %30
24: ; preds = %16
%25 = load i32*, i32** %6
store i32 0, i32* %25
%26 = load i32*, i32** %7
store i32 0, i32* %26
%27 = load double*, double** %8
store double 0.000000e+00, double* %27
%28 = load i32*, i32** %9
store i32 0, i32* %28
%29 = load double*, double** %10
store double 0.000000e+00, double* %29
br label %59
30: ; preds = %16
%31 = load i32*, i32** %6
%32 = load i32, i32* %31
%33 = sub nsw i32 %32, 1
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [17 x i32], [17 x i32]* @cdflib_binomial_cdf_values.a_vec, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = load i32*, i32** %7
store i32 %36, i32* %37
%38 = load i32*, i32** %6
%39 = load i32, i32* %38
%40 = sub nsw i32 %39, 1
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [17 x double], [17 x double]* @cdflib_binomial_cdf_values.b_vec, i64 0, i64 %41
%43 = load double, double* %42
%44 = load double*, double** %8
store double %43, double* %44
%45 = load i32*, i32** %6
%46 = load i32, i32* %45
%47 = sub nsw i32 %46, 1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [17 x i32], [17 x i32]* @cdflib_binomial_cdf_values.x_vec, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = load i32*, i32** %9
store i32 %50, i32* %51
%52 = load i32*, i32** %6
%53 = load i32, i32* %52
%54 = sub nsw i32 %53, 1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [17 x double], [17 x double]* @cdflib_binomial_cdf_values.fx_vec, i64 0, i64 %55
%57 = load double, double* %56
%58 = load double*, double** %10
store double %57, double* %58
br label %59
59: ; preds = %30, %24
ret void
}

LLVM IR (-O2):
@cdflib_binomial_cdf_values.a_vec = internal unnamed_addr constant [17 x i32] [i32 2, i32 2, i32 2, i32 2, i32 2, i32 4, i32 4, i32 4, i32 4, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10]
@cdflib_binomial_cdf_values.b_vec = internal unnamed_addr constant [17 x double] [double 5.000000e-02, double 5.000000e-02, double 5.000000e-02, double 5.000000e-01, double 5.000000e-01, double 2.500000e-01, double 2.500000e-01, double 2.500000e-01, double 2.500000e-01, double 5.000000e-02, double 1.000000e-01, double 1.500000e-01, double 2.000000e-01, double 2.500000e-01, double 3.000000e-01, double 4.000000e-01, double 5.000000e-01]
@cdflib_binomial_cdf_values.fx_vec = internal unnamed_addr constant [17 x double] [double 9.025000e-01, double 9.975000e-01, double 1.000000e+00, double 2.500000e-01, double 7.500000e-01, double 3.164000e-01, double 0x3FE7A027525460AA, double 9.492000e-01, double 0x3FEFE00D1B71758E, double 9.999000e-01, double 0x3FEFF2E48E8A71DE, double 0x3FEFAEE631F8A090, double 0x3FEEF34D6A161E4F, double 9.219000e-01, double 8.497000e-01, double 0x3FE4425AEE631F8A, double 3.770000e-01]
@cdflib_binomial_cdf_values.x_vec = internal unnamed_addr constant [17 x i32] [i32 0, i32 1, i32 2, i32 0, i32 1, i32 0, i32 1, i32 2, i32 3, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4]
define void @cdflib_binomial_cdf_values(i32* nocapture %0, i32* nocapture writeonly %1, double* nocapture writeonly %2, i32* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = load i32, i32* %0
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 1, i32* %0
br label %13
9: ; preds = %5
%10 = add nuw nsw i32 %6, 1
store i32 %10, i32* %0
%11 = icmp ugt i32 %6, 16
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 0, i32* %0
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store i32 0, i32* %3
br label %30
13: ; preds = %8, %9
%14 = phi i32 [ 0, %8 ], [ %6, %9 ]
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds [17 x i32], [17 x i32]* @cdflib_binomial_cdf_values.a_vec, i64 0, i64 %15
%17 = load i32, i32* %16
store i32 %17, i32* %1
%18 = load i32, i32* %0
%19 = add nsw i32 %18, -1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [17 x double], [17 x double]* @cdflib_binomial_cdf_values.b_vec, i64 0, i64 %20
%22 = load double, double* %21
store double %22, double* %2
%23 = getelementptr inbounds [17 x i32], [17 x i32]* @cdflib_binomial_cdf_values.x_vec, i64 0, i64 %20
%24 = load i32, i32* %23
store i32 %24, i32* %3
%25 = load i32, i32* %0
%26 = add nsw i32 %25, -1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [17 x double], [17 x double]* @cdflib_binomial_cdf_values.fx_vec, i64 0, i64 %27
%29 = load double, double* %28
br label %30
30: ; preds = %13, %12
%31 = phi double [ %29, %13 ], [ 0.000000e+00, %12 ]
store double %31, double* %4
ret void
}