#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 /*<<< orphan*/ init();
int /*<<< orphan*/ insert_begin();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ show();
int /*<<< orphan*/ wipe();
int main() {
  int c;
  while (1) {
    printf("Enter choice");
    printf("1) Initialize List\n");
    printf("2) Insert Data at beginning\n");
    printf("3) Delete from front\n");
    printf("4) Wipe all nodes in memory\n");
    printf("5) Show List contents\n");
    scanf("%d", &c);
    switch (c) {
    case 1: {
      init();
      break;
    }
    case 2: {
      insert_begin();
      break;
    }
    case 3: {
      delete ();
      break;
    }
    case 4: {
      wipe();
      break;
    }
    case 5: {
      show();
      break;
    }
    case -1: {
    }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x6,%eax
ja     1241 <main+0xd1>
mov    -0x10(%rbp),%rax
lea    0xe09(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1070 <init@plt>
jmp    1241 <main+0xd1>
mov    $0x0,%al
call   1050 <insert_begin@plt>
jmp    1241 <main+0xd1>
mov    $0x0,%al
call   1090 <delete@plt>
jmp    1241 <main+0xd1>
mov    $0x0,%al
call   1060 <wipe@plt>
jmp    1241 <main+0xd1>
mov    $0x0,%al
call   1040 <show@plt>
jmp    1241 <main+0xd1>
jmp    1241 <main+0xd1>
jmp    117f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xec1(%rip),%r13
lea    0xecf(%rip),%rbx
lea    0xee4(%rip),%rbp
lea    0xe7a(%rip),%r14
lea    0x4(%rsp),%r15
lea    0xe4d(%rip),%r12
jmp    11c0 <main+0x40>
xor    %eax,%eax
call   1050 <show@plt>
nopl   0x0(%rax)
lea    0xe4d(%rip),%rdi
call   1040 <printf@plt>
lea    0xe51(%rip),%rdi
call   1030 <puts@plt>
lea    0xe58(%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   1090 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     11c0 <main+0x40>
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
xor    %eax,%eax
call   1080 <init@plt>
jmp    11c0 <main+0x40>
xor    %eax,%eax
call   1060 <insert_begin@plt>
jmp    11c0 <main+0x40>
xor    %eax,%eax
call   10a0 <delete@plt>
jmp    11c0 <main+0x40>
xor    %eax,%eax
call   1070 <wipe@plt>
jmp    11c0 <main+0x40>

LLVM IR (-O0):
@.str = [13 x i8] c"Enter choice\00"
@.str.1 = [20 x i8] c"1) Initialize List\0A\00"
@.str.2 = [29 x i8] c"2) Insert Data at beginning\0A\00"
@.str.3 = [22 x i8] c"3) Delete from front\0A\00"
@.str.4 = [29 x i8] c"4) Wipe all nodes in memory\0A\00"
@.str.5 = [23 x i8] c"5) Show List contents\0A\00"
@.str.6 = [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, %23
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 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
i32 -1, label %22
]
12: ; preds = %3
%13 = call i32 (...) @init()
br label %23
14: ; preds = %3
%15 = call i32 (...) @insert_begin()
br label %23
16: ; preds = %3
%17 = call i32 (...) @delete()
br label %23
18: ; preds = %3
%19 = call i32 (...) @wipe()
br label %23
20: ; preds = %3
%21 = call i32 (...) @show()
br label %23
22: ; preds = %3
br label %23
23: ; preds = %22, %3, %20, %18, %16, %14, %12
br label %3
}

LLVM IR (-O2):
@.str = [13 x i8] c"Enter choice\00"
@.str.6 = [3 x i8] c"%d\00"
@str = [19 x i8] c"1) Initialize List\00"
@str.7 = [28 x i8] c"2) Insert Data at beginning\00"
@str.8 = [21 x i8] c"3) Delete from front\00"
@str.9 = [28 x i8] c"4) Wipe all nodes in memory\00"
@str.10 = [22 x i8] c"5) Show List contents\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %12, %0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.7, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.8, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.9, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.10, 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 %12 [
i32 1, label %13
i32 2, label %15
i32 3, label %17
i32 4, label %19
i32 5, label %21
]
12: ; preds = %3, %21, %19, %17, %15, %13
br label %3
13: ; preds = %3
%14 = call i32 (...) @init()
br label %12
15: ; preds = %3
%16 = call i32 (...) @insert_begin()
br label %12
17: ; preds = %3
%18 = call i32 (...) @delete()
br label %12
19: ; preds = %3
%20 = call i32 (...) @wipe()
br label %12
21: ; preds = %3
%22 = call i32 (...) @show()
br label %12
}