#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 *strrchr(char *, char);
void usage(char *progpath) {
  char *progname = strrchr(progpath, '/');
  progname = (progname == NULL) ? progpath : progname + 1;
  printf("syntax:\n");
  printf("   %s -f<filename> [-s<start_address>] [-n<bytes_per_line>]\n"
         "   -f<filename>       FLEX binary file to be converted.\n"
         "   -s<start_address>  Set start address in hex. Default: Use\n"
         "                      start address from <filename> if available.\n"
         "   -n<bytes_per_line> Set number of bytes per line. Default: 32.\n",
         progname);
}


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   1040 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <usage+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1162 <usage+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x2f,%esi
call   1050 <strrchr@plt>
lea    0x1(%rax),%rbx
test   %rax,%rax
cmove  %r14,%rbx
lea    0xfe2(%rip),%rdi
call   1030 <puts@plt>
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"syntax:\0A\00"
@.str.1 = [309 x i8] c" %s -f<filename> [-s<start_address>] [-n<bytes_per_line>]\0A -f<filename> FLEX binary file to be converted.\0A -s<start_address> Set start address in hex. Default: Use\0A start address from <filename> if available.\0A -n<bytes_per_line> Set number of bytes per line. Default: 32.\0A\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 eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %2
br label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
br label %13
13: ; preds = %10, %8
%14 = phi i8* [ %9, %8 ], [ %12, %10 ]
store i8* %14, i8** %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%16 = load i8*, i8** %3
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([309 x i8], [309 x i8]* @.str.1, i64 0, i64 0), i8* %16)
ret void
}

LLVM IR (-O2):
@.str.1 = [309 x i8] c" %s -f<filename> [-s<start_address>] [-n<bytes_per_line>]\0A -f<filename> FLEX binary file to be converted.\0A -s<start_address> Set start address in hex. Default: Use\0A start address from <filename> if available.\0A -n<bytes_per_line> Set number of bytes per line. Default: 32.\0A\00"
@str = [8 x i8] c"syntax:\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* %0, i8* %4
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([309 x i8], [309 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}