#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*/ exit(int);
int get_option();
int /*<<< orphan*/ option1();
int /*<<< orphan*/ option2();
int /*<<< orphan*/ option3();
int /*<<< orphan*/ option4();
int /*<<< orphan*/ printf(char *);
int main() {
  int i = get_option();
  while (i < 1 || i > 5) {
    printf(
        "You have entered an invalid input character.  Please try again.\n\n");
    i = get_option();
  }
  if (i == 1)
    option1();
  else if (i == 2)
    option2();
  else if (i == 3)
    option3();
  else if (i == 4)
    option4();
  else if (i == 5)
    exit(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1090 <get_option@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     11a2 <main+0x32>
cmpl   $0x5,-0x8(%rbp)
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    11b2 <main+0x42>
jmp    11cd <main+0x5d>
lea    0xe47(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1090 <get_option@plt>
mov    %eax,-0x8(%rbp)
jmp    1189 <main+0x19>
cmpl   $0x1,-0x8(%rbp)
jne    11e3 <main+0x73>
mov    $0x0,%al
call   1040 <option1@plt>
jmp    124d <main+0xdd>
cmpl   $0x2,-0x8(%rbp)
jne    11f9 <main+0x89>
mov    $0x0,%al
call   1070 <option2@plt>
jmp    1248 <main+0xd8>
cmpl   $0x3,-0x8(%rbp)
jne    120f <main+0x9f>
mov    $0x0,%al
call   1030 <option3@plt>
jmp    1243 <main+0xd3>
cmpl   $0x4,-0x8(%rbp)
jne    1225 <main+0xb5>
mov    $0x0,%al
call   1060 <option4@plt>
jmp    123e <main+0xce>
cmpl   $0x5,-0x8(%rbp)
jne    1239 <main+0xc9>
mov    $0x1,%edi
call   1080 <exit@plt>
jmp    123e <main+0xce>
jmp    1243 <main+0xd3>
jmp    1248 <main+0xd8>
jmp    124d <main+0xdd>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1090 <get_option@plt>
mov    %eax,%ecx
add    $0xfffffffa,%ecx
cmp    $0xfffffffa,%ecx
ja     11a7 <main+0x37>
lea    0xe87(%rip),%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1090 <get_option@plt>
lea    -0x6(%rax),%ecx
cmp    $0xfffffffb,%ecx
jb     1190 <main+0x20>
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     11e5 <main+0x75>
lea    0xe4a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1050 <option1@plt>
jmp    11e1 <main+0x71>
xor    %eax,%eax
call   1040 <option3@plt>
jmp    11e1 <main+0x71>
xor    %eax,%eax
call   1070 <option2@plt>
jmp    11e1 <main+0x71>
xor    %eax,%eax
call   1060 <option4@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [66 x i8] c"You have entered an invalid input character. Please try again.\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @get_option()
store i32 %3, i32* %2
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 5
br label %10
10: ; preds = %7, %4
%11 = phi i1 [ true, %4 ], [ %9, %7 ]
br i1 %11, label %12, label %15
12: ; preds = %10
%13 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (...) @get_option()
store i32 %14, i32* %2
br label %4
15: ; preds = %10
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (...) @option1()
br label %44
20: ; preds = %15
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 2
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (...) @option2()
br label %43
25: ; preds = %20
%26 = load i32, i32* %2
%27 = icmp eq i32 %26, 3
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 (...) @option3()
br label %42
30: ; preds = %25
%31 = load i32, i32* %2
%32 = icmp eq i32 %31, 4
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 (...) @option4()
br label %41
35: ; preds = %30
%36 = load i32, i32* %2
%37 = icmp eq i32 %36, 5
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = call i32 @exit(i32 1)
unreachable
40: ; preds = %35
br label %41
41: ; preds = %40, %33
br label %42
42: ; preds = %41, %28
br label %43
43: ; preds = %42, %23
br label %44
44: ; preds = %43, %18
ret i32 0
}

LLVM IR (-O2):
@str = [65 x i8] c"You have entered an invalid input character. Please try again.\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @get_option()
%2 = add i32 %1, -6
%3 = icmp ult i32 %2, -5
br i1 %3, label %4, label %9
4: ; preds = %0, %4
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (...) @get_option()
%7 = add i32 %6, -6
%8 = icmp ult i32 %7, -5
br i1 %8, label %4, label %9
9: ; preds = %4, %0
%10 = phi i32 [ %1, %0 ], [ %6, %4 ]
switch i32 %10, label %19 [
i32 1, label %11
i32 2, label %13
i32 3, label %15
i32 4, label %17
]
11: ; preds = %9
%12 = tail call i32 (...) @option1()
br label %21
13: ; preds = %9
%14 = tail call i32 (...) @option2()
br label %21
15: ; preds = %9
%16 = tail call i32 (...) @option3()
br label %21
17: ; preds = %9
%18 = tail call i32 (...) @option4()
br label %21
19: ; preds = %9
%20 = tail call i32 @exit(i32 1)
unreachable
21: ; preds = %13, %17, %15, %11
ret i32 0
}