#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*/ fprintf(int /*<<< orphan*/, char *, char *, char const *,
                           char *, char *, char *);
int /*<<< orphan*/ stdout;
void usage(const char *progname) {
  fprintf(
      stdout,
      "Version %s\n"
      "Usage: %s [options]\n"
      "\t-v <version string>\t - firmware version information, default: %s\n"
      "\t-o <output file>\t - firmware output file, default: %s\n"
      "\t-m <magic>\t - firmware magic, default: %s\n"
      "\t-k <kernel file>\t\t - kernel file\n"
      "\t-r <rootfs file>\t\t - rootfs file\n"
      "\t-B <board name>\t\t - choose firmware layout for specified board "
      "(XS2, XS5, RS, XM)\n"
      "\t-h\t\t\t - this help\n",
      "1.2", progname, "UNKNOWN", "firmware-image.bin", "OPEN");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rcx
lea    0xed0(%rip),%rsi
lea    0x1037(%rip),%rdx
lea    0x1034(%rip),%r8
lea    0x1035(%rip),%r9
lea    0x1041(%rip),%rax
mov    %rax,(%rsp)
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rcx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x1069(%rip),%rax
mov    %rax,(%rsp)
lea    0xed1(%rip),%rsi
lea    0x1038(%rip),%rdx
lea    0x1035(%rip),%r8
lea    0x1036(%rip),%r9
call   1030 <fprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [366 x i8] c"Version %s\0AUsage: %s [options]\0A\09-v <version string>\09 - firmware version information, default: %s\0A\09-o <output file>\09 - firmware output file, default: %s\0A\09-m <magic>\09 - firmware magic, default: %s\0A\09-k <kernel file>\09\09 - kernel file\0A\09-r <rootfs file>\09\09 - rootfs file\0A\09-B <board name>\09\09 - choose firmware layout for specified board (XS2, XS5, RS, XM)\0A\09-h\09\09\09 - this help\0A\00"
@.str.1 = [4 x i8] c"1.2\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
@.str.3 = [19 x i8] c"firmware-image.bin\00"
@.str.4 = [5 x i8] c"OPEN\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([366 x i8], [366 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [366 x i8] c"Version %s\0AUsage: %s [options]\0A\09-v <version string>\09 - firmware version information, default: %s\0A\09-o <output file>\09 - firmware output file, default: %s\0A\09-m <magic>\09 - firmware magic, default: %s\0A\09-k <kernel file>\09\09 - kernel file\0A\09-r <rootfs file>\09\09 - rootfs file\0A\09-B <board name>\09\09 - choose firmware layout for specified board (XS2, XS5, RS, XM)\0A\09-h\09\09\09 - this help\0A\00"
@.str.1 = [4 x i8] c"1.2\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
@.str.3 = [19 x i8] c"firmware-image.bin\00"
@.str.4 = [5 x i8] c"OPEN\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([366 x i8], [366 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
ret void
}