#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 exp(double);
double sqrt(double);
double psycho_4_spreading_function(double bark) {
  double 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    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xebc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11c3 <psycho_4_spreading_function+0xa3>
movsd  0xeb2(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     11c3 <psycho_4_spreading_function+0xa3>
movsd  -0x18(%rbp),%xmm0
movsd  0xe92(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  0xe8f(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe5b(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11cb <psycho_4_spreading_function+0xab>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe75(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe4e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe4a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe1b(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  -0x38(%rbp),%xmm1
movsd  0xdfd(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xde0(%rip),%xmm0
ucomisd -0x28(%rbp),%xmm0
jb     1258 <psycho_4_spreading_function+0x138>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1282 <psycho_4_spreading_function+0x162>
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  0xde6(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psycho_4_spreading_function>:
sub    $0x18,%rsp
ucomisd 0xed4(%rip),%xmm0
xorpd  %xmm1,%xmm1
xorpd  %xmm3,%xmm3
jb     116c <psycho_4_spreading_function+0x4c>
movsd  0xeca(%rip),%xmm2
ucomisd %xmm0,%xmm2
xorpd  %xmm3,%xmm3
jb     116c <psycho_4_spreading_function+0x4c>
movsd  0xec0(%rip),%xmm3
addsd  %xmm0,%xmm3
movapd %xmm3,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm3,%xmm3
subsd  %xmm2,%xmm3
mulsd  0xeac(%rip),%xmm3
addsd  0xeac(%rip),%xmm0
movsd  0xeac(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xea8(%rip),%xmm2
mulsd  %xmm0,%xmm0
addsd  0xea4(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     11a0 <psycho_4_spreading_function+0x80>
sqrtsd %xmm0,%xmm0
jmp    11bd <psycho_4_spreading_function+0x9d>
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm3
mulsd  0xe7b(%rip),%xmm0
addsd  %xmm2,%xmm0
movsd  0xe77(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    11f0 <psycho_4_spreading_function+0xd0>
addsd  %xmm0,%xmm3
mulsd  0xe6d(%rip),%xmm3
movapd %xmm3,%xmm0
add    $0x18,%rsp
jmp    1030 <exp@plt>
xorpd  %xmm0,%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @psycho_4_spreading_function(double %0) {
%2 = fcmp oge double %0, 5.000000e-01
%3 = fcmp ole double %0, 2.500000e+00
%4 = and i1 %2, %3
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = fadd double %0, -5.000000e-01
%7 = fmul double %6, -2.000000e+00
%8 = tail call double @llvm.fmuladd.f64(double %6, double %6, double %7)
%9 = fmul double %8, 8.000000e+00
br label %10
10: ; preds = %1, %5
%11 = phi double [ %9, %5 ], [ 0.000000e+00, %1 ]
%12 = fadd double %0, 4.740000e-01
%13 = tail call double @llvm.fmuladd.f64(double %12, double 7.500000e+00, double 0x402F9F6E6106AB15)
%14 = tail call double @llvm.fmuladd.f64(double %12, double %12, double 1.000000e+00)
%15 = tail call double @sqrt(double %14)
%16 = tail call double @llvm.fmuladd.f64(double %15, double -1.750000e+01, double %13)
%17 = fcmp ugt double %16, -6.000000e+01
br i1 %17, label %18, label %22
18: ; preds = %10
%19 = fadd double %11, %16
%20 = fmul double %19, 0x3FCD791C5F88DBEF
%21 = tail call double @exp(double %20)
br label %22
22: ; preds = %10, %18
%23 = phi double [ %21, %18 ], [ 0.000000e+00, %10 ]
ret double %23
}