void cdflib_erf_values(int *n_data, double *x, double *fx) {
  enum { N_MAX = 21 };
  static const double fx_vec[N_MAX] = {
      0.0000000000E+00, 0.1124629160E+00, 0.2227025892E+00, 0.3286267595E+00,
      0.4283923550E+00, 0.5204998778E+00, 0.6038560908E+00, 0.6778011938E+00,
      0.7421009647E+00, 0.7969082124E+00, 0.8427007929E+00, 0.8802050696E+00,
      0.9103139782E+00, 0.9340079449E+00, 0.9522851198E+00, 0.9661051465E+00,
      0.9763483833E+00, 0.9837904586E+00, 0.9890905016E+00, 0.9927904292E+00,
      0.9953222650E+00};
  static const double x_vec[N_MAX] = {
      0.0E+00, 0.1E+00, 0.2E+00, 0.3E+00, 0.4E+00, 0.5E+00, 0.6E+00,
      0.7E+00, 0.8E+00, 0.9E+00, 1.0E+00, 1.1E+00, 1.2E+00, 1.3E+00,
      1.4E+00, 1.5E+00, 1.6E+00, 1.7E+00, 1.8E+00, 1.9E+00, 2.0E+00};
  if (*n_data < 0) {
    *n_data = 0;
  }
  *n_data = *n_data + 1;
  if (N_MAX < *n_data) {
    *n_data = 0;
    *x = 0.0E+00;
    *fx = 0.0E+00;
  } else {
    *x = x_vec[*n_data - 1];
    *fx = fx_vec[*n_data - 1];
  }
  return;
}


