#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ mergeSort(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  FILE *fp;
  srand(time(NULL));
  int i = 0, list[8], j = 0;
  fp = fopen("Average.txt", "w");
  if (fp == NULL) {
    perror("Error opening file.\n");
    exit(EXIT_FAILURE);
  }
  for (i = 0; i < 8; i++) {
    list[i] = rand() % 100 + 1;
    fprintf(fp, "%d ", list[i]);
  }
  fclose(fp);
  for (i = 0; i < 8; i++)
    printf("%d ", list[i]);
  printf("\n");
  mergeSort(list, 0, 8 - 1);
  fp = fopen("Output.txt", "w");
  if (fp == NULL) {
    perror("Error opening file.\n");
    exit(EXIT_FAILURE);
  }
  for (i = 0; i < 8; i++)
    fprintf(fp, "%d ", list[i]);
  fclose(fp);
  for (i = 0; i < 8; i++)
    printf("%d ", list[i]);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x44(%rbp)
lea    0xe2c(%rip),%rdi
lea    0xe31(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1209 <main+0x69>
lea    0xe18(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2dde(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    125a <main+0xba>
mov    $0x0,%al
call   10c0 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
movslq -0x14(%rbp),%rax
mov    %edx,-0x40(%rbp,%rax,4)
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edx
lea    0xddc(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1210 <main+0x70>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1298 <main+0xf8>
movslq -0x14(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%esi
lea    0xda0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    126a <main+0xca>
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x7,%edx
call   1070 <mergeSort@plt>
lea    0xd6a(%rip),%rdi
lea    0xd48(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    12f2 <main+0x152>
lea    0xd2f(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2cf5(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1329 <main+0x189>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edx
lea    0xd0d(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12f9 <main+0x159>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1367 <main+0x1c7>
movslq -0x14(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%esi
lea    0xcd1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1339 <main+0x199>
lea    0xcb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
xor    %edi,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
lea    0xe2d(%rip),%rdi
lea    0xe32(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1588 <main+0x3d8>
mov    %rax,%rbx
xor    %eax,%eax
call   10d0 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edx
add    $0x1,%edx
mov    %edx,0x34(%rsp)
mov    %edx,(%rsp)
lea    0xe02(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <fprintf@plt>
xor    %eax,%eax
call   10d0 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edx
add    $0x1,%edx
mov    %edx,0x30(%rsp)
mov    %edx,0x4(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <fprintf@plt>
xor    %eax,%eax
call   10d0 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edx
add    $0x1,%edx
mov    %edx,0x2c(%rsp)
mov    %edx,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <fprintf@plt>
xor    %eax,%eax
call   10d0 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edx
add    $0x1,%edx
mov    %edx,0x28(%rsp)
mov    %edx,0xc(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <fprintf@plt>
xor    %eax,%eax
call   10d0 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r15d
add    $0x1,%r15d
mov    %r15d,0x10(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1070 <fprintf@plt>
xor    %eax,%eax
call   10d0 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r12d
add    $0x1,%r12d
mov    %r12d,0x14(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12d,%edx
call   1070 <fprintf@plt>
xor    %eax,%eax
call   10d0 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r13d
add    $0x1,%r13d
mov    %r13d,0x18(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r13d,%edx
call   1070 <fprintf@plt>
xor    %eax,%eax
call   10d0 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0x1,%ebp
mov    %ebp,0x1c(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1070 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
mov    0x34(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    0x30(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    0x2c(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    0x28(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x7,%edx
call   1080 <mergeSort@plt>
lea    0xbc7(%rip),%rdi
lea    0xba5(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1588 <main+0x3d8>
mov    %rax,%rbp
mov    (%rsp),%edx
lea    0xba1(%rip),%rbx
mov    %rax,%rdi
mov    %rbx,%rsi
call   1070 <fprintf@plt>
mov    0x4(%rsp),%edx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1070 <fprintf@plt>
mov    0x8(%rsp),%edx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1070 <fprintf@plt>
mov    0xc(%rsp),%edx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1070 <fprintf@plt>
mov    0x10(%rsp),%edx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1070 <fprintf@plt>
mov    0x14(%rsp),%edx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1070 <fprintf@plt>
mov    0x18(%rsp),%edx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1070 <fprintf@plt>
mov    0x1c(%rsp),%edx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1070 <fprintf@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
mov    (%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xa7f(%rip),%rdi
call   10b0 <perror@plt>
mov    0x2a45(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Average.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [21 x i8] c"Error opening file.\0A\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [4 x i8] c"%d \00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [11 x i8] c"Output.txt\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca [8 x i32]
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @time(i32* null)
%7 = call i32 @srand(i32 %6)
store i32 0, i32* %3
store i32 0, i32* %5
%8 = 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* %8, i32** %2
%9 = load i32*, i32** %2
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %0
%12 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %0
store i32 0, i32* %3
br label %16
16: ; preds = %32, %15
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 8
br i1 %18, label %19, label %35
19: ; preds = %16
%20 = call i32 (...) @rand()
%21 = srem i32 %20, 100
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 %24
store i32 %22, i32* %25
%26 = load i32*, i32** %2
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = call i32 @fprintf(i32* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %19
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
br label %16
35: ; preds = %16
%36 = load i32*, i32** %2
%37 = call i32 @fclose(i32* %36)
store i32 0, i32* %3
br label %38
38: ; preds = %47, %35
%39 = load i32, i32* %3
%40 = icmp slt i32 %39, 8
br i1 %40, label %41, label %50
41: ; preds = %38
%42 = load i32, i32* %3
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %45)
br label %47
47: ; preds = %41
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 1
store i32 %49, i32* %3
br label %38
50: ; preds = %38
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%52 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 0
%53 = call i32 @mergeSort(i32* %52, i32 0, i32 7)
%54 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %54, i32** %2
%55 = load i32*, i32** %2
%56 = icmp eq i32* %55, null
br i1 %56, label %57, label %61
57: ; preds = %50
%58 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%59 = load i32, i32* @EXIT_FAILURE
%60 = call i32 @exit(i32 %59)
unreachable
61: ; preds = %50
store i32 0, i32* %3
br label %62
62: ; preds = %72, %61
%63 = load i32, i32* %3
%64 = icmp slt i32 %63, 8
br i1 %64, label %65, label %75
65: ; preds = %62
%66 = load i32*, i32** %2
%67 = load i32, i32* %3
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 %68
%70 = load i32, i32* %69
%71 = call i32 @fprintf(i32* %66, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %70)
br label %72
72: ; preds = %65
%73 = load i32, i32* %3
%74 = add nsw i32 %73, 1
store i32 %74, i32* %3
br label %62
75: ; preds = %62
%76 = load i32*, i32** %2
%77 = call i32 @fclose(i32* %76)
store i32 0, i32* %3
br label %78
78: ; preds = %87, %75
%79 = load i32, i32* %3
%80 = icmp slt i32 %79, 8
br i1 %80, label %81, label %90
81: ; preds = %78
%82 = load i32, i32* %3
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 %83
%85 = load i32, i32* %84
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %85)
br label %87
87: ; preds = %81
%88 = load i32, i32* %3
%89 = add nsw i32 %88, 1
store i32 %89, i32* %3
br label %78
90: ; preds = %78
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Average.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [21 x i8] c"Error opening file.\0A\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [4 x i8] c"%d \00"
@.str.5 = [11 x i8] c"Output.txt\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = bitcast [8 x i32]* %1 to i8*
%5 = 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))
%6 = icmp eq i32* %5, null
br i1 %6, label %61, label %7
7: ; preds = %0
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 100
%10 = add nsw i32 %9, 1
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
store i32 %10, i32* %11
%12 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%13 = tail call i32 (...) @rand()
%14 = srem i32 %13, 100
%15 = add nsw i32 %14, 1
%16 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 1
store i32 %15, i32* %16
%17 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%18 = tail call i32 (...) @rand()
%19 = srem i32 %18, 100
%20 = add nsw i32 %19, 1
%21 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 2
store i32 %20, i32* %21
%22 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%23 = tail call i32 (...) @rand()
%24 = srem i32 %23, 100
%25 = add nsw i32 %24, 1
%26 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 3
store i32 %25, i32* %26
%27 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %25)
%28 = tail call i32 (...) @rand()
%29 = srem i32 %28, 100
%30 = add nsw i32 %29, 1
%31 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 4
store i32 %30, i32* %31
%32 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %30)
%33 = tail call i32 (...) @rand()
%34 = srem i32 %33, 100
%35 = add nsw i32 %34, 1
%36 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 5
store i32 %35, i32* %36
%37 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%38 = tail call i32 (...) @rand()
%39 = srem i32 %38, 100
%40 = add nsw i32 %39, 1
%41 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 6
store i32 %40, i32* %41
%42 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %40)
%43 = tail call i32 (...) @rand()
%44 = srem i32 %43, 100
%45 = add nsw i32 %44, 1
%46 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 7
store i32 %45, i32* %46
%47 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %45)
%48 = tail call i32 @fclose(i32* %5)
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %25)
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %30)
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %40)
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %45)
%57 = tail call i32 @putchar(i32 10)
%58 = call i32 @mergeSort(i32* %11, i32 0, i32 7)
%59 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%60 = icmp eq i32* %59, null
br i1 %60, label %100, label %65
61: ; preds = %0
%62 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%63 = load i32, i32* @EXIT_FAILURE
%64 = tail call i32 @exit(i32 %63)
unreachable
65: ; preds = %7
%66 = load i32, i32* %11
%67 = call i32 @fprintf(i32* %59, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %66)
%68 = load i32, i32* %16
%69 = call i32 @fprintf(i32* %59, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %68)
%70 = load i32, i32* %21
%71 = call i32 @fprintf(i32* %59, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %70)
%72 = load i32, i32* %26
%73 = call i32 @fprintf(i32* %59, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %72)
%74 = load i32, i32* %31
%75 = call i32 @fprintf(i32* %59, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %74)
%76 = load i32, i32* %36
%77 = call i32 @fprintf(i32* %59, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %76)
%78 = load i32, i32* %41
%79 = call i32 @fprintf(i32* %59, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %78)
%80 = load i32, i32* %46
%81 = call i32 @fprintf(i32* %59, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %80)
%82 = call i32 @fclose(i32* %59)
%83 = load i32, i32* %11
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %83)
%85 = load i32, i32* %16
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %85)
%87 = load i32, i32* %21
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %87)
%89 = load i32, i32* %26
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %89)
%91 = load i32, i32* %31
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %91)
%93 = load i32, i32* %36
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %93)
%95 = load i32, i32* %41
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %95)
%97 = load i32, i32* %46
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %97)
%99 = call i32 @putchar(i32 10)
ret i32 0
100: ; preds = %7
%101 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%102 = load i32, i32* @EXIT_FAILURE
%103 = call i32 @exit(i32 %102)
unreachable
}