#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*/ problemA();
int /*<<< orphan*/ problemB();
int /*<<< orphan*/ problemC();
int /*<<< orphan*/ problemD();
int /*<<< orphan*/ problemE();
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int menuDecider = 0;
  printf("\n\nSelect Problem: \n    1: Problem A - Integers and "
         "Floating-points.\n    2: Problem B - Ohm's Law.\n    3: Problem C - "
         "Joule's Law.\n    4: Problem D - Third Order Polynomial.\n    5: "
         "Problem E - Circumference of a Circle\n    6: Quit \n");
  scanf("%d", &menuDecider);
  printf("\n");
  if (menuDecider == 1) {
    problemA();
  } else if (menuDecider == 2) {
    problemB();
  } else if (menuDecider == 3) {
    problemC();
  } else if (menuDecider == 4) {
    problemD();
  } else if (menuDecider == 5) {
    problemE();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xe73(%rip),%rdi
call   1050 <printf@plt>
lea    0xf4f(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1090 <scanf@plt>
lea    0xf3d(%rip),%rdi
call   1050 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    11c4 <main+0x54>
mov    $0x0,%al
call   1060 <problemA@plt>
jmp    122b <main+0xbb>
cmpl   $0x2,-0x8(%rbp)
jne    11da <main+0x6a>
mov    $0x0,%al
call   1030 <problemB@plt>
jmp    1226 <main+0xb6>
cmpl   $0x3,-0x8(%rbp)
jne    11f0 <main+0x80>
mov    $0x0,%al
call   1070 <problemC@plt>
jmp    1221 <main+0xb1>
cmpl   $0x4,-0x8(%rbp)
jne    1206 <main+0x96>
mov    $0x0,%al
call   1040 <problemD@plt>
jmp    121c <main+0xac>
cmpl   $0x5,-0x8(%rbp)
jne    1217 <main+0xa7>
mov    $0x0,%al
call   1080 <problemE@plt>
jmp    121c <main+0xac>
jmp    1221 <main+0xb1>
jmp    1226 <main+0xb6>
jmp    122b <main+0xbb>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xe87(%rip),%rdi
call   1040 <puts@plt>
lea    0xe78(%rip),%rdi
lea    0x4(%rsp),%rsi
call   10a0 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     11f7 <main+0x77>
lea    0xe3d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1070 <problemA@plt>
jmp    11f7 <main+0x77>
xor    %eax,%eax
call   1050 <problemB@plt>
jmp    11f7 <main+0x77>
xor    %eax,%eax
call   1080 <problemC@plt>
jmp    11f7 <main+0x77>
xor    %eax,%eax
call   1060 <problemD@plt>
jmp    11f7 <main+0x77>
xor    %eax,%eax
call   1090 <problemE@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [232 x i8] c"\0A\0ASelect Problem: \0A 1: Problem A - Integers and Floating-points.\0A 2: Problem B - Ohm's Law.\0A 3: Problem C - Joule's Law.\0A 4: Problem D - Third Order Polynomial.\0A 5: Problem E - Circumference of a Circle\0A 6: Quit \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([232 x i8], [232 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 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @problemA()
br label %34
10: ; preds = %0
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (...) @problemB()
br label %33
15: ; preds = %10
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 3
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (...) @problemC()
br label %32
20: ; preds = %15
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 4
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (...) @problemD()
br label %31
25: ; preds = %20
%26 = load i32, i32* %2
%27 = icmp eq i32 %26, 5
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 (...) @problemE()
br label %30
30: ; preds = %28, %25
br label %31
31: ; preds = %30, %23
br label %32
32: ; preds = %31, %18
br label %33
33: ; preds = %32, %13
br label %34
34: ; preds = %33, %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [231 x i8] c"\0A\0ASelect Problem: \0A 1: Problem A - Integers and Floating-points.\0A 2: Problem B - Ohm's Law.\0A 3: Problem C - Joule's Law.\0A 4: Problem D - Third Order Polynomial.\0A 5: Problem E - Circumference of a Circle\0A 6: Quit \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([231 x i8], [231 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 = call i32 @putchar(i32 10)
%6 = load i32, i32* %1
switch i32 %6, label %17 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
]
7: ; preds = %0
%8 = call i32 (...) @problemA()
br label %17
9: ; preds = %0
%10 = call i32 (...) @problemB()
br label %17
11: ; preds = %0
%12 = call i32 (...) @problemC()
br label %17
13: ; preds = %0
%14 = call i32 (...) @problemD()
br label %17
15: ; preds = %0
%16 = call i32 (...) @problemE()
br label %17
17: ; preds = %0, %9, %13, %15, %11, %7
ret i32 0
}