#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 const *, char *, int);
int /*<<< orphan*/ stderr;
void usage(int argc, char **argv) {
  static const char usage[] =
      "usage: %s [options] <in.gb>\n"
      "  -h,--help            help\n"
      "  -j,--joypad FILE     read joypad input from FILE\n"
      "  -f,--frames N        run for N frames (default: %u)\n"
      "  -o,--output FILE     output PPM file to FILE\n"
      "  -a,--animate         output an image every frame\n"
      "  -s,--seed SEED       random seed used for initializing RAM\n"
      "  -P,--palette PAL     use a builtin palette for DMG\n"
      "     --force-dmg       force running as a DMG (original gameboy)\n"
      "     --sgb-border         draw the super gameboy border\n";
  fprintf(stderr, usage, argv[0], 60);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeca(%rip),%rsi
mov    $0x3c,%ecx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xedd(%rip),%rsi
mov    $0x3c,%ecx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@usage.usage = internal constant [495 x i8] c"usage: %s [options] <in.gb>\0A -h,--help help\0A -j,--joypad FILE read joypad input from FILE\0A -f,--frames N run for N frames (default: %u)\0A -o,--output FILE output PPM file to FILE\0A -a,--animate output an image every frame\0A -s,--seed SEED random seed used for initializing RAM\0A -P,--palette PAL use a builtin palette for DMG\0A --force-dmg force running as a DMG (original gameboy)\0A --sgb-border draw the super gameboy border\0A\00"
@stderr = global i32 0
define void @usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stderr
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([495 x i8], [495 x i8]* @usage.usage, i64 0, i64 0), i8* %8, i32 60)
ret void
}

LLVM IR (-O2):
@usage.usage = internal constant [495 x i8] c"usage: %s [options] <in.gb>\0A -h,--help help\0A -j,--joypad FILE read joypad input from FILE\0A -f,--frames N run for N frames (default: %u)\0A -o,--output FILE output PPM file to FILE\0A -a,--animate output an image every frame\0A -s,--seed SEED random seed used for initializing RAM\0A -P,--palette PAL use a builtin palette for DMG\0A --force-dmg force running as a DMG (original gameboy)\0A --sgb-border draw the super gameboy border\0A\00"
@stderr = global i32 0
define void @usage(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([495 x i8], [495 x i8]* @usage.usage, i64 0, i64 0), i8* %4, i32 60)
ret void
}