#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(void) {
  printf("Usage: elftosb1 [options]\n");
  printf("Options:\n");
  printf("  -h/-?/-help\t\t\tDisplay this message\n");
  printf("  -o <file>\t\t\tSet output file\n");
  printf("  -d/-debugon\t\t\tEnable debug output\n");
  printf("  -k <file>\t\t\tSet key file\n");
  printf("  -load-binary <file> <addr>\tLoad a binary file at a specified "
         "address\n");
  printf("  -drive-tag <tag>\t\tSpecify drive tag\n");
  printf("  -w/-switchdriver <driver>\tSwitch driver\n");
  printf("  -sdram <chip select> <size>\tInit SDRAM\n");
  printf("  -jumparg <uint>\t\tSet jumpparg for jump and jumpreturn\n");
  printf("  -f/-load <file>\t\tLoad a ELF file\n");
  printf("  -r/-loadjumpreturn <file>\tLoad a ELF file and call it\n");
  printf("  -j/-loadjump <file>\t\tLoad a ELF file and jump to it\n");
  printf("  -R/-rom <uint>\t\tSet ROM version\n");
  printf("  -p/-product <ver>\t\tSet product version (xxx.xxx.xxx)\n");
  printf("  -v/-component <ver>\t\tSet component version (xxx.xxx.xxx)\n");
  printf("  -c/-critical\t\t\tSet critical flag\n");
  printf("  -C/-noncritical\t\tClear critical flag\n");
  printf("  -n/-strict\t\t\tSet strict flag\n");
  printf("  -N/-nonstrict\t\t\tClear strict flag\n");
  printf("  -call <addr>\t\t\tCall code at a specified address\n");
  printf("  -jump <addr>\t\t\tJump to code at a specified address\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0f(%rip),%rdi
call   1030 <printf@plt>
lea    0xf28(%rip),%rdi
call   1030 <printf@plt>
lea    0xf38(%rip),%rdi
call   1030 <printf@plt>
lea    0xf74(%rip),%rdi
call   1030 <printf@plt>
lea    0xf8f(%rip),%rdi
call   1030 <printf@plt>
lea    0xfae(%rip),%rdi
call   1030 <printf@plt>
lea    0xfcc(%rip),%rdi
call   1030 <printf@plt>
lea    0xff9(%rip),%rdi
call   1030 <printf@plt>
lea    0x1011(%rip),%rdi
call   1030 <printf@plt>
lea    0x103e(%rip),%rdi
call   1030 <printf@plt>
lea    0x1069(%rip),%rdi
call   1030 <printf@plt>
lea    0x1080(%rip),%rdi
call   1030 <printf@plt>
lea    0x10ac(%rip),%rdi
call   1030 <printf@plt>
lea    0x10dc(%rip),%rdi
call   1030 <printf@plt>
lea    0x10f4(%rip),%rdi
call   1030 <printf@plt>
lea    0x1110(%rip),%rdi
call   1030 <printf@plt>
lea    0x1124(%rip),%rdi
call   1030 <printf@plt>
lea    0x113d(%rip),%rdi
call   1030 <printf@plt>
lea    0x1164(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf26(%rip),%rdi
call   1030 <puts@plt>
lea    0xf35(%rip),%rdi
call   1030 <puts@plt>
lea    0xf70(%rip),%rdi
call   1030 <puts@plt>
lea    0xf8a(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa8(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc5(%rip),%rdi
call   1030 <puts@plt>
lea    0xff1(%rip),%rdi
call   1030 <puts@plt>
lea    0x1008(%rip),%rdi
call   1030 <puts@plt>
lea    0x1034(%rip),%rdi
call   1030 <puts@plt>
lea    0x105e(%rip),%rdi
call   1030 <puts@plt>
lea    0x1074(%rip),%rdi
call   1030 <puts@plt>
lea    0x109f(%rip),%rdi
call   1030 <puts@plt>
lea    0x10ce(%rip),%rdi
call   1030 <puts@plt>
lea    0x10e5(%rip),%rdi
call   1030 <puts@plt>
lea    0x1100(%rip),%rdi
call   1030 <puts@plt>
lea    0x1113(%rip),%rdi
call   1030 <puts@plt>
lea    0x112b(%rip),%rdi
call   1030 <puts@plt>
lea    0x1151(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: elftosb1 [options]\0A\00"
@.str.1 = [10 x i8] c"Options:\0A\00"
@.str.2 = [38 x i8] c" -h/-?/-help\09\09\09Display this message\0A\00"
@.str.3 = [31 x i8] c" -o <file>\09\09\09Set output file\0A\00"
@.str.4 = [37 x i8] c" -d/-debugon\09\09\09Enable debug output\0A\00"
@.str.5 = [28 x i8] c" -k <file>\09\09\09Set key file\0A\00"
@.str.6 = [72 x i8] c" -load-binary <file> <addr>\09Load a binary file at a specified address\0A\00"
@.str.7 = [39 x i8] c" -drive-tag <tag>\09\09Specify drive tag\0A\00"
@.str.8 = [43 x i8] c" -w/-switchdriver <driver>\09Switch driver\0A\00"
@.str.9 = [42 x i8] c" -sdram <chip select> <size>\09Init SDRAM\0A\00"
@.str.10 = [57 x i8] c" -jumparg <uint>\09\09Set jumpparg for jump and jumpreturn\0A\00"
@.str.11 = [36 x i8] c" -f/-load <file>\09\09Load a ELF file\0A\00"
@.str.12 = [57 x i8] c" -r/-loadjumpreturn <file>\09Load a ELF file and call it\0A\00"
@.str.13 = [55 x i8] c" -j/-loadjump <file>\09\09Load a ELF file and jump to it\0A\00"
@.str.14 = [35 x i8] c" -R/-rom <uint>\09\09Set ROM version\0A\00"
@.str.15 = [56 x i8] c" -p/-product <ver>\09\09Set product version (xxx.xxx.xxx)\0A\00"
@.str.16 = [60 x i8] c" -v/-component <ver>\09\09Set component version (xxx.xxx.xxx)\0A\00"
@.str.17 = [36 x i8] c" -c/-critical\09\09\09Set critical flag\0A\00"
@.str.18 = [40 x i8] c" -C/-noncritical\09\09Clear critical flag\0A\00"
@.str.19 = [32 x i8] c" -n/-strict\09\09\09Set strict flag\0A\00"
@.str.20 = [37 x i8] c" -N/-nonstrict\09\09\09Clear strict flag\0A\00"
@.str.21 = [51 x i8] c" -call <addr>\09\09\09Call code at a specified address\0A\00"
@.str.22 = [54 x i8] c" -jump <addr>\09\09\09Jump to code at a specified address\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.10, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.12, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.13, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.15, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.16, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.17, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.18, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.19, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.20, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.21, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.22, i64 0, i64 0))
%24 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [26 x i8] c"Usage: elftosb1 [options]\00"
@str.23 = [9 x i8] c"Options:\00"
@str.24 = [37 x i8] c" -h/-?/-help\09\09\09Display this message\00"
@str.25 = [30 x i8] c" -o <file>\09\09\09Set output file\00"
@str.26 = [36 x i8] c" -d/-debugon\09\09\09Enable debug output\00"
@str.27 = [27 x i8] c" -k <file>\09\09\09Set key file\00"
@str.28 = [71 x i8] c" -load-binary <file> <addr>\09Load a binary file at a specified address\00"
@str.29 = [38 x i8] c" -drive-tag <tag>\09\09Specify drive tag\00"
@str.30 = [42 x i8] c" -w/-switchdriver <driver>\09Switch driver\00"
@str.31 = [41 x i8] c" -sdram <chip select> <size>\09Init SDRAM\00"
@str.32 = [56 x i8] c" -jumparg <uint>\09\09Set jumpparg for jump and jumpreturn\00"
@str.33 = [35 x i8] c" -f/-load <file>\09\09Load a ELF file\00"
@str.34 = [56 x i8] c" -r/-loadjumpreturn <file>\09Load a ELF file and call it\00"
@str.35 = [54 x i8] c" -j/-loadjump <file>\09\09Load a ELF file and jump to it\00"
@str.36 = [34 x i8] c" -R/-rom <uint>\09\09Set ROM version\00"
@str.37 = [55 x i8] c" -p/-product <ver>\09\09Set product version (xxx.xxx.xxx)\00"
@str.38 = [59 x i8] c" -v/-component <ver>\09\09Set component version (xxx.xxx.xxx)\00"
@str.39 = [35 x i8] c" -c/-critical\09\09\09Set critical flag\00"
@str.40 = [39 x i8] c" -C/-noncritical\09\09Clear critical flag\00"
@str.41 = [31 x i8] c" -n/-strict\09\09\09Set strict flag\00"
@str.42 = [36 x i8] c" -N/-nonstrict\09\09\09Clear strict flag\00"
@str.43 = [50 x i8] c" -call <addr>\09\09\09Call code at a specified address\00"
@str.44 = [53 x i8] c" -jump <addr>\09\09\09Jump to code at a specified address\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.23, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.24, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.25, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.26, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.27, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.28, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.29, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.30, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.31, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.32, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.33, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.34, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.35, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.36, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.37, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.38, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.39, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.40, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.41, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.42, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.43, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.44, i64 0, i64 0))
%24 = tail call i32 @exit(i32 1)
unreachable
}