#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 */
scalar_t__ ceil(double);
scalar_t__ floor(double);
double calcG11(double fracYearIndex, double fracYear) {
  static int g11[23] = {-2298, -2298, -2297,   -2306,   -2317,  -2318,
                        -2316, -2306, -2292,   -2285,   -2250,  -2215,
                        -2169, -2119, -2068,   -2013,   -1956,  -1905,
                        -1848, -1784, -1728.2, -1671.8, -1617.8};
  return (g11[(int)floor(fracYearIndex)] * (1.0 - fracYear) +
          g11[(int)ceil(fracYearIndex)] * fracYear);
}


x86 assembly (clang, -O0):
<calcG11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
movslq %eax,%rcx
lea    0x2efa(%rip),%rax
cvtsi2sdl (%rax,%rcx,4),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xea8(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movslq %eax,%rcx
lea    0x2ec0(%rip),%rax
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcG11>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x18(%rsp)
call   1040 <floor@plt>
cltq
lea    0xed1(%rip),%rbx
xorps  %xmm0,%xmm0
cvtsi2sdl (%rbx,%rax,4),%xmm0
movsd  0xeb1(%rip),%xmm1
subsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <ceil@plt>
cltq
xorps  %xmm0,%xmm0
cvtsi2sdl (%rbx,%rax,4),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@calcG11.g11 = internal global [23 x i32] [i32 -2298, i32 -2298, i32 -2297, i32 -2306, i32 -2317, i32 -2318, i32 -2316, i32 -2306, i32 -2292, i32 -2285, i32 -2250, i32 -2215, i32 -2169, i32 -2119, i32 -2068, i32 -2013, i32 -1956, i32 -1905, i32 -1848, i32 -1784, i32 -1728, i32 -1671, i32 -1617]
define double @calcG11(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call i64 @floor(double %5)
%7 = trunc i64 %6 to i32
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [23 x i32], [23 x i32]* @calcG11.g11, i64 0, i64 %8
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
%12 = load double, double* %4
%13 = fsub double 1.000000e+00, %12
%14 = load double, double* %3
%15 = call i64 @ceil(double %14)
%16 = trunc i64 %15 to i32
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [23 x i32], [23 x i32]* @calcG11.g11, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = sitofp i32 %19 to double
%21 = load double, double* %4
%22 = fmul double %20, %21
%23 = call double @llvm.fmuladd.f64(double %11, double %13, double %22)
ret double %23
}

LLVM IR (-O2):
@calcG11.g11 = internal unnamed_addr constant [23 x i32] [i32 -2298, i32 -2298, i32 -2297, i32 -2306, i32 -2317, i32 -2318, i32 -2316, i32 -2306, i32 -2292, i32 -2285, i32 -2250, i32 -2215, i32 -2169, i32 -2119, i32 -2068, i32 -2013, i32 -1956, i32 -1905, i32 -1848, i32 -1784, i32 -1728, i32 -1671, i32 -1617]
define double @calcG11(double %0, double %1) {
%3 = tail call i64 @floor(double %0)
%4 = shl i64 %3, 32
%5 = ashr exact i64 %4, 32
%6 = getelementptr inbounds [23 x i32], [23 x i32]* @calcG11.g11, i64 0, i64 %5
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fsub double 1.000000e+00, %1
%10 = tail call i64 @ceil(double %0)
%11 = shl i64 %10, 32
%12 = ashr exact i64 %11, 32
%13 = getelementptr inbounds [23 x i32], [23 x i32]* @calcG11.g11, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = sitofp i32 %14 to double
%16 = fmul double %15, %1
%17 = tail call double @llvm.fmuladd.f64(double %8, double %9, double %16)
ret double %17
}