#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 | --add > [ --verbose ] "
         "<totally_legit_rom.gb>\n",
         name);
  printf("       %s --list\n", name);
  printf("       %s --delete <index>\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 to cart\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("    --list                  list the ROMs on the cartridge\n");
  printf("    --add                   add a ROM to the nearest space it will "
         "fit\n");
  printf("    --delete <index>        remove a ROM from the cartridge from the "
         "cartridge\n");
  printf("\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    0xf04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfbf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfe8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1011(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1034(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x105c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x108a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10c4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10f8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x112d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1159(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x115e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x118e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x11bb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x11ca(%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    0xef1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xef2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xefd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeff(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf03(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf04(%rip),%rdi
call   1040 <puts@plt>
lea    0xf34(%rip),%rdi
call   1040 <puts@plt>
lea    0xf31(%rip),%rdi
call   1040 <puts@plt>
lea    0xf5c(%rip),%rdi
call   1040 <puts@plt>
lea    0xf83(%rip),%rdi
call   1040 <puts@plt>
lea    0xfb2(%rip),%rdi
call   1040 <puts@plt>
lea    0xfdc(%rip),%rdi
call   1040 <puts@plt>
lea    0x1006(%rip),%rdi
call   1040 <puts@plt>
lea    0x102a(%rip),%rdi
call   1040 <puts@plt>
lea    0x1053(%rip),%rdi
call   1040 <puts@plt>
lea    0x1082(%rip),%rdi
call   1040 <puts@plt>
lea    0x10bd(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x10f6(%rip),%rdi
call   1040 <puts@plt>
lea    0x112c(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x115d(%rip),%rdi
call   1040 <puts@plt>
lea    0x1163(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1198(%rip),%rdi
call   1040 <puts@plt>
lea    0x11c6(%rip),%rdi
call   1040 <puts@plt>
lea    0x11d6(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [77 x i8] c"Usage: %s < --read | --write | --add > [ --verbose ] <totally_legit_rom.gb>\0A\00"
@.str.1 = [18 x i8] c" %s --list\0A\00"
@.str.2 = [28 x i8] c" %s --delete <index>\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 = [52 x i8] c" --write write ROM file to cart\0A\00"
@.str.10 = [60 x i8] c" --title title of the ROM in both banks\0A\00"
@.str.11 = [55 x i8] c" --verbose displays more information\0A\00"
@.str.12 = [55 x i8] c" --bank <num> select cart bank (1 or 2)\0A\00"
@.str.13 = [49 x i8] c" --save force write to SRAM\0A\00"
@.str.14 = [54 x i8] c" --rom force write to Flash ROM\0A\00"
@.str.15 = [60 x i8] c" --list list the ROMs on the cartridge\0A\00"
@.str.16 = [72 x i8] c" --add add a ROM to the nearest space it will fit\0A\00"
@.str.17 = [80 x i8] c" --delete <index> remove a ROM from the cartridge from the cartridge\0A\00"
@.str.18 = [2 x i8] c"\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 ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 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 ([52 x i8], [52 x i8]* @.str.9, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.10, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.11, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.12, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.13, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.14, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.15, i64 0, i64 0))
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.16, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.17, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 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.18, 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.18, 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 = [77 x i8] c"Usage: %s < --read | --write | --add > [ --verbose ] <totally_legit_rom.gb>\0A\00"
@.str.1 = [18 x i8] c" %s --list\0A\00"
@.str.2 = [28 x i8] c" %s --delete <index>\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 = [51 x i8] c" --write write ROM file to cart\00"
@str.29 = [59 x i8] c" --title title of the ROM in both banks\00"
@str.30 = [54 x i8] c" --verbose displays more information\00"
@str.31 = [54 x i8] c" --bank <num> select cart bank (1 or 2)\00"
@str.32 = [48 x i8] c" --save force write to SRAM\00"
@str.33 = [53 x i8] c" --rom force write to Flash ROM\00"
@str.34 = [59 x i8] c" --list list the ROMs on the cartridge\00"
@str.35 = [71 x i8] c" --add add a ROM to the nearest space it will fit\00"
@str.36 = [79 x i8] c" --delete <index> remove a ROM from the cartridge from the cartridge\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 ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 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 ([51 x i8], [51 x i8]* @str.28, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.29, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.30, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.31, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.32, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.33, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.34, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.35, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.36, i64 0, i64 0))
%20 = tail call i32 @putchar(i32 10)
%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
}