#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 */
float floorf(float);
int sqrtf(float);
float hypergeom_gain(float x) {
  int ind;
  float integer, frac;
  static float table[21] = {
      0.82157, 1.02017, 1.20461, 1.37534, 1.53363, 1.68092, 1.81865,
      1.94811, 2.07038, 2.18638, 2.29688, 2.40255, 2.50391, 2.60144,
      2.69551, 2.78647, 2.87458, 2.96015, 3.04333, 3.12431, 3.20326};
  if (x > 9.5)
    return 1 + .12 / x;
  integer = floorf(x);
  frac = x - integer;
  ind = (int)integer;
  return ((1 - frac) * table[ind] + frac * table[ind + 1]) / sqrtf(x + .0001);
}


x86 assembly (clang, -O0):
<hypergeom_gain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1177 <hypergeom_gain+0x57>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebf(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xeab(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1211 <hypergeom_gain+0xf1>
movss  -0x8(%rbp),%xmm0
call   1030 <floorf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
cvttss2si -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
movss  0xe7b(%rip),%xmm0
subss  -0x14(%rbp),%xmm0
movslq -0xc(%rbp),%rcx
lea    0x2e8b(%rip),%rax
movss  (%rax,%rcx,4),%xmm2
movss  -0x14(%rbp),%xmm1
mov    -0xc(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    0x2e71(%rip),%rax
mulss  (%rax,%rcx,4),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe16(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <sqrtf@plt>
movss  -0x18(%rbp),%xmm0
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hypergeom_gain>:
sub    $0x18,%rsp
cvtss2sd %xmm0,%xmm1
ucomiss 0xed1(%rip),%xmm0
jbe    114e <hypergeom_gain+0x2e>
movsd  0xed7(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  0xed3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x18,%rsp
ret
movss  %xmm0,0xc(%rsp)
movsd  %xmm1,0x10(%rsp)
call   1030 <floorf@plt>
movss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm1
cvttss2si %xmm0,%eax
movss  0xe8f(%rip),%xmm0
subss  %xmm1,%xmm0
cltq
lea    0xe9e(%rip),%rcx
mulss  0x4(%rcx,%rax,4),%xmm1
mulss  (%rcx,%rax,4),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0xe63(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <sqrtf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0xc(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@hypergeom_gain.table = internal global [21 x float] [float 0x3FEA4A4D20000000, float 0x3FF0529DC0000000, float 0x3FF3461520000000, float 0x3FF6016480000000, float 0x3FF889BFA0000000, float 0x3FFAE50C60000000, float 0x3FFD1930C0000000, float 0x3FFF2B7560000000, float 0x4000902360000000, float 0x40017DB4C0000000, float 0x40026002A0000000, float 0x4003386C20000000, float 0x4004080200000000, float 0x4004CFBFC0000000, float 0x4005906780000000, float 0x40064AB0C0000000, float 0x4006FF23C0000000, float 0x4007AE6320000000, float 0x400858BD60000000, float 0x4008FE9640000000, float 0x4009A046C0000000]
define float @hypergeom_gain(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca float
%6 = alloca float
store float %0, float* %3
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fcmp ogt double %8, 9.500000e+00
br i1 %9, label %10, label %16
10: ; preds = %1
%11 = load float, float* %3
%12 = fpext float %11 to double
%13 = fdiv double 1.200000e-01, %12
%14 = fadd double 1.000000e+00, %13
%15 = fptrunc double %14 to float
store float %15, float* %2
br label %45
16: ; preds = %1
%17 = load float, float* %3
%18 = call float @llvm.floor.f32(float %17)
store float %18, float* %5
%19 = load float, float* %3
%20 = load float, float* %5
%21 = fsub float %19, %20
store float %21, float* %6
%22 = load float, float* %5
%23 = fptosi float %22 to i32
store i32 %23, i32* %4
%24 = load float, float* %6
%25 = fsub float 1.000000e+00, %24
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [21 x float], [21 x float]* @hypergeom_gain.table, i64 0, i64 %27
%29 = load float, float* %28
%30 = load float, float* %6
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [21 x float], [21 x float]* @hypergeom_gain.table, i64 0, i64 %33
%35 = load float, float* %34
%36 = fmul float %30, %35
%37 = call float @llvm.fmuladd.f32(float %25, float %29, float %36)
%38 = load float, float* %3
%39 = fpext float %38 to double
%40 = fadd double %39, 1.000000e-04
%41 = fptrunc double %40 to float
%42 = call i32 @sqrtf(float %41)
%43 = sitofp i32 %42 to float
%44 = fdiv float %37, %43
store float %44, float* %2
br label %45
45: ; preds = %16, %10
%46 = load float, float* %2
ret float %46
}

LLVM IR (-O2):
@hypergeom_gain.table = internal unnamed_addr constant [21 x float] [float 0x3FEA4A4D20000000, float 0x3FF0529DC0000000, float 0x3FF3461520000000, float 0x3FF6016480000000, float 0x3FF889BFA0000000, float 0x3FFAE50C60000000, float 0x3FFD1930C0000000, float 0x3FFF2B7560000000, float 0x4000902360000000, float 0x40017DB4C0000000, float 0x40026002A0000000, float 0x4003386C20000000, float 0x4004080200000000, float 0x4004CFBFC0000000, float 0x4005906780000000, float 0x40064AB0C0000000, float 0x4006FF23C0000000, float 0x4007AE6320000000, float 0x400858BD60000000, float 0x4008FE9640000000, float 0x4009A046C0000000]
define float @hypergeom_gain(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ogt float %0, 9.500000e+00
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = fdiv double 1.200000e-01, %2
%6 = fadd double %5, 1.000000e+00
%7 = fptrunc double %6 to float
br label %27
8: ; preds = %1
%9 = tail call float @llvm.floor.f32(float %0)
%10 = fsub float %0, %9
%11 = fptosi float %9 to i32
%12 = fsub float 1.000000e+00, %10
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds [21 x float], [21 x float]* @hypergeom_gain.table, i64 0, i64 %13
%15 = load float, float* %14
%16 = add nsw i32 %11, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [21 x float], [21 x float]* @hypergeom_gain.table, i64 0, i64 %17
%19 = load float, float* %18
%20 = fmul float %10, %19
%21 = tail call float @llvm.fmuladd.f32(float %12, float %15, float %20)
%22 = fadd double %2, 1.000000e-04
%23 = fptrunc double %22 to float
%24 = tail call i32 @sqrtf(float %23)
%25 = sitofp i32 %24 to float
%26 = fdiv float %21, %25
br label %27
27: ; preds = %8, %4
%28 = phi float [ %7, %4 ], [ %26, %8 ]
ret float %28
}