#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*/ add_or_delete();
int /*<<< orphan*/ display();
int /*<<< orphan*/ enter();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ inquiry();
int /*<<< orphan*/ register1();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ show();
int main() {
  display();
  register1();
  int n;
  scanf("%d", &n);
  switch (n) {
  case 1:
    enter();
    break;
  case 2:
    inquiry();
    break;
  case 3:
    add_or_delete();
    break;
  case 4:
    exit(0);
    break;
  default:
    break;
  }
  show();
  scanf("%d", &n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %al,-0x11(%rbp)
call   1030 <display@plt>
mov    -0x11(%rbp),%al
call   1070 <register1@plt>
lea    0xe68(%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    $0x3,%eax
ja     1205 <main+0x85>
mov    -0x10(%rbp),%rax
lea    0xe2f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1040 <enter@plt>
jmp    120a <main+0x8a>
mov    $0x0,%al
call   10a0 <inquiry@plt>
jmp    120a <main+0x8a>
mov    $0x0,%al
call   1090 <add_or_delete@plt>
jmp    120a <main+0x8a>
xor    %edi,%edi
call   1080 <exit@plt>
jmp    120a <main+0x8a>
mov    $0x0,%al
call   1050 <show@plt>
lea    0xdf8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <display@plt>
xor    %eax,%eax
call   1070 <register1@plt>
lea    0xe7a(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     11d5 <main+0x55>
lea    0xe4d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1040 <enter@plt>
jmp    11d5 <main+0x55>
xor    %eax,%eax
call   10a0 <inquiry@plt>
jmp    11d5 <main+0x55>
xor    %eax,%eax
call   1090 <add_or_delete@plt>
xor    %eax,%eax
call   1050 <show@plt>
lea    0xe2d(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @display()
%4 = call i32 (...) @register1()
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
switch i32 %6, label %15 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
]
7: ; preds = %0
%8 = call i32 (...) @enter()
br label %16
9: ; preds = %0
%10 = call i32 (...) @inquiry()
br label %16
11: ; preds = %0
%12 = call i32 (...) @add_or_delete()
br label %16
13: ; preds = %0
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %0
br label %16
16: ; preds = %15, %11, %9, %7
%17 = call i32 (...) @show()
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 (...) @display()
%3 = tail call i32 (...) @register1()
%4 = bitcast i32* %1 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
switch i32 %6, label %15 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
]
7: ; preds = %0
%8 = call i32 (...) @enter()
br label %15
9: ; preds = %0
%10 = call i32 (...) @inquiry()
br label %15
11: ; preds = %0
%12 = call i32 (...) @add_or_delete()
br label %15
13: ; preds = %0
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %0, %11, %9, %7
%16 = call i32 (...) @show()
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}