#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_all();
int /*<<< orphan*/ pop_item();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ push_item();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ show_all();
int main() {
  int usrip;
  while (1) {
    printf("1. Push\n");
    printf("2. Pop\n");
    printf("3. Show All\n");
    printf("4. Delete All\n");
    printf("5. Exit\n");
    printf("Please enter an option\n");
    scanf("%d", &usrip);
    switch (usrip) {
    case 1:
      push_item();
      break;
    case 2:
      pop_item();
      break;
    case 3:
      show_all();
      break;
    case 4:
      del_all();
      break;
    case 5:
      del_all();
      printf("\nExiting...\n");
      return 0;
    default:
      del_all();
      printf("Hey Asshole! can you not see a list of options provided\n");
      printf("Get lost... Exiting...\n");
      return 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     123f <main+0xdf>
mov    -0x10(%rbp),%rax
lea    0xe19(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1070 <push_item@plt>
jmp    126a <main+0x10a>
mov    $0x0,%al
call   1030 <pop_item@plt>
jmp    126a <main+0x10a>
mov    $0x0,%al
call   1080 <show_all@plt>
jmp    126a <main+0x10a>
mov    $0x0,%al
call   1050 <del_all@plt>
jmp    126a <main+0x10a>
mov    $0x0,%al
call   1050 <del_all@plt>
lea    0xe37(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    126f <main+0x10f>
mov    $0x0,%al
call   1050 <del_all@plt>
lea    0xe25(%rip),%rdi
call   1040 <printf@plt>
lea    0xe52(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    126f <main+0x10f>
jmp    116f <main+0xf>
mov    -0x4(%rbp),%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    0xec0(%rip),%r13
lea    0xec7(%rip),%rbx
lea    0xec8(%rip),%rbp
lea    0xe8d(%rip),%r14
lea    0x4(%rsp),%r15
lea    0xe6d(%rip),%r12
jmp    11a7 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1050 <del_all@plt>
lea    0xe69(%rip),%rdi
call   1030 <puts@plt>
lea    0xe65(%rip),%rdi
call   1030 <puts@plt>
lea    0xe60(%rip),%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     122c <main+0xcc>
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
xor    %eax,%eax
call   1070 <push_item@plt>
jmp    11a7 <main+0x47>
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <pop_item@plt>
jmp    11a7 <main+0x47>
nopl   0x0(%rax)
xor    %eax,%eax
call   1080 <show_all@plt>
jmp    11a7 <main+0x47>
xor    %eax,%eax
call   1050 <del_all@plt>
lea    0xe31(%rip),%rdi
call   1030 <puts@plt>
lea    0xe5d(%rip),%rdi
jmp    1256 <main+0xf6>
xor    %eax,%eax
call   1050 <del_all@plt>
lea    0xe09(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"1. Push\0A\00"
@.str.1 = [8 x i8] c"2. Pop\0A\00"
@.str.2 = [13 x i8] c"3. Show All\0A\00"
@.str.3 = [15 x i8] c"4. Delete All\0A\00"
@.str.4 = [9 x i8] c"5. Exit\0A\00"
@.str.5 = [24 x i8] c"Please enter an option\0A\00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [13 x i8] c"\0AExiting...\0A\00"
@.str.8 = [57 x i8] c"Hey Asshole! can you not see a list of options provided\0A\00"
@.str.9 = [24 x i8] c"Get lost... Exiting...\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %27
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
switch i32 %11, label %23 [
i32 1, label %12
i32 2, label %14
i32 3, label %16
i32 4, label %18
i32 5, label %20
]
12: ; preds = %3
%13 = call i32 (...) @push_item()
br label %27
14: ; preds = %3
%15 = call i32 (...) @pop_item()
br label %27
16: ; preds = %3
%17 = call i32 (...) @show_all()
br label %27
18: ; preds = %3
%19 = call i32 (...) @del_all()
br label %27
20: ; preds = %3
%21 = call i32 (...) @del_all()
%22 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %1
br label %28
23: ; preds = %3
%24 = call i32 (...) @del_all()
%25 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.8, i64 0, i64 0))
%26 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %1
br label %28
27: ; preds = %18, %16, %14, %12
br label %3
28: ; preds = %23, %20
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
@.str.6 = [3 x i8] c"%d\00"
@str = [8 x i8] c"1. Push\00"
@str.10 = [7 x i8] c"2. Pop\00"
@str.11 = [12 x i8] c"3. Show All\00"
@str.12 = [14 x i8] c"4. Delete All\00"
@str.13 = [8 x i8] c"5. Exit\00"
@str.14 = [23 x i8] c"Please enter an option\00"
@str.15 = [12 x i8] c"\0AExiting...\00"
@str.16 = [56 x i8] c"Hey Asshole! can you not see a list of options provided\00"
@str.17 = [23 x i8] c"Get lost... Exiting...\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 ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.10, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.11, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.12, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.13, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.14, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
switch i32 %11, label %23 [
i32 1, label %12
i32 2, label %14
i32 3, label %16
i32 4, label %18
i32 5, label %21
]
12: ; preds = %3
%13 = call i32 (...) @push_item()
br label %20
14: ; preds = %3
%15 = call i32 (...) @pop_item()
br label %20
16: ; preds = %3
%17 = call i32 (...) @show_all()
br label %20
18: ; preds = %3
%19 = call i32 (...) @del_all()
br label %20
20: ; preds = %18, %16, %14, %12
br label %3
21: ; preds = %3
%22 = call i32 (...) @del_all()
br label %26
23: ; preds = %3
%24 = call i32 (...) @del_all()
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.16, i64 0, i64 0))
br label %26
26: ; preds = %23, %21
%27 = phi i8* [ getelementptr inbounds ([23 x i8], [23 x i8]* @str.17, i64 0, i64 0), %23 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.15, i64 0, i64 0), %21 ]
%28 = call i32 @puts(i8* dereferenceable(1) %27)
ret i32 0
}