#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*/ BinarySearchTreeMenu();
int /*<<< orphan*/ LinkListMenu();
int /*<<< orphan*/ PermutationMenu();
int /*<<< orphan*/ SortingMenu();
int /*<<< orphan*/ StackMenu();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdout;
int main() {
  int choice = 0;
  while (choice != 10) {
    printf("\n---------------------------MENU--------------------------");
    printf("\n1.  Perform Permutation Operations.");
    printf("\n2.  Perform Stack Operations.");
    printf("\n3.  Perform Sorting Operations.");
    printf("\n4.  Perform Link List Operations.");
    printf("\n5.  Perform Binary Search Tree Operations.");
    printf("\n10. Exit.");
    printf("\nEnter Your Choice: ");
    fflush(stdout);
    scanf("%d", &choice);
    switch (choice) {
    case 1:
      PermutationMenu();
      break;
    case 2:
      StackMenu();
      break;
    case 3:
      SortingMenu();
      break;
    case 4:
      LinkListMenu();
      break;
    case 5:
      BinarySearchTreeMenu();
      break;
    case 10:
      break;
    default:
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
je     1292 <main+0x112>
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
call   1040 <printf@plt>
lea    0xef1(%rip),%rdi
call   1040 <printf@plt>
lea    0xf08(%rip),%rdi
call   1040 <printf@plt>
lea    0xf28(%rip),%rdi
call   1040 <printf@plt>
lea    0xf27(%rip),%rdi
call   1040 <printf@plt>
mov    0x2dd9(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
lea    0xf22(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1090 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     1288 <main+0x108>
mov    -0x10(%rbp),%rax
lea    0xdc2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1080 <PermutationMenu@plt>
jmp    128d <main+0x10d>
mov    $0x0,%al
call   1050 <StackMenu@plt>
jmp    128d <main+0x10d>
mov    $0x0,%al
call   1060 <SortingMenu@plt>
jmp    128d <main+0x10d>
mov    $0x0,%al
call   1030 <LinkListMenu@plt>
jmp    128d <main+0x10d>
mov    $0x0,%al
call   10a0 <BinarySearchTreeMenu@plt>
jmp    128d <main+0x10d>
jmp    128d <main+0x10d>
jmp    128d <main+0x10d>
jmp    1196 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xf69(%rip),%r14
lea    0xf6d(%rip),%r15
mov    0x2e38(%rip),%rbx
lea    0xf74(%rip),%r12
lea    0x4(%rsp),%r13
lea    0xe45(%rip),%rbp
jmp    11dd <main+0x5d>
xor    %eax,%eax
call   10a0 <BinarySearchTreeMenu@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x4(%rsp),%eax
cmp    $0xa,%eax
je     128d <main+0x10d>
lea    0xe30(%rip),%rdi
call   1040 <printf@plt>
lea    0xe5f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1070 <fflush@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1090 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x1(%rax),%ecx
cmp    $0x4,%ecx
ja     11d4 <main+0x54>
movslq 0x0(%rbp,%rcx,4),%rax
add    %rbp,%rax
jmp    *%rax
xor    %eax,%eax
call   1080 <PermutationMenu@plt>
jmp    11d0 <main+0x50>
xor    %eax,%eax
call   1050 <StackMenu@plt>
jmp    11d0 <main+0x50>
xor    %eax,%eax
call   1060 <SortingMenu@plt>
jmp    11d0 <main+0x50>
xor    %eax,%eax
call   1030 <LinkListMenu@plt>
jmp    11d0 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [59 x i8] c"\0A---------------------------MENU--------------------------\00"
@.str.1 = [37 x i8] c"\0A1. Perform Permutation Operations.\00"
@.str.2 = [31 x i8] c"\0A2. Perform Stack Operations.\00"
@.str.3 = [33 x i8] c"\0A3. Perform Sorting Operations.\00"
@.str.4 = [35 x i8] c"\0A4. Perform Link List Operations.\00"
@.str.5 = [44 x i8] c"\0A5. Perform Binary Search Tree Operations.\00"
@.str.6 = [11 x i8] c"\0A10. Exit.\00"
@.str.7 = [21 x i8] c"\0AEnter Your Choice: \00"
@stdout = global i32 0
@.str.8 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %31, %0
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %32
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
%15 = load i32, i32* @stdout
%16 = call i32 @fflush(i32 %15)
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %2)
%18 = load i32, i32* %2
switch i32 %18, label %30 [
i32 1, label %19
i32 2, label %21
i32 3, label %23
i32 4, label %25
i32 5, label %27
i32 10, label %29
]
19: ; preds = %6
%20 = call i32 (...) @PermutationMenu()
br label %31
21: ; preds = %6
%22 = call i32 (...) @StackMenu()
br label %31
23: ; preds = %6
%24 = call i32 (...) @SortingMenu()
br label %31
25: ; preds = %6
%26 = call i32 (...) @LinkListMenu()
br label %31
27: ; preds = %6
%28 = call i32 (...) @BinarySearchTreeMenu()
br label %31
29: ; preds = %6
br label %31
30: ; preds = %6
br label %31
31: ; preds = %30, %29, %27, %25, %23, %21, %19
br label %3
32: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [59 x i8] c"\0A---------------------------MENU--------------------------\00"
@.str.1 = [37 x i8] c"\0A1. Perform Permutation Operations.\00"
@.str.2 = [31 x i8] c"\0A2. Perform Stack Operations.\00"
@.str.3 = [33 x i8] c"\0A3. Perform Sorting Operations.\00"
@.str.4 = [35 x i8] c"\0A4. Perform Link List Operations.\00"
@.str.5 = [44 x i8] c"\0A5. Perform Binary Search Tree Operations.\00"
@.str.6 = [11 x i8] c"\0A10. Exit.\00"
@.str.7 = [21 x i8] c"\0AEnter Your Choice: \00"
@stdout = global i32 0
@.str.8 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %0, %28
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
%12 = load i32, i32* @stdout
%13 = call i32 @fflush(i32 %12)
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%15 = load i32, i32* %1
switch i32 %15, label %28 [
i32 1, label %16
i32 2, label %18
i32 3, label %20
i32 4, label %22
i32 5, label %24
]
16: ; preds = %3
%17 = call i32 (...) @PermutationMenu()
br label %26
18: ; preds = %3
%19 = call i32 (...) @StackMenu()
br label %26
20: ; preds = %3
%21 = call i32 (...) @SortingMenu()
br label %26
22: ; preds = %3
%23 = call i32 (...) @LinkListMenu()
br label %26
24: ; preds = %3
%25 = call i32 (...) @BinarySearchTreeMenu()
br label %26
26: ; preds = %16, %18, %20, %22, %24
%27 = load i32, i32* %1
br label %28
28: ; preds = %26, %3
%29 = phi i32 [ %27, %26 ], [ %15, %3 ]
%30 = icmp eq i32 %29, 10
br i1 %30, label %31, label %3
31: ; preds = %28
ret i32 0
}