#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 *);
void display_help(char cCommand) {
  switch (cCommand) {
  default:
    printf("Currently Supported Command List\n");
    printf("i - Initialize the SIC Machine\n");
    printf("r - Load the Bootstrap Program from DEV00 into SIC's Memory\n");
    printf("b - Bootstrap the SIC Loader from DEVF1 to SIC's Memory\n");
    printf("l - Load the executable program from DEVF2 to SIC's Memory\n");
    printf("e - Execute the Loaded program in SIC's Memory\n");
    printf("d - Display Contents of Registers and memory\n");
    printf("c - Clear Screen\n");
    printf("q - Stop SIC Machine Controller\n");
    break;
  }
}


x86 assembly (clang, -O0):
<display_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
call   1030 <printf@plt>
lea    0xf36(%rip),%rdi
call   1030 <printf@plt>
lea    0xf63(%rip),%rdi
call   1030 <printf@plt>
lea    0xf93(%rip),%rdi
call   1030 <printf@plt>
lea    0xfb7(%rip),%rdi
call   1030 <printf@plt>
lea    0xfd9(%rip),%rdi
call   1030 <printf@plt>
lea    0xfdf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xf10(%rip),%rdi
call   1030 <puts@plt>
lea    0xf40(%rip),%rdi
call   1030 <puts@plt>
lea    0xf6c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf9b(%rip),%rdi
call   1030 <puts@plt>
lea    0xfbe(%rip),%rdi
call   1030 <puts@plt>
lea    0xfdf(%rip),%rdi
call   1030 <puts@plt>
lea    0xfe4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Currently Supported Command List\0A\00"
@.str.1 = [32 x i8] c"i - Initialize the SIC Machine\0A\00"
@.str.2 = [61 x i8] c"r - Load the Bootstrap Program from DEV00 into SIC's Memory\0A\00"
@.str.3 = [57 x i8] c"b - Bootstrap the SIC Loader from DEVF1 to SIC's Memory\0A\00"
@.str.4 = [60 x i8] c"l - Load the executable program from DEVF2 to SIC's Memory\0A\00"
@.str.5 = [48 x i8] c"e - Execute the Loaded program in SIC's Memory\0A\00"
@.str.6 = [46 x i8] c"d - Display Contents of Registers and memory\0A\00"
@.str.7 = [18 x i8] c"c - Clear Screen\0A\00"
@.str.8 = [33 x i8] c"q - Stop SIC Machine Controller\0A\00"
define void @display_help(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %5 [
]
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0))
br label %15
15: ; preds = %5
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"Currently Supported Command List\00"
@str.9 = [31 x i8] c"i - Initialize the SIC Machine\00"
@str.10 = [60 x i8] c"r - Load the Bootstrap Program from DEV00 into SIC's Memory\00"
@str.11 = [56 x i8] c"b - Bootstrap the SIC Loader from DEVF1 to SIC's Memory\00"
@str.12 = [59 x i8] c"l - Load the executable program from DEVF2 to SIC's Memory\00"
@str.13 = [47 x i8] c"e - Execute the Loaded program in SIC's Memory\00"
@str.14 = [45 x i8] c"d - Display Contents of Registers and memory\00"
@str.15 = [17 x i8] c"c - Clear Screen\00"
@str.16 = [32 x i8] c"q - Stop SIC Machine Controller\00"
define void @display_help(i8 signext %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.9, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.10, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.11, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.12, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.13, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.14, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.15, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.16, i64 0, i64 0))
ret void
}