#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 */
int bessi0(double);
double bessi1(double);
double exp(double);
double Epsi(double snr) {
  double val;
  val = 2 + snr * snr -
        (3.1415926535 / 8) * exp(-(snr * snr) / 2) *
            ((2 + snr * snr) * bessi0((snr * snr) / 4) +
             (snr * snr) * bessi1((snr * snr) / 4)) *
            ((2 + snr * snr) * bessi0((snr * snr) / 4) +
             (snr * snr) * bessi1((snr * snr) / 4));
  if (val < 0.001)
    val = 1;
  if (val > 10)
    val = 1;
  return val;
}


x86 assembly (clang, -O0):
<Epsi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebd(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe8b(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe7f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe58(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe35(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <bessi0@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe02(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <bessi1@plt>
movsd  -0x58(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm3
movaps %xmm0,%xmm4
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdbf(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xd9c(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <bessi0@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xd69(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <bessi1@plt>
movsd  -0x38(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm4
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm5
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm5,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xd04(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1314 <Epsi+0x1e4>
movsd  0xd11(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xd07(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1338 <Epsi+0x208>
movsd  0xced(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Epsi>:
sub    $0x48,%rsp
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0xeb6(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0xeac(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <exp@plt>
movapd %xmm0,0x30(%rsp)
movsd  0xe9d(%rip),%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1040 <bessi0@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <bessi1@plt>
mulsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <bessi0@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <bessi1@plt>
mulsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movapd 0x30(%rsp),%xmm0
mulsd  0xe15(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
movapd %xmm0,%xmm2
cmpltsd 0xdfe(%rip),%xmm1
movapd %xmm1,%xmm0
andnpd %xmm2,%xmm0
movsd  0xdf6(%rip),%xmm2
andpd  %xmm2,%xmm1
orpd   %xmm0,%xmm1
movsd  0xdee(%rip),%xmm0
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm1,%xmm3
andpd  %xmm2,%xmm0
orpd   %xmm3,%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define double @Epsi(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double 2.000000e+00)
%7 = load double, double* %2
%8 = load double, double* %2
%9 = fmul double %7, %8
%10 = fneg double %9
%11 = fdiv double %10, 2.000000e+00
%12 = call double @exp(double %11)
%13 = fmul double 0x3FD921FB54411744, %12
%14 = load double, double* %2
%15 = load double, double* %2
%16 = call double @llvm.fmuladd.f64(double %14, double %15, double 2.000000e+00)
%17 = load double, double* %2
%18 = load double, double* %2
%19 = fmul double %17, %18
%20 = fdiv double %19, 4.000000e+00
%21 = call i32 @bessi0(double %20)
%22 = sitofp i32 %21 to double
%23 = load double, double* %2
%24 = load double, double* %2
%25 = fmul double %23, %24
%26 = load double, double* %2
%27 = load double, double* %2
%28 = fmul double %26, %27
%29 = fdiv double %28, 4.000000e+00
%30 = call double @bessi1(double %29)
%31 = fmul double %25, %30
%32 = call double @llvm.fmuladd.f64(double %16, double %22, double %31)
%33 = fmul double %13, %32
%34 = load double, double* %2
%35 = load double, double* %2
%36 = call double @llvm.fmuladd.f64(double %34, double %35, double 2.000000e+00)
%37 = load double, double* %2
%38 = load double, double* %2
%39 = fmul double %37, %38
%40 = fdiv double %39, 4.000000e+00
%41 = call i32 @bessi0(double %40)
%42 = sitofp i32 %41 to double
%43 = load double, double* %2
%44 = load double, double* %2
%45 = fmul double %43, %44
%46 = load double, double* %2
%47 = load double, double* %2
%48 = fmul double %46, %47
%49 = fdiv double %48, 4.000000e+00
%50 = call double @bessi1(double %49)
%51 = fmul double %45, %50
%52 = call double @llvm.fmuladd.f64(double %36, double %42, double %51)
%53 = fneg double %33
%54 = call double @llvm.fmuladd.f64(double %53, double %52, double %6)
store double %54, double* %3
%55 = load double, double* %3
%56 = fcmp olt double %55, 1.000000e-03
br i1 %56, label %57, label %58
57: ; preds = %1
store double 1.000000e+00, double* %3
br label %58
58: ; preds = %57, %1
%59 = load double, double* %3
%60 = fcmp ogt double %59, 1.000000e+01
br i1 %60, label %61, label %62
61: ; preds = %58
store double 1.000000e+00, double* %3
br label %62
62: ; preds = %61, %58
%63 = load double, double* %3
ret double %63
}

LLVM IR (-O2):
define double @Epsi(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 2.000000e+00)
%3 = fmul double %0, %0
%4 = fmul double %3, -5.000000e-01
%5 = tail call double @exp(double %4)
%6 = fmul double %3, 2.500000e-01
%7 = tail call i32 @bessi0(double %6)
%8 = sitofp i32 %7 to double
%9 = tail call double @bessi1(double %6)
%10 = fmul double %3, %9
%11 = tail call double @llvm.fmuladd.f64(double %2, double %8, double %10)
%12 = tail call i32 @bessi0(double %6)
%13 = sitofp i32 %12 to double
%14 = tail call double @bessi1(double %6)
%15 = fmul double %3, %14
%16 = tail call double @llvm.fmuladd.f64(double %2, double %13, double %15)
%17 = fmul double %5, 0xBFD921FB54411744
%18 = fmul double %17, %11
%19 = tail call double @llvm.fmuladd.f64(double %18, double %16, double %2)
%20 = fcmp olt double %19, 1.000000e-03
%21 = select i1 %20, double 1.000000e+00, double %19
%22 = fcmp ogt double %21, 1.000000e+01
%23 = select i1 %22, double 1.000000e+00, double %21
ret double %23
}