#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*/ printf(char *, ...);
void usage(const char *name) {
  printf("Download a firmware into a Linksys WAG160N v2\n\n");
  printf("1) Power off the device\n");
  printf("2) Press the reset button\n");
  printf("3) Power on the device while holding the reset button pressed\n");
  printf("4) Wait until the power LED flashes red/green, you may release the "
         "reset button then.\n");
  printf("   The device is in download mode now.\n");
  printf("5) Call %s [-v] <ethernet device name> [<firmware file>]\n", name);
  printf(
      "   if <firmware file> is missing only the devices found are dumped\n");
  printf("   e.g.:\n");
  printf("    dump all devices connected to eth2: %s eth2\n", name);
  printf("    update a device at eth1: %s eth1 firmware\n", name);
  printf("    -v to see debugs for each packet sent/received\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xfa7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfd3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1009(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x1001(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x1020(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1041(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xf6f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf92(%rip),%rdi
call   1030 <puts@plt>
lea    0xf9e(%rip),%rdi
call   1030 <puts@plt>
lea    0xfac(%rip),%rdi
call   1030 <puts@plt>
lea    0xfde(%rip),%rdi
call   1030 <puts@plt>
lea    0x1028(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1032(%rip),%rdi
call   1030 <puts@plt>
lea    0x1069(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9e(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1044(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Download a firmware into a Linksys WAG160N v2\0A\0A\00"
@.str.1 = [25 x i8] c"1) Power off the device\0A\00"
@.str.2 = [27 x i8] c"2) Press the reset button\0A\00"
@.str.3 = [63 x i8] c"3) Power on the device while holding the reset button pressed\0A\00"
@.str.4 = [87 x i8] c"4) Wait until the power LED flashes red/green, you may release the reset button then.\0A\00"
@.str.5 = [40 x i8] c" The device is in download mode now.\0A\00"
@.str.6 = [58 x i8] c"5) Call %s [-v] <ethernet device name> [<firmware file>]\0A\00"
@.str.7 = [68 x i8] c" if <firmware file> is missing only the devices found are dumped\0A\00"
@.str.8 = [10 x i8] c" e.g.:\0A\00"
@.str.9 = [49 x i8] c" dump all devices connected to eth2: %s eth2\0A\00"
@.str.10 = [47 x i8] c" update a device at eth1: %s eth1 firmware\0A\00"
@.str.11 = [52 x i8] c" -v to see debugs for each packet sent/received\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
%9 = load i8*, i8** %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0), i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%13 = load i8*, i8** %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0), i8* %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.11, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.6 = [58 x i8] c"5) Call %s [-v] <ethernet device name> [<firmware file>]\0A\00"
@.str.9 = [49 x i8] c" dump all devices connected to eth2: %s eth2\0A\00"
@.str.10 = [47 x i8] c" update a device at eth1: %s eth1 firmware\0A\00"
@str = [47 x i8] c"Download a firmware into a Linksys WAG160N v2\0A\00"
@str.12 = [24 x i8] c"1) Power off the device\00"
@str.13 = [26 x i8] c"2) Press the reset button\00"
@str.14 = [62 x i8] c"3) Power on the device while holding the reset button pressed\00"
@str.15 = [86 x i8] c"4) Wait until the power LED flashes red/green, you may release the reset button then.\00"
@str.16 = [39 x i8] c" The device is in download mode now.\00"
@str.17 = [67 x i8] c" if <firmware file> is missing only the devices found are dumped\00"
@str.18 = [9 x i8] c" e.g.:\00"
@str.19 = [51 x i8] c" -v to see debugs for each packet sent/received\00"
define void @usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.12, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.13, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.14, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str.15, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.16, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0), i8* %0)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str.17, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.18, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), i8* %0)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0), i8* %0)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.19, i64 0, i64 0))
ret void
}