void cdflib_student_cdf_values(int *n_data, int *a, double *x, double *fx) {
  enum { N_MAX = 13 };
  static const int a_vec[N_MAX] = {1, 2, 3, 4, 5, 2, 5, 2, 5, 2, 3, 4, 5};
  static const double fx_vec[N_MAX] = {
      0.60E+00, 0.60E+00, 0.60E+00, 0.60E+00, 0.60E+00, 0.75E+00, 0.75E+00,
      0.95E+00, 0.95E+00, 0.99E+00, 0.99E+00, 0.99E+00, 0.99E+00};
  static const double x_vec[N_MAX] = {
      0.325E+00, 0.289E+00, 0.277E+00, 0.271E+00, 0.267E+00,
      0.816E+00, 0.727E+00, 2.920E+00, 2.015E+00, 6.965E+00,
      4.541E+00, 3.747E+00, 3.365E+00};
  if (*n_data < 0) {
    *n_data = 0;
  }
  *n_data = *n_data + 1;
  if (N_MAX < *n_data) {
    *n_data = 0;
    *a = 0;
    *x = 0.0E+00;
    *fx = 0.0E+00;
  } else {
    *a = a_vec[*n_data - 1];
    *x = x_vec[*n_data - 1];
    *fx = fx_vec[*n_data - 1];
  }
  return;
}


