#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*/ print_banner();
int /*<<< orphan*/ printf(char *, ...);
void print_usage(int argc, char *argv[]) {
  print_banner();
  printf("\nUsage: %s [OPTION] [driver.sys]\n", argv[0]);
  printf("  -l|--list             List supported driver versions\n");
  printf("  -i|--identify         Only identify the driver file (don't "
         "extract)\n");
  printf("  -w|--target-dir DIR   Extract and write firmware to DIR\n");
  printf(
      "  -p|--postfix \".FOO\"   Postfix for firmware filenames (.FOO.fw)\n");
  printf("  -v|--version          Print fwcutter version\n");
  printf("  -h|--help             Print this help\n");
  printf("\nExample: %s bcmwl5.sys\n"
         "         to extract the firmware blobs from bcmwl5.sys\n",
         argv[0]);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <print_banner@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xfca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1050 <print_banner@plt>
mov    (%rbx),%rsi
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf1f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf84(%rip),%rdi
call   1030 <puts@plt>
lea    0xfb2(%rip),%rdi
call   1030 <puts@plt>
lea    0xfe7(%rip),%rdi
call   1030 <puts@plt>
lea    0x100a(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xe84(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"\0AUsage: %s [OPTION] [driver.sys]\0A\00"
@.str.1 = [56 x i8] c" -l|--list List supported driver versions\0A\00"
@.str.2 = [71 x i8] c" -i|--identify Only identify the driver file (don't extract)\0A\00"
@.str.3 = [59 x i8] c" -w|--target-dir DIR Extract and write firmware to DIR\0A\00"
@.str.4 = [66 x i8] c" -p|--postfix \22.FOO\22 Postfix for firmware filenames (.FOO.fw)\0A\00"
@.str.5 = [48 x i8] c" -v|--version Print fwcutter version\0A\00"
@.str.6 = [41 x i8] c" -h|--help Print this help\0A\00"
@.str.7 = [80 x i8] c"\0AExample: %s bcmwl5.sys\0A to extract the firmware blobs from bcmwl5.sys\0A\00"
define void @print_usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @print_banner()
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0))
%16 = load i8**, i8*** %4
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.7, i64 0, i64 0), i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0AUsage: %s [OPTION] [driver.sys]\0A\00"
@.str.7 = [80 x i8] c"\0AExample: %s bcmwl5.sys\0A to extract the firmware blobs from bcmwl5.sys\0A\00"
@str = [55 x i8] c" -l|--list List supported driver versions\00"
@str.8 = [70 x i8] c" -i|--identify Only identify the driver file (don't extract)\00"
@str.9 = [58 x i8] c" -w|--target-dir DIR Extract and write firmware to DIR\00"
@str.10 = [65 x i8] c" -p|--postfix \22.FOO\22 Postfix for firmware filenames (.FOO.fw)\00"
@str.11 = [47 x i8] c" -v|--version Print fwcutter version\00"
@str.12 = [40 x i8] c" -h|--help Print this help\00"
define void @print_usage(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @print_banner()
%4 = load i8*, i8** %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.8, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.9, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.10, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.11, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.12, i64 0, i64 0))
%12 = load i8*, i8** %1
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str.7, i64 0, i64 0), i8* %12)
ret void
}