#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 *, int, 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-m <magic>\t\t - firmware magic, default: %s\n"
      "\t-f <flash base>\t\t - flash base address, default: 0x%08x\n"
      "\t-o <output file>\t - firmware output file, default: %s\n"
      "\t-p <name>:<offset>:<len>:<memaddr>:<entry>:<file>\n "
      "\t\t\t\t - create a partition from <file>\n"
      "\t-z\t\t\t - set partition offsets to zero\n"
      "\t-h\t\t\t - this help\n",
      "1.2-OpenWrt.1", progname, "UNKNOWN", "OPEN", (0xbfc00000),
      "firmware-image.bin");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rcx
lea    0xed0(%rip),%rsi
lea    0x105b(%rip),%rdx
lea    0x1062(%rip),%r8
lea    0x1063(%rip),%r9
lea    0x1061(%rip),%rax
movl   $0xbfc00000,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rcx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x1089(%rip),%rax
lea    0xed5(%rip),%rsi
lea    0x1060(%rip),%rdx
lea    0x1067(%rip),%r8
lea    0x1068(%rip),%r9
push   %rax
push   $0xffffffffbfc00000
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [402 x i8] c"Version %s\0AUsage: %s [options]\0A\09-v <version string>\09 - firmware version information, default: %s\0A\09-m <magic>\09\09 - firmware magic, default: %s\0A\09-f <flash base>\09\09 - flash base address, default: 0x%08x\0A\09-o <output file>\09 - firmware output file, default: %s\0A\09-p <name>:<offset>:<len>:<memaddr>:<entry>:<file>\0A \09\09\09\09 - create a partition from <file>\0A\09-z\09\09\09 - set partition offsets to zero\0A\09-h\09\09\09 - this help\0A\00"
@.str.1 = [14 x i8] c"1.2-OpenWrt.1\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
@.str.3 = [5 x i8] c"OPEN\00"
@.str.4 = [19 x i8] c"firmware-image.bin\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 ([402 x i8], [402 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 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 ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 -1077936128, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [402 x i8] c"Version %s\0AUsage: %s [options]\0A\09-v <version string>\09 - firmware version information, default: %s\0A\09-m <magic>\09\09 - firmware magic, default: %s\0A\09-f <flash base>\09\09 - flash base address, default: 0x%08x\0A\09-o <output file>\09 - firmware output file, default: %s\0A\09-p <name>:<offset>:<len>:<memaddr>:<entry>:<file>\0A \09\09\09\09 - create a partition from <file>\0A\09-z\09\09\09 - set partition offsets to zero\0A\09-h\09\09\09 - this help\0A\00"
@.str.1 = [14 x i8] c"1.2-OpenWrt.1\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
@.str.3 = [5 x i8] c"OPEN\00"
@.str.4 = [19 x i8] c"firmware-image.bin\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([402 x i8], [402 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 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 ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 -1077936128, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
ret void
}