#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*/ addToHeap(int);
int atoi(char *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int removeMin();
scalar_t__ strcmp(char *, char *);
char *strtok(char *, char const *);
int main(int argc, char *argv[]) {
  char *file = argv[1];
  char line[256];
  int keyArray[256];
  int numArray[20][10];
  int i = 0;
  int j = 0;
  int heapFindNum = 0;
  int xAmount = 0;
  int numCount = 0;
  int newHigh[100];
  char *token;
  const char space[2] = " ";
  FILE *openFile;
  openFile = fopen(file, "r");
  if (openFile == NULL) {
    printf("Could not open %s\n", file);
    return 0;
  }
  if (argc != 1) {
    printf("%s loaded\n", file);
  } else {
    printf("wrong numbah hoe\n");
  }
  while (fgets(line, 256, openFile)) {
    token = strtok(line, space);
    while (token != NULL) {
      if (strcmp(token, "\n") == 0) {
        j = 0;
        token = strtok(NULL, space);
      } else {
        numArray[i][j] = atoi(token);
        j++;
        if (j > 9) {
          i++;
          j = 0;
        }
        token = strtok(NULL, space);
      }
    }
  }
  for (int i = 0; i < 20; i++) {
    for (int j = 0; j < 10; j++) {
      if (j < 3) {
        numCount += numArray[i][j];
        keyArray[i] = numCount;
      }
    }
    addToHeap(keyArray[i]);
    numCount = 0;
  }
  for (int i = 0; i < 20; i++) {
    newHigh[i] = removeMin();
  }
  printf("\n");
  for (int i = 0; i < 20; i++) {
    xAmount = numArray[i][0] + numArray[i][1] + numArray[i][2];
    heapFindNum = 0;
    while (keyArray[heapFindNum] != newHigh[i]) {
      heapFindNum++;
    }
    for (int k = 0; k < 10; k++) {
      printf("%02d ", numArray[heapFindNum][k]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x844(%rbp)
movl   $0x0,-0x848(%rbp)
movl   $0x0,-0x84c(%rbp)
movl   $0x0,-0x850(%rbp)
movl   $0x0,-0x854(%rbp)
mov    0xe58(%rip),%ax
mov    %ax,-0x9fa(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe10(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0xa08(%rbp)
cmpq   $0x0,-0xa08(%rbp)
jne    1228 <main+0xa8>
mov    -0x18(%rbp),%rsi
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15a5 <main+0x425>
cmpl   $0x1,-0x8(%rbp)
je     1249 <main+0xc9>
mov    -0x18(%rbp),%rsi
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1257 <main+0xd7>
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125c <main+0xdc>
lea    -0x120(%rbp),%rdi
mov    -0xa08(%rbp),%rdx
mov    $0x100,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     136c <main+0x1ec>
lea    -0x120(%rbp),%rdi
lea    -0x9fa(%rbp),%rsi
call   1090 <strtok@plt>
mov    %rax,-0x9f8(%rbp)
cmpq   $0x0,-0x9f8(%rbp)
je     1367 <main+0x1e7>
mov    -0x9f8(%rbp),%rdi
lea    0xd6a(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12e9 <main+0x169>
movl   $0x0,-0x848(%rbp)
lea    -0x9fa(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1090 <strtok@plt>
mov    %rax,-0x9f8(%rbp)
jmp    1362 <main+0x1e2>
mov    -0x9f8(%rbp),%rdi
call   10a0 <atoi@plt>
mov    %eax,%edx
movslq -0x844(%rbp),%rcx
lea    -0x840(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x848(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x848(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x848(%rbp)
cmpl   $0x9,-0x848(%rbp)
jle    134b <main+0x1cb>
mov    -0x844(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x844(%rbp)
movl   $0x0,-0x848(%rbp)
lea    -0x9fa(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1090 <strtok@plt>
mov    %rax,-0x9f8(%rbp)
jmp    1298 <main+0x118>
jmp    125c <main+0xdc>
movl   $0x0,-0xa0c(%rbp)
cmpl   $0x14,-0xa0c(%rbp)
jge    1430 <main+0x2b0>
movl   $0x0,-0xa10(%rbp)
cmpl   $0xa,-0xa10(%rbp)
jge    13ff <main+0x27f>
cmpl   $0x3,-0xa10(%rbp)
jge    13e6 <main+0x266>
movslq -0xa0c(%rbp),%rcx
lea    -0x840(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0xa10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x854(%rbp),%eax
mov    %eax,-0x854(%rbp)
mov    -0x854(%rbp),%ecx
movslq -0xa0c(%rbp),%rax
mov    %ecx,-0x520(%rbp,%rax,4)
jmp    13eb <main+0x26b>
mov    -0xa10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa10(%rbp)
jmp    138d <main+0x20d>
movslq -0xa0c(%rbp),%rax
mov    -0x520(%rbp,%rax,4),%edi
call   1070 <addToHeap@plt>
movl   $0x0,-0x854(%rbp)
mov    -0xa0c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0c(%rbp)
jmp    1376 <main+0x1f6>
movl   $0x0,-0xa14(%rbp)
cmpl   $0x14,-0xa14(%rbp)
jge    1472 <main+0x2f2>
mov    $0x0,%al
call   1040 <removeMin@plt>
mov    %eax,%ecx
movslq -0xa14(%rbp),%rax
mov    %ecx,-0x9f0(%rbp,%rax,4)
mov    -0xa14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa14(%rbp)
jmp    143a <main+0x2ba>
lea    0xba5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xa18(%rbp)
cmpl   $0x14,-0xa18(%rbp)
jge    159e <main+0x41e>
movslq -0xa18(%rbp),%rcx
lea    -0x840(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%eax
movslq -0xa18(%rbp),%rdx
lea    -0x840(%rbp),%rcx
imul   $0x28,%rdx,%rdx
add    %rdx,%rcx
add    0x4(%rcx),%eax
movslq -0xa18(%rbp),%rdx
lea    -0x840(%rbp),%rcx
imul   $0x28,%rdx,%rdx
add    %rdx,%rcx
add    0x8(%rcx),%eax
mov    %eax,-0x850(%rbp)
movl   $0x0,-0x84c(%rbp)
movslq -0x84c(%rbp),%rax
mov    -0x520(%rbp,%rax,4),%eax
movslq -0xa18(%rbp),%rcx
cmp    -0x9f0(%rbp,%rcx,4),%eax
je     1524 <main+0x3a4>
mov    -0x84c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84c(%rbp)
jmp    14ee <main+0x36e>
movl   $0x0,-0xa1c(%rbp)
cmpl   $0xa,-0xa1c(%rbp)
jge    157c <main+0x3fc>
movslq -0x84c(%rbp),%rcx
lea    -0x840(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0xa1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xad1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xa1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa1c(%rbp)
jmp    152e <main+0x3ae>
lea    0xa9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xa18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa18(%rbp)
jmp    148a <main+0x30a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x9c8,%rsp
mov    %edi,%ebp
mov    0x8(%rsi),%rbx
movw   $0x20,0x6(%rsp)
lea    0xe3b(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <fopen@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     11ea <main+0x4a>
cmp    $0x1,%ebp
jne    1200 <main+0x60>
lea    0xe43(%rip),%rdi
call   1040 <puts@plt>
jmp    1211 <main+0x71>
lea    0xe11(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1508 <main+0x368>
lea    0xe0e(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x4c0(%rsp),%rdi
mov    $0x100,%esi
mov    0x8(%rsp),%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     12ee <main+0x14e>
xor    %ebp,%ebp
lea    0x4c0(%rsp),%rbx
lea    0x6(%rsp),%r13
lea    0xdd7(%rip),%r12
xor    %r15d,%r15d
xor    %r14d,%r14d
jmp    126f <main+0xcf>
nop
lea    0x4c0(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
mov    0x8(%rsp),%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     12ee <main+0x14e>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10b0 <strtok@plt>
test   %rax,%rax
je     1250 <main+0xb0>
mov    %rax,%rbx
jmp    12d9 <main+0x139>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   10c0 <atoi@plt>
movslq %r14d,%r14
movslq %r15d,%rcx
lea    (%r14,%r14,4),%rdx
lea    (%rsp,%rdx,8),%rdx
add    $0x1a0,%rdx
mov    %eax,(%rdx,%rcx,4)
lea    0x1(%rcx),%r15d
xor    %eax,%eax
cmp    $0x9,%ecx
setge  %al
cmovge %ebp,%r15d
add    %eax,%r14d
xor    %edi,%edi
mov    %r13,%rsi
call   10b0 <strtok@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1250 <main+0xb0>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    1290 <main+0xf0>
xor    %r15d,%r15d
jmp    12c3 <main+0x123>
lea    0x1a8(%rsp),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rbx),%edi
add    -0x8(%rbx),%edi
add    (%rbx),%edi
mov    %edi,0x5c0(%rsp,%rbp,4)
call   1090 <addToHeap@plt>
add    $0x1,%rbp
add    $0x28,%rbx
cmp    $0x14,%rbp
jne    1300 <main+0x160>
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x10(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x14(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x18(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x1c(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x20(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x24(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x28(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x2c(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x30(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x34(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x38(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x3c(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x40(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x44(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x48(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x4c(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x50(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x54(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x58(%rsp)
xor    %eax,%eax
call   1060 <removeMin@plt>
mov    %eax,0x5c(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xc11(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp,%rbp,4),%ecx
mov    $0xffffffffffffffff,%rax
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdx
add    $0x1,%rax
cmp    %ecx,0x5c4(%rsp,%rdx,4)
jne    1430 <main+0x290>
mov    %eax,%eax
lea    (%rax,%rax,4),%rbx
mov    0x1a0(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1a4(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1a8(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1ac(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1b0(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1b4(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1b8(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1bc(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1c0(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1c4(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    $0x14,%rbp
jne    1420 <main+0x280>
xor    %eax,%eax
add    $0x9c8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [19 x i8] c"Could not open %s\0A\00"
@.str.2 = [11 x i8] c"%s loaded\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [6 x i8] c"%02d \00"
@str = [17 x i8] c"wrong numbah hoe\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = alloca [256 x i32]
%5 = alloca [20 x [10 x i32]]
%6 = alloca [100 x i32]
%7 = alloca i16
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%11 = bitcast [256 x i32]* %4 to i8*
%12 = bitcast [20 x [10 x i32]]* %5 to i8*
%13 = bitcast [100 x i32]* %6 to i8*
%14 = bitcast i16* %7 to i8*
store i16 32, i16* %7
%15 = tail call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %161
19: ; preds = %2
%20 = icmp eq i32 %0, 1
br i1 %20, label %23, label %21
21: ; preds = %19
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %9)
br label %25
23: ; preds = %19
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
%26 = call i64 @fgets(i8* %10, i32 256, i32* %15)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %29, %25
br label %102
29: ; preds = %55, %34
%30 = phi i32 [ %36, %34 ], [ %56, %55 ]
%31 = phi i32 [ %35, %34 ], [ %57, %55 ]
%32 = call i64 @fgets(i8* %10, i32 256, i32* %15)
%33 = icmp eq i64 %32, 0
br i1 %33, label %28, label %34
34: ; preds = %25, %29
%35 = phi i32 [ %31, %29 ], [ 0, %25 ]
%36 = phi i32 [ %30, %29 ], [ 0, %25 ]
%37 = call i8* @strtok(i8* %10, i8* %14)
%38 = icmp eq i8* %37, null
br i1 %38, label %29, label %39
39: ; preds = %34, %55
%40 = phi i8* [ %58, %55 ], [ %37, %34 ]
%41 = phi i32 [ %57, %55 ], [ %35, %34 ]
%42 = phi i32 [ %56, %55 ], [ %36, %34 ]
%43 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %55, label %45
45: ; preds = %39
%46 = call i32 @atoi(i8* %40)
%47 = sext i32 %42 to i64
%48 = sext i32 %41 to i64
%49 = getelementptr inbounds [20 x [10 x i32]], [20 x [10 x i32]]* %5, i64 0, i64 %47, i64 %48
store i32 %46, i32* %49
%50 = add nsw i32 %41, 1
%51 = icmp sgt i32 %41, 8
%52 = zext i1 %51 to i32
%53 = add nsw i32 %42, %52
%54 = select i1 %51, i32 0, i32 %50
br label %55
55: ; preds = %39, %45
%56 = phi i32 [ %53, %45 ], [ %42, %39 ]
%57 = phi i32 [ %54, %45 ], [ 0, %39 ]
%58 = call i8* @strtok(i8* null, i8* %14)
%59 = icmp eq i8* %58, null
br i1 %59, label %29, label %39
60: ; preds = %102
%61 = call i32 (...) @removeMin()
%62 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 0
store i32 %61, i32* %62
%63 = call i32 (...) @removeMin()
%64 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 1
store i32 %63, i32* %64
%65 = call i32 (...) @removeMin()
%66 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 2
store i32 %65, i32* %66
%67 = call i32 (...) @removeMin()
%68 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 3
store i32 %67, i32* %68
%69 = call i32 (...) @removeMin()
%70 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 4
store i32 %69, i32* %70
%71 = call i32 (...) @removeMin()
%72 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 5
store i32 %71, i32* %72
%73 = call i32 (...) @removeMin()
%74 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 6
store i32 %73, i32* %74
%75 = call i32 (...) @removeMin()
%76 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 7
store i32 %75, i32* %76
%77 = call i32 (...) @removeMin()
%78 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 8
store i32 %77, i32* %78
%79 = call i32 (...) @removeMin()
%80 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 9
store i32 %79, i32* %80
%81 = call i32 (...) @removeMin()
%82 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 10
store i32 %81, i32* %82
%83 = call i32 (...) @removeMin()
%84 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 11
store i32 %83, i32* %84
%85 = call i32 (...) @removeMin()
%86 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 12
store i32 %85, i32* %86
%87 = call i32 (...) @removeMin()
%88 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 13
store i32 %87, i32* %88
%89 = call i32 (...) @removeMin()
%90 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 14
store i32 %89, i32* %90
%91 = call i32 (...) @removeMin()
%92 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 15
store i32 %91, i32* %92
%93 = call i32 (...) @removeMin()
%94 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 16
store i32 %93, i32* %94
%95 = call i32 (...) @removeMin()
%96 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 17
store i32 %95, i32* %96
%97 = call i32 (...) @removeMin()
%98 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 18
store i32 %97, i32* %98
%99 = call i32 (...) @removeMin()
%100 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 19
store i32 %99, i32* %100
%101 = call i32 @putchar(i32 10)
br label %116
102: ; preds = %28, %102
%103 = phi i64 [ %114, %102 ], [ 0, %28 ]
%104 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 %103
%105 = getelementptr inbounds [20 x [10 x i32]], [20 x [10 x i32]]* %5, i64 0, i64 %103, i64 0
%106 = load i32, i32* %105
%107 = getelementptr inbounds [20 x [10 x i32]], [20 x [10 x i32]]* %5, i64 0, i64 %103, i64 1
%108 = load i32, i32* %107
%109 = add nsw i32 %108, %106
%110 = getelementptr inbounds [20 x [10 x i32]], [20 x [10 x i32]]* %5, i64 0, i64 %103, i64 2
%111 = load i32, i32* %110
%112 = add nsw i32 %111, %109
store i32 %112, i32* %104
%113 = call i32 @addToHeap(i32 %112)
%114 = add nuw nsw i64 %103, 1
%115 = icmp eq i64 %114, 20
br i1 %115, label %60, label %102
116: ; preds = %60, %126
%117 = phi i64 [ 0, %60 ], [ %159, %126 ]
%118 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 %117
%119 = load i32, i32* %118
br label %120
120: ; preds = %120, %116
%121 = phi i64 [ %125, %120 ], [ 0, %116 ]
%122 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 %121
%123 = load i32, i32* %122
%124 = icmp eq i32 %123, %119
%125 = add nuw i64 %121, 1
br i1 %124, label %126, label %120
126: ; preds = %120
%127 = and i64 %121, 4294967295
%128 = getelementptr inbounds [20 x [10 x i32]], [20 x [10 x i32]]* %5, i64 0, i64 %127, i64 0
%129 = load i32, i32* %128
%130 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %129)
%131 = getelementptr inbounds [20 x [10 x i32]], [20 x [10 x i32]]* %5, i64 0, i64 %127, i64 1
%132 = load i32, i32* %131
%133 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %132)
%134 = getelementptr inbounds [20 x [10 x i32]], [20 x [10 x i32]]* %5, i64 0, i64 %127, i64 2
%135 = load i32, i32* %134
%136 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %135)
%137 = getelementptr inbounds [20 x [10 x i32]], [20 x [10 x i32]]* %5, i64 0, i64 %127, i64 3
%138 = load i32, i32* %137
%139 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %138)
%140 = getelementptr inbounds [20 x [10 x i32]], [20 x [10 x i32]]* %5, i64 0, i64 %127, i64 4
%141 = load i32, i32* %140
%142 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %141)
%143 = getelementptr inbounds [20 x [10 x i32]], [20 x [10 x i32]]* %5, i64 0, i64 %127, i64 5
%144 = load i32, i32* %143
%145 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %144)
%146 = getelementptr inbounds [20 x [10 x i32]], [20 x [10 x i32]]* %5, i64 0, i64 %127, i64 6
%147 = load i32, i32* %146
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %147)
%149 = getelementptr inbounds [20 x [10 x i32]], [20 x [10 x i32]]* %5, i64 0, i64 %127, i64 7
%150 = load i32, i32* %149
%151 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %150)
%152 = getelementptr inbounds [20 x [10 x i32]], [20 x [10 x i32]]* %5, i64 0, i64 %127, i64 8
%153 = load i32, i32* %152
%154 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %153)
%155 = getelementptr inbounds [20 x [10 x i32]], [20 x [10 x i32]]* %5, i64 0, i64 %127, i64 9
%156 = load i32, i32* %155
%157 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %156)
%158 = call i32 @putchar(i32 10)
%159 = add nuw nsw i64 %117, 1
%160 = icmp eq i64 %159, 20
br i1 %160, label %161, label %116
161: ; preds = %126, %17
ret i32 0
}