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

/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *, char *, ...);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  static const char *USAGE[] = {
      "Usage: %s [OPTIONS] path [arg] ...",
      "",
      "OPTIONS",
      "",
      "-a           Append to, instead of overwriting, output files. Ignored ",
      "             unless -e and/or -o are specified.",
      "-c <dir>     Set daemon's working directory to <dir>.",
      "-e <stderr>  Send daemon's stderr to file <stderr>, instead of "
      "/dev/null.",
      "-o <stdout>  Send daemon's stderr to file <stdout>, instead of "
      "/dev/null.",
      "-p <pidfile> Save PID to <pidfile>.",
      "-u <user>    Run daemon as user <user>. Requires invocation as root.",
      "-l <lockfile> Single-instance checking using lockfile <lockfile>.",
      "-v           Issue verbose messages to stdout while daemonizing"};
  int i;
  prog = basename(prog);
  fprintf(stderr, "%s, version %s\n", prog, "1.5.2");
  for (i = 0; i < sizeof(USAGE) / sizeof(const char *); i++) {
    fprintf(stderr, USAGE[i], prog);
    fputc('\n', stderr);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <basename@plt>
mov    %rax,-0x8(%rbp)
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x10ea(%rip),%rsi
lea    0x10f3(%rip),%rcx
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0xd,%rax
jae    11d4 <usage+0x94>
mov    0x2e49(%rip),%rax
mov    (%rax),%edi
movslq -0xc(%rbp),%rcx
lea    0x2eac(%rip),%rax
mov    (%rax,%rcx,8),%rsi
mov    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e26(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1182 <usage+0x42>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
call   1050 <basename@plt>
mov    %rax,%r14
mov    0x2e89(%rip),%r15
mov    (%r15),%edi
lea    0x112a(%rip),%rsi
lea    0x1133(%rip),%rcx
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe87(%rip),%r12
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15),%edi
movslq (%rbx,%r12,1),%rsi
add    %r12,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
add    $0x4,%rbx
cmp    $0x34,%rbx
jne    1180 <usage+0x40>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@usage.USAGE = internal global [13 x i8*] [i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.11, i32 0, i32 0)]
@.str = [35 x i8] c"Usage: %s [OPTIONS] path [arg] ...\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [8 x i8] c"OPTIONS\00"
@.str.3 = [71 x i8] c"-a Append to, instead of overwriting, output files. Ignored \00"
@.str.4 = [48 x i8] c" unless -e and/or -o are specified.\00"
@.str.5 = [54 x i8] c"-c <dir> Set daemon's working directory to <dir>.\00"
@.str.6 = [74 x i8] c"-e <stderr> Send daemon's stderr to file <stderr>, instead of /dev/null.\00"
@.str.7 = [74 x i8] c"-o <stdout> Send daemon's stderr to file <stdout>, instead of /dev/null.\00"
@.str.8 = [36 x i8] c"-p <pidfile> Save PID to <pidfile>.\00"
@.str.9 = [69 x i8] c"-u <user> Run daemon as user <user>. Requires invocation as root.\00"
@.str.10 = [66 x i8] c"-l <lockfile> Single-instance checking using lockfile <lockfile>.\00"
@.str.11 = [64 x i8] c"-v Issue verbose messages to stdout while daemonizing\00"
@stderr = global i32 0
@.str.12 = [16 x i8] c"%s, version %s\0A\00"
@.str.13 = [6 x i8] c"1.5.2\00"
define void @usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @basename(i8* %4)
store i8* %5, i8** %2
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0), i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
store i32 0, i32* %3
br label %9
9: ; preds = %23, %1
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = icmp ult i64 %11, 13
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load i32, i32* @stderr
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [13 x i8*], [13 x i8*]* @usage.USAGE, i64 0, i64 %16
%18 = load i8*, i8** %17
%19 = load i8*, i8** %2
%20 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %14, i8* %18, i8* %19)
%21 = load i32, i32* @stderr
%22 = call i32 @fputc(i8 signext 10, i32 %21)
br label %23
23: ; preds = %13
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %9
26: ; preds = %9
%27 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@reltable.usage = internal unnamed_addr constant [13 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([35 x i8]* @.str to i64), i64 ptrtoint ([13 x i32]* @reltable.usage to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.1 to i64), i64 ptrtoint ([13 x i32]* @reltable.usage to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.2 to i64), i64 ptrtoint ([13 x i32]* @reltable.usage to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.1 to i64), i64 ptrtoint ([13 x i32]* @reltable.usage to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([71 x i8]* @.str.3 to i64), i64 ptrtoint ([13 x i32]* @reltable.usage to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([48 x i8]* @.str.4 to i64), i64 ptrtoint ([13 x i32]* @reltable.usage to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([54 x i8]* @.str.5 to i64), i64 ptrtoint ([13 x i32]* @reltable.usage to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([74 x i8]* @.str.6 to i64), i64 ptrtoint ([13 x i32]* @reltable.usage to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([74 x i8]* @.str.7 to i64), i64 ptrtoint ([13 x i32]* @reltable.usage to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([36 x i8]* @.str.8 to i64), i64 ptrtoint ([13 x i32]* @reltable.usage to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([69 x i8]* @.str.9 to i64), i64 ptrtoint ([13 x i32]* @reltable.usage to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([66 x i8]* @.str.10 to i64), i64 ptrtoint ([13 x i32]* @reltable.usage to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([64 x i8]* @.str.11 to i64), i64 ptrtoint ([13 x i32]* @reltable.usage to i64)) to i32)]
@.str = [35 x i8] c"Usage: %s [OPTIONS] path [arg] ...\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [8 x i8] c"OPTIONS\00"
@.str.3 = [71 x i8] c"-a Append to, instead of overwriting, output files. Ignored \00"
@.str.4 = [48 x i8] c" unless -e and/or -o are specified.\00"
@.str.5 = [54 x i8] c"-c <dir> Set daemon's working directory to <dir>.\00"
@.str.6 = [74 x i8] c"-e <stderr> Send daemon's stderr to file <stderr>, instead of /dev/null.\00"
@.str.7 = [74 x i8] c"-o <stdout> Send daemon's stderr to file <stdout>, instead of /dev/null.\00"
@.str.8 = [36 x i8] c"-p <pidfile> Save PID to <pidfile>.\00"
@.str.9 = [69 x i8] c"-u <user> Run daemon as user <user>. Requires invocation as root.\00"
@.str.10 = [66 x i8] c"-l <lockfile> Single-instance checking using lockfile <lockfile>.\00"
@.str.11 = [64 x i8] c"-v Issue verbose messages to stdout while daemonizing\00"
@stderr = global i32 0
@.str.12 = [16 x i8] c"%s, version %s\0A\00"
@.str.13 = [6 x i8] c"1.5.2\00"
define void @usage(i8* %0) {
%2 = tail call i8* @basename(i8* %0)
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
br label %5
5: ; preds = %1, %5
%6 = phi i64 [ 0, %1 ], [ %13, %5 ]
%7 = load i32, i32* @stderr
%8 = shl i64 %6, 2
%9 = call i8* @llvm.load.relative.i64(i8* bitcast ([13 x i32]* @reltable.usage to i8*), i64 %8)
%10 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %7, i8* %9, i8* %2)
%11 = load i32, i32* @stderr
%12 = tail call i32 @fputc(i8 signext 10, i32 %11)
%13 = add nuw nsw i64 %6, 1
%14 = icmp eq i64 %13, 13
br i1 %14, label %15, label %5
15: ; preds = %5
%16 = tail call i32 @exit(i32 1)
unreachable
}