#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_E;
double M_PI;
double M_PI_2;
double M_PI_4;
double cos(double);
double exp(double);
double log(int);
double pow(int, double);
double sin(double);
double err_bound(int N, double K, double d, double mu) {
  double val = 4.0 / (M_PI * (1 - exp(-0.5 * M_PI * mu * M_E)));
  val /= (pow(cos(M_PI_2 * sin(d)), mu) * cos(d));
  val += mu * exp(M_PI_4 * mu);
  val *= pow(2, mu + 1) * K / (M_PI * d * mu);
  return val * exp(-M_PI * d * N / log(4 * d * N / mu));
}


x86 assembly (clang, -O0):
<err_bound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    0x2e77(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe8e(%rip),%xmm0
mov    0x2e5f(%rip),%rax
mulsd  (%rax),%xmm0
mulsd  -0x20(%rbp),%xmm0
mov    0x2e2f(%rip),%rax
mulsd  (%rax),%xmm0
call   1040 <exp@plt>
movsd  -0x58(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  0xe56(%rip),%xmm0
subsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe3e(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2e06(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <cos@plt>
cvttsd2si %xmm0,%edi
movsd  -0x20(%rbp),%xmm0
call   1070 <pow@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <cos@plt>
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    0x2da5(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x20(%rbp),%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xd9d(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
mulsd  -0x10(%rbp),%xmm0
mov    0x2d62(%rip),%rax
movsd  (%rax),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x2d35(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xd17(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1060 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_bound>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x20(%rsp)
mov    %edi,%ebx
mov    0x2e76(%rip),%r14
movsd  (%r14),%xmm1
movsd  %xmm1,(%rsp)
movsd  0xe7c(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
mov    0x2e35(%rip),%rax
mulsd  (%rax),%xmm0
call   1040 <exp@plt>
movsd  0xe64(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  (%rsp),%xmm1
movsd  0xe5b(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    0x2e13(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
call   1050 <cos@plt>
cvttsd2si %xmm0,%edi
movsd  0x8(%rsp),%xmm0
call   1070 <pow@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
call   1050 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    0x2dc0(%rip),%rax
movsd  (%rax),%xmm0
mulsd  0x8(%rsp),%xmm0
call   1040 <exp@plt>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xdbd(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
mulsd  0x20(%rsp),%xmm0
movsd  (%r14),%xmm3
movapd %xmm3,%xmm2
movsd  0x18(%rsp),%xmm1
mulsd  %xmm1,%xmm2
movsd  0x8(%rsp),%xmm4
mulsd  %xmm4,%xmm2
divsd  %xmm2,%xmm0
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
xorpd  0xd8e(%rip),%xmm3
mulsd  %xmm1,%xmm3
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  %xmm0,%xmm3
movapd %xmm3,0x20(%rsp)
mulsd  0xd61(%rip),%xmm1
mulsd  %xmm0,%xmm1
divsd  %xmm4,%xmm1
cvttsd2si %xmm1,%edi
call   1060 <log@plt>
movapd 0x20(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1040 <exp@plt>
mulsd  (%rsp),%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
@M_E = global double 0.000000e+00
@M_PI_2 = global double 0.000000e+00
@M_PI_4 = 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
store i32 %0, i32* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* @M_PI
%11 = load double, double* @M_PI
%12 = fmul double -5.000000e-01, %11
%13 = load double, double* %8
%14 = fmul double %12, %13
%15 = load double, double* @M_E
%16 = fmul double %14, %15
%17 = call double @exp(double %16)
%18 = fsub double 1.000000e+00, %17
%19 = fmul double %10, %18
%20 = fdiv double 4.000000e+00, %19
store double %20, double* %9
%21 = load double, double* @M_PI_2
%22 = load double, double* %7
%23 = call double @sin(double %22)
%24 = fmul double %21, %23
%25 = call double @cos(double %24)
%26 = fptosi double %25 to i32
%27 = load double, double* %8
%28 = call double @pow(i32 %26, double %27)
%29 = load double, double* %7
%30 = call double @cos(double %29)
%31 = fmul double %28, %30
%32 = load double, double* %9
%33 = fdiv double %32, %31
store double %33, double* %9
%34 = load double, double* %8
%35 = load double, double* @M_PI_4
%36 = load double, double* %8
%37 = fmul double %35, %36
%38 = call double @exp(double %37)
%39 = load double, double* %9
%40 = call double @llvm.fmuladd.f64(double %34, double %38, double %39)
store double %40, double* %9
%41 = load double, double* %8
%42 = fadd double %41, 1.000000e+00
%43 = call double @pow(i32 2, double %42)
%44 = load double, double* %6
%45 = fmul double %43, %44
%46 = load double, double* @M_PI
%47 = load double, double* %7
%48 = fmul double %46, %47
%49 = load double, double* %8
%50 = fmul double %48, %49
%51 = fdiv double %45, %50
%52 = load double, double* %9
%53 = fmul double %52, %51
store double %53, double* %9
%54 = load double, double* %9
%55 = load double, double* @M_PI
%56 = fneg double %55
%57 = load double, double* %7
%58 = fmul double %56, %57
%59 = load i32, i32* %5
%60 = sitofp i32 %59 to double
%61 = fmul double %58, %60
%62 = load double, double* %7
%63 = fmul double 4.000000e+00, %62
%64 = load i32, i32* %5
%65 = sitofp i32 %64 to double
%66 = fmul double %63, %65
%67 = load double, double* %8
%68 = fdiv double %66, %67
%69 = fptosi double %68 to i32
%70 = call double @log(i32 %69)
%71 = fdiv double %61, %70
%72 = call double @exp(double %71)
%73 = fmul double %54, %72
ret double %73
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
@M_E = global double 0.000000e+00
@M_PI_2 = global double 0.000000e+00
@M_PI_4 = 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, -5.000000e-01
%7 = fmul double %6, %3
%8 = load double, double* @M_E
%9 = fmul double %8, %7
%10 = tail call double @exp(double %9)
%11 = fsub double 1.000000e+00, %10
%12 = fmul double %5, %11
%13 = fdiv double 4.000000e+00, %12
%14 = load double, double* @M_PI_2
%15 = tail call double @sin(double %2)
%16 = fmul double %14, %15
%17 = tail call double @cos(double %16)
%18 = fptosi double %17 to i32
%19 = tail call double @pow(i32 %18, double %3)
%20 = tail call double @cos(double %2)
%21 = fmul double %19, %20
%22 = fdiv double %13, %21
%23 = load double, double* @M_PI_4
%24 = fmul double %23, %3
%25 = tail call double @exp(double %24)
%26 = tail call double @llvm.fmuladd.f64(double %3, double %25, double %22)
%27 = fadd double %3, 1.000000e+00
%28 = tail call double @pow(i32 2, double %27)
%29 = fmul double %28, %1
%30 = load double, double* @M_PI
%31 = fmul double %30, %2
%32 = fmul double %31, %3
%33 = fdiv double %29, %32
%34 = fmul double %26, %33
%35 = fneg double %30
%36 = fmul double %35, %2
%37 = sitofp i32 %0 to double
%38 = fmul double %36, %37
%39 = fmul double %2, 4.000000e+00
%40 = fmul double %39, %37
%41 = fdiv double %40, %3
%42 = fptosi double %41 to i32
%43 = tail call double @log(i32 %42)
%44 = fdiv double %38, %43
%45 = tail call double @exp(double %44)
%46 = fmul double %45, %34
ret double %46
}