#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 calcH11(double fracYearIndex, double fracYear) {
  static int h11[23] = {5922, 5909, 5898, 5875, 5845,   5817,   5808,  5812,
                        5821, 5810, 5815, 5820, 5791,   5776,   5737,  5675,
                        5604, 5500, 5406, 5306, 5186.1, 5080.0, 4973.5};
  return (h11[(int)floor(fracYearIndex)] * (1.0 - fracYear) +
          h11[(int)ceil(fracYearIndex)] * fracYear);
}


x86 assembly (clang, -O0):
<calcH11>:
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):
<calcH11>:
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):
@calcH11.h11 = internal global [23 x i32] [i32 5922, i32 5909, i32 5898, i32 5875, i32 5845, i32 5817, i32 5808, i32 5812, i32 5821, i32 5810, i32 5815, i32 5820, i32 5791, i32 5776, i32 5737, i32 5675, i32 5604, i32 5500, i32 5406, i32 5306, i32 5186, i32 5080, i32 4973]
define double @calcH11(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]* @calcH11.h11, 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]* @calcH11.h11, 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):
@calcH11.h11 = internal unnamed_addr constant [23 x i32] [i32 5922, i32 5909, i32 5898, i32 5875, i32 5845, i32 5817, i32 5808, i32 5812, i32 5821, i32 5810, i32 5815, i32 5820, i32 5791, i32 5776, i32 5737, i32 5675, i32 5604, i32 5500, i32 5406, i32 5306, i32 5186, i32 5080, i32 4973]
define double @calcH11(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]* @calcH11.h11, 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]* @calcH11.h11, 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
}