#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*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv[]) {
  char *cmd = "privmap";
  if (argv && argv[0])
    cmd = argv[0];
  fprintf(
      stderr,
      "usage: %s [opts]\n"
      "\n"
      "supported options:\n"
      "-g <gid> \tshow only processes with the specified group id or name\n"
      "-p <pid> \tshow only processes with the specified process id or name\n"
      "-u <uid> \tshow only processes with the specified user id or name\n"
      "-s \tshow privileges for itself too (defaults to hiding itself)\n",
      cmd);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <usage+0x3b>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114b <usage+0x3b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
test   %rdi,%rdi
je     1128 <usage+0x18>
mov    (%rdi),%rax
test   %rax,%rax
lea    0xede(%rip),%rdx
cmovne %rax,%rdx
jmp    112f <usage+0x1f>
lea    0xed1(%rip),%rdx
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"privmap\00"
@stderr = global i32 0
@.str.1 = [300 x i8] c"usage: %s [opts]\0A\0Asupported options:\0A-g <gid> \09show only processes with the specified group id or name\0A-p <pid> \09show only processes with the specified process id or name\0A-u <uid> \09show only processes with the specified user id or name\0A-s \09show privileges for itself too (defaults to hiding itself)\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8**, i8*** %2
%5 = icmp ne i8** %4, null
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8**, i8*** %2
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = load i8**, i8*** %2
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
store i8* %14, i8** %3
br label %15
15: ; preds = %11, %6, %1
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %3
%18 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([300 x i8], [300 x i8]* @.str.1, i64 0, i64 0), i8* %17)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"privmap\00"
@stderr = global i32 0
@.str.1 = [300 x i8] c"usage: %s [opts]\0A\0Asupported options:\0A-g <gid> \09show only processes with the specified group id or name\0A-p <pid> \09show only processes with the specified process id or name\0A-u <uid> \09show only processes with the specified user id or name\0A-s \09show privileges for itself too (defaults to hiding itself)\0A\00"
define void @usage(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
%6 = select i1 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4
br label %7
7: ; preds = %3, %1
%8 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %1 ], [ %6, %3 ]
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([300 x i8], [300 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret void
}