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

/* Variables and functions */
int /*<<< orphan*/ FLine(int /*<<< orphan*/ *);
int /*<<< orphan*/ FLineSpace(int /*<<< orphan*/ *);
int /*<<< orphan*/ bubbleSort(int *, int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int intLoc(int, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ printfArr(int *, int);
int strtoi(int /*<<< orphan*/);
int main(void) {
  FILE *fl = fopen("cowqueue.in", "r");
  FILE *fout = fopen("cowqueue.out", "w");
  int logs = strtoi(FLine(fl));
  int cowEntryInit[logs];
  int cowEntryFinal[logs];
  int times[logs];
  int timesFinal[logs];
  int i;
  int pos;
  int Time;
  for (i = 0; i < logs; i++) {
    *(cowEntryFinal + i) = strtoi(FLineSpace(fl));
    *(cowEntryInit + i) = *(cowEntryFinal + i);
    *(times + i) = strtoi(FLine(fl));
  }
  printfArr(cowEntryInit, logs);
  printf("\n");
  printfArr(cowEntryFinal, logs);
  printf("\n");
  printfArr(times, logs);
  printf("\n\n");
  bubbleSort(cowEntryFinal, logs);
  printfArr(cowEntryInit, logs);
  printf("\n");
  printfArr(cowEntryFinal, logs);
  printf("\n");
  printfArr(times, logs);
  printf("\n\n");
  pos = 0;
  while (pos < logs) {
    *(timesFinal + pos) =
        *(times + (intLoc(*(cowEntryFinal + pos), cowEntryInit)));
    pos++;
  }
  printfArr(cowEntryInit, logs);
  printf("\n");
  printfArr(cowEntryFinal, logs);
  printf("\n");
  printfArr(timesFinal, logs);
  printf("\n\n");
  Time = *(cowEntryFinal) + *(timesFinal);
  for (i = 0; i < logs; i++) {
    if (Time < *(cowEntryFinal + i + 1)) {
      Time = *(cowEntryFinal + i + 1) + *(timesFinal + i + 1);
      i++;
    } else {
      Time += *(timesFinal + i + 1);
      i++;
    }
  }
  printfArr(cowEntryInit, logs);
  printf("\n");
  printfArr(cowEntryFinal, logs);
  printf("\n");
  printfArr(timesFinal, logs);
  printf("\n\n");
  printf("Time: %d\n", Time);
  fprintf(fout, "%d\n", Time);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe57(%rip),%rdi
lea    0xe5c(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe4e(%rip),%rdi
lea    0xe54(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <FLine@plt>
mov    %eax,%edi
call   1040 <strtoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x1c(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x1c(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12d7 <main+0x147>
mov    -0x10(%rbp),%rdi
call   1090 <FLineSpace@plt>
mov    %eax,%edi
call   1040 <strtoi@plt>
mov    -0x70(%rbp),%rcx
mov    %eax,%esi
mov    -0x78(%rbp),%rax
movslq -0x4c(%rbp),%rdx
mov    %esi,(%rcx,%rdx,4)
movslq -0x4c(%rbp),%rdx
mov    (%rcx,%rdx,4),%edx
movslq -0x4c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rdi
call   1070 <FLine@plt>
mov    %eax,%edi
call   1040 <strtoi@plt>
mov    %eax,%edx
mov    -0x68(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1271 <main+0xe1>
mov    -0x78(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10a0 <printfArr@plt>
lea    0xd34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x70(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10a0 <printfArr@plt>
lea    0xd1a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x68(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10a0 <printfArr@plt>
lea    0xcff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x70(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1050 <bubbleSort@plt>
mov    -0x78(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10a0 <printfArr@plt>
lea    0xcda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x70(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10a0 <printfArr@plt>
lea    0xcc0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x68(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10a0 <printfArr@plt>
lea    0xca5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13cb <main+0x23b>
mov    -0x78(%rbp),%rsi
mov    -0x70(%rbp),%rax
movslq -0x50(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   10b0 <intLoc@plt>
mov    -0x68(%rbp),%rcx
mov    %eax,%edx
mov    -0x60(%rbp),%rax
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%edx
movslq -0x50(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1386 <main+0x1f6>
mov    -0x78(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10a0 <printfArr@plt>
lea    0xc40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x70(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10a0 <printfArr@plt>
lea    0xc26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x60(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10a0 <printfArr@plt>
lea    0xc0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x60(%rbp),%rcx
mov    -0x70(%rbp),%rax
mov    (%rax),%eax
add    (%rcx),%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    14a7 <main+0x317>
mov    -0x70(%rbp),%rcx
mov    -0x54(%rbp),%eax
movslq -0x4c(%rbp),%rdx
cmp    0x4(%rcx,%rdx,4),%eax
jge    1479 <main+0x2e9>
mov    -0x60(%rbp),%rcx
mov    -0x70(%rbp),%rax
movslq -0x4c(%rbp),%rdx
mov    0x4(%rax,%rdx,4),%eax
movslq -0x4c(%rbp),%rdx
add    0x4(%rcx,%rdx,4),%eax
mov    %eax,-0x54(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1494 <main+0x304>
mov    -0x60(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    0x4(%rax,%rcx,4),%eax
add    -0x54(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1499 <main+0x309>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    142f <main+0x29f>
mov    -0x78(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10a0 <printfArr@plt>
lea    0xb64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x70(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10a0 <printfArr@plt>
lea    0xb4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x60(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10a0 <printfArr@plt>
lea    0xb2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x54(%rbp),%esi
lea    0xb21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x54(%rbp),%edx
lea    0xb12(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x28(%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    $0x28,%rsp
lea    0xe38(%rip),%rdi
lea    0xe3d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
lea    0xe30(%rip),%rdi
lea    0xe36(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x40(%rbp)
mov    %rbx,%rdi
call   1090 <FLine@plt>
mov    %eax,%edi
call   1060 <strtoi@plt>
mov    %eax,%esi
lea    0xf(,%rsi,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,%r13
mov    %rdx,%rsp
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x48(%rbp)
mov    %rdx,%rsp
mov    %rsp,%r14
sub    %rcx,%r14
mov    %r14,%rsp
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x50(%rbp)
mov    %rdx,%rsp
test   %eax,%eax
jle    128e <main+0xde>
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %rsi,%r12
call   10b0 <FLineSpace@plt>
mov    %eax,%edi
call   1060 <strtoi@plt>
mov    -0x48(%rbp),%rcx
mov    %eax,(%rcx,%r15,4)
mov    %eax,0x0(%r13,%r15,4)
mov    %rbx,%rdi
call   1090 <FLine@plt>
mov    %eax,%edi
call   1060 <strtoi@plt>
mov    %r12,%rsi
mov    %eax,(%r14,%r15,4)
add    $0x1,%r15
cmp    %r15,%r12
jne    1250 <main+0xa0>
mov    %r13,%r12
mov    %r13,%rdi
mov    %rsi,%rbx
call   10c0 <printfArr@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x48(%rbp),%r13
mov    %r13,%rdi
mov    %ebx,%esi
call   10c0 <printfArr@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   10c0 <printfArr@plt>
lea    0xd56(%rip),%r15
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
mov    %ebx,%esi
call   1070 <bubbleSort@plt>
mov    %r12,%rdi
mov    %ebx,%esi
call   10c0 <printfArr@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r13,%rdi
mov    %ebx,%esi
call   10c0 <printfArr@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   10c0 <printfArr@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
test   %ebx,%ebx
mov    %rbx,%rsi
mov    -0x50(%rbp),%r15
mov    %rbx,-0x30(%rbp)
jle    1354 <main+0x1a4>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    0x0(%r13,%rbx,4),%edi
mov    %r12,%rsi
call   10d0 <intLoc@plt>
mov    -0x30(%rbp),%rsi
cltq
mov    (%r14,%rax,4),%eax
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rsi
jne    1330 <main+0x180>
mov    %r12,-0x38(%rbp)
mov    %r12,%rdi
call   10c0 <printfArr@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r13,%rdi
mov    -0x30(%rbp),%rsi
call   10c0 <printfArr@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    -0x30(%rbp),%rsi
call   10c0 <printfArr@plt>
lea    0xc92(%rip),%rdi
call   1040 <puts@plt>
mov    -0x30(%rbp),%rsi
mov    (%r15),%r14d
add    0x0(%r13),%r14d
test   %esi,%esi
jle    1409 <main+0x259>
lea    -0x1(%rsi),%rcx
mov    %rcx,%rdx
shr    %rdx
add    $0x1,%rdx
mov    %edx,%r8d
and    $0x3,%r8d
cmp    $0x6,%rcx
mov    -0x40(%rbp),%r12
mov    -0x38(%rbp),%rdi
jae    1481 <main+0x2d1>
xor    %ecx,%ecx
test   %r8,%r8
je     1411 <main+0x261>
lea    (%r15,%rcx,4),%rdx
add    $0x4,%rdx
lea    0x4(,%rcx,4),%rcx
add    %r13,%rcx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
mov    (%rcx,%rax,8),%ebx
cmp    %ebx,%r14d
cmovl  %ebx,%r14d
add    (%rdx,%rax,8),%r14d
add    $0x1,%rax
cmp    %rax,%r8
jne    13f0 <main+0x240>
jmp    1411 <main+0x261>
mov    -0x40(%rbp),%r12
mov    -0x38(%rbp),%rdi
mov    %rsi,%rbx
call   10c0 <printfArr@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r13,%rdi
mov    %ebx,%esi
call   10c0 <printfArr@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   10c0 <printfArr@plt>
lea    0xbdd(%rip),%rdi
call   1040 <puts@plt>
lea    0xbc9(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xbbe(%rip),%rsi
mov    %r12,%rdi
mov    %r14d,%edx
call   1080 <fprintf@plt>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
and    $0xfffffffffffffffc,%rdx
xor    %ecx,%ecx
jmp    14a3 <main+0x2f3>
nopl   0x0(%rax)
add    0x1c(%r15,%rcx,4),%r14d
add    $0x8,%rcx
add    $0xfffffffffffffffc,%rdx
je     13d0 <main+0x220>
mov    0x4(%r13,%rcx,4),%ebx
cmp    %ebx,%r14d
jl     14b0 <main+0x300>
mov    %r14d,%ebx
mov    0xc(%r13,%rcx,4),%eax
add    0x4(%r15,%rcx,4),%ebx
cmp    %eax,%ebx
jl     14c0 <main+0x310>
mov    %ebx,%eax
add    0xc(%r15,%rcx,4),%eax
mov    0x14(%r13,%rcx,4),%ebx
cmp    %ebx,%eax
jl     14d0 <main+0x320>
mov    %eax,%ebx
add    0x14(%r15,%rcx,4),%ebx
mov    0x1c(%r13,%rcx,4),%r14d
cmp    %r14d,%ebx
jl     1490 <main+0x2e0>
mov    %ebx,%r14d
jmp    1490 <main+0x2e0>

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

LLVM IR (-O2):
@.str = [12 x i8] c"cowqueue.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [13 x i8] c"cowqueue.out\00"
@.str.3 = [2 x i8] c"w\00"
@.str.6 = [10 x i8] c"Time: %d\0A\00"
@.str.7 = [4 x i8] c"%d\0A\00"
@str.10 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @FLine(i32* %1)
%4 = tail call i32 @strtoi(i32 %3)
%5 = zext i32 %4 to i64
%6 = alloca i32, i64 %5
%7 = alloca i32, i64 %5
%8 = alloca i32, i64 %5
%9 = alloca i32, i64 %5
%10 = icmp sgt i32 %4, 0
br i1 %10, label %11, label %22
11: ; preds = %0, %11
%12 = phi i64 [ %20, %11 ], [ 0, %0 ]
%13 = tail call i32 @FLineSpace(i32* %1)
%14 = tail call i32 @strtoi(i32 %13)
%15 = getelementptr inbounds i32, i32* %7, i64 %12
store i32 %14, i32* %15
%16 = getelementptr inbounds i32, i32* %6, i64 %12
store i32 %14, i32* %16
%17 = tail call i32 @FLine(i32* %1)
%18 = tail call i32 @strtoi(i32 %17)
%19 = getelementptr inbounds i32, i32* %8, i64 %12
store i32 %18, i32* %19
%20 = add nuw nsw i64 %12, 1
%21 = icmp eq i64 %20, %5
br i1 %21, label %22, label %11
22: ; preds = %11, %0
%23 = call i32 @printfArr(i32* %6, i32 %4)
%24 = call i32 @putchar(i32 10)
%25 = call i32 @printfArr(i32* %7, i32 %4)
%26 = call i32 @putchar(i32 10)
%27 = call i32 @printfArr(i32* %8, i32 %4)
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.10, i64 0, i64 0))
%29 = call i32 @bubbleSort(i32* %7, i32 %4)
%30 = call i32 @printfArr(i32* %6, i32 %4)
%31 = call i32 @putchar(i32 10)
%32 = call i32 @printfArr(i32* %7, i32 %4)
%33 = call i32 @putchar(i32 10)
%34 = call i32 @printfArr(i32* %8, i32 %4)
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.10, i64 0, i64 0))
br i1 %10, label %36, label %47
36: ; preds = %22, %36
%37 = phi i64 [ %45, %36 ], [ 0, %22 ]
%38 = getelementptr inbounds i32, i32* %7, i64 %37
%39 = load i32, i32* %38
%40 = call i32 @intLoc(i32 %39, i32* %6)
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %8, i64 %41
%43 = load i32, i32* %42
%44 = getelementptr inbounds i32, i32* %9, i64 %37
store i32 %43, i32* %44
%45 = add nuw nsw i64 %37, 1
%46 = icmp eq i64 %45, %5
br i1 %46, label %47, label %36
47: ; preds = %36, %22
%48 = call i32 @printfArr(i32* %6, i32 %4)
%49 = call i32 @putchar(i32 10)
%50 = call i32 @printfArr(i32* %7, i32 %4)
%51 = call i32 @putchar(i32 10)
%52 = call i32 @printfArr(i32* %9, i32 %4)
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.10, i64 0, i64 0))
%54 = load i32, i32* %7
%55 = load i32, i32* %9
%56 = add nsw i32 %55, %54
br i1 %10, label %57, label %129
57: ; preds = %47
%58 = getelementptr inbounds i32, i32* %7, i64 1
%59 = add nsw i64 %5, -1
%60 = lshr i64 %59, 1
%61 = add nuw i64 %60, 1
%62 = and i64 %61, 3
%63 = icmp ult i64 %59, 6
br i1 %63, label %108, label %64
64: ; preds = %57
%65 = and i64 %61, -4
%66 = getelementptr inbounds i32, i32* %9, i64 1
%67 = getelementptr inbounds i32, i32* %9, i64 1
%68 = getelementptr inbounds i32, i32* %9, i64 1
%69 = getelementptr inbounds i32, i32* %9, i64 1
br label %70
70: ; preds = %70, %64
%71 = phi i64 [ 0, %64 ], [ %105, %70 ]
%72 = phi i32 [ %56, %64 ], [ %104, %70 ]
%73 = phi i64 [ 0, %64 ], [ %106, %70 ]
%74 = getelementptr inbounds i32, i32* %58, i64 %71
%75 = load i32, i32* %74
%76 = icmp slt i32 %72, %75
%77 = select i1 %76, i32 %75, i32 %72
%78 = getelementptr inbounds i32, i32* %66, i64 %71
%79 = load i32, i32* %78
%80 = add nsw i32 %79, %77
%81 = or i64 %71, 2
%82 = getelementptr inbounds i32, i32* %58, i64 %81
%83 = load i32, i32* %82
%84 = icmp slt i32 %80, %83
%85 = select i1 %84, i32 %83, i32 %80
%86 = getelementptr inbounds i32, i32* %67, i64 %81
%87 = load i32, i32* %86
%88 = add nsw i32 %87, %85
%89 = or i64 %71, 4
%90 = getelementptr inbounds i32, i32* %58, i64 %89
%91 = load i32, i32* %90
%92 = icmp slt i32 %88, %91
%93 = select i1 %92, i32 %91, i32 %88
%94 = getelementptr inbounds i32, i32* %68, i64 %89
%95 = load i32, i32* %94
%96 = add nsw i32 %95, %93
%97 = or i64 %71, 6
%98 = getelementptr inbounds i32, i32* %58, i64 %97
%99 = load i32, i32* %98
%100 = icmp slt i32 %96, %99
%101 = select i1 %100, i32 %99, i32 %96
%102 = getelementptr inbounds i32, i32* %69, i64 %97
%103 = load i32, i32* %102
%104 = add nsw i32 %103, %101
%105 = add nuw nsw i64 %71, 8
%106 = add i64 %73, 4
%107 = icmp eq i64 %106, %65
br i1 %107, label %108, label %70
108: ; preds = %70, %57
%109 = phi i32 [ undef, %57 ], [ %104, %70 ]
%110 = phi i64 [ 0, %57 ], [ %105, %70 ]
%111 = phi i32 [ %56, %57 ], [ %104, %70 ]
%112 = icmp eq i64 %62, 0
br i1 %112, label %129, label %113
113: ; preds = %108
%114 = getelementptr inbounds i32, i32* %9, i64 1
br label %115
115: ; preds = %115, %113
%116 = phi i64 [ %110, %113 ], [ %126, %115 ]
%117 = phi i32 [ %111, %113 ], [ %125, %115 ]
%118 = phi i64 [ 0, %113 ], [ %127, %115 ]
%119 = getelementptr inbounds i32, i32* %58, i64 %116
%120 = load i32, i32* %119
%121 = icmp slt i32 %117, %120
%122 = select i1 %121, i32 %120, i32 %117
%123 = getelementptr inbounds i32, i32* %114, i64 %116
%124 = load i32, i32* %123
%125 = add nsw i32 %124, %122
%126 = add nuw nsw i64 %116, 2
%127 = add i64 %118, 1
%128 = icmp eq i64 %127, %62
br i1 %128, label %129, label %115
129: ; preds = %108, %115, %47
%130 = phi i32 [ %56, %47 ], [ %109, %108 ], [ %125, %115 ]
%131 = call i32 @printfArr(i32* %6, i32 %4)
%132 = call i32 @putchar(i32 10)
%133 = call i32 @printfArr(i32* %7, i32 %4)
%134 = call i32 @putchar(i32 10)
%135 = call i32 @printfArr(i32* %9, i32 %4)
%136 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.10, i64 0, i64 0))
%137 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %130)
%138 = call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %130)
ret i32 0
}