#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*/ putChar(char);
void runHelp() {
  printf("clear: erases all visible text \n");
  printf("chcolor b g r: changes characters color (previously written "
         "characters keep the original color). b, g and r are hexadecimal "
         "values for red, green and blue components\n");
  printf("bgcolor b g r: changes background color. b, g and r are hexadecimal "
         "values for blue, green and red components \n");
  printf("zerodiv: shows zero division exception handling\n");
  printf("invopc: shows invalid opcode exception handling\n");
  printf("echo str: prints string str\n");
  printf("math a b c: plots mathemathical function ax^2 + bx + c\n");
  printf("securityon: hides input characters until securityoff is invoked\n");
  printf("securityoff: recovers from securityon mode\n");
  printf("colorfade from to: prints a color fade effect between any of the "
         "primary colors or between black and white\n");
  printf("-----------------------------------------------------------\n");
  printf("-----------------------------------------------------------\n");
  printf("multiDemo: enters a finite loop. It allows the user to run new "
         "processes in the meantime \n");
  printf("killDemo: enters an infinite loop so that the only way for it to "
         "finish is killing it with the command kill\n");
  printf("kill [pid]: kills the process with the given PID\n");
  printf("mallocDemo: a simple usage of user level malloc and free\n");
  printf("ps: lists all processes including terminated ones\n");
  printf("prodcons: a simple implementation of producer consumer problem\n");
  printf("-----------------------------------------------------------\n");
  printf("-----------------------------------------------------------\n");
  printf(
      "fileDemo: creates a file and writes to it. Its content is then read.\n");
  printf("ls: shows current directorie's subfolders and files\n");
  printf("cd [path]: changes the current working directory to a specified "
         "subdirectory.\n");
  printf("touch [pathAndName]: creates a file with the specified name in the "
         "specified directory.\n");
  printf("mkdir [pathAndName]: creates a directory with the specified name in "
         "the specified directory.\n");
  printf("rm [pathAndName] [type]: deletes a file (if type is isFile), or a "
         "directory recursively (if type is isDir).\n");
  printf("fileDetails [pathAndName]: prints a file's name, size and current "
         "status.\n");
  printf("pipeProdcons: executes a producer consumer problem using pipes .\n");
  putChar('\n');
}