x86 assembly (clang, -O0):
<cdflib_erf_values>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jge    1127 <cdflib_erf_values+0x27>
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    $0x15,%eax
cmp    (%rcx),%eax
jge    116c <cdflib_erf_values+0x6c>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    11ac <cdflib_erf_values+0xac>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0xf31(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0xe61(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_erf_values>:
mov    (%rdi),%eax
test   %eax,%eax
js     1125 <cdflib_erf_values+0x25>
lea    0x1(%rax),%ecx
mov    %ecx,(%rdi)
cmp    $0x15,%eax
jb     112d <cdflib_erf_values+0x2d>
movl   $0x0,(%rdi)
movq   $0x0,(%rsi)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rdx)
ret
movl   $0x1,(%rdi)
xor    %eax,%eax
mov    %eax,%eax
lea    0xf7a(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,(%rsi)
lea    0xeba(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,(%rdx)
ret

LLVM IR (-O0):
@cdflib_erf_values.fx_vec = internal constant [21 x double] [double 0.000000e+00, double 0x3FBCCA5EA23B9876, double 0x3FCC8184B8AC9C65, double 0x3FD5083888292636, double 0x3FDB6AC7C4A53605, double 0x3FE0A7EF5C1722C9, double 0x3FE352CA022F3EB9, double 0x3FE5B08C2111F1BB, double 0x3FE7BF4A85B6EDFB, double 0x3FE98045A6C57F90, double 0x3FEAF767A73A335B, double 0x3FEC2AA3D27692AB, double 0x3FED214AC7AEBDB4, double 0x3FEDE364A13196E6, double 0x3FEE791EA4C04528, double 0x3FEEEA555716DF8D, double 0x3FEF3E3EF6F8D4C4, double 0x3FEF7B3620B9B913, double 0x3FEFA6A11FA4FFE2, double 0x3FEFC4F06F264406, double 0x3FEFD9AE1424FB0C]
@cdflib_erf_values.x_vec = internal constant [21 x double] [double 0.000000e+00, double 1.000000e-01, double 2.000000e-01, double 3.000000e-01, double 4.000000e-01, double 5.000000e-01, double 6.000000e-01, double 0x3FE6666666666666, double 8.000000e-01, double 9.000000e-01, double 1.000000e+00, double 1.100000e+00, double 1.200000e+00, double 1.300000e+00, double 1.400000e+00, double 1.500000e+00, double 1.600000e+00, double 1.700000e+00, double 1.800000e+00, double 1.900000e+00, double 2.000000e+00]
define void @cdflib_erf_values(i32* %0, double* %1, double* %2) {
%4 = alloca i32*
%5 = alloca double*
%6 = alloca double*
store i32* %0, i32** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32*, i32** %4
store i32 0, i32* %11
br label %12
12: ; preds = %10, %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
%16 = load i32*, i32** %4
store i32 %15, i32* %16
%17 = load i32*, i32** %4
%18 = load i32, i32* %17
%19 = icmp slt i32 21, %18
br i1 %19, label %20, label %24
20: ; preds = %12
%21 = load i32*, i32** %4
store i32 0, i32* %21
%22 = load double*, double** %5
store double 0.000000e+00, double* %22
%23 = load double*, double** %6
store double 0.000000e+00, double* %23
br label %39
24: ; preds = %12
%25 = load i32*, i32** %4
%26 = load i32, i32* %25
%27 = sub nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [21 x double], [21 x double]* @cdflib_erf_values.x_vec, i64 0, i64 %28
%30 = load double, double* %29
%31 = load double*, double** %5
store double %30, double* %31
%32 = load i32*, i32** %4
%33 = load i32, i32* %32
%34 = sub nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [21 x double], [21 x double]* @cdflib_erf_values.fx_vec, i64 0, i64 %35
%37 = load double, double* %36
%38 = load double*, double** %6
store double %37, double* %38
br label %39
39: ; preds = %24, %20
ret void
}

LLVM IR (-O2):
@cdflib_erf_values.fx_vec = internal unnamed_addr constant [21 x double] [double 0.000000e+00, double 0x3FBCCA5EA23B9876, double 0x3FCC8184B8AC9C65, double 0x3FD5083888292636, double 0x3FDB6AC7C4A53605, double 0x3FE0A7EF5C1722C9, double 0x3FE352CA022F3EB9, double 0x3FE5B08C2111F1BB, double 0x3FE7BF4A85B6EDFB, double 0x3FE98045A6C57F90, double 0x3FEAF767A73A335B, double 0x3FEC2AA3D27692AB, double 0x3FED214AC7AEBDB4, double 0x3FEDE364A13196E6, double 0x3FEE791EA4C04528, double 0x3FEEEA555716DF8D, double 0x3FEF3E3EF6F8D4C4, double 0x3FEF7B3620B9B913, double 0x3FEFA6A11FA4FFE2, double 0x3FEFC4F06F264406, double 0x3FEFD9AE1424FB0C]
@cdflib_erf_values.x_vec = internal unnamed_addr constant [21 x double] [double 0.000000e+00, double 1.000000e-01, double 2.000000e-01, double 3.000000e-01, double 4.000000e-01, double 5.000000e-01, double 6.000000e-01, double 0x3FE6666666666666, double 8.000000e-01, double 9.000000e-01, double 1.000000e+00, double 1.100000e+00, double 1.200000e+00, double 1.300000e+00, double 1.400000e+00, double 1.500000e+00, double 1.600000e+00, double 1.700000e+00, double 1.800000e+00, double 1.900000e+00, double 2.000000e+00]
define void @cdflib_erf_values(i32* nocapture %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
store i32 1, i32* %0
br label %11
7: ; preds = %3
%8 = add nuw nsw i32 %4, 1
store i32 %8, i32* %0
%9 = icmp ugt i32 %4, 20
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 0, i32* %0
store double 0.000000e+00, double* %1
br label %18
11: ; preds = %6, %7
%12 = phi i32 [ 0, %6 ], [ %4, %7 ]
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds [21 x double], [21 x double]* @cdflib_erf_values.x_vec, i64 0, i64 %13
%15 = load double, double* %14
store double %15, double* %1
%16 = getelementptr inbounds [21 x double], [21 x double]* @cdflib_erf_values.fx_vec, i64 0, i64 %13
%17 = load double, double* %16
br label %18
18: ; preds = %11, %10
%19 = phi double [ %17, %11 ], [ 0.000000e+00, %10 ]
store double %19, double* %2
ret void
}