#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 double clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
double clock();
int /*<<< orphan*/ printf(char *, double);
int main() {
  clock_t t_start, t_end;
  long long int i;
  double t_total;
  t_start = clock();
  for (i = 0; i < 1000000000; i++)
    ;
  t_end = clock();
  t_total = (double)(t_end - t_start) / CLOCKS_PER_SEC;
  printf("Start Time: %ld\n", t_start);
  printf("End Time: %ld\n", t_end);
  printf("Total Time: %f\n", t_total);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x3b9aca00,-0x20(%rbp)
3b
jge    1167 <main+0x47>
jmp    1156 <main+0x36>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1143 <main+0x23>
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    0x2e64(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xe65(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <clock@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <clock@plt>
movsd  %xmm0,0x8(%rsp)
movapd %xmm0,%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm0,%xmm1
mov    0x2e97(%rip),%rax
divsd  (%rax),%xmm1
movsd  %xmm1,0x10(%rsp)
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
lea    0xea3(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1040 <printf@plt>
lea    0xea0(%rip),%rdi
movsd  0x10(%rsp),%xmm0
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str = [17 x i8] c"Start Time: %ld\0A\00"
@.str.1 = [15 x i8] c"End Time: %ld\0A\00"
@.str.2 = [16 x i8] c"Total Time: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i64
%5 = alloca double
store i32 0, i32* %1
%6 = call double (...) @clock()
store double %6, double* %2
store i64 0, i64* %4
br label %7
7: ; preds = %11, %0
%8 = load i64, i64* %4
%9 = icmp slt i64 %8, 1000000000
br i1 %9, label %10, label %14
10: ; preds = %7
br label %11
11: ; preds = %10
%12 = load i64, i64* %4
%13 = add nsw i64 %12, 1
store i64 %13, i64* %4
br label %7
14: ; preds = %7
%15 = call double (...) @clock()
store double %15, double* %3
%16 = load double, double* %3
%17 = load double, double* %2
%18 = fsub double %16, %17
%19 = load double, double* @CLOCKS_PER_SEC
%20 = fdiv double %18, %19
store double %20, double* %5
%21 = load double, double* %2
%22 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %21)
%23 = load double, double* %3
%24 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %23)
%25 = load double, double* %5
%26 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %25)
ret i32 0
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str = [17 x i8] c"Start Time: %ld\0A\00"
@.str.1 = [15 x i8] c"End Time: %ld\0A\00"
@.str.2 = [16 x i8] c"Total Time: %f\0A\00"
define i32 @main() {
%1 = tail call double (...) @clock()
%2 = tail call double (...) @clock()
%3 = fsub double %2, %1
%4 = load double, double* @CLOCKS_PER_SEC
%5 = fdiv double %3, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %2)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %5)
ret i32 0
}