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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void usage(FILE *fptr, const char *progname) {
  fprintf(fptr, "Usage: %s [-hnw]\n", progname);
  fprintf(fptr, "\n");
  fprintf(fptr, "    -h\t\tDisplay this help and exit.\n");
  fprintf(fptr, "    -f\tpath\tPath to the file to use.\n");
  fprintf(fptr, "    -l\tlength\tLength to map.\n");
  fprintf(fptr, "    -n\t\tDo Not perform the read test.\n");
  fprintf(fptr, "    -o\toffset\tOffset into file to map.\n");
  fprintf(fptr, "    -w\t\tPerform write test.\n");
  fprintf(fptr, "\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf1a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xee6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xef2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf07(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf1d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe9c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xec2(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
lea    0xeb9(%rip),%rdi
mov    $0x24,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xec5(%rip),%rdi
mov    $0x25,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xed2(%rip),%rdi
mov    $0x1d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xed7(%rip),%rdi
mov    $0x26,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xee5(%rip),%rdi
mov    $0x27,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xef4(%rip),%rdi
mov    $0x1c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Usage: %s [-hnw]\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [37 x i8] c" -h\09\09Display this help and exit.\0A\00"
@.str.3 = [38 x i8] c" -f\09path\09Path to the file to use.\0A\00"
@.str.4 = [30 x i8] c" -l\09length\09Length to map.\0A\00"
@.str.5 = [39 x i8] c" -n\09\09Do Not perform the read test.\0A\00"
@.str.6 = [40 x i8] c" -o\09offset\09Offset into file to map.\0A\00"
@.str.7 = [29 x i8] c" -w\09\09Perform write test.\0A\00"
define void @usage(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %3
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32*, i32** %3
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32*, i32** %3
%13 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%14 = load i32*, i32** %3
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%16 = load i32*, i32** %3
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
%18 = load i32*, i32** %3
%19 = call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
%20 = load i32*, i32** %3
%21 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
%22 = load i32*, i32** %3
%23 = call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Usage: %s [-hnw]\0A\00"
@.str.2 = [37 x i8] c" -h\09\09Display this help and exit.\0A\00"
@.str.3 = [38 x i8] c" -f\09path\09Path to the file to use.\0A\00"
@.str.4 = [30 x i8] c" -l\09length\09Length to map.\0A\00"
@.str.5 = [39 x i8] c" -n\09\09Do Not perform the read test.\0A\00"
@.str.6 = [40 x i8] c" -o\09offset\09Offset into file to map.\0A\00"
@.str.7 = [29 x i8] c" -w\09\09Perform write test.\0A\00"
define void @usage(i32* nocapture %0, i8* %1) {
%3 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @fputc(i32 10, i32* %0)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i64 36, i64 1, i32* %0)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i64 37, i64 1, i32* %0)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i64 29, i64 1, i32* %0)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i64 38, i64 1, i32* %0)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), i64 39, i64 1, i32* %0)
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i64 28, i64 1, i32* %0)
%11 = tail call i32 @fputc(i32 10, i32* %0)
ret void
}