#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;
int print_usage(const char *prog_name) {
  fprintf(stderr, "Usage: %s [-r] [-c] [-w <savetype>] <file>\n\n", prog_name);
  fprintf(
      stderr,
      "This program takes a big-endian N64 ROM and sets the header so that\n");
  fprintf(stderr, "EverDrive64 will respect the declared save type, RTC, and "
                  "region-free\n");
  fprintf(stderr,
          "settings without needing to create a save_db.txt entry for it.\n");
  fprintf(stderr, "See: "
                  "https://github.com/krikzz/ED64/blob/master/docs/"
                  "rom_config_database.md#developer-override\n");
  fprintf(stderr, "\n");
  fprintf(stderr, "Command-line flags:\n");
  fprintf(stderr, "\t-w, --savetype <type>  Declare cartridge save type.\n");
  fprintf(stderr,
          "\t-c, --rtc              Declare real-time clock support.\n");
  fprintf(stderr, "\t-r, --regionfree       Declare region-free ROM.\n");
  fprintf(stderr, "\n");
  fprintf(stderr, "Supported cartridge save types:\n");
  fprintf(stderr, "\tnone        Game does not save or uses Controller Pak.\n");
  fprintf(stderr, "\teeprom4k    Game saves to 4 kilobit EEPROM.\n");
  fprintf(stderr, "\teeprom16k   Game saves to 16 kilobit EEPROM.\n");
  fprintf(stderr, "\tsram256k    Game saves to 256 kilobit SRAM\n");
  fprintf(stderr, "\tsram768k    Game saves to 768 kilobit SRAM\n");
  fprintf(stderr, "\tsram1m      Game saves to 1 megabit SRAM\n");
  fprintf(stderr, "\tflashram    Game saves to 1 megabit FlashRAM\n");
  return 2;
}


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    0xee6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xf14(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xf44(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
lea    0xf6d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
lea    0xe88(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
lea    0xf9f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
lea    0xf9d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
lea    0xfbc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dea(%rip),%rax
mov    (%rax),%edi
lea    0xfdf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dd3(%rip),%rax
mov    (%rax),%edi
lea    0xe15(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dbc(%rip),%rax
mov    (%rax),%edi
lea    0xfe3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2da5(%rip),%rax
mov    (%rax),%edi
lea    0xfed(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d8e(%rip),%rax
mov    (%rax),%edi
lea    0x100f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d77(%rip),%rax
mov    (%rax),%edi
lea    0x1026(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d60(%rip),%rax
mov    (%rax),%edi
lea    0x103e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d49(%rip),%rax
mov    (%rax),%edi
lea    0x1054(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d32(%rip),%rax
mov    (%rax),%edi
lea    0x106a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d1b(%rip),%rax
mov    (%rax),%edi
lea    0x107e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rdx
mov    0x2ec2(%rip),%rbx
mov    (%rbx),%edi
lea    0xed9(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef6(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf2b(%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    0xf92(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeb4(%rip),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfcf(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfd4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xffa(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1024(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x103a(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x104b(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1074(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1092(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x10b1(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x10ce(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x10eb(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1106(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: %s [-r] [-c] [-w <savetype>] <file>\0A\0A\00"
@.str.1 = [69 x i8] c"This program takes a big-endian N64 ROM and sets the header so that\0A\00"
@.str.2 = [71 x i8] c"EverDrive64 will respect the declared save type, RTC, and region-free\0A\00"
@.str.3 = [64 x i8] c"settings without needing to create a save_db.txt entry for it.\0A\00"
@.str.4 = [96 x i8] c"See: https://github.com/krikzz/ED64/blob/master/docs/rom_config_database.md#developer-override\0A\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [21 x i8] c"Command-line flags:\0A\00"
@.str.7 = [54 x i8] c"\09-w, --savetype <type> Declare cartridge save type.\0A\00"
@.str.8 = [58 x i8] c"\09-c, --rtc Declare real-time clock support.\0A\00"
@.str.9 = [50 x i8] c"\09-r, --regionfree Declare region-free ROM.\0A\00"
@.str.10 = [33 x i8] c"Supported cartridge save types:\0A\00"
@.str.11 = [57 x i8] c"\09none Game does not save or uses Controller Pak.\0A\00"
@.str.12 = [46 x i8] c"\09eeprom4k Game saves to 4 kilobit EEPROM.\0A\00"
@.str.13 = [47 x i8] c"\09eeprom16k Game saves to 16 kilobit EEPROM.\0A\00"
@.str.14 = [45 x i8] c"\09sram256k Game saves to 256 kilobit SRAM\0A\00"
@.str.15 = [45 x i8] c"\09sram768k Game saves to 768 kilobit SRAM\0A\00"
@.str.16 = [43 x i8] c"\09sram1m Game saves to 1 megabit SRAM\0A\00"
@.str.17 = [47 x i8] c"\09flashram Game saves to 1 megabit FlashRAM\0A\00"
define i32 @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 ([45 x i8], [45 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 ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.4, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.8, i64 0, i64 0))
%22 = load i32, i32* @stderr
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.9, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.11, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.12, i64 0, i64 0))
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.13, i64 0, i64 0))
%34 = load i32, i32* @stderr
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.14, i64 0, i64 0))
%36 = load i32, i32* @stderr
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.15, i64 0, i64 0))
%38 = load i32, i32* @stderr
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.16, i64 0, i64 0))
%40 = load i32, i32* @stderr
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.17, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: %s [-r] [-c] [-w <savetype>] <file>\0A\0A\00"
@.str.1 = [69 x i8] c"This program takes a big-endian N64 ROM and sets the header so that\0A\00"
@.str.2 = [71 x i8] c"EverDrive64 will respect the declared save type, RTC, and region-free\0A\00"
@.str.3 = [64 x i8] c"settings without needing to create a save_db.txt entry for it.\0A\00"
@.str.4 = [96 x i8] c"See: https://github.com/krikzz/ED64/blob/master/docs/rom_config_database.md#developer-override\0A\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [21 x i8] c"Command-line flags:\0A\00"
@.str.7 = [54 x i8] c"\09-w, --savetype <type> Declare cartridge save type.\0A\00"
@.str.8 = [58 x i8] c"\09-c, --rtc Declare real-time clock support.\0A\00"
@.str.9 = [50 x i8] c"\09-r, --regionfree Declare region-free ROM.\0A\00"
@.str.10 = [33 x i8] c"Supported cartridge save types:\0A\00"
@.str.11 = [57 x i8] c"\09none Game does not save or uses Controller Pak.\0A\00"
@.str.12 = [46 x i8] c"\09eeprom4k Game saves to 4 kilobit EEPROM.\0A\00"
@.str.13 = [47 x i8] c"\09eeprom16k Game saves to 16 kilobit EEPROM.\0A\00"
@.str.14 = [45 x i8] c"\09sram256k Game saves to 256 kilobit SRAM\0A\00"
@.str.15 = [45 x i8] c"\09sram768k Game saves to 768 kilobit SRAM\0A\00"
@.str.16 = [43 x i8] c"\09sram1m Game saves to 1 megabit SRAM\0A\00"
@.str.17 = [47 x i8] c"\09flashram Game saves to 1 megabit FlashRAM\0A\00"
define i32 @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([45 x i8], [45 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 ([69 x i8], [69 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 ([71 x i8], [71 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 ([64 x i8], [64 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 ([96 x i8], [96 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 ([2 x i8], [2 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 ([21 x i8], [21 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 ([54 x i8], [54 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 ([58 x i8], [58 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 ([50 x i8], [50 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 ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0))
%26 = load i32, i32* @stderr
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.11, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.12, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.13, i64 0, i64 0))
%32 = load i32, i32* @stderr
%33 = tail call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.14, i64 0, i64 0))
%34 = load i32, i32* @stderr
%35 = tail call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.15, i64 0, i64 0))
%36 = load i32, i32* @stderr
%37 = tail call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.16, i64 0, i64 0))
%38 = load i32, i32* @stderr
%39 = tail call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.17, i64 0, i64 0))
ret i32 2
}