#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*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void usage(int exit_status) {
  FILE *out = NULL;
  if (exit_status == EXIT_SUCCESS)
    out = stdout;
  else
    out = stderr;
  fprintf(out, "usage: pid1 [OPTIONS] <PROGRAM> [<ARG>, ...]\n"
               "\n"
               "  -m, --mount           unshare mounts namespace\n"
               "  -i, --ipc             unshare IPC namespace\n"
               "  -p, --pid             unshare PID namespace\n"
               "  ---propagation slave|shared|private|unchanged\n"
               "                        propagation mode, default shared\n"
               "  -c, --closefrom FD    Close all filedescriptors from and\n"
               "                        including FD\n");
  fflush(out);
  exit(exit_status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%eax
jne    1168 <usage+0x38>
mov    0x2e7c(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    1176 <usage+0x46>
mov    0x2e71(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe7f(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    0x2e94(%rip),%rax
cmp    %edi,(%rax)
jne    1149 <usage+0x19>
mov    0x2e91(%rip),%rax
jmp    1150 <usage+0x20>
mov    0x2e90(%rip),%rax
mov    (%rax),%rbx
lea    0xea6(%rip),%rdi
mov    $0x184,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fflush@plt>
mov    %ebp,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@stderr = global i32* null
@.str = [389 x i8] c"usage: pid1 [OPTIONS] <PROGRAM> [<ARG>, ...]\0A\0A -m, --mount unshare mounts namespace\0A -i, --ipc unshare IPC namespace\0A -p, --pid unshare PID namespace\0A ---propagation slave|shared|private|unchanged\0A propagation mode, default shared\0A -c, --closefrom FD Close all filedescriptors from and\0A including FD\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
store i32* null, i32** %3
%4 = load i32, i32* %2
%5 = load i32, i32* @EXIT_SUCCESS
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32*, i32** @stdout
store i32* %8, i32** %3
br label %11
9: ; preds = %1
%10 = load i32*, i32** @stderr
store i32* %10, i32** %3
br label %11
11: ; preds = %9, %7
%12 = load i32*, i32** %3
%13 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([389 x i8], [389 x i8]* @.str, i64 0, i64 0))
%14 = load i32*, i32** %3
%15 = call i32 @fflush(i32* %14)
%16 = load i32, i32* %2
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@stderr = global i32* null
@.str = [389 x i8] c"usage: pid1 [OPTIONS] <PROGRAM> [<ARG>, ...]\0A\0A -m, --mount unshare mounts namespace\0A -i, --ipc unshare IPC namespace\0A -p, --pid unshare PID namespace\0A ---propagation slave|shared|private|unchanged\0A propagation mode, default shared\0A -c, --closefrom FD Close all filedescriptors from and\0A including FD\0A\00"
define void @usage(i32 %0) {
%2 = load i32, i32* @EXIT_SUCCESS
%3 = icmp eq i32 %2, %0
%4 = load i32*, i32** @stdout
%5 = load i32*, i32** @stderr
%6 = select i1 %3, i32* %4, i32* %5
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([389 x i8], [389 x i8]* @.str, i64 0, i64 0), i64 388, i64 1, i32* %6)
%8 = tail call i32 @fflush(i32* %6)
%9 = tail call i32 @exit(i32 %0)
unreachable
}