#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*/ mEnter();
int menu();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int opt = menu();
  switch (opt) {
  case 0:
    printf("Wrong Option.\n");
    break;
  case 1:
    mEnter();
    break;
  case 2:
    printf("NOOP.\n");
    break;
  case 3:
    printf("NOOP.\n");
    break;
  case 4:
    printf("NOOP.\n");
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
call   1030 <menu@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x4,%rax
ja     11c0 <main+0x90>
mov    -0x20(%rbp),%rax
lea    0xe94(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
jmp    11c0 <main+0x90>
mov    $0x0,%al
call   1050 <mEnter@plt>
jmp    11c0 <main+0x90>
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
jmp    11c0 <main+0x90>
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
jmp    11c0 <main+0x90>
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <menu@plt>
cmp    $0x4,%eax
ja     116d <main+0x3d>
mov    %eax,%eax
lea    0xeba(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xebe(%rip),%rdi
jmp    115f <main+0x2f>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
jmp    116d <main+0x3d>
xor    %eax,%eax
call   1050 <mEnter@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Wrong Option.\0A\00"
@.str.1 = [7 x i8] c"NOOP.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @menu()
store i32 %7, i32* %6
%8 = load i32, i32* %6
switch i32 %8, label %19 [
i32 0, label %9
i32 1, label %11
i32 2, label %13
i32 3, label %15
i32 4, label %17
]
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %19
11: ; preds = %2
%12 = call i32 (...) @mEnter()
br label %19
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %19
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %19
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %2, %17, %15, %13, %11, %9
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@str.3 = [6 x i8] c"NOOP.\00"
@str.4 = [14 x i8] c"Wrong Option.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @menu()
switch i32 %3, label %14 [
i32 0, label %4
i32 1, label %6
i32 2, label %8
i32 3, label %10
i32 4, label %12
]
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.4, i64 0, i64 0))
br label %14
6: ; preds = %2
%7 = tail call i32 (...) @mEnter()
br label %14
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0))
br label %14
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0))
br label %14
12: ; preds = %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0))
br label %14
14: ; preds = %2, %12, %10, %8, %6, %4
ret i32 0
}