#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 *);
int /*<<< orphan*/ stderr;
int print_usage(int error_code) {
  fprintf(stderr, "\nUsage: fxload [-v] [-V] [-t type] [-d vid:pid] [-p "
                  "bus,addr] [-s loader] -i firmware\n");
  fprintf(stderr, "  -i <path>       -- Firmware to upload\n");
  fprintf(stderr, "  -s <path>       -- Second stage loader\n");
  fprintf(stderr,
          "  -t <type>       -- Target type: an21, fx, fx2, fx2lp, fx3\n");
  fprintf(stderr, "  -d <vid:pid>    -- Target device, as an USB VID:PID\n");
  fprintf(stderr, "  -p <bus,addr>   -- Target device, as a libusb bus number "
                  "and device address path\n");
  fprintf(stderr, "  -v              -- Increase verbosity\n");
  fprintf(stderr, "  -q              -- Decrease verbosity (silent mode)\n");
  fprintf(stderr, "  -V              -- Print program version\n");
  return error_code;
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xf17(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xf2b(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xf40(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
lea    0xf68(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
lea    0xf8a(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
lea    0xfc9(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
lea    0xfdd(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e16(%rip),%rax
mov    (%rax),%edi
lea    0xfff(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    0x2ec4(%rip),%rbx
mov    (%rbx),%edi
lea    0xedb(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf24(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf3f(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf5b(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf8a(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xff9(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1014(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x103d(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [87 x i8] c"\0AUsage: fxload [-v] [-V] [-t type] [-d vid:pid] [-p bus,addr] [-s loader] -i firmware\0A\00"
@.str.1 = [41 x i8] c" -i <path> -- Firmware to upload\0A\00"
@.str.2 = [42 x i8] c" -s <path> -- Second stage loader\0A\00"
@.str.3 = [61 x i8] c" -t <type> -- Target type: an21, fx, fx2, fx2lp, fx3\0A\00"
@.str.4 = [55 x i8] c" -d <vid:pid> -- Target device, as an USB VID:PID\0A\00"
@.str.5 = [84 x i8] c" -p <bus,addr> -- Target device, as a libusb bus number and device address path\0A\00"
@.str.6 = [41 x i8] c" -v -- Increase verbosity\0A\00"
@.str.7 = [55 x i8] c" -q -- Decrease verbosity (silent mode)\0A\00"
@.str.8 = [44 x i8] c" -V -- Print program version\0A\00"
define i32 @print_usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.5, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0))
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [87 x i8] c"\0AUsage: fxload [-v] [-V] [-t type] [-d vid:pid] [-p bus,addr] [-s loader] -i firmware\0A\00"
@.str.1 = [41 x i8] c" -i <path> -- Firmware to upload\0A\00"
@.str.2 = [42 x i8] c" -s <path> -- Second stage loader\0A\00"
@.str.3 = [61 x i8] c" -t <type> -- Target type: an21, fx, fx2, fx2lp, fx3\0A\00"
@.str.4 = [55 x i8] c" -d <vid:pid> -- Target device, as an USB VID:PID\0A\00"
@.str.5 = [84 x i8] c" -p <bus,addr> -- Target device, as a libusb bus number and device address path\0A\00"
@.str.6 = [41 x i8] c" -v -- Increase verbosity\0A\00"
@.str.7 = [55 x i8] c" -q -- Decrease verbosity (silent mode)\0A\00"
@.str.8 = [44 x i8] c" -V -- Print program version\0A\00"
define i32 @print_usage(i32 returned %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.5, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0))
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = tail call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
ret i32 %0
}