#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 */

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(int die, char *error) {
  fprintf(stderr, "Usage: id [<username>]\n");
  if (error)
    fprintf(stderr, "%s\n", error);
  if (die)
    exit(die);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpq   $0x0,-0x10(%rbp)
je     116c <usage+0x4c>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpl   $0x0,-0x4(%rbp)
je     117e <usage+0x5e>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb0(%rip),%r14
mov    (%r14),%edi
lea    0xec6(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %rbx,%rbx
je     115a <usage+0x3a>
mov    (%r14),%edi
lea    0xec8(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %ebp,%ebp
jne    1163 <usage+0x43>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %ebp,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: id [<username>]\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @usage(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %4
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %9, %2
%14 = load i32, i32* %3
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %3
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %13
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: id [<username>]\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @usage(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %1, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %9
9: ; preds = %6, %2
%10 = icmp eq i32 %0, 0
br i1 %10, label %13, label %11
11: ; preds = %9
%12 = tail call i32 @exit(i32 %0)
unreachable
13: ; preds = %9
ret void
}