#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 */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
double difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double, ...);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  double answer;
  long idx;
  time_t start = time(NULL);
  for (answer = 1, idx = 1; idx <= 200000; idx++) {
    printf("%f\n", answer);
    answer = answer * idx;
  }
  time_t end = time(NULL);
  printf("%f %f \n", answer, difftime(end, start) / CLOCKS_PER_SEC);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x24(%rbp)
movsd  0xea6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
cmpq   $0x30d40,-0x20(%rbp)
jg     11ad <main+0x7d>
movsd  -0x18(%rbp),%xmm0
lea    0xe87(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sdq -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1167 <main+0x37>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x24(%rbp),%esi
call   1040 <difftime@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mov    0x2e0b(%rip),%rax
divsd  (%rax),%xmm1
lea    0xe24(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%r14d
mov    $0x1,%ebp
movsd  0xeb1(%rip),%xmm0
lea    0xeb2(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rbp,%xmm0
mulsd  0x8(%rsp),%xmm0
add    $0x1,%rbp
cmp    $0x30d41,%rbp
jne    1160 <main+0x30>
xor    %edi,%edi
movsd  %xmm0,0x8(%rsp)
call   1050 <time@plt>
mov    %eax,%edi
mov    %r14d,%esi
call   1040 <difftime@plt>
movapd %xmm0,%xmm1
mov    0x2e3b(%rip),%rax
divsd  (%rax),%xmm1
lea    0xe54(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [8 x i8] c"%f %f \0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 @time(i32* null)
store i32 %10, i32* %8
store double 1.000000e+00, double* %6
store i64 1, i64* %7
br label %11
11: ; preds = %21, %2
%12 = load i64, i64* %7
%13 = icmp sle i64 %12, 200000
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = load double, double* %6
%16 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %15)
%17 = load double, double* %6
%18 = load i64, i64* %7
%19 = sitofp i64 %18 to double
%20 = fmul double %17, %19
store double %20, double* %6
br label %21
21: ; preds = %14
%22 = load i64, i64* %7
%23 = add nsw i64 %22, 1
store i64 %23, i64* %7
br label %11
24: ; preds = %11
%25 = call i32 @time(i32* null)
store i32 %25, i32* %9
%26 = load double, double* %6
%27 = load i32, i32* %9
%28 = load i32, i32* %8
%29 = call double @difftime(i32 %27, i32 %28)
%30 = load double, double* @CLOCKS_PER_SEC
%31 = fdiv double %29, %30
%32 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %26, double %31)
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [8 x i8] c"%f %f \0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
br label %4
4: ; preds = %2, %4
%5 = phi double [ 1.000000e+00, %2 ], [ %9, %4 ]
%6 = phi i64 [ 1, %2 ], [ %10, %4 ]
%7 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %5)
%8 = sitofp i64 %6 to double
%9 = fmul double %5, %8
%10 = add nuw nsw i64 %6, 1
%11 = icmp eq i64 %10, 200001
br i1 %11, label %12, label %4
12: ; preds = %4
%13 = tail call i32 @time(i32* null)
%14 = tail call double @difftime(i32 %13, i32 %3)
%15 = load double, double* @CLOCKS_PER_SEC
%16 = fdiv double %14, %15
%17 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %9, double %16)
ret i32 0
}