#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int displayMenu(int valueOfChoice) {
  printf("Please select from the following options....\n");
  printf("1) Print a list of memory locations using pointers\n");
  printf("2) Test Menu\n");
  printf("3) \n");
  printf("4) \n");
  printf("5) Quit\n");
  printf("Choice -----> ");
  scanf("%d", &valueOfChoice);
}


x86 assembly (clang, -O0):
<displayMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
call   1030 <printf@plt>
lea    0xf18(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf13(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
call   1030 <printf@plt>
lea    0xf09(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayMenu>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
lea    0xe7f(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Please select from the following options....\0A\00"
@.str.1 = [52 x i8] c"1) Print a list of memory locations using pointers\0A\00"
@.str.2 = [14 x i8] c"2) Test Menu\0A\00"
@.str.3 = [5 x i8] c"3) \0A\00"
@.str.4 = [5 x i8] c"4) \0A\00"
@.str.5 = [9 x i8] c"5) Quit\0A\00"
@.str.6 = [15 x i8] c"Choice -----> \00"
@.str.7 = [3 x i8] c"%d\00"
define i32 @displayMenu(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str.6 = [15 x i8] c"Choice -----> \00"
@.str.7 = [3 x i8] c"%d\00"
@str = [45 x i8] c"Please select from the following options....\00"
@str.8 = [51 x i8] c"1) Print a list of memory locations using pointers\00"
@str.9 = [13 x i8] c"2) Test Menu\00"
@str.10 = [4 x i8] c"3) \00"
@str.11 = [4 x i8] c"4) \00"
@str.12 = [8 x i8] c"5) Quit\00"
define i32 @displayMenu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.8, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.9, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.10, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.11, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.12, i64 0, i64 0))
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %2)
ret i32 undef
}