#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(void) {
  int termino;
  long int factorial = 1;
  double e = 1.0, eAnt = 0.0;
  printf("N\te\n");
  for (termino = 1; !(e == eAnt); termino++) {
    factorial *= termino;
    printf("Numero: %d Factorial: %ld\n", termino, factorial);
    eAnt = e;
    e += (1.0 / factorial);
    printf("%d\t%.25f\n", termino, e);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
xor    $0xff,%al
test   $0x1,%al
jne    1172 <main+0x62>
jmp    11de <main+0xce>
movslq -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xe54(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
lea    0xe5f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1151 <main+0x41>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
movsd  0xec1(%rip),%xmm0
mov    $0x1,%ebx
lea    0xebd(%rip),%r14
lea    0xed1(%rip),%r15
mov    $0x1,%r12d
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,0x8(%rsp)
imul   %rbx,%r12
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r12,%xmm0
movsd  0xe77(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0x8(%rsp),%xmm1
movsd  %xmm1,0x10(%rsp)
mov    %r15,%rdi
mov    %ebx,%esi
movapd %xmm1,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
movsd  0x10(%rsp),%xmm0
ucomisd 0x8(%rsp),%xmm0
jne    1160 <main+0x40>
jp     1160 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"N\09e\0A\00"
@.str.1 = [27 x i8] c"Numero: %d Factorial: %ld\0A\00"
@.str.2 = [10 x i8] c"%d\09%.25f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
store i64 1, i64* %3
store double 1.000000e+00, double* %4
store double 0.000000e+00, double* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %7
7: ; preds = %29, %0
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fcmp oeq double %8, %9
%11 = xor i1 %10, true
br i1 %11, label %12, label %32
12: ; preds = %7
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = load i64, i64* %3
%16 = mul nsw i64 %15, %14
store i64 %16, i64* %3
%17 = load i32, i32* %2
%18 = load i64, i64* %3
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %17, i64 %18)
%20 = load double, double* %4
store double %20, double* %5
%21 = load i64, i64* %3
%22 = sitofp i64 %21 to double
%23 = fdiv double 1.000000e+00, %22
%24 = load double, double* %4
%25 = fadd double %24, %23
store double %25, double* %4
%26 = load i32, i32* %2
%27 = load double, double* %4
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %26, double %27)
br label %29
29: ; preds = %12
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %2
br label %7
32: ; preds = %7
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"Numero: %d Factorial: %ld\0A\00"
@.str.2 = [10 x i8] c"%d\09%.25f\0A\00"
@str = [4 x i8] c"N\09e\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i64 [ 1, %0 ], [ %13, %2 ]
%4 = phi double [ 1.000000e+00, %0 ], [ %11, %2 ]
%5 = phi i64 [ 1, %0 ], [ %6, %2 ]
%6 = mul nuw nsw i64 %5, %3
%7 = trunc i64 %3 to i32
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %7, i64 %6)
%9 = sitofp i64 %6 to double
%10 = fdiv double 1.000000e+00, %9
%11 = fadd double %4, %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %7, double %11)
%13 = add nuw i64 %3, 1
%14 = fcmp une double %11, %4
br i1 %14, label %2, label %15
15: ; preds = %2
ret i32 0
}