#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();
int /*<<< orphan*/ display();
int /*<<< orphan*/ pop();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ push();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int type;
  while (1) {
    printf("1.push\n2.pop\n3.display\n4.delete\n");
    scanf("%d", &type);
    if (type == 1)
      push();
    else if (type == 2)
      pop();
    else if (type == 3)
      display();
    else if (type == 4)
      del();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9f(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    11a1 <main+0x41>
mov    $0x0,%al
call   1070 <push@plt>
jmp    11ed <main+0x8d>
cmpl   $0x2,-0x8(%rbp)
jne    11b7 <main+0x57>
mov    $0x0,%al
call   1050 <pop@plt>
jmp    11e8 <main+0x88>
cmpl   $0x3,-0x8(%rbp)
jne    11cd <main+0x6d>
mov    $0x0,%al
call   1030 <display@plt>
jmp    11e3 <main+0x83>
cmpl   $0x4,-0x8(%rbp)
jne    11de <main+0x7e>
mov    $0x0,%al
call   1080 <del@plt>
jmp    11e3 <main+0x83>
jmp    11e8 <main+0x88>
jmp    11ed <main+0x8d>
jmp    116f <main+0xf>

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   1080 <del@plt>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     11a0 <main+0x40>
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
xor    %eax,%eax
call   1070 <push@plt>
jmp    11a0 <main+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <pop@plt>
jmp    11a0 <main+0x40>
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <display@plt>
jmp    11a0 <main+0x40>

LLVM IR (-O0):
@.str = [33 x i8] c"1.push\0A2.pop\0A3.display\0A4.delete\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %28
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 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* %2)
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = call i32 (...) @push()
br label %28
10: ; preds = %3
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (...) @pop()
br label %27
15: ; preds = %10
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 3
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (...) @display()
br label %26
20: ; preds = %15
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 4
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (...) @del()
br label %25
25: ; preds = %23, %20
br label %26
26: ; preds = %25, %18
br label %27
27: ; preds = %26, %13
br label %28
28: ; preds = %27, %8
br label %3
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [32 x i8] c"1.push\0A2.pop\0A3.display\0A4.delete\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %7, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 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 %7 [
i32 1, label %8
i32 2, label %10
i32 3, label %12
i32 4, label %14
]
7: ; preds = %3, %10, %14, %12, %8
br label %3
8: ; preds = %3
%9 = call i32 (...) @push()
br label %7
10: ; preds = %3
%11 = call i32 (...) @pop()
br label %7
12: ; preds = %3
%13 = call i32 (...) @display()
br label %7
14: ; preds = %3
%15 = call i32 (...) @del()
br label %7
}