#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 ex) {
  fprintf(stderr, "usage: getpwent -h\n"
                  "usage: getpwent [-FNdgnpsu] USER\n");
  if (ex != 0)
    exit(ex);
  fprintf(stderr,
          "\n"
          "Display passwd(5) info for a user\n"
          "\n"
          "  Options:\n"
          "    -h                Display this message\n"
          "    -F                Omit field names from output\n"
          "    -N                USER is user id, not name\n"
          "    -d                Display home directory\n"
          "    -g                Display primary group id\n"
          "    -n                Display user name\n"
          "    -p                Display encrypted password\n"
          "    -q                No error message for nonexistent user\n"
          "    -s                Display login shell\n"
          "    -u                Display user id\n"
          "  Operands:\n"
          "    USER              Display information for USER\n");
  exit(ex);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x0,-0x4(%rbp)
je     1152 <usage+0x32>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb3(%rip),%r14
mov    (%r14),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
test   %ebx,%ebx
jne    1156 <usage+0x36>
mov    (%r14),%edi
lea    0xeeb(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"usage: getpwent -h\0Ausage: getpwent [-FNdgnpsu] USER\0A\00"
@.str.1 = [574 x i8] c"\0ADisplay passwd(5) info for a user\0A\0A Options:\0A -h Display this message\0A -F Omit field names from output\0A -N USER is user id, not name\0A -d Display home directory\0A -g Display primary group id\0A -n Display user name\0A -p Display encrypted password\0A -q No error message for nonexistent user\0A -s Display login shell\0A -u Display user id\0A Operands:\0A USER Display information for USER\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([574 x i8], [574 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* %2
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"usage: getpwent -h\0Ausage: getpwent [-FNdgnpsu] USER\0A\00"
@.str.1 = [574 x i8] c"\0ADisplay passwd(5) info for a user\0A\0A Options:\0A -h Display this message\0A -F Omit field names from output\0A -N USER is user id, not name\0A -d Display home directory\0A -g Display primary group id\0A -n Display user name\0A -p Display encrypted password\0A -q No error message for nonexistent user\0A -s Display login shell\0A -u Display user id\0A Operands:\0A USER Display information for USER\0A\00"
define void @usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @exit(i32 %0)
unreachable
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([574 x i8], [574 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @exit(i32 0)
unreachable
}