#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*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void usage_print(char *message) {
  FILE *out;
  if (message) {
    fprintf(stderr, "ERROR: %s.\n", message);
  }
  out = message ? stderr : stdout;
  fprintf(out, "\nUSAGE: 2048 [OPTIONS...]\n");
  fprintf(out, "      --help             Display this help text.\n");
  fprintf(out, "      --legal            Display legal information.\n");
  fprintf(out, "  -m, --mode <mode>      Select output mode.\n");
  fprintf(out, "  -s, --seed <unsigned>  Use specified seed for pseudo-random "
               "number generation.\n");
  fprintf(out, "      --version          Output version information and "
               "exit.\n\n");
  fprintf(out, "<mode> is one of:\n");
  fprintf(out, "\tformat - Dynamic input and pretty output.\n");
  fprintf(out, "\tplain - Line-by-line input and just dump output.\n");
  if (message) {
    exit(EXIT_FAILURE);
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <usage_print+0x33>
mov    0x2ea2(%rip),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeb4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1171 <usage_print+0x51>
mov    0x2e7b(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    117f <usage_print+0x5f>
mov    0x2e58(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe7a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe83(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xea3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xf22(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xf50(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xf51(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xf6b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1242 <usage_print+0x122>
mov    0x2d9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    0x2d7f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage_print>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
je     1157 <usage_print+0x27>
mov    0x2e9d(%rip),%rax
mov    (%rax),%rdi
lea    0xeb3(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %r14,%r14
jne    1165 <usage_print+0x35>
mov    0x2e6d(%rip),%rax
jmp    116c <usage_print+0x3c>
mov    0x2e74(%rip),%rax
mov    (%rax),%rbx
lea    0xe96(%rip),%rdi
mov    $0x1a,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xe98(%rip),%rdi
mov    $0x31,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xeb1(%rip),%rdi
mov    $0x34,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xecd(%rip),%rdi
mov    $0x2d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xee2(%rip),%rdi
mov    $0x51,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xf1b(%rip),%rdi
mov    $0x3f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xf42(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xf3c(%rip),%rdi
mov    $0x2b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xf4f(%rip),%rdi
mov    $0x32,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
test   %r14,%r14
jne    1263 <usage_print+0x133>
mov    0x2d6c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    0x2d6e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@.str = [12 x i8] c"ERROR: %s.\0A\00"
@stdout = global i32* null
@.str.1 = [27 x i8] c"\0AUSAGE: 2048 [OPTIONS...]\0A\00"
@.str.2 = [50 x i8] c" --help Display this help text.\0A\00"
@.str.3 = [53 x i8] c" --legal Display legal information.\0A\00"
@.str.4 = [46 x i8] c" -m, --mode <mode> Select output mode.\0A\00"
@.str.5 = [82 x i8] c" -s, --seed <unsigned> Use specified seed for pseudo-random number generation.\0A\00"
@.str.6 = [64 x i8] c" --version Output version information and exit.\0A\0A\00"
@.str.7 = [19 x i8] c"<mode> is one of:\0A\00"
@.str.8 = [44 x i8] c"\09format - Dynamic input and pretty output.\0A\00"
@.str.9 = [51 x i8] c"\09plain - Line-by-line input and just dump output.\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define void @usage_print(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32*, i32** @stderr
%8 = load i8*, i8** %2
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %6, %1
%11 = load i8*, i8** %2
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32*, i32** @stderr
br label %17
15: ; preds = %10
%16 = load i32*, i32** @stdout
br label %17
17: ; preds = %15, %13
%18 = phi i32* [ %14, %13 ], [ %16, %15 ]
store i32* %18, i32** %3
%19 = load i32*, i32** %3
%20 = call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32*, i32** %3
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%23 = load i32*, i32** %3
%24 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%25 = load i32*, i32** %3
%26 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
%27 = load i32*, i32** %3
%28 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.5, i64 0, i64 0))
%29 = load i32*, i32** %3
%30 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.6, i64 0, i64 0))
%31 = load i32*, i32** %3
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%33 = load i32*, i32** %3
%34 = call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
%35 = load i32*, i32** %3
%36 = call i32 (i32*, i8*, ...) @fprintf(i32* %35, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0))
%37 = load i8*, i8** %2
%38 = icmp ne i8* %37, null
br i1 %38, label %39, label %42
39: ; preds = %17
%40 = load i32, i32* @EXIT_FAILURE
%41 = call i32 @exit(i32 %40)
unreachable
42: ; preds = %17
%43 = load i32, i32* @EXIT_SUCCESS
%44 = call i32 @exit(i32 %43)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@.str = [12 x i8] c"ERROR: %s.\0A\00"
@stdout = global i32* null
@.str.1 = [27 x i8] c"\0AUSAGE: 2048 [OPTIONS...]\0A\00"
@.str.2 = [50 x i8] c" --help Display this help text.\0A\00"
@.str.3 = [53 x i8] c" --legal Display legal information.\0A\00"
@.str.4 = [46 x i8] c" -m, --mode <mode> Select output mode.\0A\00"
@.str.5 = [82 x i8] c" -s, --seed <unsigned> Use specified seed for pseudo-random number generation.\0A\00"
@.str.6 = [64 x i8] c" --version Output version information and exit.\0A\0A\00"
@.str.7 = [19 x i8] c"<mode> is one of:\0A\00"
@.str.8 = [44 x i8] c"\09format - Dynamic input and pretty output.\0A\00"
@.str.9 = [51 x i8] c"\09plain - Line-by-line input and just dump output.\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define void @usage_print(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32*, i32** @stderr
%5 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %3, %1
%7 = load i32*, i32** @stderr
%8 = load i32*, i32** @stdout
%9 = select i1 %2, i32* %8, i32* %7
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i64 26, i64 1, i32* %9)
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i64 49, i64 1, i32* %9)
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i64 52, i64 1, i32* %9)
%13 = tail call i64 @fwrite(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i64 45, i64 1, i32* %9)
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.5, i64 0, i64 0), i64 81, i64 1, i32* %9)
%15 = tail call i64 @fwrite(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.6, i64 0, i64 0), i64 63, i64 1, i32* %9)
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i64 18, i64 1, i32* %9)
%17 = tail call i64 @fwrite(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i64 43, i64 1, i32* %9)
%18 = tail call i64 @fwrite(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0), i64 50, i64 1, i32* %9)
br i1 %2, label %22, label %19
19: ; preds = %6
%20 = load i32, i32* @EXIT_FAILURE
%21 = tail call i32 @exit(i32 %20)
unreachable
22: ; preds = %6
%23 = load i32, i32* @EXIT_SUCCESS
%24 = tail call i32 @exit(i32 %23)
unreachable
}