#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void print_usage(const char *program_name, FILE *stream, int exit_code) {
  fprintf(stream, "Usage: %s options [ input file ]\n", program_name);
  fprintf(stream, "Generate an image for raw or file system based boot of the\n"
                  "TI AM335x Processor.\n\n");
  fprintf(stream, "  -h, --help             Display this usage information.\n"
                  "  -o, --output filename  Write output to this file.\n"
                  "  -r --raw               Make a raw boot image.\n"
                  "  -s --sign location     Sign the image with a GP header.\n"
                  "  -v --verbose           Print verbose messages.\n\n");
  fprintf(stream,
          "If no output file is indicated the input file name with a .img\n"
          "suffix is used.\n");
  exit(exit_code);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebe(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xece(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xf0e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0x1006(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rdx
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xecf(%rip),%rdi
mov    $0x51,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xf08(%rip),%rdi
mov    $0x109,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xff9(%rip),%rdi
mov    $0x4f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %ebp,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Usage: %s options [ input file ]\0A\00"
@.str.1 = [82 x i8] c"Generate an image for raw or file system based boot of the\0ATI AM335x Processor.\0A\0A\00"
@.str.2 = [266 x i8] c" -h, --help Display this usage information.\0A -o, --output filename Write output to this file.\0A -r --raw Make a raw boot image.\0A -s --sign location Sign the image with a GP header.\0A -v --verbose Print verbose messages.\0A\0A\00"
@.str.3 = [80 x i8] c"If no output file is indicated the input file name with a .img\0Asuffix is used.\0A\00"
define void @print_usage(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %5
%8 = load i8*, i8** %4
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32*, i32** %5
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32*, i32** %5
%13 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([266 x i8], [266 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32*, i32** %5
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.3, i64 0, i64 0))
%16 = load i32, i32* %6
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"Usage: %s options [ input file ]\0A\00"
@.str.1 = [82 x i8] c"Generate an image for raw or file system based boot of the\0ATI AM335x Processor.\0A\0A\00"
@.str.2 = [266 x i8] c" -h, --help Display this usage information.\0A -o, --output filename Write output to this file.\0A -r --raw Make a raw boot image.\0A -s --sign location Sign the image with a GP header.\0A -v --verbose Print verbose messages.\0A\0A\00"
@.str.3 = [80 x i8] c"If no output file is indicated the input file name with a .img\0Asuffix is used.\0A\00"
define void @print_usage(i8* %0, i32* nocapture %1, i32 %2) {
%4 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.1, i64 0, i64 0), i64 81, i64 1, i32* %1)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([266 x i8], [266 x i8]* @.str.2, i64 0, i64 0), i64 265, i64 1, i32* %1)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.3, i64 0, i64 0), i64 79, i64 1, i32* %1)
%8 = tail call i32 @exit(i32 %2)
unreachable
}