#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ solve42();
int /*<<< orphan*/ solveEquation();
int /*<<< orphan*/ solveFibonacci();
int main() {
  int choosen;
  printf(
      "Choose the part to execute:\n\t1 \t: Part 1 (equation zeros)\n\t2 \t: "
      "Part 2 (Fibonacci sequence)\n\t3 \t: Part 3 (42)\n\tother \t: Exit\n\n");
  scanf("%d", &choosen);
  if (choosen == 1) {
    solveEquation();
  } else if (choosen == 2) {
    solveFibonacci();
  } else if (choosen == 3) {
    solve42();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1050 <printf@plt>
lea    0xf0d(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1191 <main+0x41>
mov    $0x0,%al
call   1040 <solveEquation@plt>
jmp    11c2 <main+0x72>
cmpl   $0x2,-0x8(%rbp)
jne    11a7 <main+0x57>
mov    $0x0,%al
call   1030 <solveFibonacci@plt>
jmp    11bd <main+0x6d>
cmpl   $0x3,-0x8(%rbp)
jne    11b8 <main+0x68>
mov    $0x0,%al
call   1060 <solve42@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   1040 <puts@plt>
lea    0xe9c(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <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 <solveEquation@plt>
jmp    119a <main+0x4a>
xor    %eax,%eax
call   1060 <solve42@plt>
jmp    119a <main+0x4a>
xor    %eax,%eax
call   1030 <solveFibonacci@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [127 x i8] c"Choose the part to execute:\0A\091 \09: Part 1 (equation zeros)\0A\092 \09: Part 2 (Fibonacci sequence)\0A\093 \09: Part 3 (42)\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 ([127 x i8], [127 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 (...) @solveEquation()
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 (...) @solveFibonacci()
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 (...) @solve42()
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 = [126 x i8] c"Choose the part to execute:\0A\091 \09: Part 1 (equation zeros)\0A\092 \09: Part 2 (Fibonacci sequence)\0A\093 \09: Part 3 (42)\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 ([126 x i8], [126 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 (...) @solveEquation()
br label %12
8: ; preds = %0
%9 = call i32 (...) @solveFibonacci()
br label %12
10: ; preds = %0
%11 = call i32 (...) @solve42()
br label %12
12: ; preds = %0, %8, %10, %6
ret i32 0
}