#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 atoi(char *);
int /*<<< orphan*/ performanceTesting();
int print_error();
int /*<<< orphan*/ simpleBestFitTesting();
int /*<<< orphan*/ simpleFirstFitTesting();
int main(int argc, char *argv[]) {
  if (argc != 2)
    return print_error();
  if (atoi(argv[1]) == 1)
    simpleFirstFitTesting();
  else if (atoi(argv[1]) == 2)
    simpleBestFitTesting();
  else if (atoi(argv[1]) == 3)
    performanceTesting();
  else
    return print_error();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     117f <main+0x2f>
mov    $0x0,%al
call   1030 <print_error@plt>
mov    %eax,-0x4(%rbp)
jmp    1205 <main+0xb5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
cmp    $0x1,%eax
jne    11a1 <main+0x51>
mov    $0x0,%al
call   1040 <simpleFirstFitTesting@plt>
jmp    11fe <main+0xae>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
cmp    $0x2,%eax
jne    11c3 <main+0x73>
mov    $0x0,%al
call   1070 <simpleBestFitTesting@plt>
jmp    11f9 <main+0xa9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
cmp    $0x3,%eax
jne    11e5 <main+0x95>
mov    $0x0,%al
call   1050 <performanceTesting@plt>
jmp    11f4 <main+0xa4>
mov    $0x0,%al
call   1030 <print_error@plt>
mov    %eax,-0x4(%rbp)
jmp    1205 <main+0xb5>
jmp    11f9 <main+0xa9>
jmp    11fe <main+0xae>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1177 <main+0x27>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
cmp    $0x3,%eax
je     117f <main+0x2f>
cmp    $0x2,%eax
je     1188 <main+0x38>
cmp    $0x1,%eax
jne    1177 <main+0x27>
xor    %eax,%eax
call   1040 <simpleFirstFitTesting@plt>
jmp    118f <main+0x3f>
xor    %eax,%eax
pop    %rcx
jmp    1030 <print_error@plt>
xor    %eax,%eax
call   1050 <performanceTesting@plt>
jmp    118f <main+0x3f>
xor    %eax,%eax
call   1070 <simpleBestFitTesting@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @print_error()
store i32 %9, i32* %3
br label %39
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 (...) @simpleFirstFitTesting()
br label %38
18: ; preds = %10
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
%23 = icmp eq i32 %22, 2
br i1 %23, label %24, label %26
24: ; preds = %18
%25 = call i32 (...) @simpleBestFitTesting()
br label %37
26: ; preds = %18
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 @atoi(i8* %29)
%31 = icmp eq i32 %30, 3
br i1 %31, label %32, label %34
32: ; preds = %26
%33 = call i32 (...) @performanceTesting()
br label %36
34: ; preds = %26
%35 = call i32 (...) @print_error()
store i32 %35, i32* %3
br label %39
36: ; preds = %32
br label %37
37: ; preds = %36, %24
br label %38
38: ; preds = %37, %16
store i32 0, i32* %3
br label %39
39: ; preds = %38, %34, %8
%40 = load i32, i32* %3
ret i32 %40
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @print_error()
br label %18
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
switch i32 %9, label %16 [
i32 1, label %10
i32 2, label %12
i32 3, label %14
]
10: ; preds = %6
%11 = tail call i32 (...) @simpleFirstFitTesting()
br label %18
12: ; preds = %6
%13 = tail call i32 (...) @simpleBestFitTesting()
br label %18
14: ; preds = %6
%15 = tail call i32 (...) @performanceTesting()
br label %18
16: ; preds = %6
%17 = tail call i32 (...) @print_error()
br label %18
18: ; preds = %10, %14, %12, %16, %4
%19 = phi i32 [ %5, %4 ], [ %17, %16 ], [ 0, %12 ], [ 0, %14 ], [ 0, %10 ]
ret i32 %19
}