#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("\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    0xe98(%rip),%rdi
call   1060 <printf@plt>
lea    0xeb7(%rip),%rdi
call   1060 <printf@plt>
lea    0xed6(%rip),%rdi
call   1060 <printf@plt>
lea    0xef5(%rip),%rdi
call   1060 <printf@plt>
lea    0xeec(%rip),%rdi
call   1060 <printf@plt>
lea    0xef3(%rip),%rdi
call   1060 <printf@plt>
lea    0xefa(%rip),%rdi
call   1060 <printf@plt>
lea    0xf01(%rip),%rdi
call   1060 <printf@plt>
lea    0xf09(%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     1269 <showMenu+0xe9>
mov    -0x8(%rbp),%rax
lea    0xdd0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1030 <doInsert@plt>
jmp    1270 <showMenu+0xf0>
mov    $0x0,%al
call   1070 <doDelete@plt>
jmp    1270 <showMenu+0xf0>
mov    $0x0,%al
call   1080 <doSearch@plt>
jmp    1270 <showMenu+0xf0>
mov    $0x0,%al
call   1040 <doInOrder@plt>
jmp    1270 <showMenu+0xf0>
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    0xe9e(%rip),%rdi
call   1040 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <puts@plt>
lea    0xeda(%rip),%rdi
call   1040 <puts@plt>
lea    0xef8(%rip),%rdi
call   1040 <puts@plt>
lea    0xeee(%rip),%rdi
call   1040 <puts@plt>
lea    0xef4(%rip),%rdi
call   1040 <puts@plt>
lea    0xefa(%rip),%rdi
call   1040 <puts@plt>
lea    0xf00(%rip),%rdi
call   1040 <puts@plt>
lea    0xf07(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1090 <getch@plt>
add    $0xffffffcf,%eax
cmp    $0x3,%eax
ja     1244 <showMenu+0xc4>
lea    0xde5(%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 = [43 x i8] c" _____ _____ \0A\00"
@.str.2 = [43 x i8] c" | __ | ___ |_ _|___ ___ ___ \0A\00"
@.str.3 = [43 x i8] c" | __ -| |___| | | | _| -_| -_| \0A\00"
@.str.4 = [43 x i8] c" |_____| |_| |_| |___|___| \0A\00"
@.str.5 = [3 x i8] c"\0A\0A\00"
@.str.6 = [19 x i8] c"(1) Insert a Node\0A\00"
@.str.7 = [19 x i8] c"(2) Delete a Node\0A\00"
@.str.8 = [19 x i8] c"(3) Search a Node\0A\00"
@.str.9 = [20 x i8] c"(4) Print In Order\0A\00"
@.str.10 = [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 ([43 x i8], [43 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 ([43 x i8], [43 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 ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 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 ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
%12 = call i32 (...) @getch()
switch i32 %12, label %21 [
i32 49, label %13
i32 50, label %15
i32 51, label %17
i32 52, label %19
]
13: ; preds = %0
%14 = call i32 (...) @doInsert()
br label %23
15: ; preds = %0
%16 = call i32 (...) @doDelete()
br label %23
17: ; preds = %0
%18 = call i32 (...) @doSearch()
br label %23
19: ; preds = %0
%20 = call i32 (...) @doInOrder()
br label %23
21: ; preds = %0
%22 = call i32 @exit(i32 0)
unreachable
23: ; preds = %19, %17, %15, %13
ret void
}

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