#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*/ add_empl();
int /*<<< orphan*/ delete_empl();
int /*<<< orphan*/ modify_empl();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ quit_db();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srch_display_empl();
int process_choice() {
  int choice;
  do {
    printf("\n\n Enter your choice (1-5):  ");
    scanf("%d", &choice);
  } while (choice < 1 || choice > 5);
  switch (choice) {
  case 1:
    add_empl();
    break;
  case 2:
    delete_empl();
    break;
  case 3:
    modify_empl();
    break;
  case 4:
    srch_display_empl();
    break;
  case 5:
  default:
    quit_db();
  }
}


x86 assembly (clang, -O0):
<process_choice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xe95(%rip),%rdi
call   1050 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     11ad <process_choice+0x3d>
cmpl   $0x5,-0x8(%rbp)
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1178 <process_choice+0x8>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     1216 <process_choice+0xa6>
mov    -0x18(%rbp),%rax
lea    0xe28(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1090 <add_empl@plt>
jmp    121d <process_choice+0xad>
mov    $0x0,%al
call   1040 <delete_empl@plt>
jmp    121d <process_choice+0xad>
mov    $0x0,%al
call   1030 <modify_empl@plt>
jmp    121d <process_choice+0xad>
mov    $0x0,%al
call   1080 <srch_display_empl@plt>
jmp    121d <process_choice+0xad>
jmp    1216 <process_choice+0xa6>
mov    $0x0,%al
call   1060 <quit_db@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_choice>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xe90(%rip),%r14
lea    0xea7(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    0xc(%rsp),%eax
lea    -0x6(%rax),%ecx
cmp    $0xfffffffb,%ecx
jb     1190 <process_choice+0x20>
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     11d0 <process_choice+0x60>
lea    0xe42(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1090 <add_empl@plt>
jmp    11f2 <process_choice+0x82>
xor    %eax,%eax
call   1060 <quit_db@plt>
jmp    11f2 <process_choice+0x82>
xor    %eax,%eax
call   1040 <delete_empl@plt>
jmp    11f2 <process_choice+0x82>
xor    %eax,%eax
call   1030 <modify_empl@plt>
jmp    11f2 <process_choice+0x82>
xor    %eax,%eax
call   1080 <srch_display_empl@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [30 x i8] c"\0A\0A Enter your choice (1-5): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @process_choice() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %12, %0
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 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* %2)
br label %6
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 1
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 5
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ true, %6 ], [ %11, %9 ]
br i1 %13, label %3, label %14
14: ; preds = %12
%15 = load i32, i32* %2
switch i32 %15, label %25 [
i32 1, label %16
i32 2, label %18
i32 3, label %20
i32 4, label %22
i32 5, label %24
]
16: ; preds = %14
%17 = call i32 (...) @add_empl()
br label %27
18: ; preds = %14
%19 = call i32 (...) @delete_empl()
br label %27
20: ; preds = %14
%21 = call i32 (...) @modify_empl()
br label %27
22: ; preds = %14
%23 = call i32 (...) @srch_display_empl()
br label %27
24: ; preds = %14
br label %25
25: ; preds = %14, %24
%26 = call i32 (...) @quit_db()
br label %27
27: ; preds = %25, %22, %20, %18, %16
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0A\0A Enter your choice (1-5): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @process_choice() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 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 = load i32, i32* %1
%7 = add i32 %6, -6
%8 = icmp ult i32 %7, -5
br i1 %8, label %3, label %9
9: ; preds = %3
switch i32 %6, label %18 [
i32 1, label %10
i32 2, label %12
i32 3, label %14
i32 4, label %16
]
10: ; preds = %9
%11 = call i32 (...) @add_empl()
br label %20
12: ; preds = %9
%13 = call i32 (...) @delete_empl()
br label %20
14: ; preds = %9
%15 = call i32 (...) @modify_empl()
br label %20
16: ; preds = %9
%17 = call i32 (...) @srch_display_empl()
br label %20
18: ; preds = %9
%19 = call i32 (...) @quit_db()
br label %20
20: ; preds = %18, %16, %14, %12, %10
ret i32 undef
}