#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*/ bankAccount();
int /*<<< orphan*/ boatCourse();
int /*<<< orphan*/ dungeon();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int choose;
  printf(
      "Choose the part to execute:\n\t1 \t: Part 1 (Bank Account)\n\t2 \t: "
      "Part 2 (Boat course)\n\t3 \t: Part 3 (Dungeon)\n\tother \t: Exit\n\n");
  scanf("%d", &choose);
  if (choose == 1) {
    bankAccount();
  } else if (choose == 2) {
    boatCourse();
  } else if (choose == 3) {
    dungeon();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
lea    0xf09(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1191 <main+0x41>
mov    $0x0,%al
call   1050 <bankAccount@plt>
jmp    11c2 <main+0x72>
cmpl   $0x2,-0x8(%rbp)
jne    11a7 <main+0x57>
mov    $0x0,%al
call   1070 <boatCourse@plt>
jmp    11bd <main+0x6d>
cmpl   $0x3,-0x8(%rbp)
jne    11b8 <main+0x68>
mov    $0x0,%al
call   1030 <dungeon@plt>
jmp    11bd <main+0x6d>
jmp    11c2 <main+0x72>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9c(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
je     118a <main+0x3a>
cmp    $0x2,%eax
je     1193 <main+0x43>
cmp    $0x1,%eax
jne    119a <main+0x4a>
xor    %eax,%eax
call   1050 <bankAccount@plt>
jmp    119a <main+0x4a>
xor    %eax,%eax
call   1040 <dungeon@plt>
jmp    119a <main+0x4a>
xor    %eax,%eax
call   1070 <boatCourse@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [123 x i8] c"Choose the part to execute:\0A\091 \09: Part 1 (Bank Account)\0A\092 \09: Part 2 (Boat course)\0A\093 \09: Part 3 (Dungeon)\0A\09other \09: Exit\0A\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([123 x i8], [123 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @bankAccount()
br label %21
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 (...) @boatCourse()
br label %20
14: ; preds = %9
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 3
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 (...) @dungeon()
br label %19
19: ; preds = %17, %14
br label %20
20: ; preds = %19, %12
br label %21
21: ; preds = %20, %7
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [122 x i8] c"Choose the part to execute:\0A\091 \09: Part 1 (Bank Account)\0A\092 \09: Part 2 (Boat course)\0A\093 \09: Part 3 (Dungeon)\0A\09other \09: Exit\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([122 x i8], [122 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
switch i32 %5, label %12 [
i32 1, label %6
i32 2, label %8
i32 3, label %10
]
6: ; preds = %0
%7 = call i32 (...) @bankAccount()
br label %12
8: ; preds = %0
%9 = call i32 (...) @boatCourse()
br label %12
10: ; preds = %0
%11 = call i32 (...) @dungeon()
br label %12
12: ; preds = %0, %8, %10, %6
ret i32 0
}