#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ Execute(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
int main() {
  FILE *input;
  char name[] = "War and Peace.txt";
  if ((input = fopen(name, "r")) != NULL) {
    Execute(input, 100000000);
    fclose(input);
  } else {
    printf("File not found!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xea4(%rip),%ax
mov    %ax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     11aa <main+0x6a>
mov    -0x10(%rbp),%rdi
mov    $0x5f5e100,%esi
call   1060 <Execute@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
jmp    11b6 <main+0x76>
lea    0xe63(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x74,0x10(%rsp)
lea    0xeb4(%rip),%rsi
mov    %rsp,%rdi
call   1050 <fopen@plt>
test   %rax,%rax
je     1185 <main+0x45>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x5f5e100,%esi
call   1060 <Execute@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
jmp    1191 <main+0x51>
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.name = [18 x i8] c"War and Peace.txt\00"
@.str = [2 x i8] c"r\00"
@.str.1 = [17 x i8] c"File not found!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [18 x i8]
store i32 0, i32* %1
%4 = bitcast [18 x i8]* %3 to i8*
%5 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %2
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load i32*, i32** %2
%10 = call i32 @Execute(i32* %9, i32 100000000)
%11 = load i32*, i32** %2
%12 = call i32 @fclose(i32* %11)
br label %15
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
ret i32 0
}

LLVM IR (-O2):
@__const.main.name = [18 x i8] c"War and Peace.txt\00"
@.str = [2 x i8] c"r\00"
@str = [16 x i8] c"File not found!\00"
define i32 @main() {
%1 = alloca [18 x i8]
%2 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 0
%3 = call i32* @fopen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = tail call i32 @Execute(i32* %3, i32 100000000)
%7 = tail call i32 @fclose(i32* %3)
br label %10
8: ; preds = %0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret i32 0
}