#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 M_PI;
int cos(double);
double exp(double);
double pow(int, double);
double sqrt(int);
double err_bound(int N, double K, double d, double mu) {
  double pdm = sqrt(M_PI * d * mu);
  double sqn = sqrt(N);
  double val = 1.0;
  val += 2.0 / (pdm * (1 - exp(-2 * pdm)) * pow(cos(d), mu));
  val *= pow(2, mu + 1) * K / pdm;
  return val * sqn * exp(-pdm * sqn);
}


x86 assembly (clang, -O0):
<err_bound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    0x2e87(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xe6e(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe67(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm2
movsd  -0x50(%rbp),%xmm0
movsd  0xe3d(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
mov    %eax,%edi
movsd  -0x20(%rbp),%xmm0
call   1050 <pow@plt>
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe11(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xdf3(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mulsd  -0x10(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_bound>:
push   %rbx
sub    $0x50,%rsp
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x48(%rsp)
mov    %edi,%ebx
mov    0x2e89(%rip),%rax
movsd  (%rax),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movapd %xmm0,0x20(%rsp)
mov    %ebx,%edi
call   1060 <sqrt@plt>
movsd  %xmm0,0x40(%rsp)
movsd  0xe71(%rip),%xmm0
mulsd  0x20(%rsp),%xmm0
call   1030 <exp@plt>
movsd  0xe66(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x20(%rsp),%xmm1
movsd  %xmm1,0x38(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
mov    %eax,%edi
movsd  (%rsp),%xmm0
call   1050 <pow@plt>
mulsd  0x38(%rsp),%xmm0
movapd %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
addsd  0xe26(%rip),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mulsd  0x48(%rsp),%xmm0
movapd 0xe16(%rip),%xmm2
unpcklpd %xmm0,%xmm2
movapd 0x20(%rsp),%xmm0
movapd 0x10(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
divpd  %xmm1,%xmm2
movsd  0xdee(%rip),%xmm1
addsd  %xmm2,%xmm1
unpckhpd %xmm2,%xmm2
mulsd  %xmm1,%xmm2
movsd  0x40(%rsp),%xmm1
mulsd  %xmm1,%xmm2
movapd %xmm2,(%rsp)
xorpd  0xde3(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @err_bound(i32 %0, double %1, double %2, double %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i32 %0, i32* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%12 = load double, double* @M_PI
%13 = load double, double* %7
%14 = fmul double %12, %13
%15 = load double, double* %8
%16 = fmul double %14, %15
%17 = fptosi double %16 to i32
%18 = call double @sqrt(i32 %17)
store double %18, double* %9
%19 = load i32, i32* %5
%20 = call double @sqrt(i32 %19)
store double %20, double* %10
store double 1.000000e+00, double* %11
%21 = load double, double* %9
%22 = load double, double* %9
%23 = fmul double -2.000000e+00, %22
%24 = call double @exp(double %23)
%25 = fsub double 1.000000e+00, %24
%26 = fmul double %21, %25
%27 = load double, double* %7
%28 = call i32 @cos(double %27)
%29 = load double, double* %8
%30 = call double @pow(i32 %28, double %29)
%31 = fmul double %26, %30
%32 = fdiv double 2.000000e+00, %31
%33 = load double, double* %11
%34 = fadd double %33, %32
store double %34, double* %11
%35 = load double, double* %8
%36 = fadd double %35, 1.000000e+00
%37 = call double @pow(i32 2, double %36)
%38 = load double, double* %6
%39 = fmul double %37, %38
%40 = load double, double* %9
%41 = fdiv double %39, %40
%42 = load double, double* %11
%43 = fmul double %42, %41
store double %43, double* %11
%44 = load double, double* %11
%45 = load double, double* %10
%46 = fmul double %44, %45
%47 = load double, double* %9
%48 = fneg double %47
%49 = load double, double* %10
%50 = fmul double %48, %49
%51 = call double @exp(double %50)
%52 = fmul double %46, %51
ret double %52
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @err_bound(i32 %0, double %1, double %2, double %3) {
%5 = load double, double* @M_PI
%6 = fmul double %5, %2
%7 = fmul double %6, %3
%8 = fptosi double %7 to i32
%9 = tail call double @sqrt(i32 %8)
%10 = tail call double @sqrt(i32 %0)
%11 = fmul double %9, -2.000000e+00
%12 = tail call double @exp(double %11)
%13 = fsub double 1.000000e+00, %12
%14 = fmul double %9, %13
%15 = tail call i32 @cos(double %2)
%16 = tail call double @pow(i32 %15, double %3)
%17 = fmul double %14, %16
%18 = fadd double %3, 1.000000e+00
%19 = tail call double @pow(i32 2, double %18)
%20 = fmul double %19, %1
%21 = insertelement <2 x double> <double 2.000000e+00, double poison>, double %20, i64 1
%22 = insertelement <2 x double> poison, double %17, i64 0
%23 = insertelement <2 x double> %22, double %9, i64 1
%24 = fdiv <2 x double> %21, %23
%25 = extractelement <2 x double> %24, i64 0
%26 = fadd double %25, 1.000000e+00
%27 = extractelement <2 x double> %24, i64 1
%28 = fmul double %26, %27
%29 = fmul double %10, %28
%30 = fneg double %9
%31 = fmul double %10, %30
%32 = tail call double @exp(double %31)
%33 = fmul double %32, %29
ret double %33
}