#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*/ example_essay;
typedef int /*<<< orphan*/ essay;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
size_t strcspn(char *, char *);
int strlen(char *);
int main() {
  int length;
  char essay[50];
  setbuf(stdout, NULL);
  setbuf(stdin, NULL);
  setbuf(stderr, NULL);
  puts("Hey all!");
  puts("Welcome to Amer Lit!");
  puts("In this class, we will be reading books");
  puts("(wow who would have guessed)");
  puts("and then doing fun things like writing essays!");
  sleep(1);
  puts("Y'know what, let me get a really good example of an essay.");
  FILE *fp = fopen("flag.txt", "r");
  char example_essay[100];
  if (fp == NULL) {
    puts("Oh no, I can't find my former students' essays!");
    puts("How now will I set the bar redicuolously high for new students??");
    puts(
        "[If you are seeing this on the remote server, please contact admin].");
    exit(1);
  }
  fgets(example_essay, sizeof(example_essay), fp);
  sleep(1);
  puts("Actually, on further thought...");
  puts("You're a BCA student, you should be able to write a perfect essay "
       "immediately.");
  puts("Let's see it!");
  fgets(essay, sizeof(essay), stdin);
  essay[strcspn(essay, "\n")] = 0;
  length = strlen(essay);
  sleep(1);
  puts("");
  puts("TURNITIN SUBMISSION RECEIVED:");
  printf("╔═");
  for (int i = 0; i < length; ++i)
    printf("═");
  printf("═╗\n");
  printf("║ ");
  for (int i = 0; i < length; ++i)
    printf(" ");
  printf(" ║\n");
  printf("║ ");
  for (int i = 0; i < length; ++i)
    printf(" ");
  printf(" ║\n");
  printf("║ ");
  printf(essay);
  printf(" ║\n");
  printf("║ ");
  for (int i = 0; i < length; ++i)
    printf(" ");
  printf(" ║\n");
  printf("║ ");
  for (int i = 0; i < length; ++i)
    printf(" ");
  printf(" ║\n");
  printf("╚═");
  for (int i = 0; i < length; ++i)
    printf("═");
  printf("═╝\n");
  sleep(2);
  puts("");
  puts("You've clearly put a lot of work and effort into this.");
  puts("How about an 89?");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e27(%rip),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <setbuf@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <setbuf@plt>
mov    0x2e09(%rip),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <setbuf@plt>
lea    0xe1e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe1b(%rip),%rdi
call   1030 <puts@plt>
lea    0xe24(%rip),%rdi
call   1030 <puts@plt>
lea    0xe40(%rip),%rdi
call   1030 <puts@plt>
lea    0xe51(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   10b0 <sleep@plt>
lea    0xe6a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe99(%rip),%rdi
lea    0xe9b(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    127d <main+0xed>
lea    0xe82(%rip),%rdi
call   1030 <puts@plt>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
lea    -0xb0(%rbp),%rdi
mov    -0x48(%rbp),%rdx
mov    $0x64,%esi
call   1080 <fgets@plt>
mov    $0x1,%edi
call   10b0 <sleep@plt>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xf42(%rip),%rdi
call   1030 <puts@plt>
lea    -0x40(%rbp),%rdi
mov    0x2d1d(%rip),%rax
mov    (%rax),%rdx
mov    $0x32,%esi
call   1080 <fgets@plt>
lea    -0x40(%rbp),%rdi
lea    0xf5e(%rip),%rsi
call   1070 <strcspn@plt>
movb   $0x0,-0x40(%rbp,%rax,1)
lea    -0x40(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   10b0 <sleep@plt>
lea    0xf38(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf07(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0xb4(%rbp)
mov    -0xb4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1360 <main+0x1d0>
lea    0xee5(%rip),%rdi
call   1060 <printf@plt>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    1331 <main+0x1a1>
lea    0xec9(%rip),%rdi
call   1060 <printf@plt>
lea    0xec5(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0xb8(%rbp)
mov    -0xb8(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13b1 <main+0x221>
lea    0xea3(%rip),%rdi
call   1060 <printf@plt>
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    1382 <main+0x1f2>
lea    0xe85(%rip),%rdi
call   1060 <printf@plt>
lea    0xe74(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0xbc(%rbp)
mov    -0xbc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1402 <main+0x272>
lea    0xe52(%rip),%rdi
call   1060 <printf@plt>
mov    -0xbc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbc(%rbp)
jmp    13d3 <main+0x243>
lea    0xe34(%rip),%rdi
call   1060 <printf@plt>
lea    0xe23(%rip),%rdi
call   1060 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1060 <printf@plt>
lea    0xe13(%rip),%rdi
call   1060 <printf@plt>
lea    0xe02(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0xc0(%rbp)
mov    -0xc0(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1474 <main+0x2e4>
lea    0xde0(%rip),%rdi
call   1060 <printf@plt>
mov    -0xc0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc0(%rbp)
jmp    1445 <main+0x2b5>
lea    0xdc2(%rip),%rdi
call   1060 <printf@plt>
lea    0xdb1(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0xc4(%rbp)
mov    -0xc4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    14c5 <main+0x335>
lea    0xd8f(%rip),%rdi
call   1060 <printf@plt>
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
jmp    1496 <main+0x306>
lea    0xd71(%rip),%rdi
call   1060 <printf@plt>
lea    0xd6b(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0xc8(%rbp)
mov    -0xc8(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1516 <main+0x386>
lea    0xd2f(%rip),%rdi
call   1060 <printf@plt>
mov    -0xc8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc8(%rbp)
jmp    14e7 <main+0x357>
lea    0xd2d(%rip),%rdi
call   1060 <printf@plt>
mov    $0x2,%edi
call   10b0 <sleep@plt>
lea    0xd0f(%rip),%rdi
call   1030 <puts@plt>
lea    0xd13(%rip),%rdi
call   1030 <puts@plt>
lea    0xd3e(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0xa8,%rsp
mov    0x2e1c(%rip),%rax
mov    (%rax),%rdi
xor    %esi,%esi
call   1060 <setbuf@plt>
mov    0x2e23(%rip),%rbx
mov    (%rbx),%rdi
xor    %esi,%esi
call   1060 <setbuf@plt>
mov    0x2e02(%rip),%rax
mov    (%rax),%rdi
xor    %esi,%esi
call   1060 <setbuf@plt>
lea    0xe19(%rip),%rdi
call   1040 <puts@plt>
lea    0xe16(%rip),%rdi
call   1040 <puts@plt>
lea    0xe1f(%rip),%rdi
call   1040 <puts@plt>
lea    0xe3b(%rip),%rdi
call   1040 <puts@plt>
lea    0xe4c(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
lea    0xe65(%rip),%rdi
call   1040 <puts@plt>
lea    0xe94(%rip),%rdi
lea    0xe96(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1515 <main+0x375>
lea    0x40(%rsp),%rdi
mov    $0x64,%esi
mov    %rax,%rdx
call   1090 <fgets@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
lea    0xf1d(%rip),%rdi
call   1040 <puts@plt>
lea    0xf31(%rip),%rdi
call   1040 <puts@plt>
lea    0xf74(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x32,%esi
call   1090 <fgets@plt>
lea    0xf63(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcspn@plt>
movb   $0x0,(%rsp,%rax,1)
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf34(%rip),%rdi
call   1040 <puts@plt>
lea    0xf46(%rip),%rdi
call   1070 <printf@plt>
test   %ebx,%ebx
jle    1341 <main+0x1a1>
lea    0xf39(%rip),%r14
mov    %ebx,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1070 <printf@plt>
add    $0xffffffff,%ebp
jne    1300 <main+0x160>
lea    0xf72(%rip),%rdi
call   1040 <puts@plt>
lea    0xf12(%rip),%rdi
call   1070 <printf@plt>
test   %ebx,%ebx
jle    13c9 <main+0x229>
mov    %ebx,%ebp
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1330 <main+0x190>
jmp    1359 <main+0x1b9>
lea    0xf3e(%rip),%rdi
call   1040 <puts@plt>
lea    0xede(%rip),%rdi
call   1070 <printf@plt>
lea    0xf2d(%rip),%rdi
call   1040 <puts@plt>
lea    0xec6(%rip),%rdi
call   1070 <printf@plt>
test   %ebx,%ebx
jle    1391 <main+0x1f1>
mov    %ebx,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1380 <main+0x1e0>
jmp    13e1 <main+0x241>
lea    0xef5(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0xe8b(%rip),%r15
mov    %r15,%rdi
call   1070 <printf@plt>
mov    %rsp,%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1070 <printf@plt>
jmp    142f <main+0x28f>
lea    0xebd(%rip),%rdi
call   1040 <puts@plt>
lea    0xe56(%rip),%rdi
call   1070 <printf@plt>
lea    0xea5(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0xe3b(%rip),%r15
mov    %r15,%rdi
call   1070 <printf@plt>
mov    %rsp,%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1070 <printf@plt>
test   %ebx,%ebx
jle    147b <main+0x2db>
mov    %ebx,%ebp
nopl   (%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1420 <main+0x280>
lea    0xe57(%rip),%rdi
call   1040 <puts@plt>
lea    0xdf0(%rip),%rdi
call   1070 <printf@plt>
test   %ebx,%ebx
jle    1461 <main+0x2c1>
mov    %ebx,%ebp
nopl   (%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1450 <main+0x2b0>
jmp    1493 <main+0x2f3>
lea    0xe25(%rip),%rdi
call   1040 <puts@plt>
lea    0xdc3(%rip),%rdi
call   1070 <printf@plt>
jmp    14cd <main+0x32d>
lea    0xe0b(%rip),%rdi
call   1040 <puts@plt>
lea    0xda4(%rip),%rdi
call   1070 <printf@plt>
lea    0xdf3(%rip),%rdi
call   1040 <puts@plt>
lea    0xd91(%rip),%rdi
call   1070 <printf@plt>
test   %ebx,%ebx
jle    14cd <main+0x32d>
lea    0xd78(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1070 <printf@plt>
add    $0xffffffff,%ebx
jne    14c0 <main+0x320>
lea    0xdbe(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
call   10c0 <sleep@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd4a(%rip),%rdi
call   1040 <puts@plt>
lea    0xd75(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbbc(%rip),%rdi
call   1040 <puts@plt>
lea    0xbe0(%rip),%rdi
call   1040 <puts@plt>
lea    0xc15(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@stdout = global i32* null
@stdin = global i32* null
@stderr = global i32* null
@.str = [9 x i8] c"Hey all!\00"
@.str.1 = [21 x i8] c"Welcome to Amer Lit!\00"
@.str.2 = [40 x i8] c"In this class, we will be reading books\00"
@.str.3 = [29 x i8] c"(wow who would have guessed)\00"
@.str.4 = [47 x i8] c"and then doing fun things like writing essays!\00"
@.str.5 = [59 x i8] c"Y'know what, let me get a really good example of an essay.\00"
@.str.6 = [9 x i8] c"flag.txt\00"
@.str.7 = [2 x i8] c"r\00"
@.str.8 = [48 x i8] c"Oh no, I can't find my former students' essays!\00"
@.str.9 = [65 x i8] c"How now will I set the bar redicuolously high for new students??\00"
@.str.10 = [69 x i8] c"[If you are seeing this on the remote server, please contact admin].\00"
@.str.11 = [32 x i8] c"Actually, on further thought...\00"
@.str.12 = [79 x i8] c"You're a BCA student, you should be able to write a perfect essay immediately.\00"
@.str.13 = [14 x i8] c"Let's see it!\00"
@.str.14 = [2 x i8] c"\0A\00"
@.str.15 = [1 x i8] zeroinitializer
@.str.16 = [30 x i8] c"TURNITIN SUBMISSION RECEIVED:\00"
@.str.17 = [7 x i8] c"\E2\95\94\E2\95\90\00"
@.str.18 = [4 x i8] c"\E2\95\90\00"
@.str.19 = [8 x i8] c"\E2\95\90\E2\95\97\0A\00"
@.str.20 = [5 x i8] c"\E2\95\91 \00"
@.str.21 = [2 x i8] c" \00"
@.str.22 = [6 x i8] c" \E2\95\91\0A\00"
@.str.23 = [7 x i8] c"\E2\95\9A\E2\95\90\00"
@.str.24 = [8 x i8] c"\E2\95\90\E2\95\9D\0A\00"
@.str.25 = [55 x i8] c"You've clearly put a lot of work and effort into this.\00"
@.str.26 = [17 x i8] c"How about an 89?\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [50 x i8]
%4 = alloca i32*
%5 = alloca [100 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
%12 = load i32*, i32** @stdout
%13 = call i32 @setbuf(i32* %12, i32* null)
%14 = load i32*, i32** @stdin
%15 = call i32 @setbuf(i32* %14, i32* null)
%16 = load i32*, i32** @stderr
%17 = call i32 @setbuf(i32* %16, i32* null)
%18 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 @puts(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%23 = call i32 @sleep(i32 1)
%24 = call i32 @puts(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0))
%25 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %25, i32** %4
%26 = load i32*, i32** %4
%27 = icmp eq i32* %26, null
br i1 %27, label %28, label %33
28: ; preds = %0
%29 = call i32 @puts(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.8, i64 0, i64 0))
%30 = call i32 @puts(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.9, i64 0, i64 0))
%31 = call i32 @puts(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.10, i64 0, i64 0))
%32 = call i32 @exit(i32 1)
unreachable
33: ; preds = %0
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%35 = load i32*, i32** %4
%36 = call i32 @fgets(i8* %34, i32 100, i32* %35)
%37 = call i32 @sleep(i32 1)
%38 = call i32 @puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0))
%39 = call i32 @puts(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.12, i64 0, i64 0))
%40 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%41 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%42 = load i32*, i32** @stdin
%43 = call i32 @fgets(i8* %41, i32 50, i32* %42)
%44 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%45 = call i64 @strcspn(i8* %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%46 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 %45
store i8 0, i8* %46
%47 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%48 = call i32 @strlen(i8* %47)
store i32 %48, i32* %2
%49 = call i32 @sleep(i32 1)
%50 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.15, i64 0, i64 0))
%51 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0))
%52 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0))
store i32 0, i32* %6
br label %53
53: ; preds = %59, %33
%54 = load i32, i32* %6
%55 = load i32, i32* %2
%56 = icmp slt i32 %54, %55
br i1 %56, label %57, label %62
57: ; preds = %53
%58 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
br label %59
59: ; preds = %57
%60 = load i32, i32* %6
%61 = add nsw i32 %60, 1
store i32 %61, i32* %6
br label %53
62: ; preds = %53
%63 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
%64 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
store i32 0, i32* %7
br label %65
65: ; preds = %71, %62
%66 = load i32, i32* %7
%67 = load i32, i32* %2
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %74
69: ; preds = %65
%70 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0))
br label %71
71: ; preds = %69
%72 = load i32, i32* %7
%73 = add nsw i32 %72, 1
store i32 %73, i32* %7
br label %65
74: ; preds = %65
%75 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0))
%76 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
store i32 0, i32* %8
br label %77
77: ; preds = %83, %74
%78 = load i32, i32* %8
%79 = load i32, i32* %2
%80 = icmp slt i32 %78, %79
br i1 %80, label %81, label %86
81: ; preds = %77
%82 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0))
br label %83
83: ; preds = %81
%84 = load i32, i32* %8
%85 = add nsw i32 %84, 1
store i32 %85, i32* %8
br label %77
86: ; preds = %77
%87 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0))
%88 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
%89 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%90 = call i32 @printf(i8* %89)
%91 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0))
%92 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
store i32 0, i32* %9
br label %93
93: ; preds = %99, %86
%94 = load i32, i32* %9
%95 = load i32, i32* %2
%96 = icmp slt i32 %94, %95
br i1 %96, label %97, label %102
97: ; preds = %93
%98 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0))
br label %99
99: ; preds = %97
%100 = load i32, i32* %9
%101 = add nsw i32 %100, 1
store i32 %101, i32* %9
br label %93
102: ; preds = %93
%103 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0))
%104 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
store i32 0, i32* %10
br label %105
105: ; preds = %111, %102
%106 = load i32, i32* %10
%107 = load i32, i32* %2
%108 = icmp slt i32 %106, %107
br i1 %108, label %109, label %114
109: ; preds = %105
%110 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0))
br label %111
111: ; preds = %109
%112 = load i32, i32* %10
%113 = add nsw i32 %112, 1
store i32 %113, i32* %10
br label %105
114: ; preds = %105
%115 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0))
%116 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0))
store i32 0, i32* %11
br label %117
117: ; preds = %123, %114
%118 = load i32, i32* %11
%119 = load i32, i32* %2
%120 = icmp slt i32 %118, %119
br i1 %120, label %121, label %126
121: ; preds = %117
%122 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
br label %123
123: ; preds = %121
%124 = load i32, i32* %11
%125 = add nsw i32 %124, 1
store i32 %125, i32* %11
br label %117
126: ; preds = %117
%127 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%128 = call i32 @sleep(i32 2)
%129 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.15, i64 0, i64 0))
%130 = call i32 @puts(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.25, i64 0, i64 0))
%131 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.26, i64 0, i64 0))
%132 = load i32, i32* %1
ret i32 %132
}

