#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*/ enter();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ init_list();
int /*<<< orphan*/ list();
char menu_selected();
void main(void) {
  char choice;
  init_list();
  for (;;) {
    choice = menu_selected();
    switch (choice) {
    case 1:
      enter();
      break;
    case 2:
      delete ();
      break;
    case 3:
      list();
      break;
    case 4:
      exit(0);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1080 <init_list@plt>
xor    %eax,%eax
call   1050 <menu_selected@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     11ce <main+0x6e>
mov    -0x10(%rbp),%rax
lea    0xe66(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1030 <enter@plt>
jmp    11ce <main+0x6e>
mov    $0x0,%al
call   1060 <delete@plt>
jmp    11ce <main+0x6e>
mov    $0x0,%al
call   1040 <list@plt>
jmp    11ce <main+0x6e>
xor    %edi,%edi
call   1070 <exit@plt>
jmp    116f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1080 <init_list@plt>
lea    0xe91(%rip),%rbx
jmp    1187 <main+0x27>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <list@plt>
xor    %eax,%eax
call   1050 <menu_selected@plt>
movsbl %al,%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     1187 <main+0x27>
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
xor    %eax,%eax
call   1030 <enter@plt>
jmp    1187 <main+0x27>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <delete@plt>
jmp    1187 <main+0x27>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i8
%2 = call i32 (...) @init_list()
br label %3
3: ; preds = %15, %0
%4 = call signext i8 (...) @menu_selected()
store i8 %4, i8* %1
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
switch i32 %6, label %15 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
]
7: ; preds = %3
%8 = call i32 (...) @enter()
br label %15
9: ; preds = %3
%10 = call i32 (...) @delete()
br label %15
11: ; preds = %3
%12 = call i32 (...) @list()
br label %15
13: ; preds = %3
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %3, %11, %9, %7
br label %3
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @init_list()
br label %2
2: ; preds = %5, %0
%3 = tail call signext i8 (...) @menu_selected()
%4 = sext i8 %3 to i32
switch i32 %4, label %5 [
i32 1, label %6
i32 2, label %8
i32 3, label %10
i32 4, label %12
]
5: ; preds = %2, %10, %8, %6
br label %2
6: ; preds = %2
%7 = tail call i32 (...) @enter()
br label %5
8: ; preds = %2
%9 = tail call i32 (...) @delete()
br label %5
10: ; preds = %2
%11 = tail call i32 (...) @list()
br label %5
12: ; preds = %2
%13 = tail call i32 @exit(i32 0)
unreachable
}