#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 slm_usage(const char *self) {
  printf("\n");
  printf("this application occupies required amount of memory and makes "
         "acceess\n");
  printf("for reading and updating pages to generate load for virtual memory "
         "and swapping.\n");
  printf("\n");
  printf("%s can be invoked using the following mandatory parameters\n", self);
  printf("in its command line:\n");
  printf("- clients  - number of clients to be executed simultaneously\n");
  printf("- size     - size of workset for each client, megabytes\n");
  printf("- duration - test duration in seconds, 0 means no time limit\n");
  printf(
      "- type     - test type, could be combination for client activation\n");
  printf("             and accessed pages pattern, main controls\n");
  printf("     L - linear round robin access, one by one from 0 to X\n");
  printf("     R - random access, somewhere in between 0..X\n");
  printf("     P - pseudo-random, from current point +- %u percents of 0..X,\n",
         10);
  printf("         if X is below %u than next will be -1, 0 or +1.\n", 10);
  printf("\n");
  printf("examples:\n");
  printf("  %s 8 128 120 LL - 8 clients, 128 MB per each, 120 seconds, lin/lin "
         "access\n",
         self);
  printf("  %s 8 256 0 RP   - 8 clients, 256 MB per each, non-stop, random "
         "client selection, pseudo-random pages access\n",
         self);
}


x86 assembly (clang, -O0):
<slm_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0x11aa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1180(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfa0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfcb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xffb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1031(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x105b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1089(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10ae(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10df(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10ca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10f8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x10f1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x112c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slm_usage>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1031(%rip),%rdi
call   1040 <puts@plt>
lea    0x106b(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe99(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x1095(%rip),%rdi
call   1040 <puts@plt>
lea    0x109e(%rip),%rdi
call   1040 <puts@plt>
lea    0x10cf(%rip),%rdi
call   1040 <puts@plt>
lea    0x10fb(%rip),%rdi
call   1040 <puts@plt>
lea    0x112c(%rip),%rdi
call   1040 <puts@plt>
lea    0x1163(%rip),%rdi
call   1040 <puts@plt>
lea    0x118e(%rip),%rdi
call   1040 <puts@plt>
lea    0x11bd(%rip),%rdi
call   1040 <puts@plt>
lea    0xe64(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe95(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x11b3(%rip),%rdi
call   1040 <puts@plt>
lea    0xea6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xee2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [71 x i8] c"this application occupies required amount of memory and makes acceess\0A\00"
@.str.2 = [82 x i8] c"for reading and updating pages to generate load for virtual memory and swapping.\0A\00"
@.str.3 = [60 x i8] c"%s can be invoked using the following mandatory parameters\0A\00"
@.str.4 = [22 x i8] c"in its command line:\0A\00"
@.str.5 = [62 x i8] c"- clients - number of clients to be executed simultaneously\0A\00"
@.str.6 = [57 x i8] c"- size - size of workset for each client, megabytes\0A\00"
@.str.7 = [62 x i8] c"- duration - test duration in seconds, 0 means no time limit\0A\00"
@.str.8 = [68 x i8] c"- type - test type, could be combination for client activation\0A\00"
@.str.9 = [56 x i8] c" and accessed pages pattern, main controls\0A\00"
@.str.10 = [60 x i8] c" L - linear round robin access, one by one from 0 to X\0A\00"
@.str.11 = [51 x i8] c" R - random access, somewhere in between 0..X\0A\00"
@.str.12 = [68 x i8] c" P - pseudo-random, from current point +- %u percents of 0..X,\0A\00"
@.str.13 = [58 x i8] c" if X is below %u than next will be -1, 0 or +1.\0A\00"
@.str.14 = [11 x i8] c"examples:\0A\00"
@.str.15 = [77 x i8] c" %s 8 128 120 LL - 8 clients, 128 MB per each, 120 seconds, lin/lin access\0A\00"
@.str.16 = [111 x i8] c" %s 8 256 0 RP - 8 clients, 256 MB per each, non-stop, random client selection, pseudo-random pages access\0A\00"
define void @slm_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.7, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.8, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.9, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.10, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.11, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.12, i64 0, i64 0), i32 10)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.13, i64 0, i64 0), i32 10)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0))
%21 = load i8*, i8** %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.15, i64 0, i64 0), i8* %21)
%23 = load i8*, i8** %2
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str.16, i64 0, i64 0), i8* %23)
ret void
}

LLVM IR (-O2):
@.str.3 = [60 x i8] c"%s can be invoked using the following mandatory parameters\0A\00"
@.str.12 = [68 x i8] c" P - pseudo-random, from current point +- %u percents of 0..X,\0A\00"
@.str.13 = [58 x i8] c" if X is below %u than next will be -1, 0 or +1.\0A\00"
@.str.15 = [77 x i8] c" %s 8 128 120 LL - 8 clients, 128 MB per each, 120 seconds, lin/lin access\0A\00"
@.str.16 = [111 x i8] c" %s 8 256 0 RP - 8 clients, 256 MB per each, non-stop, random client selection, pseudo-random pages access\0A\00"
@str = [70 x i8] c"this application occupies required amount of memory and makes acceess\00"
@str.17 = [81 x i8] c"for reading and updating pages to generate load for virtual memory and swapping.\00"
@str.18 = [21 x i8] c"in its command line:\00"
@str.19 = [61 x i8] c"- clients - number of clients to be executed simultaneously\00"
@str.20 = [56 x i8] c"- size - size of workset for each client, megabytes\00"
@str.21 = [61 x i8] c"- duration - test duration in seconds, 0 means no time limit\00"
@str.22 = [67 x i8] c"- type - test type, could be combination for client activation\00"
@str.23 = [55 x i8] c" and accessed pages pattern, main controls\00"
@str.24 = [59 x i8] c" L - linear round robin access, one by one from 0 to X\00"
@str.25 = [50 x i8] c" R - random access, somewhere in between 0..X\00"
@str.26 = [10 x i8] c"examples:\00"
define void @slm_usage(i8* %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str.17, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.18, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.19, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.20, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.21, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str.22, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.23, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.24, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.25, i64 0, i64 0))
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.12, i64 0, i64 0), i32 10)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.13, i64 0, i64 0), i32 10)
%17 = tail call i32 @putchar(i32 10)
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.26, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.15, i64 0, i64 0), i8* %0)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([111 x i8], [111 x i8]* @.str.16, i64 0, i64 0), i8* %0)
ret void
}