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


x86 assembly (clang, -O0):
<err_bound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
minsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x2e55(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <sqrt@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  0xe4c(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  0xe2d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe29(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe0c(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm2
movsd  -0x68(%rbp),%xmm0
movsd  0xdea(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xdcd(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
mov    %eax,%edi
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
call   1050 <pow@plt>
movsd  -0x60(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xd83(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x40(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_bound>:
push   %rbx
sub    $0x60,%rsp
movapd %xmm3,0x10(%rsp)
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
mov    %edi,%ebx
movapd %xmm2,%xmm0
cmpunordsd %xmm2,%xmm0
movapd %xmm0,%xmm4
andpd  %xmm3,%xmm4
movapd %xmm3,%xmm5
minsd  %xmm2,%xmm5
andnpd %xmm5,%xmm0
orpd   %xmm4,%xmm0
mov    0x2e63(%rip),%rax
movsd  (%rax),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
cvttsd2si %xmm2,%edi
call   1060 <sqrt@plt>
movapd %xmm0,0x20(%rsp)
mov    %ebx,%edi
call   1060 <sqrt@plt>
movsd  %xmm0,0x48(%rsp)
movsd  (%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rsp)
mulsd  0xe3b(%rip),%xmm0
addsd  0xe3b(%rip),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movapd %xmm0,0x10(%rsp)
movsd  0xe2b(%rip),%xmm0
mulsd  0x20(%rsp),%xmm0
call   1030 <exp@plt>
movsd  0xe10(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x20(%rsp),%xmm1
movsd  %xmm1,0x38(%rsp)
movsd  0x40(%rsp),%xmm0
mulsd  0xdea(%rip),%xmm0
call   1040 <cos@plt>
mov    %eax,%edi
movsd  (%rsp),%xmm0
call   1050 <pow@plt>
mulsd  0x38(%rsp),%xmm0
movapd 0x50(%rsp),%xmm2
addsd  %xmm2,%xmm2
unpcklpd 0x10(%rsp),%xmm2
movapd 0x20(%rsp),%xmm3
movapd %xmm3,%xmm1
unpcklpd %xmm0,%xmm1
divpd  %xmm1,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
addsd  0xda9(%rip),%xmm0
mulsd  %xmm2,%xmm0
movsd  0x48(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movapd %xmm0,(%rsp)
movapd %xmm3,%xmm0
xorpd  0xda2(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
add    $0x60,%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, double %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store i32 %0, i32* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%15 = load double, double* %9
%16 = load double, double* %10
%17 = call double @llvm.minnum.f64(double %15, double %16)
store double %17, double* %11
%18 = load double, double* @M_PI
%19 = load double, double* %8
%20 = fmul double %18, %19
%21 = load double, double* %11
%22 = fmul double %20, %21
%23 = fptosi double %22 to i32
%24 = call double @sqrt(i32 %23)
store double %24, double* %12
%25 = load i32, i32* %6
%26 = call double @sqrt(i32 %25)
store double %26, double* %13
store double 1.000000e+00, double* %14
%27 = load double, double* %9
%28 = load double, double* %10
%29 = fadd double %27, %28
%30 = call double @llvm.fmuladd.f64(double %29, double 5.000000e-01, double 1.000000e+00)
%31 = call double @pow(i32 2, double %30)
%32 = load double, double* %12
%33 = load double, double* %12
%34 = fmul double -2.000000e+00, %33
%35 = call double @exp(double %34)
%36 = fsub double 1.000000e+00, %35
%37 = fmul double %32, %36
%38 = load double, double* %8
%39 = fmul double 5.000000e-01, %38
%40 = call i32 @cos(double %39)
%41 = load double, double* %9
%42 = load double, double* %10
%43 = fadd double %41, %42
%44 = call double @pow(i32 %40, double %43)
%45 = fmul double %37, %44
%46 = fdiv double %31, %45
%47 = load double, double* %14
%48 = fadd double %47, %46
store double %48, double* %14
%49 = load double, double* %7
%50 = fmul double 2.000000e+00, %49
%51 = load double, double* %12
%52 = fdiv double %50, %51
%53 = load double, double* %14
%54 = fmul double %53, %52
store double %54, double* %14
%55 = load double, double* %14
%56 = load double, double* %13
%57 = fmul double %55, %56
%58 = load double, double* %12
%59 = fneg double %58
%60 = load double, double* %13
%61 = fmul double %59, %60
%62 = call double @exp(double %61)
%63 = fmul double %57, %62
ret double %63
}

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