#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(
      stderr,
      "usage: installboot [-bootsect <sector offset>] [-bootcode <sector "
      "offset>]\n"
      "                   [-v] [-EB] [-EL] bootloaderfile.bin devicefile\n\n");
  fprintf(
      stderr,
      "This program installs a boot block onto a disk.  Typically, "
      "installboot\n"
      "is used to install sibyl or other OS bootloaders.  The binary you "
      "install\n"
      "should be a raw program (not ELF) located to run in CFE's boot area\n"
      "at address 0x2000_0000.  The devicefile should be the name of the raw "
      "device\n"
      "such as /dev/hda on Linux.\n\n"
      "Care must be taken when choosing the values for -bootsect and "
      "-bootcode\n"
      "not to interfere with other partitions on your disk.   When "
      "partitioning,\n"
      "it's a good idea to reserve 3 cylinders at the beginning of the disk "
      "for\n"
      "the boot loader.\n\n"
      "-bootsect nn    specifies that the boot sector will be placed on sector "
      "'nn'\n"
      "-bootcode nn    specifies that the boot program itself will be placed\n"
      "                on sectors starting with 'nn'.  The boot sector will "
      "point\n"
      "                to this sector.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xf46(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf50(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [143 x i8] c"usage: installboot [-bootsect <sector offset>] [-bootcode <sector offset>]\0A [-v] [-EB] [-EL] bootloaderfile.bin devicefile\0A\0A\00"
@.str.1 = [811 x i8] c"This program installs a boot block onto a disk. Typically, installboot\0Ais used to install sibyl or other OS bootloaders. The binary you install\0Ashould be a raw program (not ELF) located to run in CFE's boot area\0Aat address 0x2000_0000. The devicefile should be the name of the raw device\0Asuch as /dev/hda on Linux.\0A\0ACare must be taken when choosing the values for -bootsect and -bootcode\0Anot to interfere with other partitions on your disk. When partitioning,\0Ait's a good idea to reserve 3 cylinders at the beginning of the disk for\0Athe boot loader.\0A\0A-bootsect nn specifies that the boot sector will be placed on sector 'nn'\0A-bootcode nn specifies that the boot program itself will be placed\0A on sectors starting with 'nn'. The boot sector will point\0A to this sector.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([811 x i8], [811 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [143 x i8] c"usage: installboot [-bootsect <sector offset>] [-bootcode <sector offset>]\0A [-v] [-EB] [-EL] bootloaderfile.bin devicefile\0A\0A\00"
@.str.1 = [811 x i8] c"This program installs a boot block onto a disk. Typically, installboot\0Ais used to install sibyl or other OS bootloaders. The binary you install\0Ashould be a raw program (not ELF) located to run in CFE's boot area\0Aat address 0x2000_0000. The devicefile should be the name of the raw device\0Asuch as /dev/hda on Linux.\0A\0ACare must be taken when choosing the values for -bootsect and -bootcode\0Anot to interfere with other partitions on your disk. When partitioning,\0Ait's a good idea to reserve 3 cylinders at the beginning of the disk for\0Athe boot loader.\0A\0A-bootsect nn specifies that the boot sector will be placed on sector 'nn'\0A-bootcode nn specifies that the boot program itself will be placed\0A on sectors starting with 'nn'. The boot sector will point\0A to this sector.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([811 x i8], [811 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}