#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*/ Delete();
int /*<<< orphan*/ display();
int /*<<< orphan*/ insert();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int choice;
  printf("MAIN MENU \n");
  printf("1.INSERT \n");
  printf("2.DELETE \n");
  printf("3.DISPLAY \n");
  printf("4.EXIT \n");
  printf("ENTER YOUR CHOICE \n");
  scanf("%d", &choice);
  while (choice < 4) {
    switch (choice) {
    case 1:
      insert();
      break;
    case 2:
      Delete();
      break;
    case 3:
      display();
      break;
    case 4:
      break;
    }
    printf("MAIN MENU \n");
    printf("1.INSERT \n");
    printf("2.DELETE \n");
    printf("3.DISPLAY \n");
    printf("4.EXIT \n");
    printf("ENTER YOUR CHOICE \n");
    scanf("%d", &choice);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
lea    0xea9(%rip),%rdi
call   1050 <printf@plt>
lea    0xea8(%rip),%rdi
call   1050 <printf@plt>
lea    0xea8(%rip),%rdi
call   1050 <printf@plt>
lea    0xea5(%rip),%rdi
call   1050 <printf@plt>
lea    0xead(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x4,-0x8(%rbp)
jge    1270 <main+0x120>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1213 <main+0xc3>
mov    -0x10(%rbp),%rax
lea    0xe1f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1070 <insert@plt>
jmp    1213 <main+0xc3>
mov    $0x0,%al
call   1040 <Delete@plt>
jmp    1213 <main+0xc3>
mov    $0x0,%al
call   1030 <display@plt>
jmp    1213 <main+0xc3>
jmp    1213 <main+0xc3>
lea    0xdf6(%rip),%rdi
call   1050 <printf@plt>
lea    0xdf6(%rip),%rdi
call   1050 <printf@plt>
lea    0xdf5(%rip),%rdi
call   1050 <printf@plt>
lea    0xdf4(%rip),%rdi
call   1050 <printf@plt>
lea    0xdf4(%rip),%rdi
call   1050 <printf@plt>
lea    0xdf1(%rip),%rdi
call   1050 <printf@plt>
lea    0xdf9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
jmp    11b7 <main+0x67>
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
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
lea    0xe56(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
jg     1269 <main+0x119>
lea    0xe50(%rip),%r12
lea    0xe53(%rip),%r13
lea    0xe57(%rip),%rbx
lea    0xe58(%rip),%rbp
lea    0xe1c(%rip),%r14
lea    0x4(%rsp),%r15
jmp    1243 <main+0xf3>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <Delete@plt>
lea    0xe05(%rip),%rdi
call   1030 <puts@plt>
lea    0xe04(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x4,%eax
jge    1269 <main+0x119>
cmp    $0x3,%eax
je     1260 <main+0x110>
cmp    $0x2,%eax
je     11f0 <main+0xa0>
cmp    $0x1,%eax
jne    11f7 <main+0xa7>
xor    %eax,%eax
call   1070 <insert@plt>
jmp    11f7 <main+0xa7>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <display@plt>
jmp    11f7 <main+0xa7>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"MAIN MENU \0A\00"
@.str.1 = [11 x i8] c"1.INSERT \0A\00"
@.str.2 = [11 x i8] c"2.DELETE \0A\00"
@.str.3 = [12 x i8] c"3.DISPLAY \0A\00"
@.str.4 = [9 x i8] c"4.EXIT \0A\00"
@.str.5 = [20 x i8] c"ENTER YOUR CHOICE \0A\00"
@.str.6 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %2)
br label %10
10: ; preds = %22, %0
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 4
br i1 %12, label %13, label %30
13: ; preds = %10
%14 = load i32, i32* %2
switch i32 %14, label %22 [
i32 1, label %15
i32 2, label %17
i32 3, label %19
i32 4, label %21
]
15: ; preds = %13
%16 = call i32 (...) @insert()
br label %22
17: ; preds = %13
%18 = call i32 (...) @Delete()
br label %22
19: ; preds = %13
%20 = call i32 (...) @display()
br label %22
21: ; preds = %13
br label %22
22: ; preds = %13, %21, %19, %17, %15
%23 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%25 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%26 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%27 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%28 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %2)
br label %10
30: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str.6 = [3 x i8] c"%d\00"
@str.12 = [11 x i8] c"MAIN MENU \00"
@str.13 = [10 x i8] c"1.INSERT \00"
@str.14 = [10 x i8] c"2.DELETE \00"
@str.15 = [11 x i8] c"3.DISPLAY \00"
@str.16 = [8 x i8] c"4.EXIT \00"
@str.17 = [19 x i8] c"ENTER YOUR CHOICE \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.12, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.13, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.14, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.15, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.16, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.17, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp slt i32 %10, 4
br i1 %11, label %12, label %30
12: ; preds = %0, %20
%13 = phi i32 [ %28, %20 ], [ %10, %0 ]
switch i32 %13, label %20 [
i32 1, label %14
i32 2, label %16
i32 3, label %18
]
14: ; preds = %12
%15 = call i32 (...) @insert()
br label %20
16: ; preds = %12
%17 = call i32 (...) @Delete()
br label %20
18: ; preds = %12
%19 = call i32 (...) @display()
br label %20
20: ; preds = %12, %18, %16, %14
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.12, i64 0, i64 0))
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.13, i64 0, i64 0))
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.14, i64 0, i64 0))
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.15, i64 0, i64 0))
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.16, i64 0, i64 0))
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.17, i64 0, i64 0))
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %1)
%28 = load i32, i32* %1
%29 = icmp slt i32 %28, 4
br i1 %29, label %12, label %30
30: ; preds = %20, %0
ret i32 0
}