#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(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ removePartSums(int, unsigned int *);
int /*<<< orphan*/ sort(int, unsigned int *);
int main() {
  FILE *f1;
  int n, done;
  unsigned int m[24], mustSell = 0;
  for (int i = 0; i < 24; i++) {
    m[i] = 0;
  }
  f1 = fopen("CelebritySplit.txt", "r");
  if (f1 == NULL) {
    printf("\nUnable to open CelebritySplit3.txt\n");
    exit(1);
  }
  done = 0;
  while (!done) {
    fscanf(f1, "%d", &n);
    if (n == 0) {
      printf("\nDone\n");
      exit(0);
    }
    if (n > 24) {
      printf("\nError - N > 24\n");
      exit(1);
    }
    for (int i = 0; i < n; i++) {
      fscanf(f1, "%u", &m[i]);
    }
    printf("\nInput\n");
    printf("\nN = %d\n", n);
    for (int i = 0; i < n; i++) {
      printf("\n%u", m[i]);
    }
    sort(n, m);
    printf("\n\nSorted Input\n");
    for (int i = 0; i < n; i++) {
      printf("\n%u", m[i]);
    }
    printf("\n\n");
    removePartSums(n, m);
    printf("\n\nAfter Subtractions\n");
    for (int i = 0; i < n; i++) {
      printf("\n%u", m[i]);
    }
    for (int i = 0; i < n; i++) {
      mustSell += m[i];
    }
    printf("\n\nThe celebs must sell $%d worth of houses.\n", mustSell);
    mustSell = 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x84(%rbp)
movl   $0x0,-0x88(%rbp)
cmpl   $0x18,-0x88(%rbp)
jge    11b6 <main+0x56>
movslq -0x88(%rbp),%rax
movl   $0x0,-0x80(%rbp,%rax,4)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    1186 <main+0x26>
lea    0xe43(%rip),%rdi
lea    0xe4f(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11f0 <main+0x90>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    120d <main+0xad>
jmp    144f <main+0x2ef>
mov    -0x10(%rbp),%rdi
lea    0xe22(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
cmpl   $0x0,-0x14(%rbp)
jne    1242 <main+0xe2>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
cmpl   $0x18,-0x14(%rbp)
jle    1264 <main+0x104>
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
movl   $0x0,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12b5 <main+0x155>
mov    -0x10(%rbp),%rdi
movslq -0x8c(%rbp),%rax
lea    -0x80(%rbp),%rdx
shl    $0x2,%rax
add    %rax,%rdx
lea    0xdcd(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    126e <main+0x10e>
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xd90(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x90(%rbp)
mov    -0x90(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    131a <main+0x1ba>
movslq -0x90(%rbp),%rax
mov    -0x80(%rbp,%rax,4),%esi
lea    0xd67(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x90(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x90(%rbp)
jmp    12de <main+0x17e>
mov    -0x14(%rbp),%edi
lea    -0x80(%rbp),%rsi
call   1050 <sort@plt>
lea    0xd3d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    137a <main+0x21a>
movslq -0x94(%rbp),%rax
mov    -0x80(%rbp,%rax,4),%esi
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    133e <main+0x1de>
lea    0xcf9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0x80(%rbp),%rsi
call   1030 <removePartSums@plt>
lea    0xce2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    13e8 <main+0x288>
movslq -0x98(%rbp),%rax
mov    -0x80(%rbp,%rax,4),%esi
lea    0xc99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    13ac <main+0x24c>
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    142c <main+0x2cc>
movslq -0x9c(%rbp),%rax
mov    -0x80(%rbp,%rax,4),%eax
add    -0x84(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    13f2 <main+0x292>
mov    -0x84(%rbp),%esi
lea    0xc5a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x84(%rbp)
jmp    11f7 <main+0x97>
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
pxor   %xmm0,%xmm0
movdqa %xmm0,0x60(%rsp)
movdqa %xmm0,0x50(%rsp)
movdqa %xmm0,0x40(%rsp)
movdqa %xmm0,0x30(%rsp)
movdqa %xmm0,0x20(%rsp)
movdqa %xmm0,0x10(%rsp)
lea    0xe53(%rip),%rdi
lea    0xe5f(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
jne    11ca <main+0x5a>
lea    0xece(%rip),%rdi
jmp    148a <main+0x31a>
mov    %rax,%r13
lea    0xe41(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1070 <fscanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jne    11fe <main+0x8e>
lea    0xe9b(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1090 <exit@plt>
lea    0x10(%rsp),%r12
lea    0xe18(%rip),%r15
lea    0xe10(%rip),%r14
jmp    1252 <main+0xe2>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xdfe(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
lea    0xdda(%rip),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1070 <fscanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
mov    %rbp,%r12
je     11eb <main+0x7b>
cmp    $0x18,%eax
jg     1483 <main+0x313>
test   %eax,%eax
jle    1292 <main+0x122>
mov    %r12,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r13,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <fscanf@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%rbp
jl     1270 <main+0x100>
lea    0xdb9(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%esi
lea    0xd6f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edi
test   %edi,%edi
jle    12dc <main+0x16c>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rdi
cmp    %rdi,%rbx
jl     12c0 <main+0x150>
mov    %r12,%rsi
call   1060 <sort@plt>
lea    0xd6e(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,0xc(%rsp)
jle    131c <main+0x1ac>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     1300 <main+0x190>
lea    0xd2d(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%edi
mov    %r12,%rbp
mov    %r12,%rsi
call   1030 <removePartSums@plt>
lea    0xd2a(%rip),%rdi
call   1040 <puts@plt>
xor    %r12d,%r12d
cmpl   $0x0,0xc(%rsp)
jle    1220 <main+0xb0>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     1360 <main+0x1f0>
mov    %eax,%eax
test   %eax,%eax
jle    1220 <main+0xb0>
cmp    $0x8,%eax
jae    1395 <main+0x225>
xor    %ecx,%ecx
xor    %r12d,%r12d
jmp    1470 <main+0x300>
mov    %eax,%ecx
and    $0xfffffff8,%ecx
lea    -0x8(%rcx),%rsi
mov    %rsi,%rdi
shr    $0x3,%rdi
add    $0x1,%rdi
mov    %edi,%edx
and    $0x3,%edx
cmp    $0x18,%rsi
jae    13c0 <main+0x250>
pxor   %xmm0,%xmm0
xor    %esi,%esi
pxor   %xmm1,%xmm1
jmp    140d <main+0x29d>
and    $0xfffffffffffffffc,%rdi
pxor   %xmm0,%xmm0
xor    %esi,%esi
pxor   %xmm1,%xmm1
xchg   %ax,%ax
paddd  0x10(%rsp,%rsi,4),%xmm0
paddd  0x20(%rsp,%rsi,4),%xmm1
paddd  0x30(%rsp,%rsi,4),%xmm0
paddd  0x40(%rsp,%rsi,4),%xmm1
paddd  0x50(%rsp,%rsi,4),%xmm0
paddd  0x60(%rsp,%rsi,4),%xmm1
paddd  0x70(%rsp,%rsi,4),%xmm0
paddd  0x80(%rsp,%rsi,4),%xmm1
add    $0x20,%rsi
add    $0xfffffffffffffffc,%rdi
jne    13d0 <main+0x260>
test   %rdx,%rdx
je     1444 <main+0x2d4>
lea    0x20(%rsp),%rdi
lea    (%rdi,%rsi,4),%rsi
shl    $0x5,%rdx
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
paddd  -0x10(%rsi,%rdi,1),%xmm0
paddd  (%rsi,%rdi,1),%xmm1
add    $0x20,%rdi
cmp    %rdi,%rdx
jne    1430 <main+0x2c0>
paddd  %xmm1,%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%r12d
cmp    %rax,%rcx
je     1220 <main+0xb0>
nopl   0x0(%rax,%rax,1)
add    0x10(%rsp,%rcx,4),%r12d
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1470 <main+0x300>
jmp    1220 <main+0xb0>
lea    0xbf3(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"CelebritySplit.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [37 x i8] c"\0AUnable to open CelebritySplit3.txt\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [7 x i8] c"\0ADone\0A\00"
@.str.5 = [17 x i8] c"\0AError - N > 24\0A\00"
@.str.6 = [3 x i8] c"%u\00"
@.str.7 = [8 x i8] c"\0AInput\0A\00"
@.str.8 = [9 x i8] c"\0AN = %d\0A\00"
@.str.9 = [4 x i8] c"\0A%u\00"
@.str.10 = [16 x i8] c"\0A\0ASorted Input\0A\00"
@.str.11 = [3 x i8] c"\0A\0A\00"
@.str.12 = [22 x i8] c"\0A\0AAfter Subtractions\0A\00"
@.str.13 = [45 x i8] c"\0A\0AThe celebs must sell $%d worth of houses.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca [24 x i32]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
store i32 0, i32* %7
br label %13
13: ; preds = %20, %0
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 24
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [24 x i32], [24 x i32]* %5, i64 0, i64 %18
store i32 0, i32* %19
br label %20
20: ; preds = %16
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %13
23: ; preds = %13
%24 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %24, i32** %2
%25 = load i32*, i32** %2
%26 = icmp eq i32* %25, null
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%29 = call i32 @exit(i32 1)
unreachable
30: ; preds = %23
store i32 0, i32* %4
br label %31
31: ; preds = %132, %30
%32 = load i32, i32* %4
%33 = icmp ne i32 %32, 0
%34 = xor i1 %33, true
br i1 %34, label %35, label %135
35: ; preds = %31
%36 = load i32*, i32** %2
%37 = call i32 (i32*, i8*, ...) @fscanf(i32* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%38 = load i32, i32* %3
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %35
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%42 = call i32 @exit(i32 0)
unreachable
43: ; preds = %35
%44 = load i32, i32* %3
%45 = icmp sgt i32 %44, 24
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %43
store i32 0, i32* %8
br label %50
50: ; preds = %60, %49
%51 = load i32, i32* %8
%52 = load i32, i32* %3
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %63
54: ; preds = %50
%55 = load i32*, i32** %2
%56 = load i32, i32* %8
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [24 x i32], [24 x i32]* %5, i64 0, i64 %57
%59 = call i32 (i32*, i8*, ...) @fscanf(i32* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %58)
br label %60
60: ; preds = %54
%61 = load i32, i32* %8
%62 = add nsw i32 %61, 1
store i32 %62, i32* %8
br label %50
63: ; preds = %50
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%65 = load i32, i32* %3
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %65)
store i32 0, i32* %9
br label %67
67: ; preds = %77, %63
%68 = load i32, i32* %9
%69 = load i32, i32* %3
%70 = icmp slt i32 %68, %69
br i1 %70, label %71, label %80
71: ; preds = %67
%72 = load i32, i32* %9
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [24 x i32], [24 x i32]* %5, i64 0, i64 %73
%75 = load i32, i32* %74
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %75)
br label %77
77: ; preds = %71
%78 = load i32, i32* %9
%79 = add nsw i32 %78, 1
store i32 %79, i32* %9
br label %67
80: ; preds = %67
%81 = load i32, i32* %3
%82 = getelementptr inbounds [24 x i32], [24 x i32]* %5, i64 0, i64 0
%83 = call i32 @sort(i32 %81, i32* %82)
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %10
br label %85
85: ; preds = %95, %80
%86 = load i32, i32* %10
%87 = load i32, i32* %3
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %98
89: ; preds = %85
%90 = load i32, i32* %10
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [24 x i32], [24 x i32]* %5, i64 0, i64 %91
%93 = load i32, i32* %92
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %93)
br label %95
95: ; preds = %89
%96 = load i32, i32* %10
%97 = add nsw i32 %96, 1
store i32 %97, i32* %10
br label %85
98: ; preds = %85
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%100 = load i32, i32* %3
%101 = getelementptr inbounds [24 x i32], [24 x i32]* %5, i64 0, i64 0
%102 = call i32 @removePartSums(i32 %100, i32* %101)
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0))
store i32 0, i32* %11
br label %104
104: ; preds = %114, %98
%105 = load i32, i32* %11
%106 = load i32, i32* %3
%107 = icmp slt i32 %105, %106
br i1 %107, label %108, label %117
108: ; preds = %104
%109 = load i32, i32* %11
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [24 x i32], [24 x i32]* %5, i64 0, i64 %110
%112 = load i32, i32* %111
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %112)
br label %114
114: ; preds = %108
%115 = load i32, i32* %11
%116 = add nsw i32 %115, 1
store i32 %116, i32* %11
br label %104
117: ; preds = %104
store i32 0, i32* %12
br label %118
118: ; preds = %129, %117
%119 = load i32, i32* %12
%120 = load i32, i32* %3
%121 = icmp slt i32 %119, %120
br i1 %121, label %122, label %132
122: ; preds = %118
%123 = load i32, i32* %12
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [24 x i32], [24 x i32]* %5, i64 0, i64 %124
%126 = load i32, i32* %125
%127 = load i32, i32* %6
%128 = add i32 %127, %126
store i32 %128, i32* %6
br label %129
129: ; preds = %122
%130 = load i32, i32* %12
%131 = add nsw i32 %130, 1
store i32 %131, i32* %12
br label %118
132: ; preds = %118
%133 = load i32, i32* %6
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), i32 %133)
store i32 0, i32* %6
br label %31
135: ; preds = %31
%136 = load i32, i32* %1
ret i32 %136
}

LLVM IR (-O2):
@.str = [19 x i8] c"CelebritySplit.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.6 = [3 x i8] c"%u\00"
@.str.8 = [9 x i8] c"\0AN = %d\0A\00"
@.str.9 = [4 x i8] c"\0A%u\00"
@.str.13 = [45 x i8] c"\0A\0AThe celebs must sell $%d worth of houses.\0A\00"
@str = [7 x i8] c"\0AInput\00"
@str.14 = [15 x i8] c"\0A\0ASorted Input\00"
@str.15 = [2 x i8] c"\0A\00"
@str.16 = [21 x i8] c"\0A\0AAfter Subtractions\00"
@str.17 = [16 x i8] c"\0AError - N > 24\00"
@str.18 = [6 x i8] c"\0ADone\00"
@str.19 = [36 x i8] c"\0AUnable to open CelebritySplit3.txt\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [24 x i32]
%3 = bitcast [24 x i32]* %2 to i8*
%4 = bitcast i32* %1 to i8*
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 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 %13, label %7
7: ; preds = %0
%8 = call i32 (i32*, i8*, ...) @fscanf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %7
%12 = getelementptr inbounds [24 x i32], [24 x i32]* %2, i64 0, i64 0
br label %19
13: ; preds = %0
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.19, i64 0, i64 0))
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %170, %7
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.18, i64 0, i64 0))
%18 = call i32 @exit(i32 0)
unreachable
19: ; preds = %11, %170
%20 = phi i32 [ %9, %11 ], [ %174, %170 ]
%21 = icmp sgt i32 %20, 24
br i1 %21, label %24, label %22
22: ; preds = %19
%23 = icmp sgt i32 %20, 0
br i1 %23, label %33, label %27
24: ; preds = %19
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.17, i64 0, i64 0))
%26 = call i32 @exit(i32 1)
unreachable
27: ; preds = %33, %22
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%29 = load i32, i32* %1
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %1
%32 = icmp sgt i32 %31, 0
br i1 %32, label %47, label %41
33: ; preds = %22, %33
%34 = phi i64 [ %37, %33 ], [ 0, %22 ]
%35 = getelementptr inbounds [24 x i32], [24 x i32]* %2, i64 0, i64 %34
%36 = call i32 (i32*, i8*, ...) @fscanf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %35)
%37 = add nuw nsw i64 %34, 1
%38 = load i32, i32* %1
%39 = sext i32 %38 to i64
%40 = icmp slt i64 %37, %39
br i1 %40, label %33, label %27
41: ; preds = %47, %27
%42 = phi i32 [ %31, %27 ], [ %53, %47 ]
%43 = call i32 @sort(i32 %42, i32* %12)
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.14, i64 0, i64 0))
%45 = load i32, i32* %1
%46 = icmp sgt i32 %45, 0
br i1 %46, label %63, label %56
47: ; preds = %27, %47
%48 = phi i64 [ %52, %47 ], [ 0, %27 ]
%49 = getelementptr inbounds [24 x i32], [24 x i32]* %2, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %50)
%52 = add nuw nsw i64 %48, 1
%53 = load i32, i32* %1
%54 = sext i32 %53 to i64
%55 = icmp slt i64 %52, %54
br i1 %55, label %47, label %41
56: ; preds = %63, %41
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.15, i64 0, i64 0))
%58 = load i32, i32* %1
%59 = call i32 @removePartSums(i32 %58, i32* %12)
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.16, i64 0, i64 0))
%61 = load i32, i32* %1
%62 = icmp sgt i32 %61, 0
br i1 %62, label %161, label %170
63: ; preds = %41, %63
%64 = phi i64 [ %68, %63 ], [ 0, %41 ]
%65 = getelementptr inbounds [24 x i32], [24 x i32]* %2, i64 0, i64 %64
%66 = load i32, i32* %65
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %66)
%68 = add nuw nsw i64 %64, 1
%69 = load i32, i32* %1
%70 = sext i32 %69 to i64
%71 = icmp slt i64 %68, %70
br i1 %71, label %63, label %56
72: ; preds = %161
%73 = icmp sgt i32 %167, 0
br i1 %73, label %74, label %170
74: ; preds = %72
%75 = zext i32 %167 to i64
%76 = icmp ult i32 %167, 8
br i1 %76, label %158, label %77
77: ; preds = %74
%78 = and i64 %75, 4294967288
%79 = add nsw i64 %78, -8
%80 = lshr exact i64 %79, 3
%81 = add nuw nsw i64 %80, 1
%82 = and i64 %81, 3
%83 = icmp ult i64 %79, 24
br i1 %83, label %129, label %84
84: ; preds = %77
%85 = and i64 %81, 4611686018427387900
br label %86
86: ; preds = %86, %84
%87 = phi i64 [ 0, %84 ], [ %126, %86 ]
%88 = phi <4 x i32> [ zeroinitializer, %84 ], [ %124, %86 ]
%89 = phi <4 x i32> [ zeroinitializer, %84 ], [ %125, %86 ]
%90 = phi i64 [ 0, %84 ], [ %127, %86 ]
%91 = getelementptr inbounds [24 x i32], [24 x i32]* %2, i64 0, i64 %87
%92 = bitcast i32* %91 to <4 x i32>*
%93 = load <4 x i32>, <4 x i32>* %92
%94 = getelementptr inbounds i32, i32* %91, i64 4
%95 = bitcast i32* %94 to <4 x i32>*
%96 = load <4 x i32>, <4 x i32>* %95
%97 = add <4 x i32> %93, %88
%98 = add <4 x i32> %96, %89
%99 = or i64 %87, 8
%100 = getelementptr inbounds [24 x i32], [24 x i32]* %2, i64 0, i64 %99
%101 = bitcast i32* %100 to <4 x i32>*
%102 = load <4 x i32>, <4 x i32>* %101
%103 = getelementptr inbounds i32, i32* %100, i64 4
%104 = bitcast i32* %103 to <4 x i32>*
%105 = load <4 x i32>, <4 x i32>* %104
%106 = add <4 x i32> %102, %97
%107 = add <4 x i32> %105, %98
%108 = or i64 %87, 16
%109 = getelementptr inbounds [24 x i32], [24 x i32]* %2, i64 0, i64 %108
%110 = bitcast i32* %109 to <4 x i32>*
%111 = load <4 x i32>, <4 x i32>* %110
%112 = getelementptr inbounds i32, i32* %109, i64 4
%113 = bitcast i32* %112 to <4 x i32>*
%114 = load <4 x i32>, <4 x i32>* %113
%115 = add <4 x i32> %111, %106
%116 = add <4 x i32> %114, %107
%117 = or i64 %87, 24
%118 = getelementptr inbounds [24 x i32], [24 x i32]* %2, i64 0, i64 %117
%119 = bitcast i32* %118 to <4 x i32>*
%120 = load <4 x i32>, <4 x i32>* %119
%121 = getelementptr inbounds i32, i32* %118, i64 4
%122 = bitcast i32* %121 to <4 x i32>*
%123 = load <4 x i32>, <4 x i32>* %122
%124 = add <4 x i32> %120, %115
%125 = add <4 x i32> %123, %116
%126 = add nuw i64 %87, 32
%127 = add i64 %90, 4
%128 = icmp eq i64 %127, %85
br i1 %128, label %129, label %86
129: ; preds = %86, %77
%130 = phi <4 x i32> [ undef, %77 ], [ %124, %86 ]
%131 = phi <4 x i32> [ undef, %77 ], [ %125, %86 ]
%132 = phi i64 [ 0, %77 ], [ %126, %86 ]
%133 = phi <4 x i32> [ zeroinitializer, %77 ], [ %124, %86 ]
%134 = phi <4 x i32> [ zeroinitializer, %77 ], [ %125, %86 ]
%135 = icmp eq i64 %82, 0
br i1 %135, label %152, label %136
136: ; preds = %129, %136
%137 = phi i64 [ %149, %136 ], [ %132, %129 ]
%138 = phi <4 x i32> [ %147, %136 ], [ %133, %129 ]
%139 = phi <4 x i32> [ %148, %136 ], [ %134, %129 ]
%140 = phi i64 [ %150, %136 ], [ 0, %129 ]
%141 = getelementptr inbounds [24 x i32], [24 x i32]* %2, i64 0, i64 %137
%142 = bitcast i32* %141 to <4 x i32>*
%143 = load <4 x i32>, <4 x i32>* %142
%144 = getelementptr inbounds i32, i32* %141, i64 4
%145 = bitcast i32* %144 to <4 x i32>*
%146 = load <4 x i32>, <4 x i32>* %145
%147 = add <4 x i32> %143, %138
%148 = add <4 x i32> %146, %139
%149 = add nuw i64 %137, 8
%150 = add i64 %140, 1
%151 = icmp eq i64 %150, %82
br i1 %151, label %152, label %136
152: ; preds = %136, %129
%153 = phi <4 x i32> [ %130, %129 ], [ %147, %136 ]
%154 = phi <4 x i32> [ %131, %129 ], [ %148, %136 ]
%155 = add <4 x i32> %154, %153
%156 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %155)
%157 = icmp eq i64 %78, %75
br i1 %157, label %170, label %158
158: ; preds = %74, %152
%159 = phi i64 [ 0, %74 ], [ %78, %152 ]
%160 = phi i32 [ 0, %74 ], [ %156, %152 ]
br label %176
161: ; preds = %56, %161
%162 = phi i64 [ %166, %161 ], [ 0, %56 ]
%163 = getelementptr inbounds [24 x i32], [24 x i32]* %2, i64 0, i64 %162
%164 = load i32, i32* %163
%165 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %164)
%166 = add nuw nsw i64 %162, 1
%167 = load i32, i32* %1
%168 = sext i32 %167 to i64
%169 = icmp slt i64 %166, %168
br i1 %169, label %161, label %72
170: ; preds = %176, %152, %56, %72
%171 = phi i32 [ 0, %72 ], [ 0, %56 ], [ %156, %152 ], [ %181, %176 ]
%172 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), i32 %171)
%173 = call i32 (i32*, i8*, ...) @fscanf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%174 = load i32, i32* %1
%175 = icmp eq i32 %174, 0
br i1 %175, label %16, label %19
176: ; preds = %158, %176
%177 = phi i64 [ %182, %176 ], [ %159, %158 ]
%178 = phi i32 [ %181, %176 ], [ %160, %158 ]
%179 = getelementptr inbounds [24 x i32], [24 x i32]* %2, i64 0, i64 %177
%180 = load i32, i32* %179
%181 = add i32 %180, %178
%182 = add nuw nsw i64 %177, 1
%183 = icmp eq i64 %182, %75
br i1 %183, label %170, label %176
}