#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);
int /*<<< orphan*/ display();
int /*<<< orphan*/ insert(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int c, da;
  do {
    printf("\n1 insert element\n2 delete element\n3 display \n4 exit");
    scanf("%d", &c);
    switch (c) {
    case 1:
      printf("enter the value\n");
      scanf("%d", &da);
      insert(da);
      break;
    case 2:
      printf("enter the element\n");
      scanf("%d", &da);
      delete (da);
      break;
    case 3:
      display();
    }
  } while (c < 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     11aa <main+0x5a>
jmp    1188 <main+0x38>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11d3 <main+0x83>
jmp    1199 <main+0x49>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     11fc <main+0xac>
jmp    1203 <main+0xb3>
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
lea    0xe78(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1060 <insert@plt>
jmp    1203 <main+0xb3>
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe4f(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1070 <delete@plt>
jmp    1203 <main+0xb3>
mov    $0x0,%al
call   1030 <display@plt>
jmp    1208 <main+0xb8>
cmpl   $0x4,-0x4(%rbp)
jl     1158 <main+0x8>
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    0xe8e(%rip),%r14
lea    0xebc(%rip),%rbx
lea    0x4(%rsp),%r15
lea    0xeb3(%rip),%r12
mov    %rsp,%r13
lea    0xebb(%rip),%rbp
jmp    11c4 <main+0x64>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1060 <scanf@plt>
mov    (%rsp),%edi
call   1080 <delete@plt>
mov    0x4(%rsp),%eax
cmp    $0x4,%eax
jge    1219 <main+0xb9>
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
je     1210 <main+0xb0>
cmp    $0x2,%eax
je     11a0 <main+0x40>
cmp    $0x1,%eax
jne    11bf <main+0x5f>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1060 <scanf@plt>
mov    (%rsp),%edi
call   1070 <insert@plt>
jmp    11bb <main+0x5b>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <display@plt>
jmp    11bb <main+0x5b>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [53 x i8] c"\0A1 insert element\0A2 delete element\0A3 display \0A4 exit\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"enter the value\0A\00"
@.str.3 = [19 x i8] c"enter the element\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %20, %0
%4 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
switch i32 %6, label %19 [
i32 1, label %7
i32 2, label %12
i32 3, label %17
]
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = call i32 @insert(i32 %10)
br label %19
12: ; preds = %3
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = call i32 @delete(i32 %15)
br label %19
17: ; preds = %3
%18 = call i32 (...) @display()
br label %19
19: ; preds = %17, %3, %12, %7
br label %20
20: ; preds = %19
%21 = load i32, i32* %1
%22 = icmp slt i32 %21, 4
br i1 %22, label %3, label %23
23: ; preds = %20
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"\0A1 insert element\0A2 delete element\0A3 display \0A4 exit\00"
@.str.1 = [3 x i8] c"%d\00"
@str = [18 x i8] c"enter the element\00"
@str.4 = [16 x i8] c"enter the value\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %23, %0
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
switch i32 %8, label %23 [
i32 1, label %9
i32 2, label %14
i32 3, label %19
]
9: ; preds = %5
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.4, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %2
%13 = call i32 @insert(i32 %12)
br label %21
14: ; preds = %5
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%17 = load i32, i32* %2
%18 = call i32 @delete(i32 %17)
br label %21
19: ; preds = %5
%20 = call i32 (...) @display()
br label %21
21: ; preds = %19, %14, %9
%22 = load i32, i32* %1
br label %23
23: ; preds = %21, %5
%24 = phi i32 [ %22, %21 ], [ %8, %5 ]
%25 = icmp slt i32 %24, 4
br i1 %25, label %5, label %26
26: ; preds = %23
ret void
}