#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);
double sqrt(double);
float psycho_4_spreading_function(float bark) {
  float tempx, x, tempy, temp;
  tempx = bark;
  if (tempx >= 0.5 && tempx <= 2.5) {
    temp = tempx - 0.5;
    x = 8.0 * (temp * temp - 2.0 * temp);
  } else
    x = 0.0;
  tempx += 0.474;
  tempy = 15.811389 + 7.5 * tempx - 17.5 * sqrt(1.0 + tempx * tempx);
  if (tempy <= -60.0)
    return 0.0;
  tempx = exp((x + tempy) * 0.2302585093);
  return tempx;
}


x86 assembly (clang, -O0):
<psycho_4_spreading_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11c4 <psycho_4_spreading_function+0xa4>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea5(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     11c4 <psycho_4_spreading_function+0xa4>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe82(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm0
subsd  %xmm0,%xmm1
movsd  0xe5e(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11cc <psycho_4_spreading_function+0xac>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe63(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe35(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe31(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe02(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  -0x20(%rbp),%xmm1
movsd  0xde4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdba(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1275 <psycho_4_spreading_function+0x155>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    12a7 <psycho_4_spreading_function+0x187>
movss  -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdbd(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <exp@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psycho_4_spreading_function>:
sub    $0x18,%rsp
cvtss2sd %xmm0,%xmm1
ucomiss 0xed1(%rip),%xmm0
xorps  %xmm3,%xmm3
jb     116f <psycho_4_spreading_function+0x4f>
movss  0xec8(%rip),%xmm2
ucomiss %xmm0,%xmm2
jb     116f <psycho_4_spreading_function+0x4f>
addss  0xebf(%rip),%xmm0
movaps %xmm0,%xmm2
mulss  %xmm0,%xmm2
cvtss2sd %xmm2,%xmm2
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm0
subsd  %xmm0,%xmm2
mulsd  0xea8(%rip),%xmm2
xorps  %xmm3,%xmm3
cvtsd2ss %xmm2,%xmm3
addsd  0xea1(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
mulsd  0xe93(%rip),%xmm2
addsd  0xe93(%rip),%xmm2
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xe8b(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11b5 <psycho_4_spreading_function+0x95>
sqrtsd %xmm0,%xmm0
jmp    11d2 <psycho_4_spreading_function+0xb2>
movss  %xmm3,0xc(%rsp)
movsd  %xmm2,0x10(%rsp)
call   1040 <sqrt@plt>
movsd  0x10(%rsp),%xmm2
movss  0xc(%rsp),%xmm3
mulsd  0xe5e(%rip),%xmm0
addsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0xe22(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    120f <psycho_4_spreading_function+0xef>
addss  %xmm0,%xmm3
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
mulsd  0xe3e(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x18,%rsp
jmp    1030 <exp@plt>
xorps  %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @psycho_4_spreading_function(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %3
%8 = load float, float* %3
store float %8, float* %4
%9 = load float, float* %4
%10 = fpext float %9 to double
%11 = fcmp oge double %10, 5.000000e-01
br i1 %11, label %12, label %30
12: ; preds = %1
%13 = load float, float* %4
%14 = fpext float %13 to double
%15 = fcmp ole double %14, 2.500000e+00
br i1 %15, label %16, label %30
16: ; preds = %12
%17 = load float, float* %4
%18 = fpext float %17 to double
%19 = fsub double %18, 5.000000e-01
%20 = fptrunc double %19 to float
store float %20, float* %7
%21 = load float, float* %7
%22 = load float, float* %7
%23 = fmul float %21, %22
%24 = fpext float %23 to double
%25 = load float, float* %7
%26 = fpext float %25 to double
%27 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %26, double %24)
%28 = fmul double 8.000000e+00, %27
%29 = fptrunc double %28 to float
store float %29, float* %5
br label %31
30: ; preds = %12, %1
store float 0.000000e+00, float* %5
br label %31
31: ; preds = %30, %16
%32 = load float, float* %4
%33 = fpext float %32 to double
%34 = fadd double %33, 4.740000e-01
%35 = fptrunc double %34 to float
store float %35, float* %4
%36 = load float, float* %4
%37 = fpext float %36 to double
%38 = call double @llvm.fmuladd.f64(double 7.500000e+00, double %37, double 0x402F9F6E6106AB15)
%39 = load float, float* %4
%40 = load float, float* %4
%41 = fmul float %39, %40
%42 = fpext float %41 to double
%43 = fadd double 1.000000e+00, %42
%44 = call double @sqrt(double %43)
%45 = call double @llvm.fmuladd.f64(double -1.750000e+01, double %44, double %38)
%46 = fptrunc double %45 to float
store float %46, float* %6
%47 = load float, float* %6
%48 = fpext float %47 to double
%49 = fcmp ole double %48, -6.000000e+01
br i1 %49, label %50, label %51
50: ; preds = %31
store float 0.000000e+00, float* %2
br label %60
51: ; preds = %31
%52 = load float, float* %5
%53 = load float, float* %6
%54 = fadd float %52, %53
%55 = fpext float %54 to double
%56 = fmul double %55, 0x3FCD791C5F88DBEF
%57 = fptrunc double %56 to float
%58 = call float @exp(float %57)
store float %58, float* %4
%59 = load float, float* %4
store float %59, float* %2
br label %60
60: ; preds = %51, %50
%61 = load float, float* %2
ret float %61
}

LLVM IR (-O2):
define float @psycho_4_spreading_function(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ult float %0, 5.000000e-01
%4 = fcmp ugt float %0, 2.500000e+00
%5 = or i1 %3, %4
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = fadd float %0, -5.000000e-01
%8 = fmul float %7, %7
%9 = fpext float %8 to double
%10 = fpext float %7 to double
%11 = tail call double @llvm.fmuladd.f64(double %10, double -2.000000e+00, double %9)
%12 = fmul double %11, 8.000000e+00
%13 = fptrunc double %12 to float
br label %14
14: ; preds = %1, %6
%15 = phi float [ %13, %6 ], [ 0.000000e+00, %1 ]
%16 = fadd double %2, 4.740000e-01
%17 = fptrunc double %16 to float
%18 = fpext float %17 to double
%19 = tail call double @llvm.fmuladd.f64(double %18, double 7.500000e+00, double 0x402F9F6E6106AB15)
%20 = fmul float %17, %17
%21 = fpext float %20 to double
%22 = fadd double %21, 1.000000e+00
%23 = tail call double @sqrt(double %22)
%24 = tail call double @llvm.fmuladd.f64(double %23, double -1.750000e+01, double %19)
%25 = fptrunc double %24 to float
%26 = fcmp ugt float %25, -6.000000e+01
br i1 %26, label %27, label %33
27: ; preds = %14
%28 = fadd float %15, %25
%29 = fpext float %28 to double
%30 = fmul double %29, 0x3FCD791C5F88DBEF
%31 = fptrunc double %30 to float
%32 = tail call float @exp(float %31)
br label %33
33: ; preds = %14, %27
%34 = phi float [ %32, %27 ], [ 0.000000e+00, %14 ]
ret float %34
}