#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*/ del_beg();
int /*<<< orphan*/ display();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ ins_beg();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  int choice;
  do {
    printf("1)Insert \n2)Delete \n3)Display\n4)Exit\n");
    scanf("%d", &choice);
    switch (choice) {
    case 1:
      ins_beg();
      break;
    case 2:
      del_beg();
      break;
    case 3:
      display();
      break;
    case 4:
      exit(0);
    }
  } while (choice != 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x3,%eax
ja     11df <main+0x7f>
mov    -0x18(%rbp),%rax
lea    0xe55(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1040 <ins_beg@plt>
jmp    11df <main+0x7f>
mov    $0x0,%al
call   1080 <del_beg@plt>
jmp    11df <main+0x7f>
mov    $0x0,%al
call   1030 <display@plt>
jmp    11df <main+0x7f>
xor    %edi,%edi
call   1070 <exit@plt>
jmp    11e4 <main+0x84>
cmpl   $0x4,-0xc(%rbp)
jne    116f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xea4(%rip),%r14
lea    0xe9a(%rip),%r15
lea    0x4(%rsp),%r12
lea    0xe7e(%rip),%rbx
jmp    11a0 <main+0x40>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <display@plt>
mov    0x4(%rsp),%eax
cmp    $0x4,%eax
je     11e9 <main+0x89>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x1(%rax),%ecx
cmp    $0x3,%ecx
ja     119b <main+0x3b>
movslq (%rbx,%rcx,4),%rax
add    %rbx,%rax
jmp    *%rax
xor    %eax,%eax
call   1050 <ins_beg@plt>
jmp    1197 <main+0x37>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <del_beg@plt>
jmp    1197 <main+0x37>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"1)Insert \0A2)Delete \0A3)Display\0A4)Exit\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %17, %0
%5 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
switch i32 %7, label %16 [
i32 1, label %8
i32 2, label %10
i32 3, label %12
i32 4, label %14
]
8: ; preds = %4
%9 = call i32 (...) @ins_beg()
br label %16
10: ; preds = %4
%11 = call i32 (...) @del_beg()
br label %16
12: ; preds = %4
%13 = call i32 (...) @display()
br label %16
14: ; preds = %4
%15 = call i32 @exit(i32 0)
unreachable
16: ; preds = %4, %12, %10, %8
br label %17
17: ; preds = %16
%18 = load i32, i32* %3
%19 = icmp ne i32 %18, 4
br i1 %19, label %4, label %20
20: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [37 x i8] c"1)Insert \0A2)Delete \0A3)Display\0A4)Exit\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %17, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 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 %17 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
]
7: ; preds = %3
%8 = call i32 (...) @ins_beg()
br label %15
9: ; preds = %3
%10 = call i32 (...) @del_beg()
br label %15
11: ; preds = %3
%12 = call i32 (...) @display()
br label %15
13: ; preds = %3
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %11, %9, %7
%16 = load i32, i32* %1
br label %17
17: ; preds = %15, %3
%18 = phi i32 [ %16, %15 ], [ %6, %3 ]
%19 = icmp eq i32 %18, 4
br i1 %19, label %20, label %3
20: ; preds = %17
ret i32 0
}