#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 *outf, const char *progname) {
  fprintf(outf,
          "usage: %s [-h|-?] [-v] [-l] [-d] [-3] [-n nrruns] [-i iterations]\n",
          progname);
  fprintf(outf, "                     [-r rollout] [-a] test [test...]\n");
  fprintf(outf, "\n\t-h|-?  : this help\n");
  fprintf(outf, "\t-v     : verbose, display actual PMC counter values\n");
  fprintf(outf, "\t-l     : list all defined tests\n");
  fprintf(outf, "\t-d     : dump generated code to stdout\n");
  fprintf(outf, "\t-3     : generate code with 32-bit operands by default\n");
  fprintf(outf, "\t-6     : generate code with 64-bit operands by default\n");
  fprintf(outf, "\t-n runs: repeat each run <runs> times and average\n");
  fprintf(outf, "\t-i iter: repeat the 8 instructions <iter> times in a\n");
  fprintf(outf, "\t         loop, default is 1 million\n");
  fprintf(outf, "\t-r loop: roll out the loops <loop> times, default: 8\n");
  fprintf(outf, "\t-c file: load binary code from file and execute that\n");
  fprintf(outf, "\t-a     : run all defined tests in a row\n");
  fprintf(outf, "\ttest   : test name, can be followed by .32 or .64 to\n");
  fprintf(outf, "\t         explicitly specify the operand bitness\n");
  fprintf(outf, "\t         use -l to get list of defined tests\n");
  return;
}


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    0xf02(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf27(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf2b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf4f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf5f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf76(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf9d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xfc4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xfe6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x100b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x101f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x1044(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x1069(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x1081(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x10a6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x10c6(%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    0xed2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xf07(%rip),%rdi
mov    $0x36,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xf25(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xf22(%rip),%rdi
mov    $0x35,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xf3f(%rip),%rdi
mov    $0x21,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xf48(%rip),%rdi
mov    $0x28,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xf58(%rip),%rdi
mov    $0x38,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xf78(%rip),%rdi
mov    $0x38,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xf98(%rip),%rdi
mov    $0x33,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xfb3(%rip),%rdi
mov    $0x36,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xfd1(%rip),%rdi
mov    $0x25,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xfde(%rip),%rdi
mov    $0x36,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xffc(%rip),%rdi
mov    $0x36,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0x101a(%rip),%rdi
mov    $0x29,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0x102b(%rip),%rdi
mov    $0x36,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0x1049(%rip),%rdi
mov    $0x31,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0x1062(%rip),%rdi
mov    $0x2e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [67 x i8] c"usage: %s [-h|-?] [-v] [-l] [-d] [-3] [-n nrruns] [-i iterations]\0A\00"
@.str.1 = [55 x i8] c" [-r rollout] [-a] test [test...]\0A\00"
@.str.2 = [22 x i8] c"\0A\09-h|-? : this help\0A\00"
@.str.3 = [54 x i8] c"\09-v : verbose, display actual PMC counter values\0A\00"
@.str.4 = [34 x i8] c"\09-l : list all defined tests\0A\00"
@.str.5 = [41 x i8] c"\09-d : dump generated code to stdout\0A\00"
@.str.6 = [57 x i8] c"\09-3 : generate code with 32-bit operands by default\0A\00"
@.str.7 = [57 x i8] c"\09-6 : generate code with 64-bit operands by default\0A\00"
@.str.8 = [52 x i8] c"\09-n runs: repeat each run <runs> times and average\0A\00"
@.str.9 = [55 x i8] c"\09-i iter: repeat the 8 instructions <iter> times in a\0A\00"
@.str.10 = [38 x i8] c"\09 loop, default is 1 million\0A\00"
@.str.11 = [55 x i8] c"\09-r loop: roll out the loops <loop> times, default: 8\0A\00"
@.str.12 = [55 x i8] c"\09-c file: load binary code from file and execute that\0A\00"
@.str.13 = [42 x i8] c"\09-a : run all defined tests in a row\0A\00"
@.str.14 = [55 x i8] c"\09test : test name, can be followed by .32 or .64 to\0A\00"
@.str.15 = [50 x i8] c"\09 explicitly specify the operand bitness\0A\00"
@.str.16 = [47 x i8] c"\09 use -l to get list of defined tests\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 ([67 x i8], [67 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 ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32*, i32** %3
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32*, i32** %3
%13 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0))
%14 = load i32*, i32** %3
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%16 = load i32*, i32** %3
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
%18 = load i32*, i32** %3
%19 = call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0))
%20 = load i32*, i32** %3
%21 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.7, i64 0, i64 0))
%22 = load i32*, i32** %3
%23 = call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.8, i64 0, i64 0))
%24 = load i32*, i32** %3
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0))
%26 = load i32*, i32** %3
%27 = call i32 (i32*, i8*, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
%28 = load i32*, i32** %3
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %28, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.11, i64 0, i64 0))
%30 = load i32*, i32** %3
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.12, i64 0, i64 0))
%32 = load i32*, i32** %3
%33 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.13, i64 0, i64 0))
%34 = load i32*, i32** %3
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %34, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.14, i64 0, i64 0))
%36 = load i32*, i32** %3
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.15, i64 0, i64 0))
%38 = load i32*, i32** %3
%39 = call i32 (i32*, i8*, ...) @fprintf(i32* %38, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.16, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [67 x i8] c"usage: %s [-h|-?] [-v] [-l] [-d] [-3] [-n nrruns] [-i iterations]\0A\00"
@.str.1 = [55 x i8] c" [-r rollout] [-a] test [test...]\0A\00"
@.str.2 = [22 x i8] c"\0A\09-h|-? : this help\0A\00"
@.str.3 = [54 x i8] c"\09-v : verbose, display actual PMC counter values\0A\00"
@.str.4 = [34 x i8] c"\09-l : list all defined tests\0A\00"
@.str.5 = [41 x i8] c"\09-d : dump generated code to stdout\0A\00"
@.str.6 = [57 x i8] c"\09-3 : generate code with 32-bit operands by default\0A\00"
@.str.7 = [57 x i8] c"\09-6 : generate code with 64-bit operands by default\0A\00"
@.str.8 = [52 x i8] c"\09-n runs: repeat each run <runs> times and average\0A\00"
@.str.9 = [55 x i8] c"\09-i iter: repeat the 8 instructions <iter> times in a\0A\00"
@.str.10 = [38 x i8] c"\09 loop, default is 1 million\0A\00"
@.str.11 = [55 x i8] c"\09-r loop: roll out the loops <loop> times, default: 8\0A\00"
@.str.12 = [55 x i8] c"\09-c file: load binary code from file and execute that\0A\00"
@.str.13 = [42 x i8] c"\09-a : run all defined tests in a row\0A\00"
@.str.14 = [55 x i8] c"\09test : test name, can be followed by .32 or .64 to\0A\00"
@.str.15 = [50 x i8] c"\09 explicitly specify the operand bitness\0A\00"
@.str.16 = [47 x i8] c"\09 use -l to get list of defined tests\0A\00"
define void @usage(i32* nocapture %0, i8* %1) {
%3 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0), i64 54, i64 1, i32* %0)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i64 21, i64 1, i32* %0)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0), i64 53, i64 1, i32* %0)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i64 33, i64 1, i32* %0)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i64 40, i64 1, i32* %0)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0), i64 56, i64 1, i32* %0)
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.7, i64 0, i64 0), i64 56, i64 1, i32* %0)
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.8, i64 0, i64 0), i64 51, i64 1, i32* %0)
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0), i64 54, i64 1, i32* %0)
%13 = tail call i64 @fwrite(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0), i64 37, i64 1, i32* %0)
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.11, i64 0, i64 0), i64 54, i64 1, i32* %0)
%15 = tail call i64 @fwrite(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.12, i64 0, i64 0), i64 54, i64 1, i32* %0)
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.13, i64 0, i64 0), i64 41, i64 1, i32* %0)
%17 = tail call i64 @fwrite(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.14, i64 0, i64 0), i64 54, i64 1, i32* %0)
%18 = tail call i64 @fwrite(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.15, i64 0, i64 0), i64 49, i64 1, i32* %0)
%19 = tail call i64 @fwrite(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.16, i64 0, i64 0), i64 46, i64 1, i32* %0)
ret void
}