#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*/ printf(char *);
void usage(void) {
  printf("USAGE:\n");
  printf("    piboot <options> <kernel>\n");
  printf("\n");
  printf("    -h | --help             Show this screen.\n");
  printf("    -p | --port <device>    Use specified serial port to "
         "communicate.\n");
  printf("    -b | --beef-bss         Fill BSS section with 0xDEADBEEF instead "
         "of zeros.\n");
  printf("    -m | --monitor          Start monitoring uart output after "
         "starting kernel\n");
  printf("    -l | --load-addr <addr> Specify address where to load binary "
         "files.\n"
         "       |                    Defaults to 0x8000, increases with each "
         "loaded file.\n"
         "       |                    Has no effect when loading ELF files.\n");
  printf("    -x | --exec-addr <addr> Address where to start executing. "
         "Defaults to\n"
         "       |                    0x8000. When loading ELF, it's "
         "entrypoint address\n"
         "       |                    is used instead.\n");
  printf("    -s | --suspended        Do not start to execute right away.\n");
  printf("    -w | --no-watchdog      Disable watchdog.\n");
  printf("    -v | --verbose          Display what actions are performed.\n");
  printf("    -r | --reboot           Reboot the Pi.\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0x11aa(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
call   1030 <printf@plt>
lea    0xf46(%rip),%rdi
call   1030 <printf@plt>
lea    0xf8a(%rip),%rdi
call   1030 <printf@plt>
lea    0xfce(%rip),%rdi
call   1030 <printf@plt>
lea    0x109e(%rip),%rdi
call   1030 <printf@plt>
lea    0x1158(%rip),%rdi
call   1030 <printf@plt>
lea    0x118d(%rip),%rdi
call   1030 <printf@plt>
lea    0x11b0(%rip),%rdi
call   1030 <printf@plt>
lea    0x11e5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xed3(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xedb(%rip),%rdi
call   1040 <puts@plt>
lea    0xefd(%rip),%rdi
call   1040 <puts@plt>
lea    0xf37(%rip),%rdi
call   1040 <puts@plt>
lea    0xf7a(%rip),%rdi
call   1040 <puts@plt>
lea    0xfbd(%rip),%rdi
call   1040 <puts@plt>
lea    0x108c(%rip),%rdi
call   1040 <puts@plt>
lea    0x1145(%rip),%rdi
call   1040 <puts@plt>
lea    0x1179(%rip),%rdi
call   1040 <puts@plt>
lea    0x119b(%rip),%rdi
call   1040 <puts@plt>
lea    0x11cf(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"USAGE:\0A\00"
@.str.1 = [31 x i8] c" piboot <options> <kernel>\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [47 x i8] c" -h | --help Show this screen.\0A\00"
@.str.4 = [71 x i8] c" -p | --port <device> Use specified serial port to communicate.\0A\00"
@.str.5 = [80 x i8] c" -b | --beef-bss Fill BSS section with 0xDEADBEEF instead of zeros.\0A\00"
@.str.6 = [80 x i8] c" -m | --monitor Start monitoring uart output after starting kernel\0A\00"
@.str.7 = [220 x i8] c" -l | --load-addr <addr> Specify address where to load binary files.\0A | Defaults to 0x8000, increases with each loaded file.\0A | Has no effect when loading ELF files.\0A\00"
@.str.8 = [198 x i8] c" -x | --exec-addr <addr> Address where to start executing. Defaults to\0A | 0x8000. When loading ELF, it's entrypoint address\0A | is used instead.\0A\00"
@.str.9 = [65 x i8] c" -s | --suspended Do not start to execute right away.\0A\00"
@.str.10 = [47 x i8] c" -w | --no-watchdog Disable watchdog.\0A\00"
@.str.11 = [65 x i8] c" -v | --verbose Display what actions are performed.\0A\00"
@.str.12 = [44 x i8] c" -r | --reboot Reboot the Pi.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([220 x i8], [220 x i8]* @.str.7, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([198 x i8], [198 x i8]* @.str.8, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.9, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.11, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.12, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"USAGE:\00"
@str.13 = [30 x i8] c" piboot <options> <kernel>\00"
@str.14 = [46 x i8] c" -h | --help Show this screen.\00"
@str.15 = [70 x i8] c" -p | --port <device> Use specified serial port to communicate.\00"
@str.16 = [79 x i8] c" -b | --beef-bss Fill BSS section with 0xDEADBEEF instead of zeros.\00"
@str.17 = [79 x i8] c" -m | --monitor Start monitoring uart output after starting kernel\00"
@str.18 = [219 x i8] c" -l | --load-addr <addr> Specify address where to load binary files.\0A | Defaults to 0x8000, increases with each loaded file.\0A | Has no effect when loading ELF files.\00"
@str.19 = [197 x i8] c" -x | --exec-addr <addr> Address where to start executing. Defaults to\0A | 0x8000. When loading ELF, it's entrypoint address\0A | is used instead.\00"
@str.20 = [64 x i8] c" -s | --suspended Do not start to execute right away.\00"
@str.21 = [46 x i8] c" -w | --no-watchdog Disable watchdog.\00"
@str.22 = [64 x i8] c" -v | --verbose Display what actions are performed.\00"
@str.23 = [43 x i8] c" -r | --reboot Reboot the Pi.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.13, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.14, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.15, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.16, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.17, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([219 x i8], [219 x i8]* @str.18, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([197 x i8], [197 x i8]* @str.19, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.20, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.21, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.22, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.23, i64 0, i64 0))
ret void
}