#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*/ doDelete();
int /*<<< orphan*/ doInOrder();
int /*<<< orphan*/ doInsert();
int /*<<< orphan*/ doSearch();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getch();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void showMenu() {
  system("cls");
  printf("     ___   ___      _____ ___ ___ ___       \n");
  printf("     /_\\ \\ / / |    |_   _| _ \\ __| __|  \n");
  printf("    / _ \\ - /| |__    | | |   / _|| _|     \n");
  printf("   /_/ \\_\\_/ |____|   |_| |_|_\\___|___|  \n");
  printf("                     By: Raven G. Duran     \n");
  printf("\n\n");
  printf("(1) Insert a Node\n");
  printf("(2) Delete a Node\n");
  printf("(3) Search a Node\n");
  printf("(4) Print In Order\n");
  printf("(5) Exit\n");
  switch (getch()) {
  case '1':
    doInsert();
    break;
  case '2':
    doDelete();
    break;
  case '3':
    doSearch();
    break;
  case '4':
    doInOrder();
    break;
  default:
    exit(0);
  }
}


x86 assembly (clang, -O0):
<showMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe81(%rip),%rdi
call   1050 <system@plt>
lea    0xe79(%rip),%rdi
call   1060 <printf@plt>
lea    0xe9b(%rip),%rdi
call   1060 <printf@plt>
lea    0xeba(%rip),%rdi
call   1060 <printf@plt>
lea    0xedb(%rip),%rdi
call   1060 <printf@plt>
lea    0xefa(%rip),%rdi
call   1060 <printf@plt>
lea    0xf1c(%rip),%rdi
call   1060 <printf@plt>
lea    0xf13(%rip),%rdi
call   1060 <printf@plt>
lea    0xf1a(%rip),%rdi
call   1060 <printf@plt>
lea    0xf21(%rip),%rdi
call   1060 <printf@plt>
lea    0xf28(%rip),%rdi
call   1060 <printf@plt>
lea    0xf30(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1090 <getch@plt>
add    $0xffffffcf,%eax
mov    %eax,%ecx
mov    %rcx,-0x8(%rbp)
sub    $0x3,%eax
ja     1275 <showMenu+0xf5>
mov    -0x8(%rbp),%rax
lea    0xdc4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1030 <doInsert@plt>
jmp    127c <showMenu+0xfc>
mov    $0x0,%al
call   1070 <doDelete@plt>
jmp    127c <showMenu+0xfc>
mov    $0x0,%al
call   1080 <doSearch@plt>
jmp    127c <showMenu+0xfc>
mov    $0x0,%al
call   1040 <doInOrder@plt>
jmp    127c <showMenu+0xfc>
xor    %edi,%edi
call   10a0 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showMenu>:
push   %rax
lea    0xe88(%rip),%rdi
call   1060 <system@plt>
lea    0xe80(%rip),%rdi
call   1040 <puts@plt>
lea    0xea1(%rip),%rdi
call   1040 <puts@plt>
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
lea    0xedf(%rip),%rdi
call   1040 <puts@plt>
lea    0xefd(%rip),%rdi
call   1040 <puts@plt>
lea    0xf1e(%rip),%rdi
call   1040 <puts@plt>
lea    0xf14(%rip),%rdi
call   1040 <puts@plt>
lea    0xf1a(%rip),%rdi
call   1040 <puts@plt>
lea    0xf20(%rip),%rdi
call   1040 <puts@plt>
lea    0xf26(%rip),%rdi
call   1040 <puts@plt>
lea    0xf2d(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1090 <getch@plt>
add    $0xffffffcf,%eax
cmp    $0x3,%eax
ja     1250 <showMenu+0xd0>
lea    0xdd9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
pop    %rcx
jmp    1030 <doInsert@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <doSearch@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <doDelete@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <doInOrder@plt>
xor    %edi,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [46 x i8] c" ___ ___ _____ ___ ___ ___ \0A\00"
@.str.2 = [43 x i8] c" /_\\ \\ / / | |_ _| _ \\ __| __| \0A\00"
@.str.3 = [45 x i8] c" / _ \\ - /| |__ | | | / _|| _| \0A\00"
@.str.4 = [43 x i8] c" /_/ \\_\\_/ |____| |_| |_|_\\___|___| \0A\00"
@.str.5 = [46 x i8] c" By: Raven G. Duran \0A\00"
@.str.6 = [3 x i8] c"\0A\0A\00"
@.str.7 = [19 x i8] c"(1) Insert a Node\0A\00"
@.str.8 = [19 x i8] c"(2) Delete a Node\0A\00"
@.str.9 = [19 x i8] c"(3) Search a Node\0A\00"
@.str.10 = [20 x i8] c"(4) Print In Order\0A\00"
@.str.11 = [10 x i8] c"(5) Exit\0A\00"
define void @showMenu() {
%1 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
%13 = call i32 (...) @getch()
switch i32 %13, label %22 [
i32 49, label %14
i32 50, label %16
i32 51, label %18
i32 52, label %20
]
14: ; preds = %0
%15 = call i32 (...) @doInsert()
br label %24
16: ; preds = %0
%17 = call i32 (...) @doDelete()
br label %24
18: ; preds = %0
%19 = call i32 (...) @doSearch()
br label %24
20: ; preds = %0
%21 = call i32 (...) @doInOrder()
br label %24
22: ; preds = %0
%23 = call i32 @exit(i32 0)
unreachable
24: ; preds = %20, %18, %16, %14
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@str = [45 x i8] c" ___ ___ _____ ___ ___ ___ \00"
@str.12 = [42 x i8] c" /_\\ \\ / / | |_ _| _ \\ __| __| \00"
@str.13 = [44 x i8] c" / _ \\ - /| |__ | | | / _|| _| \00"
@str.14 = [42 x i8] c" /_/ \\_\\_/ |____| |_| |_|_\\___|___| \00"
@str.15 = [45 x i8] c" By: Raven G. Duran \00"
@str.16 = [2 x i8] c"\0A\00"
@str.17 = [18 x i8] c"(1) Insert a Node\00"
@str.18 = [18 x i8] c"(2) Delete a Node\00"
@str.19 = [18 x i8] c"(3) Search a Node\00"
@str.20 = [19 x i8] c"(4) Print In Order\00"
@str.21 = [9 x i8] c"(5) Exit\00"
define void @showMenu() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.12, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.13, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.14, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.15, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.16, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.17, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.18, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.19, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.20, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.21, i64 0, i64 0))
%13 = tail call i32 (...) @getch()
switch i32 %13, label %22 [
i32 49, label %14
i32 50, label %16
i32 51, label %18
i32 52, label %20
]
14: ; preds = %0
%15 = tail call i32 (...) @doInsert()
br label %24
16: ; preds = %0
%17 = tail call i32 (...) @doDelete()
br label %24
18: ; preds = %0
%19 = tail call i32 (...) @doSearch()
br label %24
20: ; preds = %0
%21 = tail call i32 (...) @doInOrder()
br label %24
22: ; preds = %0
%23 = tail call i32 @exit(i32 0)
unreachable
24: ; preds = %20, %18, %16, %14
ret void
}