#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *stdout;
void usage(FILE *file) {
  if (file == NULL) {
    file = stdout;
  }
  fprintf(
      file,
      "bt-client [OPTIONS] file.torrent\n"
      "  -h            \t Print this help screen\n"
      "  -b ip         \t Bind to this ip for incoming connections, ports\n"
      "                \t are selected automatically\n"
      "  -s save_file  \t Save the torrent in directory save_dir (dflt: .)\n"
      "  -l log_file   \t Save logs to log_filw (dflt: bt-client.log)\n"
      "  -p ip:port    \t Instead of contacing the tracker for a peer list,\n"
      "                \t use this peer instead, ip:port (ip or hostname)\n"
      "                \t (include multiple -p for more than 1 peer)\n"
      "  -I id         \t Set the node identifier to id (dflt: random)\n"
      "  -v            \t verbose, print additional verbose info\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1135 <usage+0x25>
mov    0x2eb2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
test   %rdi,%rdi
jne    1122 <usage+0x12>
mov    0x2ec1(%rip),%rax
mov    (%rax),%rcx
lea    0xed7(%rip),%rdi
mov    $0x275,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@stdout = global i32* null
@.str = [630 x i8] c"bt-client [OPTIONS] file.torrent\0A -h \09 Print this help screen\0A -b ip \09 Bind to this ip for incoming connections, ports\0A \09 are selected automatically\0A -s save_file \09 Save the torrent in directory save_dir (dflt: .)\0A -l log_file \09 Save logs to log_filw (dflt: bt-client.log)\0A -p ip:port \09 Instead of contacing the tracker for a peer list,\0A \09 use this peer instead, ip:port (ip or hostname)\0A \09 (include multiple -p for more than 1 peer)\0A -I id \09 Set the node identifier to id (dflt: random)\0A -v \09 verbose, print additional verbose info\0A\00"
define void @usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32*, i32** @stdout
store i32* %6, i32** %2
br label %7
7: ; preds = %5, %1
%8 = load i32*, i32** %2
%9 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([630 x i8], [630 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32* null
@.str = [630 x i8] c"bt-client [OPTIONS] file.torrent\0A -h \09 Print this help screen\0A -b ip \09 Bind to this ip for incoming connections, ports\0A \09 are selected automatically\0A -s save_file \09 Save the torrent in directory save_dir (dflt: .)\0A -l log_file \09 Save logs to log_filw (dflt: bt-client.log)\0A -p ip:port \09 Instead of contacing the tracker for a peer list,\0A \09 use this peer instead, ip:port (ip or hostname)\0A \09 (include multiple -p for more than 1 peer)\0A -I id \09 Set the node identifier to id (dflt: random)\0A -v \09 verbose, print additional verbose info\0A\00"
define void @usage(i32* %0) {
%2 = icmp eq i32* %0, null
%3 = load i32*, i32** @stdout
%4 = select i1 %2, i32* %3, i32* %0
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([630 x i8], [630 x i8]* @.str, i64 0, i64 0), i64 629, i64 1, i32* %4)
ret void
}