#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 *, long double, long double);
int main() {
  long double x;
  long double i;
  x = 1;
  for (i = 1; i <= 120000000; i++)
    x = x * i;
  printf("%d faculty: %e \n", i - 1, x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
fld1
fld    %st(0)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
flds   0xece(%rip)
fucomip %st(1),%st
fstp   %st(0)
jb     115b <main+0x4b>
jmp    1141 <main+0x31>
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
fmulp  %st,%st(1)
fstpt  -0x20(%rbp)
fldt   -0x30(%rbp)
fld1
faddp  %st,%st(1)
fstpt  -0x30(%rbp)
jmp    1129 <main+0x19>
fldt   -0x30(%rbp)
fld1
fchs
faddp  %st,%st(1)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
fld1
flds   0xee4(%rip)
fld    %st(1)
fld    %st(2)
fmul   %st(1),%st
fxch   %st(1)
fadd   %st(3),%st
fxch   %st(2)
fucomi %st(2),%st
fxch   %st(2)
fxch   %st(1)
jae    1120 <main+0x10>
fstp   %st(3)
fstp   %st(1)
fld1
fchs
faddp  %st,%st(1)
fxch   %st(1)
fstpt  0x10(%rsp)
fstpt  (%rsp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%d faculty: %e \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store i32 0, i32* %1
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %2
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %3
br label %4
4: ; preds = %11, %0
%5 = load x86_fp80, x86_fp80* %3
%6 = fcmp ole x86_fp80 %5, 0xK4019E4E1C00000000000
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load x86_fp80, x86_fp80* %2
%9 = load x86_fp80, x86_fp80* %3
%10 = fmul x86_fp80 %8, %9
store x86_fp80 %10, x86_fp80* %2
br label %11
11: ; preds = %7
%12 = load x86_fp80, x86_fp80* %3
%13 = fadd x86_fp80 %12, 0xK3FFF8000000000000000
store x86_fp80 %13, x86_fp80* %3
br label %4
14: ; preds = %4
%15 = load x86_fp80, x86_fp80* %3
%16 = fsub x86_fp80 %15, 0xK3FFF8000000000000000
%17 = load x86_fp80, x86_fp80* %2
%18 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), x86_fp80 %16, x86_fp80 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"%d faculty: %e \0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi x86_fp80 [ 0xK3FFF8000000000000000, %0 ], [ %5, %1 ]
%3 = phi x86_fp80 [ 0xK3FFF8000000000000000, %0 ], [ %4, %1 ]
%4 = fmul x86_fp80 %3, %2
%5 = fadd x86_fp80 %2, 0xK3FFF8000000000000000
%6 = fcmp ugt x86_fp80 %5, 0xK4019E4E1C00000000000
br i1 %6, label %7, label %1
7: ; preds = %1
%8 = fadd x86_fp80 %5, 0xKBFFF8000000000000000
%9 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), x86_fp80 %8, x86_fp80 %4)
ret i32 0
}