#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*/ SEEK_END;
int /*<<< orphan*/ bubbleSort(int *, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ gets(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ system(char *);
int main() {
  FILE *infile, *outfile;
  char filename[100];
  long pos = 0;
  int size = 0, value = 0, i = 0;
  int *data;
  system("cls");
  printf("\nEnter a filename to open: ");
  gets(filename);
  if ((infile = fopen(filename, "r")) == NULL) {
    printf("\nCannot open file for reading..\n");
    return 1;
  }
  fseek(infile, 0, SEEK_END);
  pos = ftell(infile);
  size = pos / sizeof(int);
  data = (int *)malloc(size * sizeof(int));
  rewind(infile);
  printf("\nReading data now..\n");
  while (!feof(infile) && fscanf(infile, "%d", &value) && i < size) {
    data[i] = value;
    i++;
  }
  fclose(infile);
  printf("\nSorting started..\n");
  bubbleSort(data, size);
  printf("\nData sorted. Now saving as \'output.txt\' ..\n");
  outfile = fopen("output.txt", "w+");
  for (i = 0; i < size; i++)
    fprintf(outfile, "%d\n", data[i]);
  printf("\nData saved.\n");
  rewind(outfile);
  printf("\nReading data now..\n");
  i = 0;
  while (!feof(outfile) && fscanf(outfile, "%d", &value) && i < size) {
    printf("%d\n", value);
    i++;
  }
  fclose(outfile);
  printf("\nProcessing Complete.\n");
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x88(%rbp)
movl   $0x0,-0x8c(%rbp)
movl   $0x0,-0x90(%rbp)
movl   $0x0,-0x94(%rbp)
lea    0xdee(%rip),%rdi
call   1040 <system@plt>
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x80(%rbp),%rdi
call   10c0 <gets@plt>
lea    -0x80(%rbp),%rdi
lea    0xde7(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1266 <main+0x96>
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14f6 <main+0x326>
mov    -0x10(%rbp),%rdi
mov    0x2d77(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10e0 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <ftell@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rax
shr    $0x2,%rax
mov    %eax,-0x8c(%rbp)
movslq -0x8c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10d0 <malloc@plt>
mov    %rax,-0xa0(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <rewind@plt>
lea    0xd7f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <feof@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa1(%rbp)
jne    1328 <main+0x158>
mov    -0x10(%rbp),%rdi
lea    0xd66(%rip),%rsi
lea    -0x90(%rbp),%rdx
call   1070 <fscanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xa1(%rbp)
je     1328 <main+0x158>
mov    -0x94(%rbp),%eax
cmp    -0x8c(%rbp),%eax
setl   %al
mov    %al,-0xa1(%rbp)
mov    -0xa1(%rbp),%al
test   $0x1,%al
jne    133b <main+0x16b>
jmp    1366 <main+0x196>
mov    -0x90(%rbp),%edx
mov    -0xa0(%rbp),%rax
movslq -0x94(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    12cb <main+0xfb>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xce5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xa0(%rbp),%rdi
mov    -0x8c(%rbp),%esi
call   1080 <bubbleSort@plt>
lea    0xcd9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xcf8(%rip),%rdi
lea    0xcfc(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0x8c(%rbp),%eax
jge    1405 <main+0x235>
mov    -0x18(%rbp),%rdi
mov    -0xa0(%rbp),%rax
movslq -0x94(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xcbe(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    13be <main+0x1ee>
lea    0xca2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <rewind@plt>
lea    0xc20(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x94(%rbp)
mov    -0x18(%rbp),%rdi
call   10b0 <feof@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa2(%rbp)
jne    1491 <main+0x2c1>
mov    -0x18(%rbp),%rdi
lea    0xbfd(%rip),%rsi
lea    -0x90(%rbp),%rdx
call   1070 <fscanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xa2(%rbp)
je     1491 <main+0x2c1>
mov    -0x94(%rbp),%eax
cmp    -0x8c(%rbp),%eax
setl   %al
mov    %al,-0xa2(%rbp)
mov    -0xa2(%rbp),%al
test   $0x1,%al
jne    14a4 <main+0x2d4>
jmp    14cc <main+0x2fc>
mov    -0x90(%rbp),%esi
lea    0xbf9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1434 <main+0x264>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xbe0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xbe9(%rip),%rdi
call   1040 <system@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
movl   $0x0,0xc(%rsp)
lea    0xe03(%rip),%rdi
call   1050 <system@plt>
lea    0xdfb(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   10d0 <gets@plt>
lea    0xdfc(%rip),%rsi
mov    %rbx,%rdi
call   1100 <fopen@plt>
test   %rax,%rax
je     13e9 <main+0x209>
mov    %rax,%rbx
mov    0x2da9(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10f0 <fseek@plt>
mov    %rbx,%rdi
call   10b0 <ftell@plt>
mov    %rax,%r14
shr    $0x2,%r14
and    $0xfffffffc,%eax
mov    %eax,%edi
call   10e0 <malloc@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1070 <rewind@plt>
lea    0xe13(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   10c0 <feof@plt>
test   %eax,%eax
jne    12d4 <main+0xf4>
movslq %r14d,%rbp
xor    %r12d,%r12d
lea    0xc(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
lea    0xd78(%rip),%rsi
mov    %r13,%rdx
call   1080 <fscanf@plt>
test   %rax,%rax
je     12d4 <main+0xf4>
cmp    %rbp,%r12
jge    12d4 <main+0xf4>
mov    0xc(%rsp),%eax
mov    %eax,(%r15,%r12,4)
add    $0x1,%r12
mov    %rbx,%rdi
call   10c0 <feof@plt>
test   %eax,%eax
je     12a0 <main+0xc0>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xd5a(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r14d,%esi
call   1090 <bubbleSort@plt>
lea    0xd56(%rip),%rdi
call   1030 <puts@plt>
lea    0xd1f(%rip),%rdi
lea    0xd23(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,%r13
test   %r14d,%r14d
jle    1348 <main+0x168>
mov    %r14d,%ebp
xor    %ebx,%ebx
lea    0xd0d(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edx
mov    %r13,%rdi
mov    %r12,%rsi
call   10a0 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1330 <main+0x150>
lea    0xd2d(%rip),%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1070 <rewind@plt>
lea    0xd26(%rip),%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   10c0 <feof@plt>
test   %eax,%eax
jne    13c5 <main+0x1e5>
lea    0xca7(%rip),%r15
lea    0xc(%rsp),%r12
lea    0xcac(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1080 <fscanf@plt>
test   %rax,%rax
je     13c5 <main+0x1e5>
cmp    %r14d,%ebp
jge    13c5 <main+0x1e5>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    %r13,%rdi
call   10c0 <feof@plt>
test   %eax,%eax
je     1390 <main+0x1b0>
mov    %r13,%rdi
call   1040 <fclose@plt>
lea    0xcc9(%rip),%rdi
call   1030 <puts@plt>
lea    0xc57(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
jmp    13fa <main+0x21a>
lea    0xcc3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [28 x i8] c"\0AEnter a filename to open: \00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [33 x i8] c"\0ACannot open file for reading..\0A\00"
@SEEK_END = global i32 0
@.str.4 = [21 x i8] c"\0AReading data now..\0A\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [20 x i8] c"\0ASorting started..\0A\00"
@.str.7 = [45 x i8] c"\0AData sorted. Now saving as 'output.txt' ..\0A\00"
@.str.8 = [11 x i8] c"output.txt\00"
@.str.9 = [3 x i8] c"w+\00"
@.str.10 = [4 x i8] c"%d\0A\00"
@.str.11 = [14 x i8] c"\0AData saved.\0A\00"
@.str.12 = [23 x i8] c"\0AProcessing Complete.\0A\00"
@.str.13 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca [100 x i8]
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
store i32 0, i32* %1
store i64 0, i64* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
%10 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%13 = call i32 @gets(i8* %12)
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%15 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %15, i32** %2
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %19
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %1
br label %112
19: ; preds = %0
%20 = load i32*, i32** %2
%21 = load i32, i32* @SEEK_END
%22 = call i32 @fseek(i32* %20, i32 0, i32 %21)
%23 = load i32*, i32** %2
%24 = call i64 @ftell(i32* %23)
store i64 %24, i64* %5
%25 = load i64, i64* %5
%26 = udiv i64 %25, 4
%27 = trunc i64 %26 to i32
store i32 %27, i32* %6
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = mul i64 %29, 4
%31 = trunc i64 %30 to i32
%32 = call i64 @malloc(i32 %31)
%33 = inttoptr i64 %32 to i32*
store i32* %33, i32** %9
%34 = load i32*, i32** %2
%35 = call i32 @rewind(i32* %34)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
br label %37
37: ; preds = %51, %19
%38 = load i32*, i32** %2
%39 = call i32 @feof(i32* %38)
%40 = icmp ne i32 %39, 0
br i1 %40, label %49, label %41
41: ; preds = %37
%42 = load i32*, i32** %2
%43 = call i64 @fscanf(i32* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %7)
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %41
%46 = load i32, i32* %8
%47 = load i32, i32* %6
%48 = icmp slt i32 %46, %47
br label %49
49: ; preds = %45, %41, %37
%50 = phi i1 [ false, %41 ], [ false, %37 ], [ %48, %45 ]
br i1 %50, label %51, label %59
51: ; preds = %49
%52 = load i32, i32* %7
%53 = load i32*, i32** %9
%54 = load i32, i32* %8
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i32, i32* %53, i64 %55
store i32 %52, i32* %56
%57 = load i32, i32* %8
%58 = add nsw i32 %57, 1
store i32 %58, i32* %8
br label %37
59: ; preds = %49
%60 = load i32*, i32** %2
%61 = call i32 @fclose(i32* %60)
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%63 = load i32*, i32** %9
%64 = load i32, i32* %6
%65 = call i32 @bubbleSort(i32* %63, i32 %64)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
%67 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
store i32* %67, i32** %3
store i32 0, i32* %8
br label %68
68: ; preds = %80, %59
%69 = load i32, i32* %8
%70 = load i32, i32* %6
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %83
72: ; preds = %68
%73 = load i32*, i32** %3
%74 = load i32*, i32** %9
%75 = load i32, i32* %8
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i32, i32* %74, i64 %76
%78 = load i32, i32* %77
%79 = call i32 @fprintf(i32* %73, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 %78)
br label %80
80: ; preds = %72
%81 = load i32, i32* %8
%82 = add nsw i32 %81, 1
store i32 %82, i32* %8
br label %68
83: ; preds = %68
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0))
%85 = load i32*, i32** %3
%86 = call i32 @rewind(i32* %85)
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %8
br label %88
88: ; preds = %102, %83
%89 = load i32*, i32** %3
%90 = call i32 @feof(i32* %89)
%91 = icmp ne i32 %90, 0
br i1 %91, label %100, label %92
92: ; preds = %88
%93 = load i32*, i32** %3
%94 = call i64 @fscanf(i32* %93, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %7)
%95 = icmp ne i64 %94, 0
br i1 %95, label %96, label %100
96: ; preds = %92
%97 = load i32, i32* %8
%98 = load i32, i32* %6
%99 = icmp slt i32 %97, %98
br label %100
100: ; preds = %96, %92, %88
%101 = phi i1 [ false, %92 ], [ false, %88 ], [ %99, %96 ]
br i1 %101, label %102, label %107
102: ; preds = %100
%103 = load i32, i32* %7
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 %103)
%105 = load i32, i32* %8
%106 = add nsw i32 %105, 1
store i32 %106, i32* %8
br label %88
107: ; preds = %100
%108 = load i32*, i32** %3
%109 = call i32 @fclose(i32* %108)
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0))
%111 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
store i32 0, i32* %1
br label %112
112: ; preds = %107, %17
%113 = load i32, i32* %1
ret i32 %113
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.1 = [28 x i8] c"\0AEnter a filename to open: \00"
@.str.2 = [2 x i8] c"r\00"
@SEEK_END = global i32 0
@.str.5 = [3 x i8] c"%d\00"
@.str.8 = [11 x i8] c"output.txt\00"
@.str.9 = [3 x i8] c"w+\00"
@.str.10 = [4 x i8] c"%d\0A\00"
@.str.13 = [6 x i8] c"pause\00"
@str.14 = [19 x i8] c"\0ASorting started..\00"
@str.15 = [44 x i8] c"\0AData sorted. Now saving as 'output.txt' ..\00"
@str.16 = [13 x i8] c"\0AData saved.\00"
@str.17 = [20 x i8] c"\0AReading data now..\00"
@str.18 = [22 x i8] c"\0AProcessing Complete.\00"
@str.19 = [32 x i8] c"\0ACannot open file for reading..\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @gets(i8* %3)
%8 = call i32* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.19, i64 0, i64 0))
br label %79
12: ; preds = %0
%13 = load i32, i32* @SEEK_END
%14 = call i32 @fseek(i32* %8, i32 0, i32 %13)
%15 = call i64 @ftell(i32* %8)
%16 = lshr i64 %15, 2
%17 = trunc i64 %16 to i32
%18 = trunc i64 %15 to i32
%19 = and i32 %18, -4
%20 = call i64 @malloc(i32 %19)
%21 = inttoptr i64 %20 to i32*
%22 = call i32 @rewind(i32* %8)
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.17, i64 0, i64 0))
%24 = call i32 @feof(i32* %8)
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %41
26: ; preds = %12
%27 = shl i64 %16, 32
%28 = ashr exact i64 %27, 32
br label %29
29: ; preds = %26, %35
%30 = phi i64 [ 0, %26 ], [ %38, %35 ]
%31 = call i64 @fscanf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%32 = icmp ne i64 %31, 0
%33 = icmp slt i64 %30, %28
%34 = select i1 %32, i1 %33, i1 false
br i1 %34, label %35, label %41
35: ; preds = %29
%36 = load i32, i32* %2
%37 = getelementptr inbounds i32, i32* %21, i64 %30
store i32 %36, i32* %37
%38 = add nuw nsw i64 %30, 1
%39 = call i32 @feof(i32* %8)
%40 = icmp eq i32 %39, 0
br i1 %40, label %29, label %41
41: ; preds = %29, %35, %12
%42 = call i32 @fclose(i32* %8)
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.14, i64 0, i64 0))
%44 = call i32 @bubbleSort(i32* %21, i32 %17)
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.15, i64 0, i64 0))
%46 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%47 = icmp sgt i32 %17, 0
br i1 %47, label %48, label %57
48: ; preds = %41
%49 = and i64 %16, 4294967295
br label %50
50: ; preds = %48, %50
%51 = phi i64 [ 0, %48 ], [ %55, %50 ]
%52 = getelementptr inbounds i32, i32* %21, i64 %51
%53 = load i32, i32* %52
%54 = call i32 @fprintf(i32* %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 %53)
%55 = add nuw nsw i64 %51, 1
%56 = icmp eq i64 %55, %49
br i1 %56, label %57, label %50
57: ; preds = %50, %41
%58 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.16, i64 0, i64 0))
%59 = call i32 @rewind(i32* %46)
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.17, i64 0, i64 0))
%61 = call i32 @feof(i32* %46)
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %75
63: ; preds = %57, %69
%64 = phi i32 [ %72, %69 ], [ 0, %57 ]
%65 = call i64 @fscanf(i32* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%66 = icmp ne i64 %65, 0
%67 = icmp slt i32 %64, %17
%68 = select i1 %66, i1 %67, i1 false
br i1 %68, label %69, label %75
69: ; preds = %63
%70 = load i32, i32* %2
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 %70)
%72 = add nuw nsw i32 %64, 1
%73 = call i32 @feof(i32* %46)
%74 = icmp eq i32 %73, 0
br i1 %74, label %63, label %75
75: ; preds = %63, %69, %57
%76 = call i32 @fclose(i32* %46)
%77 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.18, i64 0, i64 0))
%78 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
br label %79
79: ; preds = %75, %10
%80 = phi i32 [ 1, %10 ], [ 0, %75 ]
ret i32 %80
}