#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*/ Menu();
int /*<<< orphan*/ Task1();
int /*<<< orphan*/ Task2();
int /*<<< orphan*/ Task3();
int /*<<< orphan*/ Task4();
int /*<<< orphan*/ Task5();
int /*<<< orphan*/ Task6();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i = 0;
  do {
    Menu();
    scanf("%d", &i);
    switch (i) {
    case 1:
      Task1();
      break;
    case 2:
      Task2();
      break;
    case 3:
      Task3();
      break;
    case 4:
      Task4();
      break;
    case 5:
      Task5();
      break;
    case 6:
      Task6();
      break;
    case 0:
      printf("The end.\n");
      break;
    default:
      printf("Wrong number, try again\n");
    }
  } while (i != 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
call   1070 <Menu@plt>
lea    0xe68(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1090 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x6,%rax
ja     123b <main+0xab>
mov    -0x10(%rbp),%rax
lea    0xe27(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1080 <Task1@plt>
jmp    1247 <main+0xb7>
mov    $0x0,%al
call   1060 <Task2@plt>
jmp    1247 <main+0xb7>
mov    $0x0,%al
call   10b0 <Task3@plt>
jmp    1247 <main+0xb7>
mov    $0x0,%al
call   1050 <Task4@plt>
jmp    1247 <main+0xb7>
mov    $0x0,%al
call   10a0 <Task5@plt>
jmp    1247 <main+0xb7>
mov    $0x0,%al
call   1040 <Task6@plt>
jmp    1247 <main+0xb7>
lea    0xdee(%rip),%rdi
call   1030 <printf@plt>
jmp    1247 <main+0xb7>
lea    0xde7(%rip),%rdi
call   1030 <printf@plt>
jmp    124c <main+0xbc>
cmpl   $0x0,-0x8(%rbp)
jne    11a6 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xe70(%rip),%r14
lea    0xc(%rsp),%r13
lea    0xe70(%rip),%r15
lea    0xe41(%rip),%rbx
lea    0xe59(%rip),%r12
jmp    11d7 <main+0x47>
mov    %r15,%rdi
call   1030 <puts@plt>
cmpl   $0x0,0xc(%rsp)
je     1237 <main+0xa7>
xor    %eax,%eax
call   1070 <Menu@plt>
mov    %r14,%rdi
mov    %r13,%rsi
call   1090 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x6,%rax
ja     11c8 <main+0x38>
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
mov    %r12,%rdi
jmp    11cb <main+0x3b>
xor    %eax,%eax
call   1060 <Task2@plt>
jmp    11d0 <main+0x40>
xor    %eax,%eax
call   10b0 <Task3@plt>
jmp    11d0 <main+0x40>
xor    %eax,%eax
call   1050 <Task4@plt>
jmp    11d0 <main+0x40>
xor    %eax,%eax
call   1080 <Task1@plt>
jmp    11d0 <main+0x40>
xor    %eax,%eax
call   10a0 <Task5@plt>
jmp    11d0 <main+0x40>
xor    %eax,%eax
call   1040 <Task6@plt>
jmp    11d0 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"The end.\0A\00"
@.str.2 = [25 x i8] c"Wrong number, try again\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %24, %0
%4 = call i32 (...) @Menu()
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
switch i32 %6, label %21 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
i32 6, label %17
i32 0, label %19
]
7: ; preds = %3
%8 = call i32 (...) @Task1()
br label %23
9: ; preds = %3
%10 = call i32 (...) @Task2()
br label %23
11: ; preds = %3
%12 = call i32 (...) @Task3()
br label %23
13: ; preds = %3
%14 = call i32 (...) @Task4()
br label %23
15: ; preds = %3
%16 = call i32 (...) @Task5()
br label %23
17: ; preds = %3
%18 = call i32 (...) @Task6()
br label %23
19: ; preds = %3
%20 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %23
21: ; preds = %3
%22 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %21, %19, %17, %15, %13, %11, %9, %7
br label %24
24: ; preds = %23
%25 = load i32, i32* %2
%26 = icmp ne i32 %25, 0
br i1 %26, label %3, label %27
27: ; preds = %24
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [9 x i8] c"The end.\00"
@str.3 = [24 x i8] c"Wrong number, try again\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %23, %0
%4 = call i32 (...) @Menu()
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
switch i32 %6, label %21 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
i32 6, label %17
i32 0, label %19
]
7: ; preds = %3
%8 = call i32 (...) @Task1()
br label %23
9: ; preds = %3
%10 = call i32 (...) @Task2()
br label %23
11: ; preds = %3
%12 = call i32 (...) @Task3()
br label %23
13: ; preds = %3
%14 = call i32 (...) @Task4()
br label %23
15: ; preds = %3
%16 = call i32 (...) @Task5()
br label %23
17: ; preds = %3
%18 = call i32 (...) @Task6()
br label %23
19: ; preds = %3
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %23
21: ; preds = %3
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.3, i64 0, i64 0))
br label %23
23: ; preds = %7, %9, %11, %13, %15, %17, %19, %21
%24 = load i32, i32* %1
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %3
26: ; preds = %23
ret i32 0
}