#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*/ printf(char *, char *);
char *strrchr(char *, char);
void yar_server_print_usage(char *argv0) {
  char *prog = strrchr(argv0, '/');
  if (prog) {
    prog++;
  } else {
    prog = "yar";
  }
  printf("Usage: %s -S <host>:<port> -n <workers number>\n"
         "\n"
         "    -S <host>:<port>  Run yar at host:port\n"
         "    -n <workers num>  How many workers\n"
         "    -K <restart|stop> \n"
         "    -h                help\n",
         prog);
  return;
}


x86 assembly (clang, -O0):
<yar_server_print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115a <yar_server_print_usage+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1165 <yar_server_print_usage+0x45>
lea    0xe9f(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yar_server_print_usage>:
push   %rax
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
lea    0xec7(%rip),%rsi
cmovne %rcx,%rsi
lea    0xec0(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"yar\00"
@.str.1 = [181 x i8] c"Usage: %s -S <host>:<port> -n <workers number>\0A\0A -S <host>:<port> Run yar at host:port\0A -n <workers num> How many workers\0A -K <restart|stop> \0A -h help\0A\00"
define void @yar_server_print_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, i32 1
store i8* %10, i8** %3
br label %12
11: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %3
br label %12
12: ; preds = %11, %8
%13 = load i8*, i8** %3
%14 = call i32 @printf(i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"yar\00"
@.str.1 = [181 x i8] c"Usage: %s -S <host>:<port> -n <workers number>\0A\0A -S <host>:<port> Run yar at host:port\0A -n <workers num> How many workers\0A -K <restart|stop> \0A -h help\0A\00"
define void @yar_server_print_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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}