#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*/ Problem1();
int /*<<< orphan*/ Problem10();
int /*<<< orphan*/ Problem12();
int /*<<< orphan*/ Problem14();
int /*<<< orphan*/ Problem15();
int /*<<< orphan*/ Problem18();
int /*<<< orphan*/ Problem2();
int /*<<< orphan*/ Problem20();
int /*<<< orphan*/ Problem3();
int /*<<< orphan*/ Problem7();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int test, exit = 0;
  while (exit == 0) {
    printf("Please enter a program number to test: ");
    scanf("%d", &test);
    getchar();
    if (test == 1) {
      Problem1();
    } else if (test == 2) {
      Problem2();
    } else if (test == 3) {
      Problem3();
    } else if (test == 7) {
      Problem7();
    } else if (test == 10) {
      Problem10();
    } else if (test == 12) {
      Problem12();
    } else if (test == 14) {
      Problem14();
    } else if (test == 15) {
      Problem15();
    } else if (test == 18) {
      Problem18();
    } else if (test == 20) {
      Problem20();
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    131c <main+0x14c>
lea    0xe09(%rip),%rdi
call   10b0 <printf@plt>
lea    0xe25(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   10f0 <scanf@plt>
mov    $0x0,%al
call   10c0 <getchar@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1229 <main+0x59>
mov    $0x0,%al
call   1050 <Problem1@plt>
jmp    1317 <main+0x147>
cmpl   $0x2,-0x8(%rbp)
jne    123f <main+0x6f>
mov    $0x0,%al
call   10d0 <Problem2@plt>
jmp    1312 <main+0x142>
cmpl   $0x3,-0x8(%rbp)
jne    1255 <main+0x85>
mov    $0x0,%al
call   1060 <Problem3@plt>
jmp    130d <main+0x13d>
cmpl   $0x7,-0x8(%rbp)
jne    126b <main+0x9b>
mov    $0x0,%al
call   1040 <Problem7@plt>
jmp    1308 <main+0x138>
cmpl   $0xa,-0x8(%rbp)
jne    1281 <main+0xb1>
mov    $0x0,%al
call   1070 <Problem10@plt>
jmp    1303 <main+0x133>
cmpl   $0xc,-0x8(%rbp)
jne    1297 <main+0xc7>
mov    $0x0,%al
call   1080 <Problem12@plt>
jmp    12fe <main+0x12e>
cmpl   $0xe,-0x8(%rbp)
jne    12ad <main+0xdd>
mov    $0x0,%al
call   1090 <Problem14@plt>
jmp    12f9 <main+0x129>
cmpl   $0xf,-0x8(%rbp)
jne    12c3 <main+0xf3>
mov    $0x0,%al
call   10e0 <Problem15@plt>
jmp    12f4 <main+0x124>
cmpl   $0x12,-0x8(%rbp)
jne    12d9 <main+0x109>
mov    $0x0,%al
call   10a0 <Problem18@plt>
jmp    12ef <main+0x11f>
cmpl   $0x14,-0x8(%rbp)
jne    12ea <main+0x11a>
mov    $0x0,%al
call   1030 <Problem20@plt>
jmp    12ef <main+0x11f>
jmp    12f4 <main+0x124>
jmp    12f9 <main+0x129>
jmp    12fe <main+0x12e>
jmp    1303 <main+0x133>
jmp    1308 <main+0x138>
jmp    130d <main+0x13d>
jmp    1312 <main+0x142>
jmp    1317 <main+0x147>
jmp    11e6 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xe71(%rip),%r14
lea    0xe92(%rip),%r15
lea    0x4(%rsp),%r12
lea    0xe0e(%rip),%rbx
jmp    1200 <main+0x30>
xor    %eax,%eax
call   1030 <Problem20@plt>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   10b0 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   10f0 <scanf@plt>
xor    %eax,%eax
call   10c0 <getchar@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x13,%eax
ja     1200 <main+0x30>
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
xor    %eax,%eax
call   1050 <Problem1@plt>
jmp    1200 <main+0x30>
xor    %eax,%eax
call   10d0 <Problem2@plt>
jmp    1200 <main+0x30>
xor    %eax,%eax
call   1060 <Problem3@plt>
jmp    1200 <main+0x30>
xor    %eax,%eax
call   1040 <Problem7@plt>
jmp    1200 <main+0x30>
xor    %eax,%eax
call   1070 <Problem10@plt>
jmp    1200 <main+0x30>
xor    %eax,%eax
call   1080 <Problem12@plt>
jmp    1200 <main+0x30>
xor    %eax,%eax
call   1090 <Problem14@plt>
jmp    1200 <main+0x30>
xor    %eax,%eax
call   10e0 <Problem15@plt>
jmp    1200 <main+0x30>
xor    %eax,%eax
call   10a0 <Problem18@plt>
jmp    1200 <main+0x30>

LLVM IR (-O0):
@.str = [40 x i8] c"Please enter a program number to test: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %69, %0
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %70
7: ; preds = %4
%8 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = call i32 (...) @getchar()
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 (...) @Problem1()
br label %69
15: ; preds = %7
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (...) @Problem2()
br label %68
20: ; preds = %15
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 3
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (...) @Problem3()
br label %67
25: ; preds = %20
%26 = load i32, i32* %2
%27 = icmp eq i32 %26, 7
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 (...) @Problem7()
br label %66
30: ; preds = %25
%31 = load i32, i32* %2
%32 = icmp eq i32 %31, 10
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 (...) @Problem10()
br label %65
35: ; preds = %30
%36 = load i32, i32* %2
%37 = icmp eq i32 %36, 12
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = call i32 (...) @Problem12()
br label %64
40: ; preds = %35
%41 = load i32, i32* %2
%42 = icmp eq i32 %41, 14
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = call i32 (...) @Problem14()
br label %63
45: ; preds = %40
%46 = load i32, i32* %2
%47 = icmp eq i32 %46, 15
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = call i32 (...) @Problem15()
br label %62
50: ; preds = %45
%51 = load i32, i32* %2
%52 = icmp eq i32 %51, 18
br i1 %52, label %53, label %55
53: ; preds = %50
%54 = call i32 (...) @Problem18()
br label %61
55: ; preds = %50
%56 = load i32, i32* %2
%57 = icmp eq i32 %56, 20
br i1 %57, label %58, label %60
58: ; preds = %55
%59 = call i32 (...) @Problem20()
br label %60
60: ; preds = %58, %55
br label %61
61: ; preds = %60, %53
br label %62
62: ; preds = %61, %48
br label %63
63: ; preds = %62, %43
br label %64
64: ; preds = %63, %38
br label %65
65: ; preds = %64, %33
br label %66
66: ; preds = %65, %28
br label %67
67: ; preds = %66, %23
br label %68
68: ; preds = %67, %18
br label %69
69: ; preds = %68, %13
br label %4
70: ; preds = %4
%71 = load i32, i32* %1
ret i32 %71
}

LLVM IR (-O2):
@.str = [40 x i8] c"Please enter a program number to test: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %8, %0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = call i32 (...) @getchar()
%7 = load i32, i32* %1
switch i32 %7, label %8 [
i32 1, label %9
i32 2, label %11
i32 3, label %13
i32 7, label %15
i32 10, label %17
i32 12, label %19
i32 14, label %21
i32 15, label %23
i32 18, label %25
i32 20, label %27
]
8: ; preds = %3, %11, %15, %19, %23, %27, %25, %21, %17, %13, %9
br label %3
9: ; preds = %3
%10 = call i32 (...) @Problem1()
br label %8
11: ; preds = %3
%12 = call i32 (...) @Problem2()
br label %8
13: ; preds = %3
%14 = call i32 (...) @Problem3()
br label %8
15: ; preds = %3
%16 = call i32 (...) @Problem7()
br label %8
17: ; preds = %3
%18 = call i32 (...) @Problem10()
br label %8
19: ; preds = %3
%20 = call i32 (...) @Problem12()
br label %8
21: ; preds = %3
%22 = call i32 (...) @Problem14()
br label %8
23: ; preds = %3
%24 = call i32 (...) @Problem15()
br label %8
25: ; preds = %3
%26 = call i32 (...) @Problem18()
br label %8
27: ; preds = %3
%28 = call i32 (...) @Problem20()
br label %8
}