void cdflib_gamma_values(int *n_data, double *x, double *fx) {
  enum { N_MAX = 18 };
  static const double fx_vec[N_MAX] = {
      4.590845E+00,     2.218160E+00,     1.489192E+00,     1.164230E+00,
      1.0000000000E+00, 0.9513507699E+00, 0.9181687424E+00, 0.8974706963E+00,
      0.8872638175E+00, 0.8862269255E+00, 0.8935153493E+00, 0.9086387329E+00,
      0.9313837710E+00, 0.9617658319E+00, 1.0000000000E+00, 3.6288000E+05,
      1.2164510E+17,    8.8417620E+30};
  static const double x_vec[N_MAX] = {
      0.2E+00, 0.4E+00, 0.6E+00, 0.8E+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, 10.0E+00, 20.0E+00, 30.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_gamma_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_gamma_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    $0x12,%eax
cmp    (%rcx),%eax
jge    116c <cdflib_gamma_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_gamma_values+0xac>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0xf11(%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_gamma_values>:
mov    (%rdi),%eax
test   %eax,%eax
js     1125 <cdflib_gamma_values+0x25>
lea    0x1(%rax),%ecx
mov    %ecx,(%rdi)
cmp    $0x12,%eax
jb     112d <cdflib_gamma_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    0xf5a(%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_gamma_values.fx_vec = internal constant [18 x double] [double 0x40125D0678C0053E, double 2.218160e+00, double 0x3FF7D3BAFD976FF4, double 1.164230e+00, double 1.000000e+00, double 0x3FEE71772B77D665, double 0x3FED61A36A1A288A, double 0x3FECB81477374257, double 0x3FEC647716E2C588, double 0x3FEC5BF891BB6D99, double 0x3FEC97AD8076F5E5, double 0x3FED13918935E66F, double 0x3FEDCDE5568F0B7F, double 0x3FEEC6C9234D76A6, double 1.000000e+00, double 3.628800e+05, double 0x437B02B92EE2AB80, double 0x465BE65186DC7F4B]
@cdflib_gamma_values.x_vec = internal constant [18 x double] [double 2.000000e-01, double 4.000000e-01, double 6.000000e-01, double 8.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, double 1.000000e+01, double 2.000000e+01, double 3.000000e+01]
define void @cdflib_gamma_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 18, %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 [18 x double], [18 x double]* @cdflib_gamma_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 [18 x double], [18 x double]* @cdflib_gamma_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_gamma_values.fx_vec = internal unnamed_addr constant [18 x double] [double 0x40125D0678C0053E, double 2.218160e+00, double 0x3FF7D3BAFD976FF4, double 1.164230e+00, double 1.000000e+00, double 0x3FEE71772B77D665, double 0x3FED61A36A1A288A, double 0x3FECB81477374257, double 0x3FEC647716E2C588, double 0x3FEC5BF891BB6D99, double 0x3FEC97AD8076F5E5, double 0x3FED13918935E66F, double 0x3FEDCDE5568F0B7F, double 0x3FEEC6C9234D76A6, double 1.000000e+00, double 3.628800e+05, double 0x437B02B92EE2AB80, double 0x465BE65186DC7F4B]
@cdflib_gamma_values.x_vec = internal unnamed_addr constant [18 x double] [double 2.000000e-01, double 4.000000e-01, double 6.000000e-01, double 8.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, double 1.000000e+01, double 2.000000e+01, double 3.000000e+01]
define void @cdflib_gamma_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, 17
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 [18 x double], [18 x double]* @cdflib_gamma_values.x_vec, i64 0, i64 %13
%15 = load double, double* %14
store double %15, double* %1
%16 = getelementptr inbounds [18 x double], [18 x double]* @cdflib_gamma_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
}