#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 *, char *, char *);
void usage(char *program) {
  printf(
      "%s [-o offset] [-ea]\n"
      " Usage:\n"
      "	-o|--offset offset(page unit)	Position of error injection from the "
      "first THP.\n"
      "	-e|--early-kill			Set PR_MCE_KILL_EARLY(default NOT "
      "early-kill).\n"
      "	-a|--avoid-touch		Avoid touching error page(page unit) "
      "and\n"
      "					only used when early-kill is not set.\n"
      "	-h|--help\n\n"
      " Examples:\n"
      "	1. Inject the 2nd page(4k) of THP and early killed.\n"
      "	%s -o 1 -e\n\n"
      "	2. Inject the 4th page(4k) of THP, late killed and untouched.\n"
      "	%s --offset 3 --avoid-touch\n\n"
      " Note:\n"
      "	Options				Default set\n"
      "	early-kill			no\n"
      "	offset				0(head page)\n"
      "	avoid-touch			no\n\n",
      program, program, program);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    %rcx,%rsi
mov    %rcx,%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [551 x i8] c"%s [-o offset] [-ea]\0A Usage:\0A\09-o|--offset offset(page unit)\09Position of error injection from the first THP.\0A\09-e|--early-kill\09\09\09Set PR_MCE_KILL_EARLY(default NOT early-kill).\0A\09-a|--avoid-touch\09\09Avoid touching error page(page unit) and\0A\09\09\09\09\09only used when early-kill is not set.\0A\09-h|--help\0A\0A Examples:\0A\091. Inject the 2nd page(4k) of THP and early killed.\0A\09%s -o 1 -e\0A\0A\092. Inject the 4th page(4k) of THP, late killed and untouched.\0A\09%s --offset 3 --avoid-touch\0A\0A Note:\0A\09Options\09\09\09\09Default set\0A\09early-kill\09\09\09no\0A\09offset\09\09\09\090(head page)\0A\09avoid-touch\09\09\09no\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([551 x i8], [551 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [551 x i8] c"%s [-o offset] [-ea]\0A Usage:\0A\09-o|--offset offset(page unit)\09Position of error injection from the first THP.\0A\09-e|--early-kill\09\09\09Set PR_MCE_KILL_EARLY(default NOT early-kill).\0A\09-a|--avoid-touch\09\09Avoid touching error page(page unit) and\0A\09\09\09\09\09only used when early-kill is not set.\0A\09-h|--help\0A\0A Examples:\0A\091. Inject the 2nd page(4k) of THP and early killed.\0A\09%s -o 1 -e\0A\0A\092. Inject the 4th page(4k) of THP, late killed and untouched.\0A\09%s --offset 3 --avoid-touch\0A\0A Note:\0A\09Options\09\09\09\09Default set\0A\09early-kill\09\09\09no\0A\09offset\09\09\09\090(head page)\0A\09avoid-touch\09\09\09no\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([551 x i8], [551 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0, i8* %0)
ret void
}