#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 *);
int /*<<< orphan*/ readcall(char *);
int main(void) {
  char *filename = "text/Hacker_Crackdown_1k.txt";
  int i;
  printf("+------------------+\n");
  printf("+ READ NOISE START +\n");
  for (i = 0; i < 8; i++) {
    readcall(filename);
  }
  printf("+ READ NOISE DONE  +\n");
  printf("+------------------+\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    117a <main+0x5a>
mov    -0x10(%rbp),%rdi
call   1040 <readcall@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1159 <main+0x39>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xf1c(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeba(%rip),%rbx
mov    %rbx,%rdi
call   1040 <readcall@plt>
mov    %rbx,%rdi
call   1040 <readcall@plt>
mov    %rbx,%rdi
call   1040 <readcall@plt>
mov    %rbx,%rdi
call   1040 <readcall@plt>
mov    %rbx,%rdi
call   1040 <readcall@plt>
mov    %rbx,%rdi
call   1040 <readcall@plt>
mov    %rbx,%rdi
call   1040 <readcall@plt>
mov    %rbx,%rdi
call   1040 <readcall@plt>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"text/Hacker_Crackdown_1k.txt\00"
@.str.1 = [22 x i8] c"+------------------+\0A\00"
@.str.2 = [22 x i8] c"+ READ NOISE START +\0A\00"
@.str.3 = [22 x i8] c"+ READ NOISE DONE +\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %6
6: ; preds = %12, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i8*, i8** %2
%11 = call i32 @readcall(i8* %10)
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %6
15: ; preds = %6
%16 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"text/Hacker_Crackdown_1k.txt\00"
@str.4 = [21 x i8] c"+ READ NOISE START +\00"
@str.5 = [21 x i8] c"+ READ NOISE DONE +\00"
@str.6 = [21 x i8] c"+------------------+\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.6, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @readcall(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @readcall(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @readcall(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @readcall(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @readcall(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @readcall(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @readcall(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @readcall(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.5, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}