#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 atoi(char *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strerror(int /*<<< orphan*/);
int strlen(char *);
scalar_t__ strstr(char *, char *);
int main(int argc, char *argv[]) {
  FILE *stream = fopen("grades.csv", "r");
  if (stream == NULL) {
    fprintf(stderr, "%s: Cannot open %s: %s\n", argv[0], "grades.csv",
            strerror(errno));
    return -1;
  }
  int count;
  scanf("%d", &count);
  printf("\n");
  char line[100][1024];
  int i;
  for (i = 0; i < 100; ++i) {
    strcpy(line[i], "");
  }
  char storeString[1024];
  i = 0;
  while (fgets(storeString, 1024, stream)) {
    if (strstr(storeString, "HW2")) {
      int storeLength = strlen(storeString);
      int characterNum = 2;
      for (int j = storeLength - 1; j > storeLength - 4; --j) {
        line[i][characterNum--] = storeString[j];
      }
      ++i;
    }
  }
  int mainArr[count];
  for (i = 0; i < count; ++i) {
    mainArr[i] = -1;
  }
  for (i = 0; strcmp(line[i], ""); ++i) {
    int currNum = atoi(line[i]);
    for (int j = 0; j < count; ++j) {
      if (currNum > mainArr[j]) {
        for (int k = count - 1; k > j; --k) {
          mainArr[k] = mainArr[k - 1];
        }
        mainArr[j] = currNum;
        break;
      }
    }
  }
  for (i = 0; i < count; ++i) {
    if (mainArr[i] == -1) {
      printf("\n");
      printf("User input was higher than grades in HW2 Category\n");
      break;
    }
    printf("%d ", mainArr[i]);
  }
  fclose(stream);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x19480,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe20(%rip),%rdi
lea    0xe24(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1255 <main+0x95>
mov    0x2dde(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1946c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x19468(%rbp)
mov    0x2db9(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x1946c(%rbp),%edi
mov    -0x19468(%rbp),%rdx
mov    %rax,%r8
lea    0xdd0(%rip),%rsi
lea    0xdbc(%rip),%rcx
call   1090 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    15e5 <main+0x425>
lea    0xdc9(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   10a0 <scanf@plt>
lea    0xdb7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x19024(%rbp)
cmpl   $0x64,-0x19024(%rbp)
jge    12bf <main+0xff>
movslq -0x19024(%rbp),%rax
lea    -0x19020(%rbp),%rdi
shl    $0xa,%rax
add    %rax,%rdi
lea    0xd7e(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x19024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x19024(%rbp)
jmp    127d <main+0xbd>
movl   $0x0,-0x19024(%rbp)
lea    -0x19430(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x400,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     13a9 <main+0x1e9>
lea    -0x19430(%rbp),%rdi
lea    0xd32(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     13a4 <main+0x1e4>
lea    -0x19430(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x19434(%rbp)
movl   $0x2,-0x19438(%rbp)
mov    -0x19434(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1943c(%rbp)
mov    -0x1943c(%rbp),%eax
mov    -0x19434(%rbp),%ecx
sub    $0x4,%ecx
cmp    %ecx,%eax
jle    1395 <main+0x1d5>
movslq -0x1943c(%rbp),%rax
mov    -0x19430(%rbp,%rax,1),%dl
movslq -0x19024(%rbp),%rcx
lea    -0x19020(%rbp),%rax
shl    $0xa,%rcx
add    %rcx,%rax
mov    -0x19438(%rbp),%ecx
mov    %ecx,%esi
add    $0xffffffff,%esi
mov    %esi,-0x19438(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1943c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1943c(%rbp)
jmp    1330 <main+0x170>
mov    -0x19024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x19024(%rbp)
jmp    12c9 <main+0x109>
mov    -0x1c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x19448(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x19478(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x19450(%rbp)
movl   $0x0,-0x19024(%rbp)
mov    -0x19024(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    141b <main+0x25b>
mov    -0x19478(%rbp),%rax
movslq -0x19024(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x19024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x19024(%rbp)
jmp    13e3 <main+0x223>
movl   $0x0,-0x19024(%rbp)
movslq -0x19024(%rbp),%rax
lea    -0x19020(%rbp),%rdi
shl    $0xa,%rax
add    %rax,%rdi
lea    0xbe3(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1546 <main+0x386>
movslq -0x19024(%rbp),%rax
lea    -0x19020(%rbp),%rdi
shl    $0xa,%rax
add    %rax,%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x19454(%rbp)
movl   $0x0,-0x19458(%rbp)
mov    -0x19458(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    152d <main+0x36d>
mov    -0x19478(%rbp),%rcx
mov    -0x19454(%rbp),%eax
movslq -0x19458(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    1514 <main+0x354>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1945c(%rbp)
mov    -0x1945c(%rbp),%eax
cmp    -0x19458(%rbp),%eax
jle    14f8 <main+0x338>
mov    -0x19478(%rbp),%rax
mov    -0x1945c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
movslq -0x1945c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1945c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1945c(%rbp)
jmp    14b2 <main+0x2f2>
mov    -0x19478(%rbp),%rax
mov    -0x19454(%rbp),%edx
movslq -0x19458(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    152d <main+0x36d>
jmp    1519 <main+0x359>
mov    -0x19458(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x19458(%rbp)
jmp    147a <main+0x2ba>
jmp    1532 <main+0x372>
mov    -0x19024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x19024(%rbp)
jmp    1425 <main+0x265>
movl   $0x0,-0x19024(%rbp)
mov    -0x19024(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    15cb <main+0x40b>
mov    -0x19478(%rbp),%rax
movslq -0x19024(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
jne    1598 <main+0x3d8>
lea    0xaa5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xaa0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    15cb <main+0x40b>
mov    -0x19478(%rbp),%rax
movslq -0x19024(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xaaf(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x19024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x19024(%rbp)
jmp    1550 <main+0x390>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x19448(%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   %r13
push   %r12
push   %rbx
sub    $0x19458,%rsp
mov    %rsi,%rbx
lea    0xde2(%rip),%rdi
lea    0xde6(%rip),%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
je     1662 <main+0x462>
mov    %rax,%r14
lea    0xde8(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   10e0 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %ebx,%ebx
lea    0xdcb(%rip),%r15
nopl   0x0(%rax)
lea    (%rbx,%rbp,1),%rdi
add    $0xfffffffffffe6b80,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
add    $0x400,%rbx
cmp    $0x19000,%rbx
jne    1260 <main+0x60>
lea    -0x480(%rbp),%rdi
mov    $0x400,%esi
mov    %r14,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     132a <main+0x12a>
xor    %ebx,%ebx
lea    -0x1947e(%rbp),%r13
lea    0xd78(%rip),%r15
lea    -0x480(%rbp),%r12
jmp    12d5 <main+0xd5>
nopl   0x0(%rax)
mov    %r12,%rdi
mov    $0x400,%esi
mov    %r14,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     132a <main+0x12a>
mov    %r12,%rdi
mov    %r15,%rsi
call   1120 <strstr@plt>
test   %rax,%rax
je     12c0 <main+0xc0>
mov    %r12,%rdi
call   1070 <strlen@plt>
movslq %ebx,%rbx
mov    %rbx,%rdi
shl    $0xa,%rdi
lea    -0x2(%rax),%ecx
cmp    %ecx,%eax
cmovl  %eax,%ecx
mov    %eax,%edx
sub    %ecx,%edx
sub    %rdx,%rdi
add    %r13,%rdi
add    $0xffffffff,%eax
cltq
sub    %rdx,%rax
lea    (%rax,%rbp,1),%rsi
add    $0xfffffffffffffb80,%rsi
add    $0x1,%rdx
call   10d0 <memcpy@plt>
add    $0x1,%ebx
jmp    12c0 <main+0xc0>
mov    %rsp,-0x70(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%r12
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
mov    -0x2c(%rbp),%edx
test   %edx,%edx
jle    135e <main+0x15e>
shl    $0x2,%rdx
mov    %r12,%rdi
mov    $0xff,%esi
call   1090 <memset@plt>
lea    0xcbf(%rip),%rsi
lea    -0x19480(%rbp),%rbx
mov    %rbx,%rdi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     162d <main+0x42d>
lea    -0x4(%r12),%rax
mov    %rax,-0x78(%rbp)
lea    0x4(%r12),%rax
mov    %rax,-0x68(%rbp)
lea    0x8(%r12),%rax
mov    %rax,-0x60(%rbp)
lea    -0x10(%r12),%rax
mov    %rax,-0x58(%rbp)
xor    %r13d,%r13d
lea    0xc79(%rip),%r15
mov    %r14,-0x38(%rbp)
jmp    13ee <main+0x1ee>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ecx,(%r12,%rdi,4)
add    $0x1,%r13
mov    %r13,%rax
shl    $0xa,%rax
lea    (%rax,%rbp,1),%rbx
add    $0xfffffffffffe6b80,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     162d <main+0x42d>
mov    %rbx,%rdi
call   1100 <atoi@plt>
movslq -0x2c(%rbp),%r9
test   %r9,%r9
jle    13c4 <main+0x1c4>
mov    %eax,%ecx
mov    %r9d,%ebx
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
cmp    (%r12,%rdi,4),%ecx
jg     1430 <main+0x230>
add    $0x1,%rdi
cmp    %rdi,%rbx
jne    1410 <main+0x210>
jmp    13c4 <main+0x1c4>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%eax
cmp    %edi,%eax
jle    13c0 <main+0x1c0>
lea    -0x2(%r9),%r11
cmp    %r11,%rdi
mov    %r11,%r10
cmovl  %rdi,%r10
lea    -0x1(%r9),%rsi
not    %r10
add    %r9,%r10
cmp    $0x7,%r10
jbe    1510 <main+0x310>
cmp    %r11,%rdi
mov    %r11,%rax
cmovl  %rdi,%rax
neg    %rax
lea    (%r9,%rax,1),%r8
add    $0xfffffffffffffffe,%r8
lea    -0x2(%rbx),%r14d
mov    %r14d,%r15d
sub    %r8d,%r15d
mov    %r8,%rax
mov    $0x4,%edx
mul    %rdx
seto   %dl
cmp    %r14d,%r15d
jg     1500 <main+0x300>
shr    $0x20,%r8
jne    1500 <main+0x300>
mov    %edx,%r15d
mov    -0x78(%rbp),%rdx
lea    (%rdx,%r9,4),%r8
mov    %r8,%rdx
sub    %rax,%rdx
cmp    %r8,%rdx
ja     1500 <main+0x300>
test   %r15b,%r15b
jne    1500 <main+0x300>
movslq %r14d,%rdx
lea    (%r12,%rdx,4),%r8
mov    %r8,%rdx
sub    %rax,%rdx
cmp    %r8,%rdx
ja     1500 <main+0x300>
test   %r15b,%r15b
jne    1500 <main+0x300>
mov    %r14d,-0x3c(%rbp)
cmp    %r11,%rdi
mov    %r11,%rax
cmovl  %rdi,%rax
mov    -0x68(%rbp),%r15
lea    (%r15,%rax,4),%r8
lea    -0x2(%r9),%edx
movslq %edx,%r14
lea    (%r15,%r14,4),%rdx
cmp    %rdx,%r8
jae    152f <main+0x32f>
lea    (%r12,%r9,4),%r8
add    %r14,%rax
sub    %r9,%rax
mov    -0x60(%rbp),%rdx
lea    (%rdx,%rax,4),%rax
cmp    %r8,%rax
jae    152f <main+0x32f>
mov    -0x38(%rbp),%r14
lea    0xb19(%rip),%r15
nopl   0x0(%rax,%rax,1)
movslq %ebx,%rax
mov    -0x8(%r12,%rax,4),%eax
mov    %eax,(%r12,%rsi,4)
mov    %esi,%ebx
lea    -0x1(%rsi),%rax
mov    %rax,%rsi
cmp    %rdi,%rax
jg     1510 <main+0x310>
jmp    13c0 <main+0x1c0>
mov    %r10,%r8
and    $0xfffffffffffffff8,%r8
lea    -0x8(%r8),%rdx
mov    %rdx,%rax
shr    $0x3,%rax
add    $0x1,%rax
test   %rdx,%rdx
je     15e2 <main+0x3e2>
mov    %rax,-0x48(%rbp)
mov    %r8,-0x50(%rbp)
mov    -0x58(%rbp),%rax
lea    (%rax,%r9,4),%r14
lea    -0xa(%rbx),%r8d
mov    -0x3c(%rbp),%r15d
cmp    %r11,%rdi
cmovl  %rdi,%r11
not    %r11
add    %r9,%r11
and    $0xfffffffffffffff8,%r11
add    $0xfffffffffffffff8,%r11
shr    $0x3,%r11
add    $0x1,%r11
and    $0xfffffffffffffffe,%r11
xor    %edx,%edx
nopl   0x0(%rax)
lea    (%r15,%rdx,1),%eax
cltq
movups -0x1c(%r12,%rax,4),%xmm0
movups -0xc(%r12,%rax,4),%xmm1
movups %xmm1,(%r14,%rdx,4)
movups %xmm0,-0x10(%r14,%rdx,4)
lea    (%r8,%rdx,1),%eax
cltq
movups -0x1c(%r12,%rax,4),%xmm0
movups -0xc(%r12,%rax,4),%xmm1
movups %xmm1,-0x20(%r14,%rdx,4)
movups %xmm0,-0x30(%r14,%rdx,4)
add    $0xfffffffffffffff0,%rdx
add    $0xfffffffffffffffe,%r11
jne    1590 <main+0x390>
neg    %rdx
mov    -0x50(%rbp),%r8
mov    -0x48(%rbp),%rax
jmp    15e4 <main+0x3e4>
xor    %edx,%edx
test   $0x1,%al
mov    -0x38(%rbp),%r14
lea    0xa33(%rip),%r15
je     1616 <main+0x416>
mov    %rsi,%rax
sub    %rdx,%rax
sub    %edx,%ebx
movslq %ebx,%rdx
movups -0x24(%r12,%rdx,4),%xmm0
movups -0x14(%r12,%rdx,4),%xmm1
movups %xmm1,-0xc(%r12,%rax,4)
movups %xmm0,-0x1c(%r12,%rax,4)
cmp    %r8,%r10
je     13c0 <main+0x1c0>
sub    %r8,%rsi
sub    %r8d,%r9d
mov    %r9d,%ebx
jmp    1510 <main+0x310>
cmpl   $0x0,-0x2c(%rbp)
jle    16b6 <main+0x4b6>
lea    0x9ee(%rip),%r15
xor    %ebx,%ebx
mov    (%r12,%rbx,4),%esi
cmp    $0xffffffff,%esi
je     16a0 <main+0x4a0>
mov    %r15,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x1,%rbx
movslq -0x2c(%rbp),%rax
cmp    %rax,%rbx
jl     1640 <main+0x440>
jmp    16b6 <main+0x4b6>
mov    0x2977(%rip),%rax
mov    (%rax),%r14d
mov    (%rbx),%rbx
mov    0x2962(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
lea    0x989(%rip),%rsi
lea    0x975(%rip),%rcx
mov    %r14d,%edi
mov    %rbx,%rdx
mov    %rax,%r8
call   10c0 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    16c4 <main+0x4c4>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x97f(%rip),%rdi
call   1050 <puts@plt>
mov    %r14,%rdi
call   1060 <fclose@plt>
mov    -0x70(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"grades.csv\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [24 x i8] c"%s: Cannot open %s: %s\0A\00"
@errno = global i32 0
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [1 x i8] zeroinitializer
@.str.6 = [4 x i8] c"HW2\00"
@.str.7 = [51 x i8] c"User input was higher than grades in HW2 Category\0A\00"
@.str.8 = [4 x i8] c"%d \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca [100 x [1024 x i8]]
%9 = alloca i32
%10 = alloca [1024 x i8]
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%19 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %19, i32** %6
%20 = load i32*, i32** %6
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %30
22: ; preds = %2
%23 = load i32, i32* @stderr
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = load i32, i32* @errno
%28 = call i8* @strerror(i32 %27)
%29 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %26, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %28)
store i32 -1, i32* %3
br label %184
30: ; preds = %2
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %9
br label %33
33: ; preds = %42, %30
%34 = load i32, i32* %9
%35 = icmp slt i32 %34, 100
br i1 %35, label %36, label %45
36: ; preds = %33
%37 = load i32, i32* %9
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [100 x [1024 x i8]], [100 x [1024 x i8]]* %8, i64 0, i64 %38
%40 = getelementptr inbounds [1024 x i8], [1024 x i8]* %39, i64 0, i64 0
%41 = call i32 @strcpy(i8* %40, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
br label %42
42: ; preds = %36
%43 = load i32, i32* %9
%44 = add nsw i32 %43, 1
store i32 %44, i32* %9
br label %33
45: ; preds = %33
store i32 0, i32* %9
br label %46
46: ; preds = %83, %45
%47 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%48 = load i32*, i32** %6
%49 = call i64 @fgets(i8* %47, i32 1024, i32* %48)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %84
51: ; preds = %46
%52 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%53 = call i64 @strstr(i8* %52, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %83
55: ; preds = %51
%56 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%57 = call i32 @strlen(i8* %56)
store i32 %57, i32* %11
store i32 2, i32* %12
%58 = load i32, i32* %11
%59 = sub nsw i32 %58, 1
store i32 %59, i32* %13
br label %60
60: ; preds = %77, %55
%61 = load i32, i32* %13
%62 = load i32, i32* %11
%63 = sub nsw i32 %62, 4
%64 = icmp sgt i32 %61, %63
br i1 %64, label %65, label %80
65: ; preds = %60
%66 = load i32, i32* %13
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = load i32, i32* %9
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [100 x [1024 x i8]], [100 x [1024 x i8]]* %8, i64 0, i64 %71
%73 = load i32, i32* %12
%74 = add nsw i32 %73, -1
store i32 %74, i32* %12
%75 = sext i32 %73 to i64
%76 = getelementptr inbounds [1024 x i8], [1024 x i8]* %72, i64 0, i64 %75
store i8 %69, i8* %76
br label %77
77: ; preds = %65
%78 = load i32, i32* %13
%79 = add nsw i32 %78, -1
store i32 %79, i32* %13
br label %60
80: ; preds = %60
%81 = load i32, i32* %9
%82 = add nsw i32 %81, 1
store i32 %82, i32* %9
br label %83
83: ; preds = %80, %51
br label %46
84: ; preds = %46
%85 = load i32, i32* %7
%86 = zext i32 %85 to i64
%87 = call i8* @llvm.stacksave()
store i8* %87, i8** %14
%88 = alloca i32, i64 %86
store i64 %86, i64* %15
store i32 0, i32* %9
br label %89
89: ; preds = %97, %84
%90 = load i32, i32* %9
%91 = load i32, i32* %7
%92 = icmp slt i32 %90, %91
br i1 %92, label %93, label %100
93: ; preds = %89
%94 = load i32, i32* %9
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i32, i32* %88, i64 %95
store i32 -1, i32* %96
br label %97
97: ; preds = %93
%98 = load i32, i32* %9
%99 = add nsw i32 %98, 1
store i32 %99, i32* %9
br label %89
100: ; preds = %89
store i32 0, i32* %9
br label %101
101: ; preds = %154, %100
%102 = load i32, i32* %9
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [100 x [1024 x i8]], [100 x [1024 x i8]]* %8, i64 0, i64 %103
%105 = getelementptr inbounds [1024 x i8], [1024 x i8]* %104, i64 0, i64 0
%106 = call i64 @strcmp(i8* %105, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
%107 = icmp ne i64 %106, 0
br i1 %107, label %108, label %157
108: ; preds = %101
%109 = load i32, i32* %9
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [100 x [1024 x i8]], [100 x [1024 x i8]]* %8, i64 0, i64 %110
%112 = getelementptr inbounds [1024 x i8], [1024 x i8]* %111, i64 0, i64 0
%113 = call i32 @atoi(i8* %112)
store i32 %113, i32* %16
store i32 0, i32* %17
br label %114
114: ; preds = %150, %108
%115 = load i32, i32* %17
%116 = load i32, i32* %7
%117 = icmp slt i32 %115, %116
br i1 %117, label %118, label %153
118: ; preds = %114
%119 = load i32, i32* %16
%120 = load i32, i32* %17
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i32, i32* %88, i64 %121
%123 = load i32, i32* %122
%124 = icmp sgt i32 %119, %123
br i1 %124, label %125, label %149
125: ; preds = %118
%126 = load i32, i32* %7
%127 = sub nsw i32 %126, 1
store i32 %127, i32* %18
br label %128
128: ; preds = %141, %125
%129 = load i32, i32* %18
%130 = load i32, i32* %17
%131 = icmp sgt i32 %129, %130
br i1 %131, label %132, label %144
132: ; preds = %128
%133 = load i32, i32* %18
%134 = sub nsw i32 %133, 1
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds i32, i32* %88, i64 %135
%137 = load i32, i32* %136
%138 = load i32, i32* %18
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i32, i32* %88, i64 %139
store i32 %137, i32* %140
br label %141
141: ; preds = %132
%142 = load i32, i32* %18
%143 = add nsw i32 %142, -1
store i32 %143, i32* %18
br label %128
144: ; preds = %128
%145 = load i32, i32* %16
%146 = load i32, i32* %17
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i32, i32* %88, i64 %147
store i32 %145, i32* %148
br label %153
149: ; preds = %118
br label %150
150: ; preds = %149
%151 = load i32, i32* %17
%152 = add nsw i32 %151, 1
store i32 %152, i32* %17
br label %114
153: ; preds = %144, %114
br label %154
154: ; preds = %153
%155 = load i32, i32* %9
%156 = add nsw i32 %155, 1
store i32 %156, i32* %9
br label %101
157: ; preds = %101
store i32 0, i32* %9
br label %158
158: ; preds = %177, %157
%159 = load i32, i32* %9
%160 = load i32, i32* %7
%161 = icmp slt i32 %159, %160
br i1 %161, label %162, label %180
162: ; preds = %158
%163 = load i32, i32* %9
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds i32, i32* %88, i64 %164
%166 = load i32, i32* %165
%167 = icmp eq i32 %166, -1
br i1 %167, label %168, label %171
168: ; preds = %162
%169 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%170 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.7, i64 0, i64 0))
br label %180
171: ; preds = %162
%172 = load i32, i32* %9
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds i32, i32* %88, i64 %173
%175 = load i32, i32* %174
%176 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %175)
br label %177
177: ; preds = %171
%178 = load i32, i32* %9
%179 = add nsw i32 %178, 1
store i32 %179, i32* %9
br label %158
180: ; preds = %168, %158
%181 = load i32*, i32** %6
%182 = call i32 @fclose(i32* %181)
store i32 0, i32* %3
%183 = load i8*, i8** %14
br label %184
184: ; preds = %180, %22
%185 = load i32, i32* %3
ret i32 %185
}

LLVM IR (-O2):
@.str = [11 x i8] c"grades.csv\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [24 x i8] c"%s: Cannot open %s: %s\0A\00"
@errno = global i32 0
@.str.3 = [3 x i8] c"%d\00"
@.str.5 = [1 x i8] zeroinitializer
@.str.6 = [4 x i8] c"HW2\00"
@.str.8 = [4 x i8] c"%d \00"
@str = [50 x i8] c"User input was higher than grades in HW2 Category\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca [100 x [1024 x i8]]
%5 = alloca [1024 x i8]
%6 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = load i32, i32* @errno
%12 = tail call i8* @strerror(i32 %11)
%13 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %273
14: ; preds = %2
%15 = bitcast i32* %3 to i8*
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%17 = call i32 @putchar(i32 10)
%18 = getelementptr inbounds [100 x [1024 x i8]], [100 x [1024 x i8]]* %4, i64 0, i64 0, i64 0
br label %19
19: ; preds = %14, %19
%20 = phi i64 [ 0, %14 ], [ %23, %19 ]
%21 = getelementptr inbounds [100 x [1024 x i8]], [100 x [1024 x i8]]* %4, i64 0, i64 %20, i64 0
%22 = call i32 @strcpy(i8* %21, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
%23 = add nuw nsw i64 %20, 1
%24 = icmp eq i64 %23, 100
br i1 %24, label %25, label %19
25: ; preds = %19
%26 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%27 = call i64 @fgets(i8* %26, i32 1024, i32* %6)
%28 = icmp eq i64 %27, 0
br i1 %28, label %55, label %29
29: ; preds = %25
%30 = getelementptr inbounds [100 x [1024 x i8]], [100 x [1024 x i8]]* %4, i64 0, i64 0, i64 2
br label %31
31: ; preds = %29, %51
%32 = phi i32 [ %52, %51 ], [ 0, %29 ]
%33 = call i64 @strstr(i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %51, label %35
35: ; preds = %31
%36 = call i32 @strlen(i8* %26)
%37 = sext i32 %32 to i64
%38 = shl nsw i64 %37, 10
%39 = add i32 %36, -2
%40 = call i32 @llvm.smin.i32(i32 %36, i32 %39)
%41 = sub i32 %36, %40
%42 = zext i32 %41 to i64
%43 = sub nsw i64 %38, %42
%44 = getelementptr i8, i8* %30, i64 %43
%45 = add i32 %36, -1
%46 = sext i32 %45 to i64
%47 = sub nsw i64 %46, %42
%48 = getelementptr [1024 x i8], [1024 x i8]* %5, i64 0, i64 %47
%49 = add nuw nsw i64 %42, 1
%50 = add nsw i32 %32, 1
br label %51
51: ; preds = %35, %31
%52 = phi i32 [ %50, %35 ], [ %32, %31 ]
%53 = call i64 @fgets(i8* %26, i32 1024, i32* %6)
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %31
55: ; preds = %51, %25
%56 = load i32, i32* %3
%57 = zext i32 %56 to i64
%58 = call i8* @llvm.stacksave()
%59 = alloca i32, i64 %57
%60 = load i32, i32* %3
%61 = icmp sgt i32 %60, 0
br i1 %61, label %62, label %66
62: ; preds = %55
%63 = bitcast i32* %59 to i8*
%64 = zext i32 %60 to i64
%65 = shl nuw nsw i64 %64, 2
br label %66
66: ; preds = %62, %55
%67 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
%68 = icmp eq i64 %67, 0
br i1 %68, label %74, label %69
69: ; preds = %66
%70 = getelementptr i32, i32* %59, i64 -1
%71 = getelementptr inbounds i32, i32* %59, i64 1
%72 = getelementptr i32, i32* %59, i64 2
%73 = getelementptr inbounds i32, i32* %59, i64 1
br label %77
74: ; preds = %252, %66
%75 = load i32, i32* %3
%76 = icmp sgt i32 %75, 0
br i1 %76, label %257, label %271
77: ; preds = %69, %252
%78 = phi i64 [ %253, %252 ], [ 0, %69 ]
%79 = phi i8* [ %254, %252 ], [ %18, %69 ]
%80 = call i32 @atoi(i8* %79)
%81 = load i32, i32* %3
%82 = icmp sgt i32 %81, 0
br i1 %82, label %83, label %252
83: ; preds = %77
%84 = zext i32 %81 to i64
br label %85
85: ; preds = %83, %249
%86 = phi i64 [ 0, %83 ], [ %250, %249 ]
%87 = getelementptr inbounds i32, i32* %59, i64 %86
%88 = load i32, i32* %87
%89 = icmp sgt i32 %80, %88
br i1 %89, label %90, label %249
90: ; preds = %85
%91 = trunc i64 %86 to i32
%92 = and i64 %86, 4294967295
%93 = getelementptr inbounds i32, i32* %59, i64 %92
%94 = add nsw i32 %81, -1
%95 = icmp sgt i32 %94, %91
br i1 %95, label %96, label %237
96: ; preds = %90
%97 = sext i32 %81 to i64
%98 = add nsw i64 %97, -1
%99 = shl i64 %86, 32
%100 = ashr exact i64 %99, 32
%101 = add nsw i64 %97, -2
%102 = call i64 @llvm.smin.i64(i64 %86, i64 %101)
%103 = xor i64 %102, -1
%104 = add i64 %103, %97
%105 = icmp ult i64 %104, 8
br i1 %105, label %234, label %106
106: ; preds = %96
%107 = add nsw i64 %97, -2
%108 = add nsw i64 %97, -2
%109 = call i64 @llvm.smin.i64(i64 %86, i64 %108)
%110 = sub i64 %107, %109
%111 = add i32 %81, -2
%112 = trunc i64 %110 to i32
%113 = sub i32 %111, %112
%114 = icmp sgt i32 %113, %111
%115 = icmp ugt i64 %110, 4294967295
%116 = or i1 %114, %115
%117 = getelementptr i32, i32* %70, i64 %97
%118 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %110, i64 4)
%119 = extractvalue { i64, i1 } %118, 0
%120 = extractvalue { i64, i1 } %118, 1
%121 = bitcast i32* %117 to i8*
%122 = sub i64 0, %119
%123 = getelementptr i8, i8* %121, i64 %122
%124 = icmp ugt i8* %123, %121
%125 = or i1 %124, %120
%126 = sext i32 %111 to i64
%127 = getelementptr i32, i32* %59, i64 %126
%128 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %110, i64 4)
%129 = extractvalue { i64, i1 } %128, 0
%130 = extractvalue { i64, i1 } %128, 1
%131 = bitcast i32* %127 to i8*
%132 = sub i64 0, %129
%133 = getelementptr i8, i8* %131, i64 %132
%134 = icmp ugt i8* %133, %131
%135 = or i1 %134, %130
%136 = or i1 %116, %125
%137 = or i1 %136, %135
br i1 %137, label %234, label %138
138: ; preds = %106
%139 = add nsw i64 %97, -2
%140 = call i64 @llvm.smin.i64(i64 %86, i64 %139)
%141 = getelementptr i32, i32* %71, i64 %140
%142 = getelementptr i32, i32* %59, i64 %97
%143 = add i32 %81, -2
%144 = sext i32 %143 to i64
%145 = add i64 %140, %144
%146 = sub i64 %145, %97
%147 = getelementptr i32, i32* %72, i64 %146
%148 = getelementptr i32, i32* %73, i64 %144
%149 = icmp ult i32* %141, %148
%150 = icmp ult i32* %147, %142
%151 = and i1 %149, %150
br i1 %151, label %234, label %152
152: ; preds = %138
%153 = and i64 %104, -8
%154 = sub i64 %98, %153
%155 = trunc i64 %153 to i32
%156 = sub i32 %81, %155
%157 = add i64 %153, -8
%158 = lshr exact i64 %157, 3
%159 = add nuw nsw i64 %158, 1
%160 = and i64 %159, 1
%161 = icmp eq i64 %157, 0
br i1 %161, label %209, label %162
162: ; preds = %152
%163 = and i64 %159, 4611686018427387902
br label %164
164: ; preds = %164, %162
%165 = phi i64 [ 0, %162 ], [ %206, %164 ]
%166 = phi i64 [ 0, %162 ], [ %207, %164 ]
%167 = sub i64 %98, %165
%168 = trunc i64 %165 to i32
%169 = sub i32 %81, %168
%170 = add nsw i32 %169, -2
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds i32, i32* %59, i64 %171
%173 = getelementptr inbounds i32, i32* %172, i64 -3
%174 = bitcast i32* %173 to <4 x i32>*
%175 = load <4 x i32>, <4 x i32>* %174
%176 = getelementptr inbounds i32, i32* %172, i64 -4
%177 = getelementptr inbounds i32, i32* %176, i64 -3
%178 = bitcast i32* %177 to <4 x i32>*
%179 = load <4 x i32>, <4 x i32>* %178
%180 = getelementptr inbounds i32, i32* %59, i64 %167
%181 = getelementptr inbounds i32, i32* %180, i64 -3
%182 = bitcast i32* %181 to <4 x i32>*
store <4 x i32> %175, <4 x i32>* %182
%183 = getelementptr inbounds i32, i32* %180, i64 -4
%184 = getelementptr inbounds i32, i32* %183, i64 -3
%185 = bitcast i32* %184 to <4 x i32>*
store <4 x i32> %179, <4 x i32>* %185
%186 = or i64 %165, 8
%187 = sub i64 %98, %186
%188 = trunc i64 %186 to i32
%189 = sub i32 %81, %188
%190 = add nsw i32 %189, -2
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds i32, i32* %59, i64 %191
%193 = getelementptr inbounds i32, i32* %192, i64 -3
%194 = bitcast i32* %193 to <4 x i32>*
%195 = load <4 x i32>, <4 x i32>* %194
%196 = getelementptr inbounds i32, i32* %192, i64 -4
%197 = getelementptr inbounds i32, i32* %196, i64 -3
%198 = bitcast i32* %197 to <4 x i32>*
%199 = load <4 x i32>, <4 x i32>* %198
%200 = getelementptr inbounds i32, i32* %59, i64 %187
%201 = getelementptr inbounds i32, i32* %200, i64 -3
%202 = bitcast i32* %201 to <4 x i32>*
store <4 x i32> %195, <4 x i32>* %202
%203 = getelementptr inbounds i32, i32* %200, i64 -4
%204 = getelementptr inbounds i32, i32* %203, i64 -3
%205 = bitcast i32* %204 to <4 x i32>*
store <4 x i32> %199, <4 x i32>* %205
%206 = add nuw i64 %165, 16
%207 = add i64 %166, 2
%208 = icmp eq i64 %207, %163
br i1 %208, label %209, label %164
209: ; preds = %164, %152
%210 = phi i64 [ 0, %152 ], [ %206, %164 ]
%211 = icmp eq i64 %160, 0
br i1 %211, label %232, label %212
212: ; preds = %209
%213 = sub i64 %98, %210
%214 = trunc i64 %210 to i32
%215 = sub i32 %81, %214
%216 = add nsw i32 %215, -2
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds i32, i32* %59, i64 %217
%219 = getelementptr inbounds i32, i32* %218, i64 -3
%220 = bitcast i32* %219 to <4 x i32>*
%221 = load <4 x i32>, <4 x i32>* %220
%222 = getelementptr inbounds i32, i32* %218, i64 -4
%223 = getelementptr inbounds i32, i32* %222, i64 -3
%224 = bitcast i32* %223 to <4 x i32>*
%225 = load <4 x i32>, <4 x i32>* %224
%226 = getelementptr inbounds i32, i32* %59, i64 %213
%227 = getelementptr inbounds i32, i32* %226, i64 -3
%228 = bitcast i32* %227 to <4 x i32>*
store <4 x i32> %221, <4 x i32>* %228
%229 = getelementptr inbounds i32, i32* %226, i64 -4
%230 = getelementptr inbounds i32, i32* %229, i64 -3
%231 = bitcast i32* %230 to <4 x i32>*
store <4 x i32> %225, <4 x i32>* %231
br label %232
232: ; preds = %209, %212
%233 = icmp eq i64 %104, %153
br i1 %233, label %237, label %234
234: ; preds = %138, %106, %96, %232
%235 = phi i64 [ %98, %138 ], [ %98, %106 ], [ %98, %96 ], [ %154, %232 ]
%236 = phi i32 [ %81, %138 ], [ %81, %106 ], [ %81, %96 ], [ %156, %232 ]
br label %238
237: ; preds = %238, %232, %90
store i32 %80, i32* %93
br label %252
238: ; preds = %234, %238
%239 = phi i64 [ %247, %238 ], [ %235, %234 ]
%240 = phi i32 [ %241, %238 ], [ %236, %234 ]
%241 = trunc i64 %239 to i32
%242 = add nsw i32 %240, -2
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds i32, i32* %59, i64 %243
%245 = load i32, i32* %244
%246 = getelementptr inbounds i32, i32* %59, i64 %239
store i32 %245, i32* %246
%247 = add nsw i64 %239, -1
%248 = icmp sgt i64 %247, %100
br i1 %248, label %238, label %237
249: ; preds = %85
%250 = add nuw nsw i64 %86, 1
%251 = icmp eq i64 %250, %84
br i1 %251, label %252, label %85
252: ; preds = %249, %77, %237
%253 = add nuw i64 %78, 1
%254 = getelementptr inbounds [100 x [1024 x i8]], [100 x [1024 x i8]]* %4, i64 0, i64 %253, i64 0
%255 = call i64 @strcmp(i8* %254, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
%256 = icmp eq i64 %255, 0
br i1 %256, label %74, label %77
257: ; preds = %74, %265
%258 = phi i64 [ %267, %265 ], [ 0, %74 ]
%259 = getelementptr inbounds i32, i32* %59, i64 %258
%260 = load i32, i32* %259
%261 = icmp eq i32 %260, -1
br i1 %261, label %262, label %265
262: ; preds = %257
%263 = call i32 @putchar(i32 10)
%264 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
br label %271
265: ; preds = %257
%266 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %260)
%267 = add nuw nsw i64 %258, 1
%268 = load i32, i32* %3
%269 = sext i32 %268 to i64
%270 = icmp slt i64 %267, %269
br i1 %270, label %257, label %271
271: ; preds = %265, %74, %262
%272 = call i32 @fclose(i32* %6)
br label %273
273: ; preds = %271, %8
%274 = phi i32 [ -1, %8 ], [ 0, %271 ]
ret i32 %274
}