#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*/ all_book();
int /*<<< orphan*/ change_book();
int /*<<< orphan*/ deadline_book();
int /*<<< orphan*/ del_book();
int /*<<< orphan*/ find_book();
int /*<<< orphan*/ input_book();
int /*<<< orphan*/ printerrorMenu();
int /*<<< orphan*/ scanf(char *, int);
int /*<<< orphan*/ select_book();
int /*<<< orphan*/ showMenu();
int listenMenu() {
  int op;
  scanf("%d", op);
  switch (op) {
  case 1:
    input_book();
    break;
  case 2:
    change_book();
    break;
  case 3:
    del_book();
    break;
  case 4:
    find_book();
    break;
  case 5:
    select_book();
    break;
  case 6:
    deadline_book();
    break;
  case 7:
    all_book();
    break;
  case 0:
    return 1;
    break;
  default:
    printerrorMenu();
  }
  showMenu();
  return 0;
}


x86 assembly (clang, -O0):
<listenMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%esi
lea    0xe6e(%rip),%rdi
call   1090 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x7,%rax
ja     123c <listenMenu+0x9c>
mov    -0x10(%rbp),%rax
lea    0xe2d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1080 <input_book@plt>
jmp    1243 <listenMenu+0xa3>
mov    $0x0,%al
call   1030 <change_book@plt>
jmp    1243 <listenMenu+0xa3>
mov    $0x0,%al
call   1070 <del_book@plt>
jmp    1243 <listenMenu+0xa3>
mov    $0x0,%al
call   1040 <find_book@plt>
jmp    1243 <listenMenu+0xa3>
mov    $0x0,%al
call   10b0 <select_book@plt>
jmp    1243 <listenMenu+0xa3>
mov    $0x0,%al
call   1060 <deadline_book@plt>
jmp    1243 <listenMenu+0xa3>
mov    $0x0,%al
call   10a0 <all_book@plt>
jmp    1243 <listenMenu+0xa3>
movl   $0x1,-0x4(%rbp)
jmp    1251 <listenMenu+0xb1>
mov    $0x0,%al
call   10c0 <printerrorMenu@plt>
mov    $0x0,%al
call   1050 <showMenu@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listenMenu>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <input_book@plt>
xor    %eax,%eax
call   1030 <showMenu@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @listenMenu() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
switch i32 %5, label %21 [
i32 1, label %6
i32 2, label %8
i32 3, label %10
i32 4, label %12
i32 5, label %14
i32 6, label %16
i32 7, label %18
i32 0, label %20
]
6: ; preds = %0
%7 = call i32 (...) @input_book()
br label %23
8: ; preds = %0
%9 = call i32 (...) @change_book()
br label %23
10: ; preds = %0
%11 = call i32 (...) @del_book()
br label %23
12: ; preds = %0
%13 = call i32 (...) @find_book()
br label %23
14: ; preds = %0
%15 = call i32 (...) @select_book()
br label %23
16: ; preds = %0
%17 = call i32 (...) @deadline_book()
br label %23
18: ; preds = %0
%19 = call i32 (...) @all_book()
br label %23
20: ; preds = %0
store i32 1, i32* %1
br label %25
21: ; preds = %0
%22 = call i32 (...) @printerrorMenu()
br label %23
23: ; preds = %21, %18, %16, %14, %12, %10, %8, %6
%24 = call i32 (...) @showMenu()
store i32 0, i32* %1
br label %25
25: ; preds = %23, %20
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @listenMenu() {
%1 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 undef)
%2 = tail call i32 (...) @input_book()
%3 = tail call i32 (...) @showMenu()
ret i32 0
}