#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: bin2boot [-h][-v] <outFile> <headerAddr> \n");
  printf("<imFile1> <imAddr1> <imSize1> [<imFile2> <imAddr2> <imSize2>]\n");
  printf("this function makes image bootable by netboot\n");
  printf("from one or two binary images\n");
  printf("-h         - prints this message\n");
  printf("-v         - verbose output\n");
  printf("outFile    - output file\n");
  printf("headerAddr - address to place header in memory\n");
  printf("             it should be below or equal 0x97e00\n");
  printf("imFile1    - first image\n");
  printf("imAddr1    - its start address, image has to be placed whole\n");
  printf("             below 0x98000 and should not overlap with header\n");
  printf("imSize1    - actual size of compressed image, 0 for uncompressed\n");
  printf("imFile2    - second image\n");
  printf("imAddr2    - its start address\n");
  printf("imSize2    - actual size of compressed image, 0 for uncompressed\n");
  return;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3e(%rip),%rdi
call   1030 <printf@plt>
lea    0xf61(%rip),%rdi
call   1030 <printf@plt>
lea    0xf74(%rip),%rdi
call   1030 <printf@plt>
lea    0xf8a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf9b(%rip),%rdi
call   1030 <printf@plt>
lea    0xfa9(%rip),%rdi
call   1030 <printf@plt>
lea    0xfcd(%rip),%rdi
call   1030 <printf@plt>
lea    0xff3(%rip),%rdi
call   1030 <printf@plt>
lea    0x1001(%rip),%rdi
call   1030 <printf@plt>
lea    0x1033(%rip),%rdi
call   1030 <printf@plt>
lea    0x1066(%rip),%rdi
call   1030 <printf@plt>
lea    0x109c(%rip),%rdi
call   1030 <printf@plt>
lea    0x10ab(%rip),%rdi
call   1030 <printf@plt>
lea    0x10bf(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf61(%rip),%rdi
call   1030 <puts@plt>
lea    0xf73(%rip),%rdi
call   1030 <puts@plt>
lea    0xf88(%rip),%rdi
call   1030 <puts@plt>
lea    0xf98(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa5(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc8(%rip),%rdi
call   1030 <puts@plt>
lea    0xfed(%rip),%rdi
call   1030 <puts@plt>
lea    0xffa(%rip),%rdi
call   1030 <puts@plt>
lea    0x102b(%rip),%rdi
call   1030 <puts@plt>
lea    0x105d(%rip),%rdi
call   1030 <puts@plt>
lea    0x1092(%rip),%rdi
call   1030 <puts@plt>
lea    0x10a0(%rip),%rdi
call   1030 <puts@plt>
lea    0x10b3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"usage: bin2boot [-h][-v] <outFile> <headerAddr> \0A\00"
@.str.1 = [63 x i8] c"<imFile1> <imAddr1> <imSize1> [<imFile2> <imAddr2> <imSize2>]\0A\00"
@.str.2 = [47 x i8] c"this function makes image bootable by netboot\0A\00"
@.str.3 = [31 x i8] c"from one or two binary images\0A\00"
@.str.4 = [34 x i8] c"-h - prints this message\0A\00"
@.str.5 = [29 x i8] c"-v - verbose output\0A\00"
@.str.6 = [26 x i8] c"outFile - output file\0A\00"
@.str.7 = [48 x i8] c"headerAddr - address to place header in memory\0A\00"
@.str.8 = [50 x i8] c" it should be below or equal 0x97e00\0A\00"
@.str.9 = [26 x i8] c"imFile1 - first image\0A\00"
@.str.10 = [62 x i8] c"imAddr1 - its start address, image has to be placed whole\0A\00"
@.str.11 = [63 x i8] c" below 0x98000 and should not overlap with header\0A\00"
@.str.12 = [66 x i8] c"imSize1 - actual size of compressed image, 0 for uncompressed\0A\00"
@.str.13 = [27 x i8] c"imFile2 - second image\0A\00"
@.str.14 = [32 x i8] c"imAddr2 - its start address\0A\00"
@.str.15 = [66 x i8] c"imSize2 - actual size of compressed image, 0 for uncompressed\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 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 ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.10, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.11, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.12, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.14, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.15, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [49 x i8] c"usage: bin2boot [-h][-v] <outFile> <headerAddr> \00"
@str.16 = [62 x i8] c"<imFile1> <imAddr1> <imSize1> [<imFile2> <imAddr2> <imSize2>]\00"
@str.17 = [46 x i8] c"this function makes image bootable by netboot\00"
@str.18 = [30 x i8] c"from one or two binary images\00"
@str.19 = [33 x i8] c"-h - prints this message\00"
@str.20 = [28 x i8] c"-v - verbose output\00"
@str.21 = [25 x i8] c"outFile - output file\00"
@str.22 = [47 x i8] c"headerAddr - address to place header in memory\00"
@str.23 = [49 x i8] c" it should be below or equal 0x97e00\00"
@str.24 = [25 x i8] c"imFile1 - first image\00"
@str.25 = [61 x i8] c"imAddr1 - its start address, image has to be placed whole\00"
@str.26 = [62 x i8] c" below 0x98000 and should not overlap with header\00"
@str.27 = [65 x i8] c"imSize1 - actual size of compressed image, 0 for uncompressed\00"
@str.28 = [26 x i8] c"imFile2 - second image\00"
@str.29 = [31 x i8] c"imAddr2 - its start address\00"
@str.30 = [65 x i8] c"imSize2 - actual size of compressed image, 0 for uncompressed\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.16, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.17, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.18, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.19, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.20, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.21, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.22, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.23, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.24, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.25, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.26, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.27, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.28, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.29, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.30, i64 0, i64 0))
ret void
}