#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*/ displayMenu();
int /*<<< orphan*/ printWhile();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int choice;
  do {
    displayMenu();
    scanf("%d", &choice);
    if (choice == 1) {
      printWhile();
    } else if (choice == 2) {
    } else if (choice == 3) {
    } else if (choice == 4) {
    } else
      return 0;
  } while (choice != 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <displayMenu@plt>
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    116c <main+0x3c>
mov    $0x0,%al
call   1050 <printWhile@plt>
jmp    11b4 <main+0x84>
cmpl   $0x2,-0x8(%rbp)
jne    117b <main+0x4b>
jmp    11af <main+0x7f>
cmpl   $0x3,-0x8(%rbp)
jne    118a <main+0x5a>
jmp    11aa <main+0x7a>
cmpl   $0x4,-0x8(%rbp)
jne    1199 <main+0x69>
jmp    11a5 <main+0x75>
movl   $0x0,-0x4(%rbp)
jmp    11ca <main+0x9a>
jmp    11aa <main+0x7a>
jmp    11af <main+0x7f>
jmp    11b4 <main+0x84>
jmp    11b9 <main+0x89>
cmpl   $0xa,-0x8(%rbp)
jne    113f <main+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
lea    0x4(%rsp),%rbx
jmp    1155 <main+0x25>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0xa,%eax
je     1185 <main+0x55>
xor    %eax,%eax
call   1030 <displayMenu@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x2(%rax),%ecx
cmp    $0x3,%ecx
jb     1150 <main+0x20>
cmp    $0x1,%eax
jne    1185 <main+0x55>
xor    %eax,%eax
call   1050 <printWhile@plt>
mov    0x4(%rsp),%eax
jmp    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %27, %0
%4 = call i32 (...) @displayMenu()
%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
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = call i32 (...) @printWhile()
br label %26
10: ; preds = %3
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %14
13: ; preds = %10
br label %25
14: ; preds = %10
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 3
br i1 %16, label %17, label %18
17: ; preds = %14
br label %24
18: ; preds = %14
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 4
br i1 %20, label %21, label %22
21: ; preds = %18
br label %23
22: ; preds = %18
store i32 0, i32* %1
br label %31
23: ; preds = %21
br label %24
24: ; preds = %23, %17
br label %25
25: ; preds = %24, %13
br label %26
26: ; preds = %25, %8
br label %27
27: ; preds = %26
%28 = load i32, i32* %2
%29 = icmp ne i32 %28, 10
br i1 %29, label %3, label %30
30: ; preds = %27
store i32 0, i32* %1
br label %31
31: ; preds = %30, %22
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %10, %0
%4 = call i32 (...) @displayMenu()
%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 %13 [
i32 1, label %7
i32 4, label %10
i32 3, label %10
i32 2, label %10
]
7: ; preds = %3
%8 = call i32 (...) @printWhile()
%9 = load i32, i32* %1
br label %10
10: ; preds = %3, %3, %3, %7
%11 = phi i32 [ %6, %3 ], [ %6, %3 ], [ %6, %3 ], [ %9, %7 ]
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %3
13: ; preds = %3, %10
ret i32 0
}