#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("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    1234 <main+0xe4>
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    0xe2d(%rip),%rdi
call   1050 <printf@plt>
lea    0xe35(%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   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
lea    0xe58(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x3,%eax
jg     1219 <main+0xc9>
lea    0xe73(%rip),%r14
lea    0xe37(%rip),%r15
lea    0xc(%rsp),%rbx
jmp    11f3 <main+0xa3>
xor    %eax,%eax
call   1050 <Delete@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x4,%eax
jge    1219 <main+0xc9>
cmp    $0x3,%eax
je     1210 <main+0xc0>
cmp    $0x2,%eax
je     11d0 <main+0x80>
cmp    $0x1,%eax
jne    11d7 <main+0x87>
xor    %eax,%eax
call   1070 <insert@plt>
jmp    11d7 <main+0x87>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <display@plt>
jmp    11d7 <main+0x87>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
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 %25
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 ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %2)
br label %10
25: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str.6 = [3 x i8] c"%d\00"
@str = [11 x i8] c"MAIN MENU \00"
@str.7 = [10 x i8] c"1.INSERT \00"
@str.8 = [10 x i8] c"2.DELETE \00"
@str.9 = [11 x i8] c"3.DISPLAY \00"
@str.10 = [8 x i8] c"4.EXIT \00"
@str.12 = [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, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.9, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.10, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.12, 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 %25
12: ; preds = %0, %20
%13 = phi i32 [ %23, %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 ([19 x i8], [19 x i8]* @str.12, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %1)
%23 = load i32, i32* %1
%24 = icmp slt i32 %23, 4
br i1 %24, label %12, label %25
25: ; preds = %20, %0
ret i32 0
}