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

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
unsigned long get_file_size(char *);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ read_file_contents(char *, unsigned long const,
                                      unsigned char *);
int /*<<< orphan*/ traverse_binary_sequence(unsigned char *,
                                            unsigned long const);
int main(void) {
  clock_t start = clock();
  const unsigned long file_length =
      get_file_size("./output_files_to_ignore/words.txt");
  unsigned char buffer[file_length];
  read_file_contents("./output_files_to_ignore/words.txt", file_length, buffer);
  traverse_binary_sequence(buffer, file_length);
  clock_t end = clock();
  printf("Time taken %f seconds.\n", ((double)(end - start)) / CLOCKS_PER_SEC);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
lea    0xe8f(%rip),%rdi
call   1070 <get_file_size@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x38(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe54(%rip),%rdi
call   1050 <read_file_contents@plt>
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <traverse_binary_sequence@plt>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
sub    -0x10(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2e0b(%rip),%rax
divsd  (%rax),%xmm0
lea    0xe3b(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%r14
lea    0xe94(%rip),%r15
mov    %r15,%rdi
call   1070 <get_file_size@plt>
mov    %rax,%r12
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <read_file_contents@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <traverse_binary_sequence@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %r14,%rax
cvtsi2sd %rax,%xmm0
mov    0x2e31(%rip),%rax
divsd  (%rax),%xmm0
lea    0xe61(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"./output_files_to_ignore/words.txt\00"
@.str.1 = [24 x i8] c"Time taken %f seconds.\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
%7 = call i64 (...) @clock()
store i64 %7, i64* %2
%8 = call i64 @get_file_size(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %4
%11 = alloca i8, i64 %9
store i64 %9, i64* %5
%12 = load i64, i64* %3
%13 = call i32 @read_file_contents(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %12, i8* %11)
%14 = load i64, i64* %3
%15 = call i32 @traverse_binary_sequence(i8* %11, i64 %14)
%16 = call i64 (...) @clock()
store i64 %16, i64* %6
%17 = load i64, i64* %6
%18 = load i64, i64* %2
%19 = sub nsw i64 %17, %18
%20 = sitofp i64 %19 to double
%21 = load double, double* @CLOCKS_PER_SEC
%22 = fdiv double %20, %21
%23 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %22)
store i32 1, i32* %1
%24 = load i8*, i8** %4
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
@.str = [35 x i8] c"./output_files_to_ignore/words.txt\00"
@.str.1 = [24 x i8] c"Time taken %f seconds.\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @main() {
%1 = tail call i64 (...) @clock()
%2 = tail call i64 @get_file_size(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = alloca i8, i64 %2
%4 = call i32 @read_file_contents(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %2, i8* %3)
%5 = call i32 @traverse_binary_sequence(i8* %3, i64 %2)
%6 = call i64 (...) @clock()
%7 = sub nsw i64 %6, %1
%8 = sitofp i64 %7 to double
%9 = load double, double* @CLOCKS_PER_SEC
%10 = fdiv double %8, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 1
}