#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() {
  printf("memgobble\n");
  printf("memgobble [options]\n");
  printf("List of options:\n");
  printf("\t-h                   : Display usage\n");
  printf("\t-v                   : Switch verbose off\n");
  printf("\t-p <locality count>  : Maximum locality the system will run\n");
  printf("\t-l <upper limit>     : Set the upper bound of alloc request\n");
  printf("\t-e <Execution time>  : Execution time of each locality in Ms\n");
  printf("\t-M <pages>           : Maximum allocation in pages per phase\n");
  printf("\t-s <speed>           : Speed at which memory is gobbled\n");
  printf("\t\t speed: 0-n, Higher the value faster the memory exhaustion\n");
  printf("\t-t <access-type>     : Access type of the locality\n");
  printf("\t\t access-type:\n");
  printf("\t\t\t0: Fix memory access pattern\n");
  printf("\t\t\t1: Stride memory access pattern\n");
  printf("\t\t\t2: Sequential memory access pattern\n");
  printf("\t\t\t3: Repeat memory access pattern\n");
  printf("\t\t\t4: Random memory access pattern\n");
  printf("\t-V <File name>	: Vector of localities\n");
  printf("\t-I		: Vector is IPFVT\n");
  printf("\t if CUSTOM_LINUX_KERNEL defined, then\n");
  printf("\t\t -S <STMA Count>	: STMA Value\n");
  printf("\t\t -L <LTMA Count>	: LTMA Value\n");
  printf("\t endif\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0e(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2e(%rip),%rdi
call   1030 <printf@plt>
lea    0xf60(%rip),%rdi
call   1030 <printf@plt>
lea    0xf92(%rip),%rdi
call   1030 <printf@plt>
lea    0xfc5(%rip),%rdi
call   1030 <printf@plt>
lea    0xff8(%rip),%rdi
call   1030 <printf@plt>
lea    0x1026(%rip),%rdi
call   1030 <printf@plt>
lea    0x1058(%rip),%rdi
call   1030 <printf@plt>
lea    0x1081(%rip),%rdi
call   1030 <printf@plt>
lea    0x1086(%rip),%rdi
call   1030 <printf@plt>
lea    0x109b(%rip),%rdi
call   1030 <printf@plt>
lea    0x10b3(%rip),%rdi
call   1030 <printf@plt>
lea    0x10cf(%rip),%rdi
call   1030 <printf@plt>
lea    0x10e7(%rip),%rdi
call   1030 <printf@plt>
lea    0x10ff(%rip),%rdi
call   1030 <printf@plt>
lea    0x111b(%rip),%rdi
call   1030 <printf@plt>
lea    0x1127(%rip),%rdi
call   1030 <printf@plt>
lea    0x1143(%rip),%rdi
call   1030 <printf@plt>
lea    0x1158(%rip),%rdi
call   1030 <printf@plt>
lea    0x116d(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf8e(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc0(%rip),%rdi
call   1030 <puts@plt>
lea    0xff2(%rip),%rdi
call   1030 <puts@plt>
lea    0x101f(%rip),%rdi
call   1030 <puts@plt>
lea    0x1050(%rip),%rdi
call   1030 <puts@plt>
lea    0x1078(%rip),%rdi
call   1030 <puts@plt>
lea    0x107c(%rip),%rdi
call   1030 <puts@plt>
lea    0x1090(%rip),%rdi
call   1030 <puts@plt>
lea    0x10a7(%rip),%rdi
call   1030 <puts@plt>
lea    0x10c2(%rip),%rdi
call   1030 <puts@plt>
lea    0x10d9(%rip),%rdi
call   1030 <puts@plt>
lea    0x10f0(%rip),%rdi
call   1030 <puts@plt>
lea    0x110b(%rip),%rdi
call   1030 <puts@plt>
lea    0x1116(%rip),%rdi
call   1030 <puts@plt>
lea    0x1131(%rip),%rdi
call   1030 <puts@plt>
lea    0x1145(%rip),%rdi
call   1030 <puts@plt>
lea    0x1159(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"memgobble\0A\00"
@.str.1 = [21 x i8] c"memgobble [options]\0A\00"
@.str.2 = [18 x i8] c"List of options:\0A\00"
@.str.3 = [39 x i8] c"\09-h : Display usage\0A\00"
@.str.4 = [44 x i8] c"\09-v : Switch verbose off\0A\00"
@.str.5 = [62 x i8] c"\09-p <locality count> : Maximum locality the system will run\0A\00"
@.str.6 = [62 x i8] c"\09-l <upper limit> : Set the upper bound of alloc request\0A\00"
@.str.7 = [63 x i8] c"\09-e <Execution time> : Execution time of each locality in Ms\0A\00"
@.str.8 = [63 x i8] c"\09-M <pages> : Maximum allocation in pages per phase\0A\00"
@.str.9 = [58 x i8] c"\09-s <speed> : Speed at which memory is gobbled\0A\00"
@.str.10 = [62 x i8] c"\09\09 speed: 0-n, Higher the value faster the memory exhaustion\0A\00"
@.str.11 = [53 x i8] c"\09-t <access-type> : Access type of the locality\0A\00"
@.str.12 = [17 x i8] c"\09\09 access-type:\0A\00"
@.str.13 = [33 x i8] c"\09\09\090: Fix memory access pattern\0A\00"
@.str.14 = [36 x i8] c"\09\09\091: Stride memory access pattern\0A\00"
@.str.15 = [40 x i8] c"\09\09\092: Sequential memory access pattern\0A\00"
@.str.16 = [36 x i8] c"\09\09\093: Repeat memory access pattern\0A\00"
@.str.17 = [36 x i8] c"\09\09\094: Random memory access pattern\0A\00"
@.str.18 = [40 x i8] c"\09-V <File name>\09: Vector of localities\0A\00"
@.str.19 = [24 x i8] c"\09-I\09\09: Vector is IPFVT\0A\00"
@.str.20 = [40 x i8] c"\09 if CUSTOM_LINUX_KERNEL defined, then\0A\00"
@.str.21 = [33 x i8] c"\09\09 -S <STMA Count>\09: STMA Value\0A\00"
@.str.22 = [33 x i8] c"\09\09 -L <LTMA Count>\09: LTMA Value\0A\00"
@.str.23 = [9 x i8] c"\09 endif\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.7, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.9, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.10, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.11, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.14, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.15, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.16, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.17, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.18, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.19, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.20, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.22, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"memgobble\00"
@str.24 = [20 x i8] c"memgobble [options]\00"
@str.25 = [17 x i8] c"List of options:\00"
@str.26 = [38 x i8] c"\09-h : Display usage\00"
@str.27 = [43 x i8] c"\09-v : Switch verbose off\00"
@str.28 = [61 x i8] c"\09-p <locality count> : Maximum locality the system will run\00"
@str.29 = [61 x i8] c"\09-l <upper limit> : Set the upper bound of alloc request\00"
@str.30 = [62 x i8] c"\09-e <Execution time> : Execution time of each locality in Ms\00"
@str.31 = [62 x i8] c"\09-M <pages> : Maximum allocation in pages per phase\00"
@str.32 = [57 x i8] c"\09-s <speed> : Speed at which memory is gobbled\00"
@str.33 = [61 x i8] c"\09\09 speed: 0-n, Higher the value faster the memory exhaustion\00"
@str.34 = [52 x i8] c"\09-t <access-type> : Access type of the locality\00"
@str.35 = [16 x i8] c"\09\09 access-type:\00"
@str.36 = [32 x i8] c"\09\09\090: Fix memory access pattern\00"
@str.37 = [35 x i8] c"\09\09\091: Stride memory access pattern\00"
@str.38 = [39 x i8] c"\09\09\092: Sequential memory access pattern\00"
@str.39 = [35 x i8] c"\09\09\093: Repeat memory access pattern\00"
@str.40 = [35 x i8] c"\09\09\094: Random memory access pattern\00"
@str.41 = [39 x i8] c"\09-V <File name>\09: Vector of localities\00"
@str.42 = [23 x i8] c"\09-I\09\09: Vector is IPFVT\00"
@str.43 = [39 x i8] c"\09 if CUSTOM_LINUX_KERNEL defined, then\00"
@str.44 = [32 x i8] c"\09\09 -S <STMA Count>\09: STMA Value\00"
@str.45 = [32 x i8] c"\09\09 -L <LTMA Count>\09: LTMA Value\00"
@str.46 = [8 x i8] c"\09 endif\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.24, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.25, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.26, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.27, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.28, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.29, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.30, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.31, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.32, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.33, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.34, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.35, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.36, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.37, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.38, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.39, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.40, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.41, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.42, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.43, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.44, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.45, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.46, i64 0, i64 0))
ret void
}