#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*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *name) {
  printf("Usage: %s < --read | --write > [ --verbose ] <totally_legit_rom.gb> "
         "[<dontsteal.gb>]\n",
         name);
  printf("       %s --delete BANK [BANK]...\n", name);
  printf("       %s --format\n", name);
  printf("       %s --title\n", name);
  printf("       %s --version\n", name);
  printf("       %s --help\n", name);
  printf("Writes a ROM or SAV file to the EMS 64 Mbit USB flash cart\n\n");
  printf("Options:\n");
  printf("    --read                  read entire cart into file\n");
  printf("    --write                 write ROM file(s) to cart\n");
  printf("    --delete                delete ROMs with the specified bank "
         "numbers\n");
  printf("    --format                delete all ROMs of the specified page\n");
  printf("    --title                 title of the ROM in both banks\n");
  printf("    --verbose               displays more information\n");
  printf("    --bank <num>            select cart bank (1 or 2)\n");
  printf("    --save                  force write to SRAM\n");
  printf("    --rom                   force write to Flash ROM\n");
  printf("\n");
  printf("You MUST supply exactly one of --read, --write, or --title\n");
  printf("Reading or writing with a file ending in .sav will write to SRAM.\n");
  printf("To select between ROM and SRAM, use ONE of the --save / --rom "
         "options.\n");
  printf("\n");
  printf("Advanced options:\n");
  printf("    --blocksize <size>      bytes per block (default: 4096 read, 32 "
         "write)\n");
  printf("\n");
  printf("Written by Mike Ryan <mikeryan@lacklustre.net> and others\n");
  printf("See web site for more info:\n");
  printf("    http://lacklustre.net/gb/ems/\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfa6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfe1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1016(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1044(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x106d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1096(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10b9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10d3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1101(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1136(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1162(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1167(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1197(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x11c4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x11d3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xefa(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf0c(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf0f(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf11(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf15(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf16(%rip),%rdi
call   1040 <puts@plt>
lea    0xf46(%rip),%rdi
call   1040 <puts@plt>
lea    0xf43(%rip),%rdi
call   1040 <puts@plt>
lea    0xf6e(%rip),%rdi
call   1040 <puts@plt>
lea    0xf98(%rip),%rdi
call   1040 <puts@plt>
lea    0xfd4(%rip),%rdi
call   1040 <puts@plt>
lea    0x100a(%rip),%rdi
call   1040 <puts@plt>
lea    0x1039(%rip),%rdi
call   1040 <puts@plt>
lea    0x1063(%rip),%rdi
call   1040 <puts@plt>
lea    0x108d(%rip),%rdi
call   1040 <puts@plt>
lea    0x10b1(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x10d0(%rip),%rdi
call   1040 <puts@plt>
lea    0x10ff(%rip),%rdi
call   1040 <puts@plt>
lea    0x1135(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1166(%rip),%rdi
call   1040 <puts@plt>
lea    0x116c(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x11a1(%rip),%rdi
call   1040 <puts@plt>
lea    0x11cf(%rip),%rdi
call   1040 <puts@plt>
lea    0x11df(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [86 x i8] c"Usage: %s < --read | --write > [ --verbose ] <totally_legit_rom.gb> [<dontsteal.gb>]\0A\00"
@.str.1 = [35 x i8] c" %s --delete BANK [BANK]...\0A\00"
@.str.2 = [20 x i8] c" %s --format\0A\00"
@.str.3 = [19 x i8] c" %s --title\0A\00"
@.str.4 = [21 x i8] c" %s --version\0A\00"
@.str.5 = [18 x i8] c" %s --help\0A\00"
@.str.6 = [61 x i8] c"Writes a ROM or SAV file to the EMS 64 Mbit USB flash cart\0A\0A\00"
@.str.7 = [10 x i8] c"Options:\0A\00"
@.str.8 = [56 x i8] c" --read read entire cart into file\0A\00"
@.str.9 = [55 x i8] c" --write write ROM file(s) to cart\0A\00"
@.str.10 = [73 x i8] c" --delete delete ROMs with the specified bank numbers\0A\00"
@.str.11 = [67 x i8] c" --format delete all ROMs of the specified page\0A\00"
@.str.12 = [60 x i8] c" --title title of the ROM in both banks\0A\00"
@.str.13 = [55 x i8] c" --verbose displays more information\0A\00"
@.str.14 = [55 x i8] c" --bank <num> select cart bank (1 or 2)\0A\00"
@.str.15 = [49 x i8] c" --save force write to SRAM\0A\00"
@.str.16 = [54 x i8] c" --rom force write to Flash ROM\0A\00"
@.str.17 = [2 x i8] c"\0A\00"
@.str.18 = [60 x i8] c"You MUST supply exactly one of --read, --write, or --title\0A\00"
@.str.19 = [67 x i8] c"Reading or writing with a file ending in .sav will write to SRAM.\0A\00"
@.str.20 = [72 x i8] c"To select between ROM and SRAM, use ONE of the --save / --rom options.\0A\00"
@.str.21 = [19 x i8] c"Advanced options:\0A\00"
@.str.22 = [76 x i8] c" --blocksize <size> bytes per block (default: 4096 read, 32 write)\0A\00"
@.str.23 = [59 x i8] c"Written by Mike Ryan <mikeryan@lacklustre.net> and others\0A\00"
@.str.24 = [29 x i8] c"See web site for more info:\0A\00"
@.str.25 = [35 x i8] c" http://lacklustre.net/gb/ems/\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.6, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.8, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.10, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.11, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.12, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.13, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.14, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.15, i64 0, i64 0))
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.16, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.18, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.19, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.20, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.21, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.22, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.23, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.24, i64 0, i64 0))
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.25, i64 0, i64 0))
%37 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [86 x i8] c"Usage: %s < --read | --write > [ --verbose ] <totally_legit_rom.gb> [<dontsteal.gb>]\0A\00"
@.str.1 = [35 x i8] c" %s --delete BANK [BANK]...\0A\00"
@.str.2 = [20 x i8] c" %s --format\0A\00"
@.str.3 = [19 x i8] c" %s --title\0A\00"
@.str.4 = [21 x i8] c" %s --version\0A\00"
@.str.5 = [18 x i8] c" %s --help\0A\00"
@str = [60 x i8] c"Writes a ROM or SAV file to the EMS 64 Mbit USB flash cart\0A\00"
@str.26 = [9 x i8] c"Options:\00"
@str.27 = [55 x i8] c" --read read entire cart into file\00"
@str.28 = [54 x i8] c" --write write ROM file(s) to cart\00"
@str.29 = [72 x i8] c" --delete delete ROMs with the specified bank numbers\00"
@str.30 = [66 x i8] c" --format delete all ROMs of the specified page\00"
@str.31 = [59 x i8] c" --title title of the ROM in both banks\00"
@str.32 = [54 x i8] c" --verbose displays more information\00"
@str.33 = [54 x i8] c" --bank <num> select cart bank (1 or 2)\00"
@str.34 = [48 x i8] c" --save force write to SRAM\00"
@str.35 = [53 x i8] c" --rom force write to Flash ROM\00"
@str.36 = [59 x i8] c"You MUST supply exactly one of --read, --write, or --title\00"
@str.37 = [66 x i8] c"Reading or writing with a file ending in .sav will write to SRAM.\00"
@str.38 = [71 x i8] c"To select between ROM and SRAM, use ONE of the --save / --rom options.\00"
@str.39 = [18 x i8] c"Advanced options:\00"
@str.40 = [75 x i8] c" --blocksize <size> bytes per block (default: 4096 read, 32 write)\00"
@str.41 = [58 x i8] c"Written by Mike Ryan <mikeryan@lacklustre.net> and others\00"
@str.42 = [28 x i8] c"See web site for more info:\00"
@str.43 = [34 x i8] c" http://lacklustre.net/gb/ems/\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8* %0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %0)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.26, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.27, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.28, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str.29, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.30, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.31, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.32, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.33, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.34, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.35, i64 0, i64 0))
%19 = tail call i32 @putchar(i32 10)
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.36, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.37, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.38, i64 0, i64 0))
%23 = tail call i32 @putchar(i32 10)
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.39, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.40, i64 0, i64 0))
%26 = tail call i32 @putchar(i32 10)
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.41, i64 0, i64 0))
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.42, i64 0, i64 0))
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.43, i64 0, i64 0))
%30 = tail call i32 @exit(i32 1)
unreachable
}