#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 /*<<< orphan*/ printf(char *, ...);
int main() {
  int f[10] = {1}, i;
  double e[10] = {1};
  for (i = 1; i < 10; ++i)
    f[i] = f[i - 1] * i;
  for (i = 1; i < 10; ++i)
    e[i] = e[i - 1] + (double)1 / f[i];
  printf("n e\n- -----------\n0 1\n1 2\n2 2.5\n");
  for (i = 3; i < 10; ++i)
    printf("%d %.9lf\n", i, e[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x1,-0x30(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1040 <memset@plt>
movsd  0xe9c(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movl   $0x1,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11a3 <main+0x83>
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,4),%ecx
imul   -0x34(%rbp),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1173 <main+0x53>
movl   $0x1,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11fa <main+0xda>
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
movslq -0x34(%rbp),%rax
cvtsi2sdl -0x30(%rbp,%rax,4),%xmm2
movsd  0xe29(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movslq -0x34(%rbp),%rax
movsd  %xmm0,-0x90(%rbp,%rax,8)
ff ff
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11aa <main+0x8a>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    1245 <main+0x125>
mov    -0x34(%rbp),%esi
movslq -0x34(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
lea    0xdf9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    120f <main+0xef>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf1a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf04(%rip),%rbx
movsd  0xec4(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xeb5(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xea6(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe97(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe88(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe79(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe6a(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"n e\0A- -----------\0A0 1\0A1 2\0A2 2.5\0A\00"
@.str.1 = [10 x i8] c"%d %.9lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca [10 x double]
store i32 0, i32* %1
%5 = bitcast [10 x i32]* %2 to i8*
%6 = bitcast i8* %5 to <{ i32, [9 x i32] }>*
%7 = getelementptr inbounds <{ i32, [9 x i32] }>, <{ i32, [9 x i32] }>* %6, i32 0, i32 0
store i32 1, i32* %7
%8 = bitcast [10 x double]* %4 to i8*
%9 = bitcast i8* %8 to <{ double, [9 x double] }>*
%10 = getelementptr inbounds <{ double, [9 x double] }>, <{ double, [9 x double] }>* %9, i32 0, i32 0
store double 1.000000e+00, double* %10
store i32 1, i32* %3
br label %11
11: ; preds = %25, %0
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 10
br i1 %13, label %14, label %28
14: ; preds = %11
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %3
%21 = mul nsw i32 %19, %20
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %23
store i32 %21, i32* %24
br label %25
25: ; preds = %14
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %11
28: ; preds = %11
store i32 1, i32* %3
br label %29
29: ; preds = %48, %28
%30 = load i32, i32* %3
%31 = icmp slt i32 %30, 10
br i1 %31, label %32, label %51
32: ; preds = %29
%33 = load i32, i32* %3
%34 = sub nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [10 x double], [10 x double]* %4, i64 0, i64 %35
%37 = load double, double* %36
%38 = load i32, i32* %3
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = sitofp i32 %41 to double
%43 = fdiv double 1.000000e+00, %42
%44 = fadd double %37, %43
%45 = load i32, i32* %3
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [10 x double], [10 x double]* %4, i64 0, i64 %46
store double %44, double* %47
br label %48
48: ; preds = %32
%49 = load i32, i32* %3
%50 = add nsw i32 %49, 1
store i32 %50, i32* %3
br label %29
51: ; preds = %29
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 3, i32* %3
br label %53
53: ; preds = %63, %51
%54 = load i32, i32* %3
%55 = icmp slt i32 %54, 10
br i1 %55, label %56, label %66
56: ; preds = %53
%57 = load i32, i32* %3
%58 = load i32, i32* %3
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [10 x double], [10 x double]* %4, i64 0, i64 %59
%61 = load double, double* %60
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %57, double %61)
br label %63
63: ; preds = %56
%64 = load i32, i32* %3
%65 = add nsw i32 %64, 1
store i32 %65, i32* %3
br label %53
66: ; preds = %53
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"%d %.9lf\0A\00"
@str = [32 x i8] c"n e\0A- -----------\0A0 1\0A1 2\0A2 2.5\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 3, double 0x4005555555555555)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 4, double 0x4005AAAAAAAAAAAA)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 5, double 0x4005BBBBBBBBBBBB)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 6, double 0x4005BE93E93E93E9)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 7, double 0x4005BEFBEFBEFBF0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 8, double 0x4005BF08F08F08F1)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 9, double 0x4005BF0A626D4346)
ret i32 0
}