#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 M_LN2;
int pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, const char *argv[]) {
  int n;
  long double relError, factorial = 1;
  printf("Integer  Relative Error\n");
  for (n = 1; n <= 15; n++) {
    factorial *= (n + 1.0);
    relError = (2 / factorial) * pow((M_LN2 / 2), (n + 1));
    printf("  %2i      %0.15Le\n", n, relError);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
fld1
fstpt  -0x40(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0xf,-0x14(%rbp)
jg     11db <main+0xbb>
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0xe99(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
fldl   -0x50(%rbp)
fldt   -0x40(%rbp)
fmulp  %st,%st(1)
fstpt  -0x40(%rbp)
fldt   -0x40(%rbp)
flds   0xe84(%rip)
fdivp  %st,%st(1)
fstpt  -0x5c(%rbp)
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
mov    %edi,%eax
shr    $0x1f,%eax
add    %eax,%edi
sar    %edi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
call   1040 <pow@plt>
fldt   -0x5c(%rbp)
mov    %eax,-0x44(%rbp)
fildl  -0x44(%rbp)
fmulp  %st,%st(1)
fstpt  -0x30(%rbp)
mov    -0x14(%rbp),%esi
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xe5f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
movsd  0xeb2(%rip),%xmm0
fld1
mov    $0x2,%ebx
mov    0x2e84(%rip),%r15
lea    0xea9(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x1(%rbx),%ebp
addsd  0xe85(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  %xmm0,0x28(%rsp)
fmull  0x28(%rsp)
fld    %st(0)
fstpt  0x3c(%rsp)
fdivrs 0xe71(%rip)
fstpt  0x30(%rsp)
mov    (%r15),%eax
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
mov    %ebx,%esi
call   1050 <pow@plt>
mov    %eax,0x1c(%rsp)
fldt   0x30(%rsp)
fimull 0x1c(%rsp)
fstpt  (%rsp)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0x20(%rsp),%xmm0
fldt   0x3c(%rsp)
add    $0x1,%ebx
cmp    $0x11,%ebx
jne    1170 <main+0x40>
fstp   %st(0)
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Integer Relative Error\0A\00"
@M_LN2 = global i32 0
@.str.1 = [20 x i8] c" %2i %0.15Le\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca x86_fp80
%8 = alloca x86_fp80
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %6
br label %10
10: ; preds = %32, %2
%11 = load i32, i32* %6
%12 = icmp sle i32 %11, 15
br i1 %12, label %13, label %35
13: ; preds = %10
%14 = load i32, i32* %6
%15 = sitofp i32 %14 to double
%16 = fadd double %15, 1.000000e+00
%17 = fpext double %16 to x86_fp80
%18 = load x86_fp80, x86_fp80* %8
%19 = fmul x86_fp80 %18, %17
store x86_fp80 %19, x86_fp80* %8
%20 = load x86_fp80, x86_fp80* %8
%21 = fdiv x86_fp80 0xK40008000000000000000, %20
%22 = load i32, i32* @M_LN2
%23 = sdiv i32 %22, 2
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
%26 = call i32 @pow(i32 %23, i32 %25)
%27 = sitofp i32 %26 to x86_fp80
%28 = fmul x86_fp80 %21, %27
store x86_fp80 %28, x86_fp80* %7
%29 = load i32, i32* %6
%30 = load x86_fp80, x86_fp80* %7
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %29, x86_fp80 %30)
br label %32
32: ; preds = %13
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
store i32 %34, i32* %6
br label %10
35: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@M_LN2 = global i32 0
@.str.1 = [20 x i8] c" %2i %0.15Le\0A\00"
@str = [24 x i8] c"Integer Relative Error\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %2, %4
%5 = phi x86_fp80 [ 0xK3FFF8000000000000000, %2 ], [ %10, %4 ]
%6 = phi i32 [ 1, %2 ], [ %14, %4 ]
%7 = sitofp i32 %6 to double
%8 = fadd double %7, 1.000000e+00
%9 = fpext double %8 to x86_fp80
%10 = fmul x86_fp80 %5, %9
%11 = fdiv x86_fp80 0xK40008000000000000000, %10
%12 = load i32, i32* @M_LN2
%13 = sdiv i32 %12, 2
%14 = add nuw nsw i32 %6, 1
%15 = tail call i32 @pow(i32 %13, i32 %14)
%16 = sitofp i32 %15 to x86_fp80
%17 = fmul x86_fp80 %11, %16
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %6, x86_fp80 %17)
%19 = icmp eq i32 %14, 16
br i1 %19, label %20, label %4
20: ; preds = %4
ret i32 0
}