#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*/ puts(char *);
void display_help(void) {
  printf("This program writes files, reads files, and copies files.\n"
         "When writing to a file, it appends the line buffered input.\n\n"
         "This program works best with valid text based files.\n"
         "Since the program does not check to see if the file is\n"
         "actually a text based file, it may attempt to print\n"
         "garbarge to the display.\n\n");
  printf("%-23s%s\n\n", "h or help", "Prints this help menu to the display.");
  printf("%-23s%s\n", "w or write",
         "Takes input from the display and writes to [target] file.");
  printf("%-23s%s\n", " ",
         "When writing a file, input is taken from the display");
  printf("%-23s%s\n", " ",
         "and written to the [target] file. Output is not echoed.");
  printf("%-23s%s\n\n", " ",
         "To exit a write session, provide the EOF character.");
  printf("%-23s%s\n", "r or read", "Prints the [target] file to the display.");
  printf("%-23s%s\n", "l or line",
         "Prints the given line from the [source] file to the display.");
  printf("%-23s%s\n", "c or copy",
         "Copies the [source] files contents to the [target] file.");
  printf("%-23s%s\n", "# or clear", "Clears the screens visual output.");
  printf("%-23s%s\n", "s or system",
         "Make a system call; Commands are system dependant.");
  printf("%-23s%s\n\n", "q to quit", "Exit this application.");
  puts("All files can be given a [target], or [source], name.");
  puts("EOF for Windows is Ctrl+Z");
  puts("EOF for Unix is Ctrl+D\n");
}


