#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void print_usage(char *prog_name) {
  fprintf(stderr,
          "Usage: %s [-b] -l <size>B/K/M -h <file> -o <file> -t <title> <file> "
          "[[-s <offset>B/K/M] <file>]*\n\n",
          prog_name);
  fprintf(
      stderr,
      "This program appends a header to an arbitrary number of binaries,\n");
  fprintf(
      stderr,
      "the first being an Nintendo64 binary and the rest arbitrary data.\n\n");
  fprintf(stderr, "\t-b\t\tByteswap the resulting output.\n");
  fprintf(stderr, "\t-l <size>\tForce output to <size> bytes.\n");
  fprintf(stderr, "\t-h <file>\tUse <file> as header.\n");
  fprintf(stderr, "\t-o <file>\tOutput is saved to <file>.\n");
  fprintf(stderr, "\t-t <title>\tTitle of ROM.\n");
  fprintf(stderr, "\t-s <offset>\tNext file starts at <offset> from top of "
                  "memory.  Offset must be 32bit aligned.\n");
  fprintf(stderr, "\t\t\tB for byte offset.\n");
  fprintf(stderr, "\t\t\tK for kilobyte offset.\n");
  fprintf(stderr, "\t\t\tM for megabyte offset.\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xf1c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xf48(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xf75(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
lea    0xf83(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
lea    0xf96(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
lea    0xfa1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
lea    0xfb1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
lea    0xfb5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dea(%rip),%rax
mov    (%rax),%edi
lea    0xffc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dd3(%rip),%rax
mov    (%rax),%edi
lea    0xffc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dbc(%rip),%rax
mov    (%rax),%edi
lea    0x1000(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf2f(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf62(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf96(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfab(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfc5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfd7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfee(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xff9(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1047(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x104e(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1059(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [99 x i8] c"Usage: %s [-b] -l <size>B/K/M -h <file> -o <file> -t <title> <file> [[-s <offset>B/K/M] <file>]*\0A\0A\00"
@.str.1 = [67 x i8] c"This program appends a header to an arbitrary number of binaries,\0A\00"
@.str.2 = [68 x i8] c"the first being an Nintendo64 binary and the rest arbitrary data.\0A\0A\00"
@.str.3 = [37 x i8] c"\09-b\09\09Byteswap the resulting output.\0A\00"
@.str.4 = [42 x i8] c"\09-l <size>\09Force output to <size> bytes.\0A\00"
@.str.5 = [34 x i8] c"\09-h <file>\09Use <file> as header.\0A\00"
@.str.6 = [39 x i8] c"\09-o <file>\09Output is saved to <file>.\0A\00"
@.str.7 = [27 x i8] c"\09-t <title>\09Title of ROM.\0A\00"
@.str.8 = [94 x i8] c"\09-s <offset>\09Next file starts at <offset> from top of memory. Offset must be 32bit aligned.\0A\00"
@.str.9 = [23 x i8] c"\09\09\09B for byte offset.\0A\00"
@.str.10 = [27 x i8] c"\09\09\09K for kilobyte offset.\0A\00"
@.str.11 = [27 x i8] c"\09\09\09M for megabyte offset.\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.8, i64 0, i64 0))
%22 = load i32, i32* @stderr
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0))
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [99 x i8] c"Usage: %s [-b] -l <size>B/K/M -h <file> -o <file> -t <title> <file> [[-s <offset>B/K/M] <file>]*\0A\0A\00"
@.str.1 = [67 x i8] c"This program appends a header to an arbitrary number of binaries,\0A\00"
@.str.2 = [68 x i8] c"the first being an Nintendo64 binary and the rest arbitrary data.\0A\0A\00"
@.str.3 = [37 x i8] c"\09-b\09\09Byteswap the resulting output.\0A\00"
@.str.4 = [42 x i8] c"\09-l <size>\09Force output to <size> bytes.\0A\00"
@.str.5 = [34 x i8] c"\09-h <file>\09Use <file> as header.\0A\00"
@.str.6 = [39 x i8] c"\09-o <file>\09Output is saved to <file>.\0A\00"
@.str.7 = [27 x i8] c"\09-t <title>\09Title of ROM.\0A\00"
@.str.8 = [94 x i8] c"\09-s <offset>\09Next file starts at <offset> from top of memory. Offset must be 32bit aligned.\0A\00"
@.str.9 = [23 x i8] c"\09\09\09B for byte offset.\0A\00"
@.str.10 = [27 x i8] c"\09\09\09K for kilobyte offset.\0A\00"
@.str.11 = [27 x i8] c"\09\09\09M for megabyte offset.\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.8, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
%22 = load i32, i32* @stderr
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0))
ret void
}