#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*/ assert(int /*<<< orphan*/);
scalar_t__ init_test();
int /*<<< orphan*/ print_for(int, int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  assert(init_test() == 0 && "Could not initialize.");
  assert(argc == 2 && "usage: file_read.out target_file");
  printf("\nSequential on file %s:\n", argv[1]);
  for (size_t fs_bits = 31 - 10; fs_bits < 31; ++fs_bits) {
    print_for(1 << fs_bits, false, argv[1]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <init_test@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
jne    1179 <main+0x39>
mov    $0x1,%al
mov    %al,-0x19(%rbp)
jmp    1179 <main+0x39>
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
cmpl   $0x2,-0x8(%rbp)
mov    %al,-0x1a(%rbp)
jne    119f <main+0x5f>
mov    $0x1,%al
mov    %al,-0x1a(%rbp)
jmp    119f <main+0x5f>
mov    -0x1a(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
movq   $0x15,-0x18(%rbp)
cmpq   $0x1f,-0x18(%rbp)
jae    1200 <main+0xc0>
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%edi
shl    %cl,%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
xor    %esi,%esi
call   1040 <print_for@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11c8 <main+0x88>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1060 <init_test@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmp    $0x2,%ebp
sete   %dil
call   1050 <assert@plt>
mov    0x8(%rbx),%rsi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%rdx
mov    $0x200000,%edi
xor    %esi,%esi
call   1040 <print_for@plt>
mov    0x8(%rbx),%rdx
mov    $0x400000,%edi
xor    %esi,%esi
call   1040 <print_for@plt>
mov    0x8(%rbx),%rdx
mov    $0x800000,%edi
xor    %esi,%esi
call   1040 <print_for@plt>
mov    0x8(%rbx),%rdx
mov    $0x1000000,%edi
xor    %esi,%esi
call   1040 <print_for@plt>
mov    0x8(%rbx),%rdx
mov    $0x2000000,%edi
xor    %esi,%esi
call   1040 <print_for@plt>
mov    0x8(%rbx),%rdx
mov    $0x4000000,%edi
xor    %esi,%esi
call   1040 <print_for@plt>
mov    0x8(%rbx),%rdx
mov    $0x8000000,%edi
xor    %esi,%esi
call   1040 <print_for@plt>
mov    0x8(%rbx),%rdx
mov    $0x10000000,%edi
xor    %esi,%esi
call   1040 <print_for@plt>
mov    0x8(%rbx),%rdx
mov    $0x20000000,%edi
xor    %esi,%esi
call   1040 <print_for@plt>
mov    0x8(%rbx),%rdx
mov    $0x40000000,%edi
xor    %esi,%esi
call   1040 <print_for@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Could not initialize.\00"
@.str.1 = [33 x i8] c"usage: file_read.out target_file\00"
@.str.2 = [25 x i8] c"\0ASequential on file %s:\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 (...) @init_test()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %2
%11 = phi i1 [ false, %2 ], [ true, %9 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %17
16: ; preds = %10
br label %17
17: ; preds = %16, %10
%18 = phi i1 [ false, %10 ], [ true, %16 ]
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %23)
store i64 21, i64* %6
br label %25
25: ; preds = %36, %17
%26 = load i64, i64* %6
%27 = icmp ult i64 %26, 31
br i1 %27, label %28, label %39
28: ; preds = %25
%29 = load i64, i64* %6
%30 = trunc i64 %29 to i32
%31 = shl i32 1, %30
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i32 @print_for(i32 %31, i32 0, i8* %34)
br label %36
36: ; preds = %28
%37 = load i64, i64* %6
%38 = add i64 %37, 1
store i64 %38, i64* %6
br label %25
39: ; preds = %25
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [25 x i8] c"\0ASequential on file %s:\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i64 (...) @init_test()
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp eq i32 %0, 2
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %10
%14 = tail call i32 @print_for(i32 2097152, i32 0, i8* %13)
%15 = load i8*, i8** %10
%16 = tail call i32 @print_for(i32 4194304, i32 0, i8* %15)
%17 = load i8*, i8** %10
%18 = tail call i32 @print_for(i32 8388608, i32 0, i8* %17)
%19 = load i8*, i8** %10
%20 = tail call i32 @print_for(i32 16777216, i32 0, i8* %19)
%21 = load i8*, i8** %10
%22 = tail call i32 @print_for(i32 33554432, i32 0, i8* %21)
%23 = load i8*, i8** %10
%24 = tail call i32 @print_for(i32 67108864, i32 0, i8* %23)
%25 = load i8*, i8** %10
%26 = tail call i32 @print_for(i32 134217728, i32 0, i8* %25)
%27 = load i8*, i8** %10
%28 = tail call i32 @print_for(i32 268435456, i32 0, i8* %27)
%29 = load i8*, i8** %10
%30 = tail call i32 @print_for(i32 536870912, i32 0, i8* %29)
%31 = load i8*, i8** %10
%32 = tail call i32 @print_for(i32 1073741824, i32 0, i8* %31)
ret i32 0
}