#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *);
int /*<<< orphan*/ stdout;
char *strrchr(char *, char);
void usage(char *pname) {
  char *p = strrchr(pname, '/');
  p = (p) ? p + 1 : "dsync";
  static const char *usage_string =
      "\t--src=dir_name     --  source directory name\n"
      "\t--dst=dir_name     --  destination directory name\n"
      "\t--symlinks=yes|no  --  read symlinks\n"
      "\t--threads=N        --  number of worker threads\n"
      "\t--info             --  show statistic at finish\n"
      "\t--version          --  show program version\n";
  fprintf(stdout, "usage: %s [OPTIONS]\n%s", p, usage_string);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116a <usage+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    117a <usage+0x4a>
lea    0xe8f(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    117a <usage+0x4a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    0x2ea2(%rip),%rcx
lea    0xf80(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
lea    0xeb7(%rip),%rdx
cmovne %rcx,%rdx
mov    0x2e8c(%rip),%rbx
mov    (%rbx),%edi
lea    0xfc0(%rip),%rsi
lea    0xea2(%rip),%rcx
call   1040 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"dsync\00"
@usage.usage_string = internal global i8* getelementptr inbounds ([279 x i8], [279 x i8]* @.str.1, i32 0, i32 0)
@.str.1 = [279 x i8] c"\09--src=dir_name -- source directory name\0A\09--dst=dir_name -- destination directory name\0A\09--symlinks=yes|no -- read symlinks\0A\09--threads=N -- number of worker threads\0A\09--info -- show statistic at finish\0A\09--version -- show program version\0A\00"
@stdout = global i32 0
@.str.2 = [23 x i8] c"usage: %s [OPTIONS]\0A%s\00"
define void @usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %8
%13 = phi i8* [ %10, %8 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %11 ]
store i8* %13, i8** %3
%14 = load i32, i32* @stdout
%15 = load i8*, i8** %3
%16 = load i8*, i8** @usage.usage_string
%17 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %15, i8* %16)
%18 = load i32, i32* @stdout
%19 = call i32 @fflush(i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"dsync\00"
@.str.1 = [279 x i8] c"\09--src=dir_name -- source directory name\0A\09--dst=dir_name -- destination directory name\0A\09--symlinks=yes|no -- read symlinks\0A\09--threads=N -- number of worker threads\0A\09--info -- show statistic at finish\0A\09--version -- show program version\0A\00"
@stdout = global i32 0
@.str.2 = [23 x i8] c"usage: %s [OPTIONS]\0A%s\00"
define void @usage(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4
%6 = load i32, i32* @stdout
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([279 x i8], [279 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = tail call i32 @fflush(i32 %8)
ret void
}