#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 *);
void usage(char *progn) {
  printf(
      "Usage: %s <options>\n"
      "\n"
      "    --region|-r <base> <size> <file>\n"
      "        Maps RAM at the specified base address and size, and loads the\n"
      "        specified readmemh-format file at that address.\n"
      "\n"
      "    --pc|-p <addr>\n"
      "        Sets the initial value of the program counter.\n"
      "\n"
      "    --dump|-d <file>\n"
      "        Dumps the final state of the machine's registers to the "
      "specified\n"
      "        file.  (If unspecified, the state is dumped to standard "
      "output.)\n"
      "\n"
      "    --console|-c <addr>\n"
      "        Maps a serial console (connected to stdio) at the specified "
      "address.\n"
      "\n"
      "    --filter|-f <filter>\n"
      "        Sets a filter to allow only instructions required for a certain "
      "lab.\n"
      "        Valid values of filter are: lab1, lab2, lab3\n"
      "\n"
      "    --step|-s\n"
      "        Pause and dump registers after each instruction executes.\n"
      "\n"
      "    --help|-h\n"
      "        Shows this help screen.\n"
      "\n"
      "    --quiet|-q\n"
      "        Decreases the verbosity of the program's output.\n"
      "\n"
      "    --verbose|-v\n"
      "        Increases the verbosity of the program's output.\n"
      "\n"
      "    --version|-V\n"
      "        Prints the program version.\n"
      "\n",
      progn);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [1019 x i8] c"Usage: %s <options>\0A\0A --region|-r <base> <size> <file>\0A Maps RAM at the specified base address and size, and loads the\0A specified readmemh-format file at that address.\0A\0A --pc|-p <addr>\0A Sets the initial value of the program counter.\0A\0A --dump|-d <file>\0A Dumps the final state of the machine's registers to the specified\0A file. (If unspecified, the state is dumped to standard output.)\0A\0A --console|-c <addr>\0A Maps a serial console (connected to stdio) at the specified address.\0A\0A --filter|-f <filter>\0A Sets a filter to allow only instructions required for a certain lab.\0A Valid values of filter are: lab1, lab2, lab3\0A\0A --step|-s\0A Pause and dump registers after each instruction executes.\0A\0A --help|-h\0A Shows this help screen.\0A\0A --quiet|-q\0A Decreases the verbosity of the program's output.\0A\0A --verbose|-v\0A Increases the verbosity of the program's output.\0A\0A --version|-V\0A Prints the program version.\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([1019 x i8], [1019 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [1019 x i8] c"Usage: %s <options>\0A\0A --region|-r <base> <size> <file>\0A Maps RAM at the specified base address and size, and loads the\0A specified readmemh-format file at that address.\0A\0A --pc|-p <addr>\0A Sets the initial value of the program counter.\0A\0A --dump|-d <file>\0A Dumps the final state of the machine's registers to the specified\0A file. (If unspecified, the state is dumped to standard output.)\0A\0A --console|-c <addr>\0A Maps a serial console (connected to stdio) at the specified address.\0A\0A --filter|-f <filter>\0A Sets a filter to allow only instructions required for a certain lab.\0A Valid values of filter are: lab1, lab2, lab3\0A\0A --step|-s\0A Pause and dump registers after each instruction executes.\0A\0A --help|-h\0A Shows this help screen.\0A\0A --quiet|-q\0A Decreases the verbosity of the program's output.\0A\0A --verbose|-v\0A Increases the verbosity of the program's output.\0A\0A --version|-V\0A Prints the program version.\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([1019 x i8], [1019 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}