#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 flash to <file>\n");
  printf("--write=<file> ,   -w <file>            =   write the <file> to the "
         "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("--no-verify                             =   skip verification after "
         "flashing (not recommended)\n");
  printf("\n");
  printf("Presets:\n");
  printf("bb                                      =   Data Block B\n");
  printf("ba                                      =   Data Block A\n");
  printf("b3                                      =   Block 3\n");
  printf("b2                                      =   Block 2\n");
  printf("b1                                      =   Block 1\n");
  printf("b0                                      =   Block 0\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    0xf06(%rip),%rdi
call   1030 <printf@plt>
lea    0xf45(%rip),%rdi
call   1030 <printf@plt>
lea    0xf81(%rip),%rdi
call   1030 <printf@plt>
lea    0xfce(%rip),%rdi
call   1030 <printf@plt>
lea    0x100d(%rip),%rdi
call   1030 <printf@plt>
lea    0x1062(%rip),%rdi
call   1030 <printf@plt>
lea    0x10b4(%rip),%rdi
call   1030 <printf@plt>
lea    0x10aa(%rip),%rdi
call   1030 <printf@plt>
lea    0x10a8(%rip),%rdi
call   1030 <printf@plt>
lea    0x10d6(%rip),%rdi
call   1030 <printf@plt>
lea    0x1104(%rip),%rdi
call   1030 <printf@plt>
lea    0x112d(%rip),%rdi
call   1030 <printf@plt>
lea    0x1156(%rip),%rdi
call   1030 <printf@plt>
lea    0x117f(%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    0xef7(%rip),%rdi
call   1040 <puts@plt>
lea    0xf35(%rip),%rdi
call   1040 <puts@plt>
lea    0xf70(%rip),%rdi
call   1040 <puts@plt>
lea    0xfbc(%rip),%rdi
call   1040 <puts@plt>
lea    0xffa(%rip),%rdi
call   1040 <puts@plt>
lea    0x104e(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1097(%rip),%rdi
call   1040 <puts@plt>
lea    0x1094(%rip),%rdi
call   1040 <puts@plt>
lea    0x10c1(%rip),%rdi
call   1040 <puts@plt>
lea    0x10ee(%rip),%rdi
call   1040 <puts@plt>
lea    0x1116(%rip),%rdi
call   1040 <puts@plt>
lea    0x113e(%rip),%rdi
call   1040 <puts@plt>
lea    0x1166(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"options:\0A\00"
@.str.1 = [70 x i8] c"--dump=<file> , -d <file> = dump the flash to <file>\0A\00"
@.str.2 = [75 x i8] c"--write=<file> , -w <file> = write the <file> to the 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 = [96 x i8] c"--no-verify = skip verification after flashing (not recommended)\0A\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [10 x i8] c"Presets:\0A\00"
@.str.10 = [58 x i8] c"bb = Data Block B\0A\00"
@.str.11 = [58 x i8] c"ba = Data Block A\0A\00"
@.str.12 = [53 x i8] c"b3 = Block 3\0A\00"
@.str.13 = [53 x i8] c"b2 = Block 2\0A\00"
@.str.14 = [53 x i8] c"b1 = Block 1\0A\00"
@.str.15 = [53 x i8] c"b0 = Block 0\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 ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 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 ([96 x i8], [96 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.10, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.11, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.12, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.13, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.14, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.15, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"options:\00"
@str.16 = [69 x i8] c"--dump=<file> , -d <file> = dump the flash to <file>\00"
@str.17 = [74 x i8] c"--write=<file> , -w <file> = write the <file> to the flash\00"
@str.18 = [71 x i8] c"--erase = just erase the flash block\00"
@str.19 = [88 x i8] c"--address=0x<addr> , -a 0x<addr> = ram address from which read or write starts\00"
@str.20 = [74 x i8] c"--size=0x<size> , -s 0x<size> = size of data to read or write\00"
@str.21 = [96 x i8] c"--preset=<preset> , -p <preset> = sets address and size based on a preset, see below.\00"
@str.22 = [95 x i8] c"--no-verify = skip verification after flashing (not recommended)\00"
@str.23 = [9 x i8] c"Presets:\00"
@str.24 = [57 x i8] c"bb = Data Block B\00"
@str.25 = [57 x i8] c"ba = Data Block A\00"
@str.26 = [52 x i8] c"b3 = Block 3\00"
@str.27 = [52 x i8] c"b2 = Block 2\00"
@str.28 = [52 x i8] c"b1 = Block 1\00"
@str.29 = [52 x i8] c"b0 = Block 0\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 ([69 x i8], [69 x i8]* @str.16, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.17, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.18, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @str.19, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.20, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([96 x i8], [96 x i8]* @str.21, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([95 x i8], [95 x i8]* @str.22, i64 0, i64 0))
%10 = tail call i32 @putchar(i32 10)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.23, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.24, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.25, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.26, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.27, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.28, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.29, i64 0, i64 0))
ret void
}