#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*/ printf(char *);
void menu(int ll) {
  switch (ll) {
  case 1:
    printf("\n\n\n\t-----------------Linked List OPERATIONS-----------------");
    printf("\n\n\t1. Insert atBeg  \t2. Insert atEnd \t\t3. Insert atPos \t4. "
           "Create Random List");
    printf("\n\n\t5. Length  \t\t6. Delete atBeg \t\t7. Delete atEnd \t8. "
           "Delete atPos");
    printf("\n\n\t9. Sort\t\t\t10. Copy\t\t\t11. Reverse\t\t12. Search");
    printf("\n\n\t13. Display\t\t14. Merge\t\t\t15. Merge Ordered \t16. Create "
           "List\n\n\t17. Insert Ordered\t0. Exit");
    printf("\n\t______________________________________________________\n");
    break;
  case 2:
    printf("\n\n\n\t-----------------Stack ADT OPERATIONS-----------------");
    printf("\n\n\t1. Push  \t2. Pop \t\t3. isEmpty \t4. atTop");
    printf("\n\t5. Display \t0. Exit");
    printf("\n\t______________________________________________________\n");
    break;
  case 3:
    printf("\n\n\n\t------------QUEUE ADT OPERATIONS-------------");
    printf("\n\n\t1.Insert  \t2. Delete \t3. isEmpty \t4. Display");
    printf("\n\n\t5. Front\t6. Rear\t\t0. Exit");
    printf("\n\t______________________________________________________\n");
    break;
  }
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     1151 <menu+0x41>
jmp    112f <menu+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     119e <menu+0x8e>
jmp    1140 <menu+0x30>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
je     11d3 <menu+0xc3>
jmp    1203 <menu+0xf3>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1b(%rip),%rdi
call   1030 <printf@plt>
lea    0xf52(%rip),%rdi
call   1030 <printf@plt>
lea    0xf76(%rip),%rdi
call   1030 <printf@plt>
lea    0xfc6(%rip),%rdi
call   1030 <printf@plt>
jmp    1203 <menu+0xf3>
lea    0xfef(%rip),%rdi
call   1030 <printf@plt>
lea    0x101e(%rip),%rdi
call   1030 <printf@plt>
lea    0x103d(%rip),%rdi
call   1030 <printf@plt>
lea    0xf91(%rip),%rdi
call   1030 <printf@plt>
jmp    1203 <menu+0xf3>
lea    0x1036(%rip),%rdi
call   1030 <printf@plt>
lea    0x105c(%rip),%rdi
call   1030 <printf@plt>
lea    0x1080(%rip),%rdi
call   1030 <printf@plt>
lea    0xf5c(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
push   %r14
push   %rbx
push   %rax
cmp    $0x3,%edi
je     1166 <menu+0x46>
cmp    $0x2,%edi
je     117d <menu+0x5d>
cmp    $0x1,%edi
jne    11ba <menu+0x9a>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
lea    0xef3(%rip),%rdi
call   1040 <printf@plt>
lea    0xfa8(%rip),%r14
lea    0xf71(%rip),%rbx
lea    0xf27(%rip),%rdi
jmp    1192 <menu+0x72>
lea    0x10cb(%rip),%r14
lea    0x1094(%rip),%rbx
lea    0x105b(%rip),%rdi
jmp    1192 <menu+0x72>
lea    0x103c(%rip),%r14
lea    0x100a(%rip),%rbx
lea    0xfc8(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
lea    0x10a7(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [61 x i8] c"\0A\0A\0A\09-----------------Linked List OPERATIONS-----------------\00"
@.str.1 = [78 x i8] c"\0A\0A\091. Insert atBeg \092. Insert atEnd \09\093. Insert atPos \094. Create Random List\00"
@.str.2 = [67 x i8] c"\0A\0A\095. Length \09\096. Delete atBeg \09\097. Delete atEnd \098. Delete atPos\00"
@.str.3 = [48 x i8] c"\0A\0A\099. Sort\09\09\0910. Copy\09\09\0911. Reverse\09\0912. Search\00"
@.str.4 = [92 x i8] c"\0A\0A\0913. Display\09\0914. Merge\09\09\0915. Merge Ordered \0916. Create List\0A\0A\0917. Insert Ordered\090. Exit\00"
@.str.5 = [58 x i8] c"\0A\09______________________________________________________\0A\00"
@.str.6 = [59 x i8] c"\0A\0A\0A\09-----------------Stack ADT OPERATIONS-----------------\00"
@.str.7 = [43 x i8] c"\0A\0A\091. Push \092. Pop \09\093. isEmpty \094. atTop\00"
@.str.8 = [22 x i8] c"\0A\095. Display \090. Exit\00"
@.str.9 = [50 x i8] c"\0A\0A\0A\09------------QUEUE ADT OPERATIONS-------------\00"
@.str.10 = [48 x i8] c"\0A\0A\091.Insert \092. Delete \093. isEmpty \094. Display\00"
@.str.11 = [29 x i8] c"\0A\0A\095. Front\096. Rear\09\090. Exit\00"
define void @menu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %21 [
i32 1, label %4
i32 2, label %11
i32 3, label %16
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0))
br label %21
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0))
br label %21
16: ; preds = %1
%17 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.9, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.10, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0))
br label %21
21: ; preds = %1, %16, %11, %4
ret void
}

