#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*/ printHeader();
int /*<<< orphan*/ printf(char *);
void printUsage() {
  printHeader();
  printf("options:\n");
  printf("--dump=<file> ,  -d <file>              =   dump the ram (or flash, "
         "which is mapped in ram) to <file>\n");
  printf("--write=<file> ,   -w <file>            =   write the <file> to the "
         "ram (or flash)\n");
  printf("--erase                                 =   just erase the flash "
         "block\n");
  printf("--address=0x<addr> , -a 0x<addr>        =   ram address from which "
         "read or write starts\n");
  printf("--size=0x<size> ,  -s 0x<size>          =   size of data to read or "
         "write\n");
  printf("--preset=<preset> , -p <preset>         =   sets address and size "
         "based on a preset, see below.\n");
  printf("--execute                               =   exit the Boot ROM and "
         "execute firmware\n");
  printf("--no-verify                             =   skip verification after "
         "flashing (not recommended)\n");
  printf("--fix-lgc-static-checksum               =   adds fixed checksum to "
         "end of data (LGC algo.)\n");
  printf("                                            (use when flashing "
         "modified static data)\n");
  printf("\n");
  printf("Presets:\n");
  printf("df1                                     =   DataFlash1 (usually "
         "dynamic data to persist between resets)\n");
  printf("df2                                     =   DataFlash2 (usually "
         "dynamic data to persist between resets)\n");
  printf("df3                                     =   DataFlash3 (usually "
         "static data)\n");
  printf("fw                                      =   The firmware\n");
  printf("full1                                   =   0-FFFF first half of a "
         "full dump\n");
  printf("full2                                   =   10000-11FFF second half "
         "of full dump\n");
  printf("                                            Note: this is probably "
         "the boot rom and is unwritable\n");
  printf("                                                  full1 will be "
         "enough for most puproses\n");
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <printHeader@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
lea    0xf27(%rip),%rdi
call   1030 <printf@plt>
lea    0xf6f(%rip),%rdi
call   1030 <printf@plt>
lea    0xfab(%rip),%rdi
call   1030 <printf@plt>
lea    0xff8(%rip),%rdi
call   1030 <printf@plt>
lea    0x1037(%rip),%rdi
call   1030 <printf@plt>
lea    0x108c(%rip),%rdi
call   1030 <printf@plt>
lea    0x10d4(%rip),%rdi
call   1030 <printf@plt>
lea    0x1128(%rip),%rdi
call   1030 <printf@plt>
lea    0x1178(%rip),%rdi
call   1030 <printf@plt>
lea    0x116a(%rip),%rdi
call   1030 <printf@plt>
lea    0x11b6(%rip),%rdi
call   1030 <printf@plt>
lea    0x11b4(%rip),%rdi
call   1030 <printf@plt>
lea    0x1211(%rip),%rdi
call   1030 <printf@plt>
lea    0x126e(%rip),%rdi
call   1030 <printf@plt>
lea    0x12b0(%rip),%rdi
call   1030 <printf@plt>
lea    0x12de(%rip),%rdi
call   1030 <printf@plt>
lea    0x1320(%rip),%rdi
call   1030 <printf@plt>
lea    0x1366(%rip),%rdi
call   1030 <printf@plt>
lea    0x13bd(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
xor    %eax,%eax
call   1050 <printHeader@plt>
lea    0xec1(%rip),%rdi
call   1040 <puts@plt>
lea    0xebe(%rip),%rdi
call   1040 <puts@plt>
lea    0xf18(%rip),%rdi
call   1040 <puts@plt>
lea    0xf5f(%rip),%rdi
call   1040 <puts@plt>
lea    0xf9a(%rip),%rdi
call   1040 <puts@plt>
lea    0xfe6(%rip),%rdi
call   1040 <puts@plt>
lea    0x1024(%rip),%rdi
call   1040 <puts@plt>
lea    0x1078(%rip),%rdi
call   1040 <puts@plt>
lea    0x10bf(%rip),%rdi
call   1040 <puts@plt>
lea    0x1112(%rip),%rdi
call   1040 <puts@plt>
lea    0x1161(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x11a0(%rip),%rdi
call   1040 <puts@plt>
lea    0x119d(%rip),%rdi
call   1040 <puts@plt>
lea    0x11f9(%rip),%rdi
call   1040 <puts@plt>
lea    0x1255(%rip),%rdi
call   1040 <puts@plt>
lea    0x1296(%rip),%rdi
call   1040 <puts@plt>
lea    0x12c3(%rip),%rdi
call   1040 <puts@plt>
lea    0x1304(%rip),%rdi
call   1040 <puts@plt>
lea    0x1349(%rip),%rdi
call   1040 <puts@plt>
lea    0x139f(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"options:\0A\00"
@.str.1 = [103 x i8] c"--dump=<file> , -d <file> = dump the ram (or flash, which is mapped in ram) to <file>\0A\00"
@.str.2 = [84 x i8] c"--write=<file> , -w <file> = write the <file> to the ram (or flash)\0A\00"
@.str.3 = [72 x i8] c"--erase = just erase the flash block\0A\00"
@.str.4 = [89 x i8] c"--address=0x<addr> , -a 0x<addr> = ram address from which read or write starts\0A\00"
@.str.5 = [75 x i8] c"--size=0x<size> , -s 0x<size> = size of data to read or write\0A\00"
@.str.6 = [97 x i8] c"--preset=<preset> , -p <preset> = sets address and size based on a preset, see below.\0A\00"
@.str.7 = [84 x i8] c"--execute = exit the Boot ROM and execute firmware\0A\00"
@.str.8 = [96 x i8] c"--no-verify = skip verification after flashing (not recommended)\0A\00"
@.str.9 = [92 x i8] c"--fix-lgc-static-checksum = adds fixed checksum to end of data (LGC algo.)\0A\00"
@.str.10 = [86 x i8] c" (use when flashing modified static data)\0A\00"
@.str.11 = [2 x i8] c"\0A\00"
@.str.12 = [10 x i8] c"Presets:\0A\00"
@.str.13 = [105 x i8] c"df1 = DataFlash1 (usually dynamic data to persist between resets)\0A\00"
@.str.14 = [105 x i8] c"df2 = DataFlash2 (usually dynamic data to persist between resets)\0A\00"
@.str.15 = [78 x i8] c"df3 = DataFlash3 (usually static data)\0A\00"
@.str.16 = [58 x i8] c"fw = The firmware\0A\00"
@.str.17 = [78 x i8] c"full1 = 0-FFFF first half of a full dump\0A\00"
@.str.18 = [82 x i8] c"full2 = 10000-11FFF second half of full dump\0A\00"
@.str.19 = [99 x i8] c" Note: this is probably the boot rom and is unwritable\0A\00"
@.str.20 = [90 x i8] c" full1 will be enough for most puproses\0A\00"
define void @printUsage() {
%1 = call i32 (...) @printHeader()
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.8, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.9, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.10, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str.13, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str.14, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.15, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.16, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.17, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.18, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.19, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.20, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"options:\00"
@str.21 = [102 x i8] c"--dump=<file> , -d <file> = dump the ram (or flash, which is mapped in ram) to <file>\00"
@str.22 = [83 x i8] c"--write=<file> , -w <file> = write the <file> to the ram (or flash)\00"
@str.23 = [71 x i8] c"--erase = just erase the flash block\00"
@str.24 = [88 x i8] c"--address=0x<addr> , -a 0x<addr> = ram address from which read or write starts\00"
@str.25 = [74 x i8] c"--size=0x<size> , -s 0x<size> = size of data to read or write\00"
@str.26 = [96 x i8] c"--preset=<preset> , -p <preset> = sets address and size based on a preset, see below.\00"
@str.27 = [83 x i8] c"--execute = exit the Boot ROM and execute firmware\00"
@str.28 = [95 x i8] c"--no-verify = skip verification after flashing (not recommended)\00"
@str.29 = [91 x i8] c"--fix-lgc-static-checksum = adds fixed checksum to end of data (LGC algo.)\00"
@str.30 = [85 x i8] c" (use when flashing modified static data)\00"
@str.31 = [9 x i8] c"Presets:\00"
@str.32 = [104 x i8] c"df1 = DataFlash1 (usually dynamic data to persist between resets)\00"
@str.33 = [104 x i8] c"df2 = DataFlash2 (usually dynamic data to persist between resets)\00"
@str.34 = [77 x i8] c"df3 = DataFlash3 (usually static data)\00"
@str.35 = [57 x i8] c"fw = The firmware\00"
@str.36 = [77 x i8] c"full1 = 0-FFFF first half of a full dump\00"
@str.37 = [81 x i8] c"full2 = 10000-11FFF second half of full dump\00"
@str.38 = [98 x i8] c" Note: this is probably the boot rom and is unwritable\00"
@str.39 = [89 x i8] c" full1 will be enough for most puproses\00"
define void @printUsage() {
%1 = tail call i32 (...) @printHeader()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([102 x i8], [102 x i8]* @str.21, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str.22, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.23, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @str.24, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.25, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([96 x i8], [96 x i8]* @str.26, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str.27, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([95 x i8], [95 x i8]* @str.28, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([91 x i8], [91 x i8]* @str.29, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @str.30, i64 0, i64 0))
%13 = tail call i32 @putchar(i32 10)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.31, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([104 x i8], [104 x i8]* @str.32, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([104 x i8], [104 x i8]* @str.33, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.34, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.35, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.36, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str.37, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @str.38, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([89 x i8], [89 x i8]* @str.39, i64 0, i64 0))
ret void
}