#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 *stream, int exhaustive) {
  fprintf(stream, "Usage: erldaemon [options] -- <erlang command line>\n");
  if (exhaustive) {
    fprintf(stream, "\nOptions:\n"
                    "  -f            run in the foreground\n"
                    "  -h            show this help\n"
                    "  -l FILE       log stdout of erlang to FILE\n"
                    "  -n NAME       use NAME as syslog identifier\n"
                    "  -p FILE       create FILE with process id\n");
  }
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed6(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x0,-0xc(%rbp)
je     1149 <usage+0x39>
mov    -0x8(%rbp),%rdi
lea    0xef1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xee1(%rip),%rdi
mov    $0x34,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
test   %ebp,%ebp
je     1154 <usage+0x44>
lea    0xef9(%rip),%rdi
mov    $0xd6,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fwrite@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [53 x i8] c"Usage: erldaemon [options] -- <erlang command line>\0A\00"
@.str.1 = [215 x i8] c"\0AOptions:\0A -f run in the foreground\0A -h show this help\0A -l FILE log stdout of erlang to FILE\0A -n NAME use NAME as syslog identifier\0A -p FILE create FILE with process id\0A\00"
define void @usage(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32*, i32** %3
%11 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([215 x i8], [215 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Usage: erldaemon [options] -- <erlang command line>\0A\00"
@.str.1 = [215 x i8] c"\0AOptions:\0A -f run in the foreground\0A -h show this help\0A -l FILE log stdout of erlang to FILE\0A -n NAME use NAME as syslog identifier\0A -p FILE create FILE with process id\0A\00"
define void @usage(i32* nocapture %0, i32 %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i64 52, i64 1, i32* %0)
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([215 x i8], [215 x i8]* @.str.1, i64 0, i64 0), i64 214, i64 1, i32* %0)
br label %7
7: ; preds = %5, %2
ret void
}