LLVM IR (-O2):
@stdout = global i32* null
@stdin = global i32* null
@stderr = global i32* null
@.str = [9 x i8] c"Hey all!\00"
@.str.1 = [21 x i8] c"Welcome to Amer Lit!\00"
@.str.2 = [40 x i8] c"In this class, we will be reading books\00"
@.str.3 = [29 x i8] c"(wow who would have guessed)\00"
@.str.4 = [47 x i8] c"and then doing fun things like writing essays!\00"
@.str.5 = [59 x i8] c"Y'know what, let me get a really good example of an essay.\00"
@.str.6 = [9 x i8] c"flag.txt\00"
@.str.7 = [2 x i8] c"r\00"
@.str.8 = [48 x i8] c"Oh no, I can't find my former students' essays!\00"
@.str.9 = [65 x i8] c"How now will I set the bar redicuolously high for new students??\00"
@.str.10 = [69 x i8] c"[If you are seeing this on the remote server, please contact admin].\00"
@.str.11 = [32 x i8] c"Actually, on further thought...\00"
@.str.12 = [79 x i8] c"You're a BCA student, you should be able to write a perfect essay immediately.\00"
@.str.13 = [14 x i8] c"Let's see it!\00"
@.str.14 = [2 x i8] c"\0A\00"
@.str.16 = [30 x i8] c"TURNITIN SUBMISSION RECEIVED:\00"
@.str.17 = [7 x i8] c"\E2\95\94\E2\95\90\00"
@.str.18 = [4 x i8] c"\E2\95\90\00"
@.str.20 = [5 x i8] c"\E2\95\91 \00"
@.str.23 = [7 x i8] c"\E2\95\9A\E2\95\90\00"
@.str.25 = [55 x i8] c"You've clearly put a lot of work and effort into this.\00"
@.str.26 = [17 x i8] c"How about an 89?\00"
@str = [7 x i8] c"\E2\95\90\E2\95\97\00"
@str.31 = [5 x i8] c" \E2\95\91\00"
@str.32 = [7 x i8] c"\E2\95\90\E2\95\9D\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = load i32*, i32** @stdout
%5 = tail call i32 @setbuf(i32* %4, i32* null)
%6 = load i32*, i32** @stdin
%7 = tail call i32 @setbuf(i32* %6, i32* null)
%8 = load i32*, i32** @stderr
%9 = tail call i32 @setbuf(i32* %8, i32* null)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%15 = tail call i32 @sleep(i32 1)
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0))
%17 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%19 = icmp eq i32* %17, null
br i1 %19, label %20, label %25
20: ; preds = %0
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.8, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.9, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.10, i64 0, i64 0))
%24 = tail call i32 @exit(i32 1)
unreachable
25: ; preds = %0
%26 = call i32 @fgets(i8* %18, i32 100, i32* %17)
%27 = call i32 @sleep(i32 1)
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0))
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @.str.12, i64 0, i64 0))
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%31 = load i32*, i32** @stdin
%32 = call i32 @fgets(i8* %3, i32 50, i32* %31)
%33 = call i64 @strcspn(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%34 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 %33
store i8 0, i8* %34
%35 = call i32 @strlen(i8* %3)
%36 = call i32 @sleep(i32 1)
%37 = call i32 @putchar(i32 10)
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0))
%39 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0))
%40 = icmp sgt i32 %35, 0
br i1 %40, label %44, label %49
41: ; preds = %44
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%43 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
br i1 %40, label %55, label %60
44: ; preds = %25, %44
%45 = phi i32 [ %47, %44 ], [ 0, %25 ]
%46 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
%47 = add nuw nsw i32 %45, 1
%48 = icmp eq i32 %47, %35
br i1 %48, label %41, label %44
49: ; preds = %25
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%51 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
br label %52
52: ; preds = %55, %49
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.31, i64 0, i64 0))
%54 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
br i1 %40, label %69, label %74
55: ; preds = %41, %55
%56 = phi i32 [ %58, %55 ], [ 0, %41 ]
%57 = call i32 @putchar(i32 32)
%58 = add nuw nsw i32 %56, 1
%59 = icmp eq i32 %58, %35
br i1 %59, label %52, label %55
60: ; preds = %41
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.31, i64 0, i64 0))
%62 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
br label %63
63: ; preds = %69, %60
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.31, i64 0, i64 0))
%65 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
%66 = call i32 @printf(i8* %3)
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.31, i64 0, i64 0))
%68 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
br i1 %40, label %83, label %88
69: ; preds = %52, %69
%70 = phi i32 [ %72, %69 ], [ 0, %52 ]
%71 = call i32 @putchar(i32 32)
%72 = add nuw nsw i32 %70, 1
%73 = icmp eq i32 %72, %35
br i1 %73, label %63, label %69
74: ; preds = %52
%75 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.31, i64 0, i64 0))
%76 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
%77 = call i32 @printf(i8* %3)
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.31, i64 0, i64 0))
%79 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
br label %80
80: ; preds = %83, %74
%81 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.31, i64 0, i64 0))
%82 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
br i1 %40, label %94, label %99
83: ; preds = %63, %83
%84 = phi i32 [ %86, %83 ], [ 0, %63 ]
%85 = call i32 @putchar(i32 32)
%86 = add nuw nsw i32 %84, 1
%87 = icmp eq i32 %86, %35
br i1 %87, label %80, label %83
88: ; preds = %63
%89 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.31, i64 0, i64 0))
%90 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
br label %91
91: ; preds = %94, %88
%92 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.31, i64 0, i64 0))
%93 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0))
br i1 %40, label %108, label %102
94: ; preds = %80, %94
%95 = phi i32 [ %97, %94 ], [ 0, %80 ]
%96 = call i32 @putchar(i32 32)
%97 = add nuw nsw i32 %95, 1
%98 = icmp eq i32 %97, %35
br i1 %98, label %91, label %94
99: ; preds = %80
%100 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.31, i64 0, i64 0))
%101 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0))
br label %102
102: ; preds = %108, %99, %91
%103 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.32, i64 0, i64 0))
%104 = call i32 @sleep(i32 2)
%105 = call i32 @putchar(i32 10)
%106 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.25, i64 0, i64 0))
%107 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.26, i64 0, i64 0))
ret i32 0
108: ; preds = %91, %108
%109 = phi i32 [ %111, %108 ], [ 0, %91 ]
%110 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
%111 = add nuw nsw i32 %109, 1
%112 = icmp eq i32 %111, %35
br i1 %112, label %102, label %108
}