#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 *, ...);
void usage(FILE *fd, int argc, char **argv) {
  fprintf(fd, "Usage: %s [OPTIONS]\n", argv[0]);
  fprintf(fd, "\n");
  fprintf(fd, "  -B|--background             Fork into background\n");
  fprintf(fd, "  -P|--pidfile PATH           Create a PID-file\n");
  fprintf(fd, "  -l|--loglevel LEVEL         Set logging level\n");
  fprintf(
      fd,
      "                              0=error, 1=info, 2=debug, 3=verbose\n");
  fprintf(fd, "  -L|--logfile PATH           Write log to file\n");
  fprintf(fd, "  -f|--force                  Force mode\n");
  fprintf(fd, "\n");
  fprintf(fd, "  -h|--help                   Print this help text\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xecb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xede(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xefd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf1c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf4d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf6c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe4e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf72(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdx),%rdx
lea    0xec2(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
lea    0xebc(%rip),%rdi
mov    $0x33,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xed7(%rip),%rdi
mov    $0x30,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xeef(%rip),%rdi
mov    $0x30,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xf07(%rip),%rdi
mov    $0x42,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xf31(%rip),%rdi
mov    $0x30,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xf49(%rip),%rdi
mov    $0x29,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
lea    0xf4d(%rip),%rdi
mov    $0x33,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1050 <fwrite@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Usage: %s [OPTIONS]\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [52 x i8] c" -B|--background Fork into background\0A\00"
@.str.3 = [49 x i8] c" -P|--pidfile PATH Create a PID-file\0A\00"
@.str.4 = [49 x i8] c" -l|--loglevel LEVEL Set logging level\0A\00"
@.str.5 = [67 x i8] c" 0=error, 1=info, 2=debug, 3=verbose\0A\00"
@.str.6 = [49 x i8] c" -L|--logfile PATH Write log to file\0A\00"
@.str.7 = [42 x i8] c" -f|--force Force mode\0A\00"
@.str.8 = [52 x i8] c" -h|--help Print this help text\0A\00"
define void @usage(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8**
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32*, i32** %4
%8 = load i8**, i8*** %6
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32*, i32** %4
%13 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32*, i32** %4
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
%16 = load i32*, i32** %4
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
%18 = load i32*, i32** %4
%19 = call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
%20 = load i32*, i32** %4
%21 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.5, i64 0, i64 0))
%22 = load i32*, i32** %4
%23 = call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0))
%24 = load i32*, i32** %4
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0))
%26 = load i32*, i32** %4
%27 = call i32 (i32*, i8*, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%28 = load i32*, i32** %4
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %28, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.8, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Usage: %s [OPTIONS]\0A\00"
@.str.2 = [52 x i8] c" -B|--background Fork into background\0A\00"
@.str.3 = [49 x i8] c" -P|--pidfile PATH Create a PID-file\0A\00"
@.str.4 = [49 x i8] c" -l|--loglevel LEVEL Set logging level\0A\00"
@.str.5 = [67 x i8] c" 0=error, 1=info, 2=debug, 3=verbose\0A\00"
@.str.6 = [49 x i8] c" -L|--logfile PATH Write log to file\0A\00"
@.str.7 = [42 x i8] c" -f|--force Force mode\0A\00"
@.str.8 = [52 x i8] c" -h|--help Print this help text\0A\00"
define void @usage(i32* nocapture %0, i32 %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i32 @fputc(i32 10, i32* %0)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i64 51, i64 1, i32* %0)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i64 48, i64 1, i32* %0)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i64 48, i64 1, i32* %0)
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.5, i64 0, i64 0), i64 66, i64 1, i32* %0)
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0), i64 48, i64 1, i32* %0)
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0), i64 41, i64 1, i32* %0)
%13 = tail call i32 @fputc(i32 10, i32* %0)
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.8, i64 0, i64 0), i64 51, i64 1, i32* %0)
ret void
}