#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 *, ...);
void usage(const char *prgname, int full_info, int options) {
  printf(
      "testmyram "
      "0.1"
      " -- Simple RAM testing program\nCopyright (C) 2011  Robert Homann\n\n");
  if (full_info)
    printf(
        "This program is free software; you can redistribute it and/or modify "
        "it under\nthe terms of the GNU General Public License as published by "
        "the Free Software\nFoundation; either version 2, or (at your option) "
        "any later version.\n\nThis program is distributed in the hope that it "
        "will be useful, but WITHOUT\nANY WARRANTY; without even the implied "
        "warranty of MERCHANTABILITY or FITNESS\nFOR A PARTICULAR PURPOSE. See "
        "the GNU General Public License for more details.\nYou should have "
        "received a copy of the GNU General Public License along with\nthis "
        "program (see the file COPYING); if not, write to the Free "
        "Software\nFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA  "
        "02111-1307, USA.\n\nGet the latest version from "
        "https://github.com/rhomann/testmyram"
        "\n");
  else
    printf("This program is distributed in the hope that it will be useful, "
           "but WITHOUT\nANY WARRANTY; without even the implied warranty of "
           "MERCHANTABILITY or FITNESS\nFOR A PARTICULAR PURPOSE. See "
           "testmyram -V for details and license information.\n");
  if (options)
    printf("\nUsage: %s [options]\n\nOptions:\n-n num   Number of memory "
           "blocks (default: 10).\n-s size  Size per memory block (default: 1 "
           "MiB).\n-d sec   Number of seconds to wait between write and read "
           "phase (default: 0).\n-r iter  Number of read iterations after "
           "writing (default: 1).\n-i iter  Number of iterations (default: "
           "unlimited).\n-j num   Number of checks running in parallel "
           "(default: 1). Parameters above\n         are per thread.\n-v       "
           "Verbose execution.\n-V       Show version and license "
           "information.\n-h       This help screen.\n",
           prgname);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
je     114d <usage+0x3d>
lea    0xf0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115b <usage+0x4b>
lea    0x11eb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x10(%rbp)
je     1177 <usage+0x67>
mov    -0x8(%rbp),%rsi
lea    0x12ba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x10dc(%rip),%rdi
call   1030 <puts@plt>
test   %ebx,%ebx
lea    0x111d(%rip),%rax
lea    0x1200(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
test   %ebp,%ebp
je     1169 <usage+0x49>
lea    0xea5(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [80 x i8] c"testmyram 0.1 -- Simple RAM testing program\0ACopyright (C) 2011 Robert Homann\0A\0A\00"
@.str.1 = [751 x i8] c"This program is free software; you can redistribute it and/or modify it under\0Athe terms of the GNU General Public License as published by the Free Software\0AFoundation; either version 2, or (at your option) any later version.\0A\0AThis program is distributed in the hope that it will be useful, but WITHOUT\0AANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\0AFOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\0AYou should have received a copy of the GNU General Public License along with\0Athis program (see the file COPYING); if not, write to the Free Software\0AFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\0A\0AGet the latest version from https://github.com/rhomann/testmyram\0A\00"
@.str.2 = [235 x i8] c"This program is distributed in the hope that it will be useful, but WITHOUT\0AANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\0AFOR A PARTICULAR PURPOSE. See testmyram -V for details and license information.\0A\00"
@.str.3 = [526 x i8] c"\0AUsage: %s [options]\0A\0AOptions:\0A-n num Number of memory blocks (default: 10).\0A-s size Size per memory block (default: 1 MiB).\0A-d sec Number of seconds to wait between write and read phase (default: 0).\0A-r iter Number of read iterations after writing (default: 1).\0A-i iter Number of iterations (default: unlimited).\0A-j num Number of checks running in parallel (default: 1). Parameters above\0A are per thread.\0A-v Verbose execution.\0A-V Show version and license information.\0A-h This help screen.\0A\00"
define void @usage(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([751 x i8], [751 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([235 x i8], [235 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %6
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i8*, i8** %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([526 x i8], [526 x i8]* @.str.3, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %17, %14
ret void
}

LLVM IR (-O2):
@.str.3 = [526 x i8] c"\0AUsage: %s [options]\0A\0AOptions:\0A-n num Number of memory blocks (default: 10).\0A-s size Size per memory block (default: 1 MiB).\0A-d sec Number of seconds to wait between write and read phase (default: 0).\0A-r iter Number of read iterations after writing (default: 1).\0A-i iter Number of iterations (default: unlimited).\0A-j num Number of checks running in parallel (default: 1). Parameters above\0A are per thread.\0A-v Verbose execution.\0A-V Show version and license information.\0A-h This help screen.\0A\00"
@str = [79 x i8] c"testmyram 0.1 -- Simple RAM testing program\0ACopyright (C) 2011 Robert Homann\0A\00"
@str.4 = [234 x i8] c"This program is distributed in the hope that it will be useful, but WITHOUT\0AANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\0AFOR A PARTICULAR PURPOSE. See testmyram -V for details and license information.\00"
@str.5 = [750 x i8] c"This program is free software; you can redistribute it and/or modify it under\0Athe terms of the GNU General Public License as published by the Free Software\0AFoundation; either version 2, or (at your option) any later version.\0A\0AThis program is distributed in the hope that it will be useful, but WITHOUT\0AANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\0AFOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\0AYou should have received a copy of the GNU General Public License along with\0Athis program (see the file COPYING); if not, write to the Free Software\0AFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\0A\0AGet the latest version from https://github.com/rhomann/testmyram\00"
define void @usage(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str, i64 0, i64 0))
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i8* getelementptr inbounds ([234 x i8], [234 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([750 x i8], [750 x i8]* @str.5, i64 0, i64 0)
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
%8 = icmp eq i32 %2, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([526 x i8], [526 x i8]* @.str.3, i64 0, i64 0), i8* %0)
br label %11
11: ; preds = %9, %3
ret void
}