#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 EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void usage(char *prg, int full, int exit_status) {
  FILE *out = (exit_status == EXIT_SUCCESS) ? stdout : stderr;
  fprintf(out, "usage: %s <command> [<args>]\n\n", prg);
  if (full) {
    fprintf(out, "commands:\n");
    fprintf(out, "   init <input.ecs>     Initialize echochamber scene\n");
    fprintf(out, "   run <input.ecs>      Run path tracer\n");
    fprintf(out, "   mixdown <input.ecs>  Create a mixdown\n");
    fprintf(out, "   help [<command>]     Get help!\n");
  }
  exit(exit_status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    0x2e94(%rip),%rcx
cmp    (%rcx),%eax
jne    1157 <usage+0x37>
mov    0x2e8d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1165 <usage+0x45>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe84(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpl   $0x0,-0xc(%rbp)
je     11e7 <usage+0xc7>
mov    -0x18(%rbp),%rdi
lea    0xe87(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe80(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xea4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xed3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rdx
mov    0x2e8d(%rip),%rax
cmp    %r14d,(%rax)
jne    1151 <usage+0x21>
mov    0x2e89(%rip),%rax
jmp    1158 <usage+0x28>
mov    0x2e88(%rip),%rax
mov    (%rax),%rbx
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %ebp,%ebp
je     11ed <usage+0xbd>
lea    0xea8(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xe9a(%rip),%rdi
mov    $0x35,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xeb7(%rip),%rdi
mov    $0x28,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xec7(%rip),%rdi
mov    $0x29,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xed8(%rip),%rdi
mov    $0x22,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %r14d,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@stderr = global i32* null
@.str = [31 x i8] c"usage: %s <command> [<args>]\0A\0A\00"
@.str.1 = [11 x i8] c"commands:\0A\00"
@.str.2 = [54 x i8] c" init <input.ecs> Initialize echochamber scene\0A\00"
@.str.3 = [41 x i8] c" run <input.ecs> Run path tracer\0A\00"
@.str.4 = [42 x i8] c" mixdown <input.ecs> Create a mixdown\0A\00"
@.str.5 = [35 x i8] c" help [<command>] Get help!\0A\00"
define void @usage(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* @EXIT_SUCCESS
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32*, i32** @stdout
br label %15
13: ; preds = %3
%14 = load i32*, i32** @stderr
br label %15
15: ; preds = %13, %11
%16 = phi i32* [ %12, %11 ], [ %14, %13 ]
store i32* %16, i32** %7
%17 = load i32*, i32** %7
%18 = load i8*, i8** %4
%19 = call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = load i32, i32* %5
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %33
22: ; preds = %15
%23 = load i32*, i32** %7
%24 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%25 = load i32*, i32** %7
%26 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%27 = load i32*, i32** %7
%28 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%29 = load i32*, i32** %7
%30 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%31 = load i32*, i32** %7
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
br label %33
33: ; preds = %22, %15
%34 = load i32, i32* %6
%35 = call i32 @exit(i32 %34)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@stderr = global i32* null
@.str = [31 x i8] c"usage: %s <command> [<args>]\0A\0A\00"
@.str.1 = [11 x i8] c"commands:\0A\00"
@.str.2 = [54 x i8] c" init <input.ecs> Initialize echochamber scene\0A\00"
@.str.3 = [41 x i8] c" run <input.ecs> Run path tracer\0A\00"
@.str.4 = [42 x i8] c" mixdown <input.ecs> Create a mixdown\0A\00"
@.str.5 = [35 x i8] c" help [<command>] Get help!\0A\00"
define void @usage(i8* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @EXIT_SUCCESS
%5 = icmp eq i32 %4, %2
%6 = load i32*, i32** @stdout
%7 = load i32*, i32** @stderr
%8 = select i1 %5, i32* %6, i32* %7
%9 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%10 = icmp eq i32 %1, 0
br i1 %10, label %17, label %11
11: ; preds = %3
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i64 10, i64 1, i32* %8)
%13 = tail call i64 @fwrite(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i64 53, i64 1, i32* %8)
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i64 40, i64 1, i32* %8)
%15 = tail call i64 @fwrite(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i64 41, i64 1, i32* %8)
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i64 34, i64 1, i32* %8)
br label %17
17: ; preds = %11, %3
%18 = tail call i32 @exit(i32 %2)
unreachable
}