LLVM IR (-O2):
@.str = [61 x i8] c"\0A\0A\0A\09-----------------Linked List OPERATIONS-----------------\00"
@.str.1 = [78 x i8] c"\0A\0A\091. Insert atBeg \092. Insert atEnd \09\093. Insert atPos \094. Create Random List\00"
@.str.2 = [67 x i8] c"\0A\0A\095. Length \09\096. Delete atBeg \09\097. Delete atEnd \098. Delete atPos\00"
@.str.3 = [48 x i8] c"\0A\0A\099. Sort\09\09\0910. Copy\09\09\0911. Reverse\09\0912. Search\00"
@.str.4 = [92 x i8] c"\0A\0A\0913. Display\09\0914. Merge\09\09\0915. Merge Ordered \0916. Create List\0A\0A\0917. Insert Ordered\090. Exit\00"
@.str.6 = [59 x i8] c"\0A\0A\0A\09-----------------Stack ADT OPERATIONS-----------------\00"
@.str.7 = [43 x i8] c"\0A\0A\091. Push \092. Pop \09\093. isEmpty \094. atTop\00"
@.str.8 = [22 x i8] c"\0A\095. Display \090. Exit\00"
@.str.9 = [50 x i8] c"\0A\0A\0A\09------------QUEUE ADT OPERATIONS-------------\00"
@.str.10 = [48 x i8] c"\0A\0A\091.Insert \092. Delete \093. isEmpty \094. Display\00"
@.str.11 = [29 x i8] c"\0A\0A\095. Front\096. Rear\09\090. Exit\00"
@str.13 = [57 x i8] c"\0A\09______________________________________________________\00"
define void @menu(i32 %0) {
switch i32 %0, label %15 [
i32 1, label %2
i32 2, label %6
i32 3, label %5
]
2: ; preds = %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %2, %5
%7 = phi i8* [ getelementptr inbounds ([50 x i8], [50 x i8]* @.str.9, i64 0, i64 0), %5 ], [ getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0), %2 ], [ getelementptr inbounds ([59 x i8], [59 x i8]* @.str.6, i64 0, i64 0), %1 ]
%8 = phi i8* [ getelementptr inbounds ([48 x i8], [48 x i8]* @.str.10, i64 0, i64 0), %5 ], [ getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), %2 ], [ getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), %1 ]
%9 = phi i8* [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), %5 ], [ getelementptr inbounds ([92 x i8], [92 x i8]* @.str.4, i64 0, i64 0), %2 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), %1 ]
%10 = phi i8* [ getelementptr inbounds ([57 x i8], [57 x i8]* @str.13, i64 0, i64 0), %5 ], [ getelementptr inbounds ([57 x i8], [57 x i8]* @str.13, i64 0, i64 0), %2 ], [ getelementptr inbounds ([57 x i8], [57 x i8]* @str.13, i64 0, i64 0), %1 ]
%11 = tail call i32 @printf(i8* dereferenceable(1) %7)
%12 = tail call i32 @printf(i8* dereferenceable(1) %8)
%13 = tail call i32 @printf(i8* dereferenceable(1) %9)
%14 = tail call i32 @puts(i8* dereferenceable(1) %10)
br label %15
15: ; preds = %6, %1
ret void
}