#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 exp(float);
float kernel_function(float r, float h) {
  float q = r / h;
  float alpha = 1. / (5.56832799683 * h * h * h);
  if (q >= 2.) {
    return 0.;
  } else {
    return alpha * exp(-q * q);
  }
}


x86 assembly (clang, -O0):
<kernel_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xece(%rip),%xmm1
mulsd  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xea0(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe7a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     119d <kernel_function+0x8d>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11d4 <kernel_function+0xc4>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_function>:
push   %rax
divss  %xmm1,%xmm0
xorps  %xmm2,%xmm2
ucomiss 0xee1(%rip),%xmm0
jae    116e <kernel_function+0x5e>
cvtss2sd %xmm1,%xmm1
movsd  0xedb(%rip),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movsd  0xecf(%rip),%xmm1
divsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0x4(%rsp)
movaps 0xeca(%rip),%xmm1
xorps  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm2
mulss  0x4(%rsp),%xmm2
movaps %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @kernel_function(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fdiv float %8, %9
store float %10, float* %6
%11 = load float, float* %5
%12 = fpext float %11 to double
%13 = fmul double 0x401645F7C63F24E8, %12
%14 = load float, float* %5
%15 = fpext float %14 to double
%16 = fmul double %13, %15
%17 = load float, float* %5
%18 = fpext float %17 to double
%19 = fmul double %16, %18
%20 = fdiv double 1.000000e+00, %19
%21 = fptrunc double %20 to float
store float %21, float* %7
%22 = load float, float* %6
%23 = fpext float %22 to double
%24 = fcmp oge double %23, 2.000000e+00
br i1 %24, label %25, label %26
25: ; preds = %2
store float 0.000000e+00, float* %3
br label %34
26: ; preds = %2
%27 = load float, float* %7
%28 = load float, float* %6
%29 = fneg float %28
%30 = load float, float* %6
%31 = fmul float %29, %30
%32 = call float @exp(float %31)
%33 = fmul float %27, %32
store float %33, float* %3
br label %34
34: ; preds = %26, %25
%35 = load float, float* %3
ret float %35
}

LLVM IR (-O2):
define float @kernel_function(float %0, float %1) {
%3 = fdiv float %0, %1
%4 = fpext float %1 to double
%5 = fcmp ult float %3, 2.000000e+00
br i1 %5, label %6, label %16
6: ; preds = %2
%7 = fmul double %4, 0x401645F7C63F24E8
%8 = fmul double %7, %4
%9 = fmul double %8, %4
%10 = fdiv double 1.000000e+00, %9
%11 = fptrunc double %10 to float
%12 = fneg float %3
%13 = fmul float %3, %12
%14 = tail call float @exp(float %13)
%15 = fmul float %14, %11
br label %16
16: ; preds = %2, %6
%17 = phi float [ %15, %6 ], [ 0.000000e+00, %2 ]
ret float %17
}