#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 */

/* Variables and functions */
int /*<<< orphan*/ acceptData(int *, int *, int *);
int /*<<< orphan*/ printFinalList(int *, int *, int *, int *);
int /*<<< orphan*/ seperateLunch(int *, int *, int *, int *, int *, int *,
                                 int *);
int /*<<< orphan*/ sortArray(int *, int *);
int main() {
  int studID[30];
  studID[0] = 0;
  int prefer[30];
  prefer[0] = 0;
  int schoolLunch[30];
  schoolLunch[0] = 0;
  int homeLunch[30];
  homeLunch[0] = 0;
  int orderOfLine[30];
  orderOfLine[0] = 0;
  int actualSize = 0;
  int slSize = 0;
  int hlSize = 0;
  acceptData(studID, prefer, &actualSize);
  seperateLunch(studID, prefer, &actualSize, schoolLunch, homeLunch, &slSize,
                &hlSize);
  sortArray(schoolLunch, &slSize);
  sortArray(homeLunch, &hlSize);
  printFinalList(schoolLunch, homeLunch, &slSize, &hlSize);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2a0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x80(%rbp)
movl   $0x0,-0x100(%rbp)
movl   $0x0,-0x180(%rbp)
movl   $0x0,-0x200(%rbp)
movl   $0x0,-0x280(%rbp)
movl   $0x0,-0x284(%rbp)
movl   $0x0,-0x288(%rbp)
movl   $0x0,-0x28c(%rbp)
lea    -0x80(%rbp),%rdi
lea    -0x100(%rbp),%rsi
lea    -0x284(%rbp),%rdx
call   1040 <acceptData@plt>
lea    -0x80(%rbp),%rdi
lea    -0x100(%rbp),%rsi
lea    -0x180(%rbp),%rcx
lea    -0x200(%rbp),%r8
lea    -0x284(%rbp),%rdx
lea    -0x288(%rbp),%r9
lea    -0x28c(%rbp),%rax
mov    %rax,(%rsp)
call   1060 <seperateLunch@plt>
lea    -0x180(%rbp),%rdi
lea    -0x288(%rbp),%rsi
call   1030 <sortArray@plt>
lea    -0x200(%rbp),%rdi
lea    -0x28c(%rbp),%rsi
call   1030 <sortArray@plt>
lea    -0x180(%rbp),%rdi
lea    -0x200(%rbp),%rsi
lea    -0x288(%rbp),%rdx
lea    -0x28c(%rbp),%rcx
call   1050 <printFinalList@plt>
xor    %eax,%eax
add    $0x2a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x218,%rsp
movl   $0x0,0x1a0(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x120(%rsp)
movl   $0x0,0xa0(%rsp)
movl   $0x0,0x1c(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x14(%rsp)
lea    0x1a0(%rsp),%r12
lea    0x20(%rsp),%rsi
lea    0x1c(%rsp),%r15
mov    %r12,%rdi
mov    %r15,%rdx
call   1040 <acceptData@plt>
lea    0x14(%rsp),%r13
mov    %r13,(%rsp)
lea    0x120(%rsp),%rbx
lea    0xa0(%rsp),%rbp
lea    0x18(%rsp),%r14
mov    %r12,%rdi
lea    0x20(%rsp),%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %rbp,%r8
mov    %r14,%r9
call   1060 <seperateLunch@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <sortArray@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
call   1030 <sortArray@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    %r13,%rcx
call   1050 <printFinalList@plt>
xor    %eax,%eax
add    $0x218,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i32]
%3 = alloca [30 x i32]
%4 = alloca [30 x i32]
%5 = alloca [30 x i32]
%6 = alloca [30 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
%10 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 0
store i32 0, i32* %10
%11 = getelementptr inbounds [30 x i32], [30 x i32]* %3, i64 0, i64 0
store i32 0, i32* %11
%12 = getelementptr inbounds [30 x i32], [30 x i32]* %4, i64 0, i64 0
store i32 0, i32* %12
%13 = getelementptr inbounds [30 x i32], [30 x i32]* %5, i64 0, i64 0
store i32 0, i32* %13
%14 = getelementptr inbounds [30 x i32], [30 x i32]* %6, i64 0, i64 0
store i32 0, i32* %14
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
%15 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 0
%16 = getelementptr inbounds [30 x i32], [30 x i32]* %3, i64 0, i64 0
%17 = call i32 @acceptData(i32* %15, i32* %16, i32* %7)
%18 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 0
%19 = getelementptr inbounds [30 x i32], [30 x i32]* %3, i64 0, i64 0
%20 = getelementptr inbounds [30 x i32], [30 x i32]* %4, i64 0, i64 0
%21 = getelementptr inbounds [30 x i32], [30 x i32]* %5, i64 0, i64 0
%22 = call i32 @seperateLunch(i32* %18, i32* %19, i32* %7, i32* %20, i32* %21, i32* %8, i32* %9)
%23 = getelementptr inbounds [30 x i32], [30 x i32]* %4, i64 0, i64 0
%24 = call i32 @sortArray(i32* %23, i32* %8)
%25 = getelementptr inbounds [30 x i32], [30 x i32]* %5, i64 0, i64 0
%26 = call i32 @sortArray(i32* %25, i32* %9)
%27 = getelementptr inbounds [30 x i32], [30 x i32]* %4, i64 0, i64 0
%28 = getelementptr inbounds [30 x i32], [30 x i32]* %5, i64 0, i64 0
%29 = call i32 @printFinalList(i32* %27, i32* %28, i32* %8, i32* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [30 x i32]
%2 = alloca [30 x i32]
%3 = alloca [30 x i32]
%4 = alloca [30 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = bitcast [30 x i32]* %1 to i8*
%9 = getelementptr inbounds [30 x i32], [30 x i32]* %1, i64 0, i64 0
store i32 0, i32* %9
%10 = bitcast [30 x i32]* %2 to i8*
%11 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 0
store i32 0, i32* %11
%12 = bitcast [30 x i32]* %3 to i8*
%13 = getelementptr inbounds [30 x i32], [30 x i32]* %3, i64 0, i64 0
store i32 0, i32* %13
%14 = bitcast [30 x i32]* %4 to i8*
%15 = getelementptr inbounds [30 x i32], [30 x i32]* %4, i64 0, i64 0
store i32 0, i32* %15
%16 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%17 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%18 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%19 = call i32 @acceptData(i32* %9, i32* %11, i32* %5)
%20 = call i32 @seperateLunch(i32* %9, i32* %11, i32* %5, i32* %13, i32* %15, i32* %6, i32* %7)
%21 = call i32 @sortArray(i32* %13, i32* %6)
%22 = call i32 @sortArray(i32* %15, i32* %7)
%23 = call i32 @printFinalList(i32* %13, i32* %15, i32* %6, i32* %7)
ret i32 0
}