x86 assembly (clang, -O0):
<runHelp>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
call   1030 <printf@plt>
lea    0xf85(%rip),%rdi
call   1030 <printf@plt>
lea    0xfe9(%rip),%rdi
call   1030 <printf@plt>
lea    0x100e(%rip),%rdi
call   1030 <printf@plt>
lea    0x1033(%rip),%rdi
call   1030 <printf@plt>
lea    0x1044(%rip),%rdi
call   1030 <printf@plt>
lea    0x1070(%rip),%rdi
call   1030 <printf@plt>
lea    0x10a5(%rip),%rdi
call   1030 <printf@plt>
lea    0x10c5(%rip),%rdi
call   1030 <printf@plt>
lea    0x1125(%rip),%rdi
call   1030 <printf@plt>
lea    0x1119(%rip),%rdi
call   1030 <printf@plt>
lea    0x114a(%rip),%rdi
call   1030 <printf@plt>
lea    0x1199(%rip),%rdi
call   1030 <printf@plt>
lea    0x11fa(%rip),%rdi
call   1030 <printf@plt>
lea    0x1220(%rip),%rdi
call   1030 <printf@plt>
lea    0x124e(%rip),%rdi
call   1030 <printf@plt>
lea    0x1275(%rip),%rdi
call   1030 <printf@plt>
lea    0x10c5(%rip),%rdi
call   1030 <printf@plt>
lea    0x10b9(%rip),%rdi
call   1030 <printf@plt>
lea    0x1291(%rip),%rdi
call   1030 <printf@plt>
lea    0x12cb(%rip),%rdi
call   1030 <printf@plt>
lea    0x12f4(%rip),%rdi
call   1030 <printf@plt>
lea    0x1337(%rip),%rdi
call   1030 <printf@plt>
lea    0x1384(%rip),%rdi
call   1030 <printf@plt>
lea    0x13d6(%rip),%rdi
call   1030 <printf@plt>
lea    0x1437(%rip),%rdi
call   1030 <printf@plt>
lea    0x1476(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <putChar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<runHelp>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xf86(%rip),%rdi
call   1030 <puts@plt>
lea    0xfe9(%rip),%rdi
call   1030 <puts@plt>
lea    0x100d(%rip),%rdi
call   1030 <puts@plt>
lea    0x1031(%rip),%rdi
call   1030 <puts@plt>
lea    0x1041(%rip),%rdi
call   1030 <puts@plt>
lea    0x106c(%rip),%rdi
call   1030 <puts@plt>
lea    0x10a0(%rip),%rdi
call   1030 <puts@plt>
lea    0x10bf(%rip),%rdi
call   1030 <puts@plt>
lea    0x12bf(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x1107(%rip),%rdi
call   1030 <puts@plt>
lea    0x1155(%rip),%rdi
call   1030 <puts@plt>
lea    0x11b5(%rip),%rdi
call   1030 <puts@plt>
lea    0x11da(%rip),%rdi
call   1030 <puts@plt>
lea    0x1207(%rip),%rdi
call   1030 <puts@plt>
lea    0x122d(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x128c(%rip),%rdi
call   1030 <puts@plt>
lea    0x12c5(%rip),%rdi
call   1030 <puts@plt>
lea    0x12ed(%rip),%rdi
call   1030 <puts@plt>
lea    0x132f(%rip),%rdi
call   1030 <puts@plt>
lea    0x137b(%rip),%rdi
call   1030 <puts@plt>
lea    0x13cc(%rip),%rdi
call   1030 <puts@plt>
lea    0x142c(%rip),%rdi
call   1030 <puts@plt>
lea    0x146a(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1040 <putChar@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"clear: erases all visible text \0A\00"
@.str.1 = [167 x i8] c"chcolor b g r: changes characters color (previously written characters keep the original color). b, g and r are hexadecimal values for red, green and blue components\0A\00"
@.str.2 = [112 x i8] c"bgcolor b g r: changes background color. b, g and r are hexadecimal values for blue, green and red components \0A\00"
@.str.3 = [49 x i8] c"zerodiv: shows zero division exception handling\0A\00"
@.str.4 = [49 x i8] c"invopc: shows invalid opcode exception handling\0A\00"
@.str.5 = [29 x i8] c"echo str: prints string str\0A\00"
@.str.6 = [56 x i8] c"math a b c: plots mathemathical function ax^2 + bx + c\0A\00"
@.str.7 = [65 x i8] c"securityon: hides input characters until securityoff is invoked\0A\00"
@.str.8 = [44 x i8] c"securityoff: recovers from securityon mode\0A\00"
@.str.9 = [108 x i8] c"colorfade from to: prints a color fade effect between any of the primary colors or between black and white\0A\00"
@.str.10 = [61 x i8] c"-----------------------------------------------------------\0A\00"
@.str.11 = [91 x i8] c"multiDemo: enters a finite loop. It allows the user to run new processes in the meantime \0A\00"
@.str.12 = [109 x i8] c"killDemo: enters an infinite loop so that the only way for it to finish is killing it with the command kill\0A\00"
@.str.13 = [50 x i8] c"kill [pid]: kills the process with the given PID\0A\00"
@.str.14 = [58 x i8] c"mallocDemo: a simple usage of user level malloc and free\0A\00"
@.str.15 = [51 x i8] c"ps: lists all processes including terminated ones\0A\00"
@.str.16 = [64 x i8] c"prodcons: a simple implementation of producer consumer problem\0A\00"
@.str.17 = [70 x i8] c"fileDemo: creates a file and writes to it. Its content is then read.\0A\00"
@.str.18 = [53 x i8] c"ls: shows current directorie's subfolders and files\0A\00"
@.str.19 = [79 x i8] c"cd [path]: changes the current working directory to a specified subdirectory.\0A\00"
@.str.20 = [89 x i8] c"touch [pathAndName]: creates a file with the specified name in the specified directory.\0A\00"
@.str.21 = [94 x i8] c"mkdir [pathAndName]: creates a directory with the specified name in the specified directory.\0A\00"
@.str.22 = [109 x i8] c"rm [pathAndName] [type]: deletes a file (if type is isFile), or a directory recursively (if type is isDir).\0A\00"
@.str.23 = [75 x i8] c"fileDetails [pathAndName]: prints a file's name, size and current status.\0A\00"
@.str.24 = [66 x i8] c"pipeProdcons: executes a producer consumer problem using pipes .\0A\00"
define void @runHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.7, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str.9, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.10, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.10, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.11, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str.12, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.13, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.14, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.15, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.16, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.10, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.10, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.17, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.18, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.19, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.20, i64 0, i64 0))
%25 = call i32 @printf(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.21, i64 0, i64 0))
%26 = call i32 @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str.22, i64 0, i64 0))
%27 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.23, i64 0, i64 0))
%28 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.24, i64 0, i64 0))
%29 = call i32 @putChar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"clear: erases all visible text \00"
@str.25 = [166 x i8] c"chcolor b g r: changes characters color (previously written characters keep the original color). b, g and r are hexadecimal values for red, green and blue components\00"
@str.26 = [111 x i8] c"bgcolor b g r: changes background color. b, g and r are hexadecimal values for blue, green and red components \00"
@str.27 = [48 x i8] c"zerodiv: shows zero division exception handling\00"
@str.28 = [48 x i8] c"invopc: shows invalid opcode exception handling\00"
@str.29 = [28 x i8] c"echo str: prints string str\00"
@str.30 = [55 x i8] c"math a b c: plots mathemathical function ax^2 + bx + c\00"
@str.31 = [64 x i8] c"securityon: hides input characters until securityoff is invoked\00"
@str.32 = [43 x i8] c"securityoff: recovers from securityon mode\00"
@str.33 = [107 x i8] c"colorfade from to: prints a color fade effect between any of the primary colors or between black and white\00"
@str.36 = [90 x i8] c"multiDemo: enters a finite loop. It allows the user to run new processes in the meantime \00"
@str.37 = [108 x i8] c"killDemo: enters an infinite loop so that the only way for it to finish is killing it with the command kill\00"
@str.38 = [49 x i8] c"kill [pid]: kills the process with the given PID\00"
@str.39 = [57 x i8] c"mallocDemo: a simple usage of user level malloc and free\00"
@str.40 = [50 x i8] c"ps: lists all processes including terminated ones\00"
@str.41 = [63 x i8] c"prodcons: a simple implementation of producer consumer problem\00"
@str.43 = [60 x i8] c"-----------------------------------------------------------\00"
@str.44 = [69 x i8] c"fileDemo: creates a file and writes to it. Its content is then read.\00"
@str.45 = [52 x i8] c"ls: shows current directorie's subfolders and files\00"
@str.46 = [78 x i8] c"cd [path]: changes the current working directory to a specified subdirectory.\00"
@str.47 = [88 x i8] c"touch [pathAndName]: creates a file with the specified name in the specified directory.\00"
@str.48 = [93 x i8] c"mkdir [pathAndName]: creates a directory with the specified name in the specified directory.\00"
@str.49 = [108 x i8] c"rm [pathAndName] [type]: deletes a file (if type is isFile), or a directory recursively (if type is isDir).\00"
@str.50 = [74 x i8] c"fileDetails [pathAndName]: prints a file's name, size and current status.\00"
@str.51 = [65 x i8] c"pipeProdcons: executes a producer consumer problem using pipes .\00"
define void @runHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([166 x i8], [166 x i8]* @str.25, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([111 x i8], [111 x i8]* @str.26, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.27, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.28, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.29, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.30, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.31, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.32, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([107 x i8], [107 x i8]* @str.33, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.43, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.43, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([90 x i8], [90 x i8]* @str.36, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([108 x i8], [108 x i8]* @str.37, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.38, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.39, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.40, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.41, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.43, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.43, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str.44, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.45, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.46, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @str.47, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([93 x i8], [93 x i8]* @str.48, i64 0, i64 0))
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([108 x i8], [108 x i8]* @str.49, i64 0, i64 0))
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.50, i64 0, i64 0))
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.51, i64 0, i64 0))
%29 = tail call i32 @putChar(i8 signext 10)
ret void
}