#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 *, char const *);
int /*<<< orphan*/ puts(char *);
void help(const char *usageMess) {
  puts("mysh help menu");
  printf("%s\n", usageMess);
  puts("\necho [args]");
  puts("\tThis command will print any arguments the user gives it. If no");
  puts("\targuments are given, just a new line is printed.");
  puts("\nhelp");
  puts("\tPrint this history.");
  puts("\nhistory");
  puts("\tThe history command will print a numbered list of the previously");
  puts("\tentered commands. By default mysh will store the 10 previous");
  puts("\tcommands, but this number can be changed using the -h option.");
  puts("\tTo run any of these commands again, just type !x, where x is");
  puts("\tthe number of the command you want. This number must be within");
  puts("\tthe valid range of current commands being stored to be");
  puts("\tsuccessful.");
  puts("\nquit");
  puts("\tThis will gracefully exit the shell.");
  puts("\nverbose [on|off]");
  puts("\tThis command allows the user to enable or disable verbose mode.");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0xf22(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf55(%rip),%rdi
call   1030 <puts@plt>
lea    0xf87(%rip),%rdi
call   1030 <puts@plt>
lea    0xfba(%rip),%rdi
call   1030 <puts@plt>
lea    0xfec(%rip),%rdi
call   1030 <puts@plt>
lea    0x1020(%rip),%rdi
call   1030 <puts@plt>
lea    0x104c(%rip),%rdi
call   1030 <puts@plt>
lea    0x104d(%rip),%rdi
call   1030 <puts@plt>
lea    0x1047(%rip),%rdi
call   1030 <puts@plt>
lea    0x1061(%rip),%rdi
call   1030 <puts@plt>
lea    0x1067(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xed8(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    0xf28(%rip),%rdi
call   1030 <puts@plt>
lea    0xf22(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf28(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf90(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc3(%rip),%rdi
call   1030 <puts@plt>
lea    0xff5(%rip),%rdi
call   1030 <puts@plt>
lea    0x1029(%rip),%rdi
call   1030 <puts@plt>
lea    0x1055(%rip),%rdi
call   1030 <puts@plt>
lea    0x1056(%rip),%rdi
call   1030 <puts@plt>
lea    0x1050(%rip),%rdi
call   1030 <puts@plt>
lea    0x106a(%rip),%rdi
call   1030 <puts@plt>
lea    0x1070(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"mysh help menu\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [13 x i8] c"\0Aecho [args]\00"
@.str.3 = [64 x i8] c"\09This command will print any arguments the user gives it. If no\00"
@.str.4 = [50 x i8] c"\09arguments are given, just a new line is printed.\00"
@.str.5 = [6 x i8] c"\0Ahelp\00"
@.str.6 = [21 x i8] c"\09Print this history.\00"
@.str.7 = [9 x i8] c"\0Ahistory\00"
@.str.8 = [66 x i8] c"\09The history command will print a numbered list of the previously\00"
@.str.9 = [62 x i8] c"\09entered commands. By default mysh will store the 10 previous\00"
@.str.10 = [63 x i8] c"\09commands, but this number can be changed using the -h option.\00"
@.str.11 = [62 x i8] c"\09To run any of these commands again, just type !x, where x is\00"
@.str.12 = [64 x i8] c"\09the number of the command you want. This number must be within\00"
@.str.13 = [56 x i8] c"\09the valid range of current commands being stored to be\00"
@.str.14 = [13 x i8] c"\09successful.\00"
@.str.15 = [6 x i8] c"\0Aquit\00"
@.str.16 = [38 x i8] c"\09This will gracefully exit the shell.\00"
@.str.17 = [18 x i8] c"\0Averbose [on|off]\00"
@.str.18 = [65 x i8] c"\09This command allows the user to enable or disable verbose mode.\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @puts(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @puts(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 @puts(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.8, i64 0, i64 0))
%13 = call i32 @puts(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.9, i64 0, i64 0))
%14 = call i32 @puts(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.10, i64 0, i64 0))
%15 = call i32 @puts(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.11, i64 0, i64 0))
%16 = call i32 @puts(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.12, i64 0, i64 0))
%17 = call i32 @puts(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.13, i64 0, i64 0))
%18 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0))
%19 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%20 = call i32 @puts(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.16, i64 0, i64 0))
%21 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
%22 = call i32 @puts(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.18, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"mysh help menu\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [13 x i8] c"\0Aecho [args]\00"
@.str.3 = [64 x i8] c"\09This command will print any arguments the user gives it. If no\00"
@.str.4 = [50 x i8] c"\09arguments are given, just a new line is printed.\00"
@.str.5 = [6 x i8] c"\0Ahelp\00"
@.str.6 = [21 x i8] c"\09Print this history.\00"
@.str.7 = [9 x i8] c"\0Ahistory\00"
@.str.8 = [66 x i8] c"\09The history command will print a numbered list of the previously\00"
@.str.9 = [62 x i8] c"\09entered commands. By default mysh will store the 10 previous\00"
@.str.10 = [63 x i8] c"\09commands, but this number can be changed using the -h option.\00"
@.str.11 = [62 x i8] c"\09To run any of these commands again, just type !x, where x is\00"
@.str.12 = [64 x i8] c"\09the number of the command you want. This number must be within\00"
@.str.13 = [56 x i8] c"\09the valid range of current commands being stored to be\00"
@.str.14 = [13 x i8] c"\09successful.\00"
@.str.15 = [6 x i8] c"\0Aquit\00"
@.str.16 = [38 x i8] c"\09This will gracefully exit the shell.\00"
@.str.17 = [18 x i8] c"\0Averbose [on|off]\00"
@.str.18 = [65 x i8] c"\09This command allows the user to enable or disable verbose mode.\00"
define void @help(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.8, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.9, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.10, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.11, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.12, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.13, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.16, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.18, i64 0, i64 0))
ret void
}