#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*/ add_item();
int /*<<< orphan*/ del_item();
int /*<<< orphan*/ display();
int /*<<< orphan*/ exit_end();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  do {
    printf("Press 1 for Adding Item to list\n");
    printf("Press 2 for Deleting Item from list\n");
    printf("Press 3 to Display list\n");
    printf("press 4 to Exit \n");
    scanf("%d", &a);
    switch (a) {
    case 1: {
      add_item();
      break;
    }
    case 2: {
      del_item();
      break;
    }
    case 3: {
      display();
      break;
    }
    case 4: {
      exit_end();
      break;
    }
    default: {
      printf("Sorry I Can't Understand you !\n");
      break;
    }
    }
    printf("\n");
  } while (a != 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1050 <printf@plt>
lea    0xeaf(%rip),%rdi
call   1050 <printf@plt>
lea    0xec8(%rip),%rdi
call   1050 <printf@plt>
lea    0xed5(%rip),%rdi
call   1050 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1208 <main+0xa8>
mov    -0x10(%rbp),%rax
lea    0xe31(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1060 <add_item@plt>
jmp    1214 <main+0xb4>
mov    $0x0,%al
call   1070 <del_item@plt>
jmp    1214 <main+0xb4>
mov    $0x0,%al
call   1040 <display@plt>
jmp    1214 <main+0xb4>
mov    $0x0,%al
call   1030 <exit_end@plt>
jmp    1214 <main+0xb4>
lea    0xe75(%rip),%rdi
call   1050 <printf@plt>
lea    0xe64(%rip),%rdi
call   1050 <printf@plt>
cmpl   $0x4,-0x8(%rbp)
jne    116f <main+0xf>
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    0xeb1(%rip),%r15
lea    0xece(%rip),%r12
lea    0xedf(%rip),%r13
lea    0xe79(%rip),%rbx
lea    0x4(%rsp),%rbp
lea    0xe5d(%rip),%r14
jmp    11d1 <main+0x61>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xec9(%rip),%rdi
call   1050 <puts@plt>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x4,0x4(%rsp)
je     124c <main+0xdc>
lea    0xe3b(%rip),%rdi
call   1050 <puts@plt>
mov    %r15,%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
call   1050 <puts@plt>
mov    %r13,%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1090 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     11b0 <main+0x40>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
xor    %eax,%eax
call   1070 <add_item@plt>
jmp    11c0 <main+0x50>
xchg   %ax,%ax
xor    %eax,%eax
call   1080 <del_item@plt>
jmp    11c0 <main+0x50>
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <display@plt>
jmp    11c0 <main+0x50>
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <exit_end@plt>
jmp    11c0 <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 = [33 x i8] c"Press 1 for Adding Item to list\0A\00"
@.str.1 = [37 x i8] c"Press 2 for Deleting Item from list\0A\00"
@.str.2 = [25 x i8] c"Press 3 to Display list\0A\00"
@.str.3 = [18 x i8] c"press 4 to Exit \0A\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [32 x i8] c"Sorry I Can't Understand you !\0A\00"
@.str.6 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %22, %0
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
switch i32 %9, label %18 [
i32 1, label %10
i32 2, label %12
i32 3, label %14
i32 4, label %16
]
10: ; preds = %3
%11 = call i32 (...) @add_item()
br label %20
12: ; preds = %3
%13 = call i32 (...) @del_item()
br label %20
14: ; preds = %3
%15 = call i32 (...) @display()
br label %20
16: ; preds = %3
%17 = call i32 (...) @exit_end()
br label %20
18: ; preds = %3
%19 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
br label %20
20: ; preds = %18, %16, %14, %12, %10
%21 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %22
22: ; preds = %20
%23 = load i32, i32* %2
%24 = icmp ne i32 %23, 4
br i1 %24, label %3, label %25
25: ; preds = %22
ret i32 0
}

LLVM IR (-O2):
@.str.4 = [3 x i8] c"%d\00"
@str = [32 x i8] c"Press 1 for Adding Item to list\00"
@str.7 = [36 x i8] c"Press 2 for Deleting Item from list\00"
@str.8 = [24 x i8] c"Press 3 to Display list\00"
@str.9 = [17 x i8] c"press 4 to Exit \00"
@str.10 = [31 x i8] c"Sorry I Can't Understand you !\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %20, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.7, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.8, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.9, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
switch i32 %9, label %18 [
i32 1, label %10
i32 2, label %12
i32 3, label %14
i32 4, label %16
]
10: ; preds = %3
%11 = call i32 (...) @add_item()
br label %20
12: ; preds = %3
%13 = call i32 (...) @del_item()
br label %20
14: ; preds = %3
%15 = call i32 (...) @display()
br label %20
16: ; preds = %3
%17 = call i32 (...) @exit_end()
br label %20
18: ; preds = %3
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.10, i64 0, i64 0))
br label %20
20: ; preds = %18, %16, %14, %12, %10
%21 = call i32 @putchar(i32 10)
%22 = load i32, i32* %1
%23 = icmp eq i32 %22, 4
br i1 %23, label %24, label %3
24: ; preds = %20
ret i32 0
}