#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 > <file>\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("    --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");
  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    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfdb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xff5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1023(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1058(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1084(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1089(%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    0xecb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed2(%rip),%rdi
call   1040 <puts@plt>
lea    0xf02(%rip),%rdi
call   1040 <puts@plt>
lea    0xeff(%rip),%rdi
call   1040 <puts@plt>
lea    0xf2a(%rip),%rdi
call   1040 <puts@plt>
lea    0xf51(%rip),%rdi
call   1040 <puts@plt>
lea    0xf80(%rip),%rdi
call   1040 <puts@plt>
lea    0xfaa(%rip),%rdi
call   1040 <puts@plt>
lea    0xfce(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xfed(%rip),%rdi
call   1040 <puts@plt>
lea    0x101c(%rip),%rdi
call   1040 <puts@plt>
lea    0x1052(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1083(%rip),%rdi
call   1040 <puts@plt>
lea    0x1089(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Usage: %s < --read | --write > <file>\0A\00"
@.str.1 = [19 x i8] c" %s --title\0A\00"
@.str.2 = [21 x i8] c" %s --version\0A\00"
@.str.3 = [18 x i8] c" %s --help\0A\00"
@.str.4 = [61 x i8] c"Writes a ROM or SAV file to the EMS 64 Mbit USB flash cart\0A\0A\00"
@.str.5 = [10 x i8] c"Options:\0A\00"
@.str.6 = [56 x i8] c" --read read entire cart into file\0A\00"
@.str.7 = [52 x i8] c" --write write ROM file to cart\0A\00"
@.str.8 = [60 x i8] c" --title title of the ROM in both banks\0A\00"
@.str.9 = [55 x i8] c" --bank <num> select cart bank (1 or 2)\0A\00"
@.str.10 = [49 x i8] c" --save force write to SRAM\0A\00"
@.str.11 = [54 x i8] c" --rom force write to Flash ROM\0A\00"
@.str.12 = [2 x i8] c"\0A\00"
@.str.13 = [60 x i8] c"You MUST supply exactly one of --read, --write, or --title\0A\00"
@.str.14 = [67 x i8] c"Reading or writing with a file ending in .sav will write to SRAM.\0A\00"
@.str.15 = [72 x i8] c"To select between ROM and SRAM, use ONE of the --save / --rom options.\0A\00"
@.str.16 = [19 x i8] c"Advanced options:\0A\00"
@.str.17 = [76 x i8] c" --blocksize <size> bytes per block (default: 4096 read, 32 write)\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 ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.6, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.10, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.11, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.13, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.14, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.15, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0))
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.17, i64 0, i64 0))
%26 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [39 x i8] c"Usage: %s < --read | --write > <file>\0A\00"
@.str.1 = [19 x i8] c" %s --title\0A\00"
@.str.2 = [21 x i8] c" %s --version\0A\00"
@.str.3 = [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.18 = [9 x i8] c"Options:\00"
@str.19 = [55 x i8] c" --read read entire cart into file\00"
@str.20 = [51 x i8] c" --write write ROM file to cart\00"
@str.21 = [59 x i8] c" --title title of the ROM in both banks\00"
@str.22 = [54 x i8] c" --bank <num> select cart bank (1 or 2)\00"
@str.23 = [48 x i8] c" --save force write to SRAM\00"
@str.24 = [53 x i8] c" --rom force write to Flash ROM\00"
@str.25 = [59 x i8] c"You MUST supply exactly one of --read, --write, or --title\00"
@str.26 = [66 x i8] c"Reading or writing with a file ending in .sav will write to SRAM.\00"
@str.27 = [71 x i8] c"To select between ROM and SRAM, use ONE of the --save / --rom options.\00"
@str.28 = [18 x i8] c"Advanced options:\00"
@str.29 = [75 x i8] c" --blocksize <size> bytes per block (default: 4096 read, 32 write)\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.18, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.19, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.20, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.21, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.22, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.23, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.24, i64 0, i64 0))
%14 = tail call i32 @putchar(i32 10)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.25, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.26, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.27, i64 0, i64 0))
%18 = tail call i32 @putchar(i32 10)
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.28, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.29, i64 0, i64 0))
%21 = tail call i32 @exit(i32 1)
unreachable
}