#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*/ printVersion(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *programName) {
  printVersion(0);
  printf("\n\nUsage:\n\n");
  printf("    %s [<switches>] <adventure>\n\n", programName);
  printf("where the possible optional switches are:\n");
  printf("    -u        use UTF-8 encoding for input and output\n");
  printf("    -i        use ISO8859-1 encoding for input and output\n");
  printf("    -h        this help\n");
  printf("    -v        verbose mode\n");
  printf("    -l        log game transcript to a file ('.a3t')\n");
  printf("    -c        log player command input (the solution) to a file "
         "('.a3s')\n");
  printf("    -n        don't show the Status Line\n");
  printf("    -p        don't page output\n");
  printf("    -d        enter debug mode immediately\n");
  printf("    -t[<n>]   trace game execution, higher <n> gives more trace\n");
  printf("    -r        make regression testing easier (don't timestamp, page "
         "break, randomize...)\n");
  printf("    -e        ignore version and checksum errors (dangerous)\n");
  printf("    --version print version and exit\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <printVersion@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfc3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfdf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xff2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1010(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1043(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x108f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10bf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1050 <printVersion@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
lea    0xf43(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf87(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc4(%rip),%rdi
call   1030 <puts@plt>
lea    0xfe1(%rip),%rdi
call   1030 <puts@plt>
lea    0xff5(%rip),%rdi
call   1030 <puts@plt>
lea    0x1014(%rip),%rdi
call   1030 <puts@plt>
lea    0x1048(%rip),%rdi
call   1030 <puts@plt>
lea    0x1095(%rip),%rdi
call   1030 <puts@plt>
lea    0x10c6(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\0A\0AUsage:\0A\0A\00"
@.str.1 = [34 x i8] c" %s [<switches>] <adventure>\0A\0A\00"
@.str.2 = [43 x i8] c"where the possible optional switches are:\0A\00"
@.str.3 = [55 x i8] c" -u use UTF-8 encoding for input and output\0A\00"
@.str.4 = [59 x i8] c" -i use ISO8859-1 encoding for input and output\0A\00"
@.str.5 = [25 x i8] c" -h this help\0A\00"
@.str.6 = [28 x i8] c" -v verbose mode\0A\00"
@.str.7 = [54 x i8] c" -l log game transcript to a file ('.a3t')\0A\00"
@.str.8 = [74 x i8] c" -c log player command input (the solution) to a file ('.a3s')\0A\00"
@.str.9 = [42 x i8] c" -n don't show the Status Line\0A\00"
@.str.10 = [33 x i8] c" -p don't page output\0A\00"
@.str.11 = [44 x i8] c" -d enter debug mode immediately\0A\00"
@.str.12 = [65 x i8] c" -t[<n>] trace game execution, higher <n> gives more trace\0A\00"
@.str.13 = [90 x i8] c" -r make regression testing easier (don't timestamp, page break, randomize...)\0A\00"
@.str.14 = [62 x i8] c" -e ignore version and checksum errors (dangerous)\0A\00"
@.str.15 = [38 x i8] c" --version print version and exit\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printVersion(i32 0)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.8, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.12, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.13, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.14, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.15, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [34 x i8] c" %s [<switches>] <adventure>\0A\0A\00"
@str = [10 x i8] c"\0A\0AUsage:\0A\00"
@str.16 = [42 x i8] c"where the possible optional switches are:\00"
@str.17 = [54 x i8] c" -u use UTF-8 encoding for input and output\00"
@str.18 = [58 x i8] c" -i use ISO8859-1 encoding for input and output\00"
@str.19 = [24 x i8] c" -h this help\00"
@str.20 = [27 x i8] c" -v verbose mode\00"
@str.21 = [53 x i8] c" -l log game transcript to a file ('.a3t')\00"
@str.22 = [73 x i8] c" -c log player command input (the solution) to a file ('.a3s')\00"
@str.23 = [41 x i8] c" -n don't show the Status Line\00"
@str.24 = [32 x i8] c" -p don't page output\00"
@str.25 = [43 x i8] c" -d enter debug mode immediately\00"
@str.26 = [64 x i8] c" -t[<n>] trace game execution, higher <n> gives more trace\00"
@str.27 = [89 x i8] c" -r make regression testing easier (don't timestamp, page break, randomize...)\00"
@str.28 = [61 x i8] c" -e ignore version and checksum errors (dangerous)\00"
@str.29 = [37 x i8] c" --version print version and exit\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printVersion(i32 0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.16, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.17, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.18, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.19, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.20, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.21, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.22, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.23, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.24, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.25, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.26, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([89 x i8], [89 x i8]* @str.27, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.28, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.29, i64 0, i64 0))
ret void
}