#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 */
double const interp2_k_gaussian0(double, double const);
double pow(double, double);
double sqrt(double);
double interp2_k_gaussian6(double x) {
  const double GAMMA_2 =
      (1.0 / (2.0 * (22.0 / 7.0))) * pow((1.0 / sqrt(2.0)), 2.0);
  double result = 0.0;
  if ((x >= 0.0) && (x < 3.0)) {
    result = interp2_k_gaussian0(x, (2.0 * GAMMA_2)) -
             (GAMMA_2 * interp2_k_gaussian0(x, GAMMA_2));
  }
  return result;
}


x86 assembly (clang, -O0):
<interp2_k_gaussian6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xec3(%rip),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xebb(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xea7(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe8f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     120d <interp2_k_gaussian6+0xdd>
movsd  0xe7c(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    120d <interp2_k_gaussian6+0xdd>
movsd  -0x8(%rbp),%xmm0
movsd  0xe54(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
call   1030 <interp2_k_gaussian0@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <interp2_k_gaussian0@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interp2_k_gaussian6>:
sub    $0x18,%rsp
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     116b <interp2_k_gaussian6+0x5b>
movsd  0xeda(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    116b <interp2_k_gaussian6+0x5b>
movsd  0xed4(%rip),%xmm1
movsd  %xmm0,0x8(%rsp)
call   1030 <interp2_k_gaussian0@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0xec3(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1030 <interp2_k_gaussian0@plt>
mulsd  0xeb8(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret
xorpd  %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @interp2_k_gaussian6(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = call double @sqrt(double 2.000000e+00)
%6 = fdiv double 1.000000e+00, %5
%7 = call double @pow(double %6, double 2.000000e+00)
%8 = fmul double 0x3FC45D1745D1745D, %7
store double %8, double* %3
store double 0.000000e+00, double* %4
%9 = load double, double* %2
%10 = fcmp oge double %9, 0.000000e+00
br i1 %10, label %11, label %25
11: ; preds = %1
%12 = load double, double* %2
%13 = fcmp olt double %12, 3.000000e+00
br i1 %13, label %14, label %25
14: ; preds = %11
%15 = load double, double* %2
%16 = load double, double* %3
%17 = fmul double 2.000000e+00, %16
%18 = call double @interp2_k_gaussian0(double %15, double %17)
%19 = load double, double* %3
%20 = load double, double* %2
%21 = load double, double* %3
%22 = call double @interp2_k_gaussian0(double %20, double %21)
%23 = fneg double %19
%24 = call double @llvm.fmuladd.f64(double %23, double %22, double %18)
store double %24, double* %4
br label %25
25: ; preds = %14, %11, %1
%26 = load double, double* %4
ret double %26
}

LLVM IR (-O2):
define double @interp2_k_gaussian6(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = fcmp olt double %0, 3.000000e+00
%4 = and i1 %2, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call double @interp2_k_gaussian0(double %0, double 0x3FC45D1745D1745C)
%7 = tail call double @interp2_k_gaussian0(double %0, double 0x3FB45D1745D1745C)
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0xBFB45D1745D1745C, double %6)
br label %9
9: ; preds = %5, %1
%10 = phi double [ %8, %5 ], [ 0.000000e+00, %1 ]
ret double %10
}