#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 *, ...);
int print_help(char *argv[]) {
  printf("memlab - MEMory Latency And Benchmark\n");
  printf("usage: %s  [options] [test] [test] [...]\n", argv[0]);
  printf("options:\n");
  printf("     -h     help\n");
  printf("     -p     plot (format output for gnuplot)\n");
  printf("     -q     sqlplot (format output for sqlplot)\n");
  printf("     -v     verbose (include system infos)\n");
  printf("     -rN    range N Bytes (eg. 8192, 8K, 2M, 1G)\n");
  printf("     -dN    detail for iteration: 2^N steps between Powers-of-two\n");
  printf("     -tN    create N threads\n");
  printf("tests:\n");
  printf("     lat : latency range/stride\n");
  printf("     bw  : bandwidth test\n");
  printf("     bwt : threaded bandwidth test\n");
  return 0;
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfc5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfd5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfcf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfe2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    %rdi,%rbx
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf6e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf93(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc9(%rip),%rdi
call   1030 <puts@plt>
lea    0xfda(%rip),%rdi
call   1030 <puts@plt>
lea    0xfd5(%rip),%rdi
call   1030 <puts@plt>
lea    0xfe9(%rip),%rdi
call   1030 <puts@plt>
lea    0xff7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"memlab - MEMory Latency And Benchmark\0A\00"
@.str.1 = [42 x i8] c"usage: %s [options] [test] [test] [...]\0A\00"
@.str.2 = [10 x i8] c"options:\0A\00"
@.str.3 = [18 x i8] c" -h help\0A\00"
@.str.4 = [46 x i8] c" -p plot (format output for gnuplot)\0A\00"
@.str.5 = [49 x i8] c" -q sqlplot (format output for sqlplot)\0A\00"
@.str.6 = [44 x i8] c" -v verbose (include system infos)\0A\00"
@.str.7 = [50 x i8] c" -rN range N Bytes (eg. 8192, 8K, 2M, 1G)\0A\00"
@.str.8 = [67 x i8] c" -dN detail for iteration: 2^N steps between Powers-of-two\0A\00"
@.str.9 = [30 x i8] c" -tN create N threads\0A\00"
@.str.10 = [8 x i8] c"tests:\0A\00"
@.str.11 = [33 x i8] c" lat : latency range/stride\0A\00"
@.str.12 = [27 x i8] c" bw : bandwidth test\0A\00"
@.str.13 = [36 x i8] c" bwt : threaded bandwidth test\0A\00"
define i32 @print_help(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.8, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [42 x i8] c"usage: %s [options] [test] [test] [...]\0A\00"
@str = [38 x i8] c"memlab - MEMory Latency And Benchmark\00"
@str.14 = [9 x i8] c"options:\00"
@str.15 = [17 x i8] c" -h help\00"
@str.16 = [45 x i8] c" -p plot (format output for gnuplot)\00"
@str.17 = [48 x i8] c" -q sqlplot (format output for sqlplot)\00"
@str.18 = [43 x i8] c" -v verbose (include system infos)\00"
@str.19 = [49 x i8] c" -rN range N Bytes (eg. 8192, 8K, 2M, 1G)\00"
@str.20 = [66 x i8] c" -dN detail for iteration: 2^N steps between Powers-of-two\00"
@str.21 = [29 x i8] c" -tN create N threads\00"
@str.22 = [7 x i8] c"tests:\00"
@str.23 = [32 x i8] c" lat : latency range/stride\00"
@str.24 = [26 x i8] c" bw : bandwidth test\00"
@str.25 = [35 x i8] c" bwt : threaded bandwidth test\00"
define i32 @print_help(i8** nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%3 = load i8*, i8** %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.14, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.15, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.16, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.17, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.18, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.19, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.20, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.21, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.22, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.23, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.24, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.25, i64 0, i64 0))
ret i32 0
}