#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*/ printf(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
char *strrchr(char *, char);
void usage(char *argv0, int help) {
  char *progname = strrchr(argv0, '/');
  if (progname == NULL)
    progname = argv0;
  fprintf(help ? stdout : stderr, "Usage: %s [flags] file[s]\n", progname);
  if (!help) {
    fprintf(stderr, "   or try '-h' for help\n");
    exit(1);
  }
  printf("Check given files have...\n");
  printf(" -p    permission       file must have required permissions\n");
  printf(" -t    dir|file|link    file must be of the specified type\n");
  printf(" -l    link_name        file must be a link to the given name\n");
  printf(" -s    size             file must have the given size\n");
  printf(" -u    user             file must be owned by given user\n");
  printf(" -g    group            file must be owned by given group\n");
  printf(" -f                     follow symlinks\n");
  printf(" -a                     file must be absent\n");
  printf(" -v                     increase verbosity\n");
  printf(" -h                     print help\n");
  printf(" Exit status is 0 on success, 1 on failure\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1174 <usage+0x34>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     118f <usage+0x4f>
mov    0x2e53(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    119b <usage+0x5b>
mov    0x2e4a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
lea    0xe57(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmpl   $0x0,-0xc(%rbp)
jne    11db <usage+0x9b>
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
lea    0xe51(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
call   1030 <printf@plt>
lea    0xf4e(%rip),%rdi
call   1030 <printf@plt>
lea    0xf7d(%rip),%rdi
call   1030 <printf@plt>
lea    0xf9a(%rip),%rdi
call   1030 <printf@plt>
lea    0xfbb(%rip),%rdi
call   1030 <printf@plt>
lea    0xfdb(%rip),%rdi
call   1030 <printf@plt>
lea    0xff3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
cmove  %rbx,%rax
test   %ebp,%ebp
jne    1166 <usage+0x26>
mov    0x2e7c(%rip),%rcx
jmp    116d <usage+0x2d>
mov    0x2e6b(%rip),%rcx
mov    (%rcx),%edi
lea    0xe8a(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %ebp,%ebp
je     121e <usage+0xde>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf12(%rip),%rdi
call   1030 <puts@plt>
lea    0xf44(%rip),%rdi
call   1030 <puts@plt>
lea    0xf6e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf9b(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc9(%rip),%rdi
call   1030 <puts@plt>
lea    0xfe5(%rip),%rdi
call   1030 <puts@plt>
lea    0x1005(%rip),%rdi
call   1030 <puts@plt>
lea    0x1024(%rip),%rdi
call   1030 <puts@plt>
lea    0x103b(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <puts@plt>
mov    0x2dbb(%rip),%rax
mov    (%rax),%edi
lea    0xded(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@.str = [27 x i8] c"Usage: %s [flags] file[s]\0A\00"
@.str.1 = [25 x i8] c" or try '-h' for help\0A\00"
@.str.2 = [27 x i8] c"Check given files have...\0A\00"
@.str.3 = [61 x i8] c" -p permission file must have required permissions\0A\00"
@.str.4 = [60 x i8] c" -t dir|file|link file must be of the specified type\0A\00"
@.str.5 = [63 x i8] c" -l link_name file must be a link to the given name\0A\00"
@.str.6 = [55 x i8] c" -s size file must have the given size\0A\00"
@.str.7 = [58 x i8] c" -u user file must be owned by given user\0A\00"
@.str.8 = [59 x i8] c" -g group file must be owned by given group\0A\00"
@.str.9 = [41 x i8] c" -f follow symlinks\0A\00"
@.str.10 = [45 x i8] c" -a file must be absent\0A\00"
@.str.11 = [44 x i8] c" -v increase verbosity\0A\00"
@.str.12 = [36 x i8] c" -h print help\0A\00"
@.str.13 = [44 x i8] c" Exit status is 0 on success, 1 on failure\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i8* @strrchr(i8* %6, i8 signext 47)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i8*, i8** %3
store i8* %11, i8** %5
br label %12
12: ; preds = %10, %2
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = load i32, i32* @stdout
br label %19
17: ; preds = %12
%18 = load i32, i32* @stderr
br label %19
19: ; preds = %17, %15
%20 = phi i32 [ %16, %15 ], [ %18, %17 ]
%21 = load i8*, i8** %5
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = load i32, i32* %4
%24 = icmp ne i32 %23, 0
br i1 %24, label %29, label %25
25: ; preds = %19
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %19
%30 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%31 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
%32 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
%33 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.5, i64 0, i64 0))
%34 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0))
%35 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0))
%36 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.8, i64 0, i64 0))
%37 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0))
%38 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.10, i64 0, i64 0))
%39 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0))
%40 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0))
%41 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.13, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [27 x i8] c"Usage: %s [flags] file[s]\0A\00"
@.str.1 = [25 x i8] c" or try '-h' for help\0A\00"
@str = [26 x i8] c"Check given files have...\00"
@str.14 = [60 x i8] c" -p permission file must have required permissions\00"
@str.15 = [59 x i8] c" -t dir|file|link file must be of the specified type\00"
@str.16 = [62 x i8] c" -l link_name file must be a link to the given name\00"
@str.17 = [54 x i8] c" -s size file must have the given size\00"
@str.18 = [57 x i8] c" -u user file must be owned by given user\00"
@str.19 = [58 x i8] c" -g group file must be owned by given group\00"
@str.20 = [40 x i8] c" -f follow symlinks\00"
@str.21 = [44 x i8] c" -a file must be absent\00"
@str.22 = [43 x i8] c" -v increase verbosity\00"
@str.23 = [35 x i8] c" -h print help\00"
@str.24 = [43 x i8] c" Exit status is 0 on success, 1 on failure\00"
define void @usage(i8* %0, i32 %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* %0, i8* %3
%6 = icmp eq i32 %1, 0
%7 = load i32, i32* @stdout
%8 = load i32, i32* @stderr
%9 = select i1 %6, i32 %8, i32 %7
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %5)
br i1 %6, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%14 = tail call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.14, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.15, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.16, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.17, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.18, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.19, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.20, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.21, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.22, i64 0, i64 0))
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.23, i64 0, i64 0))
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.24, i64 0, i64 0))
ret void
}