x86 assembly (clang, -O0):
<display_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xff9(%rip),%rdi
lea    0xffc(%rip),%rsi
lea    0xfff(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x1017(%rip),%rdi
lea    0x1019(%rip),%rsi
lea    0x101d(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xffb(%rip),%rdi
lea    0x1042(%rip),%rsi
lea    0x103d(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xfdf(%rip),%rdi
lea    0x1026(%rip),%rsi
lea    0x1056(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf89(%rip),%rdi
lea    0x100a(%rip),%rsi
lea    0x1072(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xfa7(%rip),%rdi
lea    0x1091(%rip),%rsi
lea    0x1094(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf8b(%rip),%rdi
lea    0x10a8(%rip),%rsi
lea    0x10ab(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf6f(%rip),%rdi
lea    0x10d3(%rip),%rsi
lea    0x10d6(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf53(%rip),%rdi
lea    0x10fa(%rip),%rsi
lea    0x10fe(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf37(%rip),%rdi
lea    0x110b(%rip),%rsi
lea    0x1110(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x112e(%rip),%rsi
lea    0x1131(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x113a(%rip),%rdi
call   1030 <puts@plt>
lea    0x1164(%rip),%rdi
call   1030 <puts@plt>
lea    0x1172(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_help>:
push   %r15
push   %r14
push   %rbx
lea    0x11b1(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%r14
lea    0xecb(%rip),%rsi
lea    0xece(%rip),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee3(%rip),%rbx
lea    0xee5(%rip),%rsi
lea    0xee9(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf12(%rip),%r15
lea    0xf0d(%rip),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf2e(%rip),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf52(%rip),%rdx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf72(%rip),%rsi
lea    0xf75(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf8d(%rip),%rsi
lea    0xf90(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xfbc(%rip),%rsi
lea    0xfbf(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xfe7(%rip),%rsi
lea    0xfeb(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xffc(%rip),%rsi
lea    0x1001(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1023(%rip),%rsi
lea    0x1026(%rip),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x102c(%rip),%rdi
call   1030 <puts@plt>
lea    0x1056(%rip),%rdi
call   1030 <puts@plt>
lea    0x1064(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [306 x i8] c"This program writes files, reads files, and copies files.\0AWhen writing to a file, it appends the line buffered input.\0A\0AThis program works best with valid text based files.\0ASince the program does not check to see if the file is\0Aactually a text based file, it may attempt to print\0Agarbarge to the display.\0A\0A\00"
@.str.1 = [10 x i8] c"%-23s%s\0A\0A\00"
@.str.2 = [10 x i8] c"h or help\00"
@.str.3 = [38 x i8] c"Prints this help menu to the display.\00"
@.str.4 = [9 x i8] c"%-23s%s\0A\00"
@.str.5 = [11 x i8] c"w or write\00"
@.str.6 = [58 x i8] c"Takes input from the display and writes to [target] file.\00"
@.str.7 = [2 x i8] c" \00"
@.str.8 = [53 x i8] c"When writing a file, input is taken from the display\00"
@.str.9 = [56 x i8] c"and written to the [target] file. Output is not echoed.\00"
@.str.10 = [52 x i8] c"To exit a write session, provide the EOF character.\00"
@.str.11 = [10 x i8] c"r or read\00"
@.str.12 = [41 x i8] c"Prints the [target] file to the display.\00"
@.str.13 = [10 x i8] c"l or line\00"
@.str.14 = [61 x i8] c"Prints the given line from the [source] file to the display.\00"
@.str.15 = [10 x i8] c"c or copy\00"
@.str.16 = [57 x i8] c"Copies the [source] files contents to the [target] file.\00"
@.str.17 = [11 x i8] c"# or clear\00"
@.str.18 = [34 x i8] c"Clears the screens visual output.\00"
@.str.19 = [12 x i8] c"s or system\00"
@.str.20 = [51 x i8] c"Make a system call; Commands are system dependant.\00"
@.str.21 = [10 x i8] c"q to quit\00"
@.str.22 = [23 x i8] c"Exit this application.\00"
@.str.23 = [54 x i8] c"All files can be given a [target], or [source], name.\00"
@.str.24 = [26 x i8] c"EOF for Windows is Ctrl+Z\00"
@.str.25 = [24 x i8] c"EOF for Unix is Ctrl+D\0A\00"
define void @display_help() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([306 x i8], [306 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.8, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.9, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.10, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.14, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.16, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.18, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.20, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.22, i64 0, i64 0))
%13 = call i32 @puts(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.23, i64 0, i64 0))
%14 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.24, i64 0, i64 0))
%15 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.25, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"%-23s%s\0A\0A\00"
@.str.2 = [10 x i8] c"h or help\00"
@.str.3 = [38 x i8] c"Prints this help menu to the display.\00"
@.str.4 = [9 x i8] c"%-23s%s\0A\00"
@.str.5 = [11 x i8] c"w or write\00"
@.str.6 = [58 x i8] c"Takes input from the display and writes to [target] file.\00"
@.str.7 = [2 x i8] c" \00"
@.str.8 = [53 x i8] c"When writing a file, input is taken from the display\00"
@.str.9 = [56 x i8] c"and written to the [target] file. Output is not echoed.\00"
@.str.10 = [52 x i8] c"To exit a write session, provide the EOF character.\00"
@.str.11 = [10 x i8] c"r or read\00"
@.str.12 = [41 x i8] c"Prints the [target] file to the display.\00"
@.str.13 = [10 x i8] c"l or line\00"
@.str.14 = [61 x i8] c"Prints the given line from the [source] file to the display.\00"
@.str.15 = [10 x i8] c"c or copy\00"
@.str.16 = [57 x i8] c"Copies the [source] files contents to the [target] file.\00"
@.str.17 = [11 x i8] c"# or clear\00"
@.str.18 = [34 x i8] c"Clears the screens visual output.\00"
@.str.19 = [12 x i8] c"s or system\00"
@.str.20 = [51 x i8] c"Make a system call; Commands are system dependant.\00"
@.str.21 = [10 x i8] c"q to quit\00"
@.str.22 = [23 x i8] c"Exit this application.\00"
@.str.23 = [54 x i8] c"All files can be given a [target], or [source], name.\00"
@.str.24 = [26 x i8] c"EOF for Windows is Ctrl+Z\00"
@.str.25 = [24 x i8] c"EOF for Unix is Ctrl+D\0A\00"
@str = [305 x i8] c"This program writes files, reads files, and copies files.\0AWhen writing to a file, it appends the line buffered input.\0A\0AThis program works best with valid text based files.\0ASince the program does not check to see if the file is\0Aactually a text based file, it may attempt to print\0Agarbarge to the display.\0A\00"
define void @display_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([305 x i8], [305 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.8, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.9, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.10, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.14, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.16, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.18, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.20, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.22, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.23, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.24, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.25, i64 0, i64 0))
ret void
}