x86 assembly (clang, -O0):
<cdflib_student_cdf_values>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jge    112b <cdflib_student_cdf_values+0x2b>
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    $0xd,%eax
cmp    (%rcx),%eax
jge    117a <cdflib_student_cdf_values+0x7a>
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
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    11d6 <cdflib_student_cdf_values+0xd6>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0xe73(%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    0xf07(%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    0xe77(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_student_cdf_values>:
mov    (%rdi),%r8d
test   %r8d,%r8d
js     112f <cdflib_student_cdf_values+0x2f>
lea    0x1(%r8),%eax
mov    %eax,(%rdi)
cmp    $0xd,%r8d
jb     1138 <cdflib_student_cdf_values+0x38>
movl   $0x0,(%rdi)
movl   $0x0,(%rsi)
movq   $0x0,(%rdx)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rcx)
ret
movl   $0x1,(%rdi)
xor    %r8d,%r8d
mov    %r8d,%r8d
lea    0xebe(%rip),%rax
mov    (%rax,%r8,4),%eax
mov    %eax,(%rsi)
movslq (%rdi),%rax
lea    0xf5e(%rip),%rsi
movsd  -0x8(%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rdx)
lea    0xedd(%rip),%rdx
movsd  -0x8(%rdx,%rax,8),%xmm0
movsd  %xmm0,(%rcx)
ret

LLVM IR (-O0):
@cdflib_student_cdf_values.a_vec = internal constant [13 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 2, i32 5, i32 2, i32 5, i32 2, i32 3, i32 4, i32 5]
@cdflib_student_cdf_values.fx_vec = internal constant [13 x double] [double 6.000000e-01, double 6.000000e-01, double 6.000000e-01, double 6.000000e-01, double 6.000000e-01, double 7.500000e-01, double 7.500000e-01, double 0x3FEE666666666666, double 0x3FEE666666666666, double 0x3FEFAE147AE147AE, double 0x3FEFAE147AE147AE, double 0x3FEFAE147AE147AE, double 0x3FEFAE147AE147AE]
@cdflib_student_cdf_values.x_vec = internal constant [13 x double] [double 3.250000e-01, double 2.890000e-01, double 2.770000e-01, double 2.710000e-01, double 2.670000e-01, double 8.160000e-01, double 7.270000e-01, double 2.920000e+00, double 2.015000e+00, double 0x401BDC28F5C28F5C, double 4.541000e+00, double 3.747000e+00, double 3.365000e+00]
define void @cdflib_student_cdf_values(i32* %0, i32* %1, double* %2, double* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca double*
%8 = alloca double*
store i32* %0, i32** %5
store i32* %1, i32** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = load i32*, i32** %5
store i32 0, i32* %13
br label %14
14: ; preds = %12, %4
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = add nsw i32 %16, 1
%18 = load i32*, i32** %5
store i32 %17, i32* %18
%19 = load i32*, i32** %5
%20 = load i32, i32* %19
%21 = icmp slt i32 13, %20
br i1 %21, label %22, label %27
22: ; preds = %14
%23 = load i32*, i32** %5
store i32 0, i32* %23
%24 = load i32*, i32** %6
store i32 0, i32* %24
%25 = load double*, double** %7
store double 0.000000e+00, double* %25
%26 = load double*, double** %8
store double 0.000000e+00, double* %26
br label %49
27: ; preds = %14
%28 = load i32*, i32** %5
%29 = load i32, i32* %28
%30 = sub nsw i32 %29, 1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [13 x i32], [13 x i32]* @cdflib_student_cdf_values.a_vec, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = load i32*, i32** %6
store i32 %33, i32* %34
%35 = load i32*, i32** %5
%36 = load i32, i32* %35
%37 = sub nsw i32 %36, 1
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [13 x double], [13 x double]* @cdflib_student_cdf_values.x_vec, i64 0, i64 %38
%40 = load double, double* %39
%41 = load double*, double** %7
store double %40, double* %41
%42 = load i32*, i32** %5
%43 = load i32, i32* %42
%44 = sub nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [13 x double], [13 x double]* @cdflib_student_cdf_values.fx_vec, i64 0, i64 %45
%47 = load double, double* %46
%48 = load double*, double** %8
store double %47, double* %48
br label %49
49: ; preds = %27, %22
ret void
}

LLVM IR (-O2):
@cdflib_student_cdf_values.a_vec = internal unnamed_addr constant [13 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 2, i32 5, i32 2, i32 5, i32 2, i32 3, i32 4, i32 5]
@cdflib_student_cdf_values.fx_vec = internal unnamed_addr constant [13 x double] [double 6.000000e-01, double 6.000000e-01, double 6.000000e-01, double 6.000000e-01, double 6.000000e-01, double 7.500000e-01, double 7.500000e-01, double 0x3FEE666666666666, double 0x3FEE666666666666, double 0x3FEFAE147AE147AE, double 0x3FEFAE147AE147AE, double 0x3FEFAE147AE147AE, double 0x3FEFAE147AE147AE]
@cdflib_student_cdf_values.x_vec = internal unnamed_addr constant [13 x double] [double 3.250000e-01, double 2.890000e-01, double 2.770000e-01, double 2.710000e-01, double 2.670000e-01, double 8.160000e-01, double 7.270000e-01, double 2.920000e+00, double 2.015000e+00, double 0x401BDC28F5C28F5C, double 4.541000e+00, double 3.747000e+00, double 3.365000e+00]
define void @cdflib_student_cdf_values(i32* nocapture %0, i32* nocapture writeonly %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4
store i32 1, i32* %0
br label %12
8: ; preds = %4
%9 = add nuw nsw i32 %5, 1
store i32 %9, i32* %0
%10 = icmp ugt i32 %5, 12
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 0, i32* %0
store i32 0, i32* %1
store double 0.000000e+00, double* %2
br label %24
12: ; preds = %7, %8
%13 = phi i32 [ 0, %7 ], [ %5, %8 ]
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds [13 x i32], [13 x i32]* @cdflib_student_cdf_values.a_vec, i64 0, i64 %14
%16 = load i32, i32* %15
store i32 %16, i32* %1
%17 = load i32, i32* %0
%18 = add nsw i32 %17, -1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [13 x double], [13 x double]* @cdflib_student_cdf_values.x_vec, i64 0, i64 %19
%21 = load double, double* %20
store double %21, double* %2
%22 = getelementptr inbounds [13 x double], [13 x double]* @cdflib_student_cdf_values.fx_vec, i64 0, i64 %19
%23 = load double, double* %22
br label %24
24: ; preds = %12, %11
%25 = phi double [ %23, %12 ], [ 0.000000e+00, %11 ]
store double %25, double* %3
ret void
}