#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*/ create();
int /*<<< orphan*/ delete ();
int /*<<< orphan*/ display();
int /*<<< orphan*/ insert();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ search();
int main() {
  int n;
  char ch;
  do {
    printf("enter choice\n");
    printf("1.creation\n2.insertion\n3.deletion\n4.search\n5.display\n");
    scanf("%d", &n);
    switch (n) {
    case '1':
      create();
      break;
    case '2':
      insert();
      break;
    case '3':
      delete ();
      break;
    case '4':
      search();
      break;
    case '5':
      display();
      break;
    default:
      printf("wrong choice\n");
      break;
    }
    printf("\nwant to continue\n");
    scanf("%s", &ch);
  } while (ch != 'n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
xor    %eax,%eax
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffcf,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     120e <main+0x9e>
mov    -0x18(%rbp),%rax
lea    0xe37(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1060 <create@plt>
jmp    121a <main+0xaa>
mov    $0x0,%al
call   1080 <insert@plt>
jmp    121a <main+0xaa>
mov    $0x0,%al
call   1090 <delete@plt>
jmp    121a <main+0xaa>
mov    $0x0,%al
call   1050 <search@plt>
jmp    121a <main+0xaa>
mov    $0x0,%al
call   1030 <display@plt>
jmp    121a <main+0xaa>
lea    0xe46(%rip),%rdi
call   1040 <printf@plt>
lea    0xe48(%rip),%rdi
call   1040 <printf@plt>
lea    0xe4f(%rip),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x6e,%eax
jne    117f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe92(%rip),%r12
lea    0x4(%rsp),%rbx
lea    0xece(%rip),%rbp
lea    0xe82(%rip),%r13
lea    0x3(%rsp),%r14
lea    0xe5f(%rip),%r15
jmp    11cc <main+0x5c>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
nop
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
cmpb   $0x6e,0x3(%rsp)
je     1236 <main+0xc6>
lea    0xe47(%rip),%rdi
call   1030 <puts@plt>
lea    0xe48(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffcf,%eax
cmp    $0x4,%eax
ja     11a3 <main+0x33>
movslq (%r15,%rax,4),%rax
add    %r15,%rax
jmp    *%rax
xor    %eax,%eax
call   1060 <create@plt>
jmp    11b0 <main+0x40>
xor    %eax,%eax
call   1080 <insert@plt>
jmp    11b0 <main+0x40>
xor    %eax,%eax
call   1090 <delete@plt>
jmp    11b0 <main+0x40>
xor    %eax,%eax
call   1050 <search@plt>
jmp    11b0 <main+0x40>
xor    %eax,%eax
call   1040 <display@plt>
jmp    11b0 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"enter choice\0A\00"
@.str.1 = [54 x i8] c"1.creation\0A2.insertion\0A3.deletion\0A4.search\0A5.display\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [14 x i8] c"wrong choice\0A\00"
@.str.4 = [19 x i8] c"\0Awant to continue\0A\00"
@.str.5 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
br label %4
4: ; preds = %24, %0
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
switch i32 %8, label %19 [
i32 49, label %9
i32 50, label %11
i32 51, label %13
i32 52, label %15
i32 53, label %17
]
9: ; preds = %4
%10 = call i32 (...) @create()
br label %21
11: ; preds = %4
%12 = call i32 (...) @insert()
br label %21
13: ; preds = %4
%14 = call i32 (...) @delete()
br label %21
15: ; preds = %4
%16 = call i32 (...) @search()
br label %21
17: ; preds = %4
%18 = call i32 (...) @display()
br label %21
19: ; preds = %4
%20 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %21
21: ; preds = %19, %17, %15, %13, %11, %9
%22 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
br label %24
24: ; preds = %21
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 110
br i1 %27, label %4, label %28
28: ; preds = %24
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%d\00"
@.str.5 = [3 x i8] c"%s\00"
@str = [13 x i8] c"enter choice\00"
@str.6 = [53 x i8] c"1.creation\0A2.insertion\0A3.deletion\0A4.search\0A5.display\00"
@str.7 = [18 x i8] c"\0Awant to continue\00"
@str.8 = [13 x i8] c"wrong choice\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = bitcast i32* %1 to i8*
br label %4
4: ; preds = %21, %0
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.6, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
switch i32 %8, label %19 [
i32 49, label %9
i32 50, label %11
i32 51, label %13
i32 52, label %15
i32 53, label %17
]
9: ; preds = %4
%10 = call i32 (...) @create()
br label %21
11: ; preds = %4
%12 = call i32 (...) @insert()
br label %21
13: ; preds = %4
%14 = call i32 (...) @delete()
br label %21
15: ; preds = %4
%16 = call i32 (...) @search()
br label %21
17: ; preds = %4
%18 = call i32 (...) @display()
br label %21
19: ; preds = %4
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.8, i64 0, i64 0))
br label %21
21: ; preds = %19, %17, %15, %13, %11, %9
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.7, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %2)
%24 = load i8, i8* %2
%25 = icmp eq i8 %24, 110
br i1 %25, label %26, label %4
26: ; preds = %21
ret i32 0
}