#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*/ generateBestCaseInputForSize(int *, int);
int /*<<< orphan*/ generateRandomInputForSize(int *, int);
int /*<<< orphan*/ generateWorstCaseInputForSize(int *, int);
int /*<<< orphan*/ printf(char *);
void buildArrayWithTaxonomy(int *theArrayPointer, int type, int arraySize) {
  switch (type) {
  case 1:
    generateRandomInputForSize(theArrayPointer, arraySize);
    break;
  case 2:
    generateBestCaseInputForSize(theArrayPointer, arraySize);
    break;
  case 3:
    generateWorstCaseInputForSize(theArrayPointer, arraySize);
    break;
  default:
    printf("\nInvalid option");
    break;
  }
}


x86 assembly (clang, -O0):
<buildArrayWithTaxonomy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     1188 <buildArrayWithTaxonomy+0x48>
jmp    1166 <buildArrayWithTaxonomy+0x26>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     1199 <buildArrayWithTaxonomy+0x59>
jmp    1177 <buildArrayWithTaxonomy+0x37>
mov    -0x14(%rbp),%eax
sub    $0x3,%eax
je     11aa <buildArrayWithTaxonomy+0x6a>
jmp    11bb <buildArrayWithTaxonomy+0x7b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <generateRandomInputForSize@plt>
jmp    11c7 <buildArrayWithTaxonomy+0x87>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1050 <generateBestCaseInputForSize@plt>
jmp    11c7 <buildArrayWithTaxonomy+0x87>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1060 <generateWorstCaseInputForSize@plt>
jmp    11c7 <buildArrayWithTaxonomy+0x87>
lea    0xe3e(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildArrayWithTaxonomy>:
cmp    $0x3,%esi
je     1156 <buildArrayWithTaxonomy+0x16>
cmp    $0x2,%esi
je     115d <buildArrayWithTaxonomy+0x1d>
cmp    $0x1,%esi
jne    1164 <buildArrayWithTaxonomy+0x24>
mov    %edx,%esi
jmp    1030 <generateRandomInputForSize@plt>
mov    %edx,%esi
jmp    1060 <generateWorstCaseInputForSize@plt>
mov    %edx,%esi
jmp    1050 <generateBestCaseInputForSize@plt>
lea    0xe95(%rip),%rdi
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\0AInvalid option\00"
define void @buildArrayWithTaxonomy(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
switch i32 %7, label %20 [
i32 1, label %8
i32 2, label %12
i32 3, label %16
]
8: ; preds = %3
%9 = load i32*, i32** %4
%10 = load i32, i32* %6
%11 = call i32 @generateRandomInputForSize(i32* %9, i32 %10)
br label %22
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = call i32 @generateBestCaseInputForSize(i32* %13, i32 %14)
br label %22
16: ; preds = %3
%17 = load i32*, i32** %4
%18 = load i32, i32* %6
%19 = call i32 @generateWorstCaseInputForSize(i32* %17, i32 %18)
br label %22
20: ; preds = %3
%21 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %20, %16, %12, %8
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0AInvalid option\00"
define void @buildArrayWithTaxonomy(i32* %0, i32 %1, i32 %2) {
switch i32 %1, label %10 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
]
4: ; preds = %3
%5 = tail call i32 @generateRandomInputForSize(i32* %0, i32 %2)
br label %12
6: ; preds = %3
%7 = tail call i32 @generateBestCaseInputForSize(i32* %0, i32 %2)
br label %12
8: ; preds = %3
%9 = tail call i32 @generateWorstCaseInputForSize(i32* %0, i32 %2)
br label %12
10: ; preds = %3
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %8, %6, %4
ret void
}