#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 */
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ cpu_set_t;
typedef int /*<<< orphan*/ __pid_t;

/* Variables and functions */
int MAP_ANON;
char *MAP_FAILED;
int MAP_HUGETLB;
int MAP_PRIVATE;
int PROT_READ;
int PROT_WRITE;
size_t _rdtsc();
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ err(int, char *, ...);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getopt(int, char **, char *);
scalar_t__ malloc(int);
void *memset(char *, int /*<<< orphan*/, size_t);
scalar_t__ mmap(int /*<<< orphan*/ *, size_t, int, int, int,
                int /*<<< orphan*/);
int /*<<< orphan*/ optarg;
int pin_cpu(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, double, ...);
size_t reader(int, size_t *);
int /*<<< orphan*/ rndm_list(int *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  char *buf1;
  void *ret;
  size_t *array, ret_val = 0;
  size_t array_stride;
  int i, j, k, cpu, cpu_run, line_count, stride, fd = -1;
  off_t offset = 0;
  int len = 10240000, iter = 100, mult = 1, main_ret = 0;
  double iterations;
  size_t start, stop, run_time, call_start, call_stop, call_run_time,
      total_bytes = 0;
  __pid_t pid = 0;
  size_t buf_size, jj, zero_loop, buf_by_num_seg, ind;
  size_t num_pages, page_size, var_size;
  int cpu_setsize;
  cpu_set_t mask;
  int *pattern;
  int step, c;
  int *index, lc_by_num_seg, count, num_seg = 32, huge = 0;
  unsigned int bitmask, *intstar;
  page_size = 4096;
  if (argc < 6) {
    fprintf(stderr,
            "the random walker requires at least 6 arguments (only the 7th in "
            "the list below is optional), there were %d\n",
            argc);
    usage();
    err(1, "insufficient invocation arguments");
  }
  while ((c = getopt(argc, argv, "i:r:l:s:S:m:L")) != -1) {
    switch (c) {
    case 'i':
      cpu = atoi(optarg);
      break;
    case 'r':
      cpu_run = atoi(optarg);
      break;
    case 'l':
      line_count = atoi(optarg);
      break;
    case 's':
      stride = atoi(optarg);
      break;
    case 'S':
      num_seg = atoi(optarg);
      break;
    case 'm':
      mult = atoi(optarg);
      break;
    case 'L':
      huge = 1;
      page_size = 2 * 1024 * 1024;
      break;
    default:
      err(1, "unknown option %c", c);
    }
  }
  iter = iter * mult;
  var_size = sizeof(size_t);
  fprintf(stderr, "size_t in %zd bytes\n", var_size);
  if (pin_cpu(pid, cpu) == -1) {
    err(1, "failed to set affinity");
  } else {
    fprintf(stderr, " process pinned to core %d\n", cpu);
  }
  pattern = (int *)malloc(num_seg * sizeof(int));
  if (pattern == NULL) {
    fprintf(stderr, " failed to malloc pattern for size = %d\n", num_seg);
    err(1, "malloc of pattern failed");
  }
  stride = page_size * stride + 64;
  buf_size = (size_t)line_count * (size_t)stride;
  num_pages = buf_size / page_size + 2;
  buf_size = page_size * num_pages;
  array_stride = stride / sizeof(size_t *);
  iterations = (double)iter * (double)len;
  index = (int *)malloc(line_count * sizeof(int));
  if (index == NULL) {
    fprintf(stderr, " failed to malloc index array for line_count of %d\n",
            line_count);
    err(1, "failed to malloc index");
  }
  if (num_seg == 1) {
    for (i = 0; i < line_count - 1; i++)
      index[i] = i;
  } else {
    rndm_list(pattern, num_seg);
    lc_by_num_seg = line_count / num_seg;
    if (lc_by_num_seg * num_seg != line_count) {
      fprintf(
          stderr,
          " line count must be a multiple of the fifth argument num_seg = %d\n",
          num_seg);
      err(1, " bad line_count");
    }
    count = 0;
    buf_by_num_seg = buf_size / num_seg;
    for (i = 0; i < lc_by_num_seg; i++) {
      step = 0;
      for (j = 0; j < num_seg; j++) {
        count++;
        if (j == (num_seg - 1))
          step = 1;
        ind = lc_by_num_seg * pattern[j];
        index[count] = (int)ind + i + step;
        if (index[count] >= line_count)
          printf(" count = %d, index = %d\n", count, index[count]);
      }
    }
  }
  index[0] = 0;
  if (huge == 0)
    buf1 = (char *)mmap(NULL, buf_size, PROT_READ | PROT_WRITE,
                        MAP_PRIVATE | MAP_ANON, fd, offset);
  if (huge == 1)
    buf1 = (char *)mmap(NULL, buf_size, PROT_READ | PROT_WRITE,
                        MAP_PRIVATE | MAP_ANON | MAP_HUGETLB, fd, offset);
  if (buf1 == MAP_FAILED) {
    fprintf(stderr, "mmap failed\n");
    err(1, "mmap failed");
  }
  fprintf(stderr, " buf1 = %p\n", buf1);
  zero_loop = buf_size / (size_t)var_size;
  fprintf(stderr, " buf_size = %zu, zero_loop = %zu, array_stride = %zd\n",
          buf_size, zero_loop, array_stride);
  array = (size_t *)buf1;
  ret = memset(buf1, 0, (size_t)buf_size);
  fprintf(stderr, " finished zeroing buf ret = %p\n", ret);
  for (jj = 0; jj < line_count - 1; jj++)
    array[index[jj] * array_stride] =
        (size_t)&array[index[jj + 1] * array_stride];
  fprintf(stderr, " target of last element in loop = %zx\n",
          (size_t)(array[line_count - 1] - (size_t)buf1));
  array[(size_t)array_stride * (size_t)(line_count - 1)] = (size_t)&array[0];
  if (pin_cpu(pid, cpu_run) == -1) {
    err(1, "cannot set cpu run affinity");
  } else {
    printf(" process pinned to core %d to run\n", cpu_run);
  }
  printf(" calling walker %d times which loops  %d times on buffer of %d lines "
         "with a stride of %d, for a total size of %zu\n",
         iter, len, line_count, stride, buf_size);
  call_start = _rdtsc();
  for (i = 0; i < iter; i++) {
    start = _rdtsc();
    ret_val = reader(len, array);
    stop = _rdtsc();
    run_time = stop - start;
  }
  call_stop = _rdtsc();
  call_run_time = call_stop - call_start;
  printf(" run time = %zd\n", call_run_time);
  printf(" average cycles per iteration = %f\n",
         (double)call_run_time / iterations);
  return main_ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x30(%rbp)
movl   $0xffffffff,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
movl   $0x9c4000,-0x60(%rbp)
movl   $0x64,-0x64(%rbp)
movl   $0x1,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
movq   $0x0,-0xb0(%rbp)
movl   $0x0,-0xb4(%rbp)
movl   $0x20,-0x124(%rbp)
movl   $0x0,-0x128(%rbp)
movq   $0x1000,-0xf0(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    128d <main+0xbd>
mov    0x2d68(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe54(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x0,%al
call   10c0 <usage@plt>
mov    $0x1,%edi
lea    0xea7(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
jmp    1292 <main+0xc2>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xeaf(%rip),%rdx
call   10e0 <getopt@plt>
mov    %eax,-0x110(%rbp)
cmp    $0xffffffff,%eax
je     13a5 <main+0x1d5>
mov    -0x110(%rbp),%eax
add    $0xffffffb4,%eax
mov    %eax,%ecx
mov    %rcx,-0x140(%rbp)
sub    $0x27,%eax
ja     1387 <main+0x1b7>
mov    -0x140(%rbp),%rax
lea    0xd43(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2d0b(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %eax,-0x48(%rbp)
jmp    13a0 <main+0x1d0>
mov    0x2cf5(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %eax,-0x4c(%rbp)
jmp    13a0 <main+0x1d0>
mov    0x2cdf(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %eax,-0x50(%rbp)
jmp    13a0 <main+0x1d0>
mov    0x2cc9(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %eax,-0x54(%rbp)
jmp    13a0 <main+0x1d0>
mov    0x2cb3(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %eax,-0x124(%rbp)
jmp    13a0 <main+0x1d0>
mov    0x2c9a(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %eax,-0x68(%rbp)
jmp    13a0 <main+0x1d0>
movl   $0x1,-0x128(%rbp)
movq   $0x200000,-0xf0(%rbp)
jmp    13a0 <main+0x1d0>
mov    -0x110(%rbp),%edx
mov    $0x1,%edi
lea    0xdc4(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
jmp    1292 <main+0xc2>
mov    -0x64(%rbp),%eax
imul   -0x68(%rbp),%eax
mov    %eax,-0x64(%rbp)
movq   $0x8,-0xf8(%rbp)
mov    0x2c07(%rip),%rax
mov    (%rax),%edi
mov    -0xf8(%rbp),%rdx
lea    0xd9e(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0xb4(%rbp),%edi
mov    -0x48(%rbp),%esi
call   1070 <pin_cpu@plt>
cmp    $0xffffffff,%eax
jne    1407 <main+0x237>
mov    $0x1,%edi
lea    0xd89(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
jmp    1421 <main+0x251>
mov    0x2bba(%rip),%rax
mov    (%rax),%edi
mov    -0x48(%rbp),%edx
lea    0xd81(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movslq -0x124(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x108(%rbp)
cmpq   $0x0,-0x108(%rbp)
jne    1478 <main+0x2a8>
mov    0x2b79(%rip),%rax
mov    (%rax),%edi
mov    -0x124(%rbp),%edx
lea    0xd59(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
lea    0xd6f(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
mov    -0xf0(%rbp),%rax
movslq -0x54(%rbp),%rcx
imul   %rcx,%rax
add    $0x40,%rax
mov    %eax,-0x54(%rbp)
movslq -0x50(%rbp),%rax
movslq -0x54(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0xc0(%rbp)
mov    -0xc0(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0xf0(%rbp)
add    $0x2,%rax
mov    %rax,-0xe8(%rbp)
mov    -0xf0(%rbp),%rax
imul   -0xe8(%rbp),%rax
ff
mov    %rax,-0xc0(%rbp)
movslq -0x54(%rbp),%rax
shr    $0x3,%rax
mov    %rax,-0x38(%rbp)
cvtsi2sdl -0x64(%rbp),%xmm0
cvtsi2sdl -0x60(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movslq -0x50(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x118(%rbp)
cmpq   $0x0,-0x118(%rbp)
jne    1544 <main+0x374>
mov    0x2aaa(%rip),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%edx
lea    0xccf(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
lea    0xcf0(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
cmpl   $0x1,-0x124(%rbp)
jne    158d <main+0x3bd>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1588 <main+0x3b8>
mov    -0x3c(%rbp),%edx
mov    -0x118(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1558 <main+0x388>
jmp    1729 <main+0x559>
mov    -0x108(%rbp),%rdi
mov    -0x124(%rbp),%esi
call   10d0 <rndm_list@plt>
mov    -0x50(%rbp),%eax
cltd
idivl  -0x124(%rbp)
mov    %eax,-0x11c(%rbp)
mov    -0x11c(%rbp),%eax
imul   -0x124(%rbp),%eax
cmp    -0x50(%rbp),%eax
je     15f5 <main+0x425>
mov    0x29fc(%rip),%rax
mov    (%rax),%edi
mov    -0x124(%rbp),%edx
lea    0xc69(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
lea    0xc99(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
movl   $0x0,-0x120(%rbp)
mov    -0xc0(%rbp),%rax
movslq -0x124(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %rax,-0xd8(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x11c(%rbp),%eax
jge    1724 <main+0x554>
movl   $0x0,-0x10c(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x124(%rbp),%eax
jge    1711 <main+0x541>
mov    -0x120(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x120(%rbp)
mov    -0x40(%rbp),%eax
mov    -0x124(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    167c <main+0x4ac>
movl   $0x1,-0x10c(%rbp)
mov    -0x11c(%rbp),%eax
mov    -0x108(%rbp),%rcx
movslq -0x40(%rbp),%rdx
imul   (%rcx,%rdx,4),%eax
cltq
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rax
mov    %eax,%edx
add    -0x3c(%rbp),%edx
add    -0x10c(%rbp),%edx
mov    -0x118(%rbp),%rax
movslq -0x120(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x118(%rbp),%rax
movslq -0x120(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x50(%rbp),%eax
jl     16fe <main+0x52e>
cvtsi2sdl -0x120(%rbp),%xmm0
ff
mov    -0x118(%rbp),%rax
movslq -0x120(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xba0(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    1703 <main+0x533>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1640 <main+0x470>
jmp    1716 <main+0x546>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1620 <main+0x450>
jmp    1729 <main+0x559>
mov    -0x118(%rbp),%rax
movl   $0x0,(%rax)
cmpl   $0x0,-0x128(%rbp)
jne    1783 <main+0x5b3>
mov    -0xc0(%rbp),%rsi
mov    0x289f(%rip),%rax
mov    (%rax),%edx
mov    0x2866(%rip),%rax
or     (%rax),%edx
mov    0x284d(%rip),%rax
mov    (%rax),%ecx
mov    0x284c(%rip),%rax
or     (%rax),%ecx
mov    -0x58(%rbp),%r8d
mov    -0x5c(%rbp),%r9d
xor    %eax,%eax
mov    %eax,%edi
call   1040 <mmap@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x128(%rbp)
jne    17d9 <main+0x609>
mov    -0xc0(%rbp),%rsi
mov    0x2852(%rip),%rax
mov    (%rax),%edx
mov    0x2819(%rip),%rax
or     (%rax),%edx
mov    0x2800(%rip),%rax
mov    (%rax),%ecx
mov    0x27ff(%rip),%rax
or     (%rax),%ecx
mov    0x281e(%rip),%rax
or     (%rax),%ecx
mov    -0x58(%rbp),%r8d
mov    -0x5c(%rbp),%r9d
xor    %eax,%eax
mov    %eax,%edi
call   1040 <mmap@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x27c4(%rip),%rcx
cmp    (%rcx),%rax
jne    1817 <main+0x647>
mov    0x27d4(%rip),%rax
mov    (%rax),%edi
lea    0xab3(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
lea    0xaad(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
mov    0x27aa(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xa9e(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0xc0(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0xf8(%rbp)
mov    %rax,-0xd0(%rbp)
mov    0x2776(%rip),%rax
mov    (%rax),%edi
mov    -0xc0(%rbp),%rdx
mov    -0xd0(%rbp),%rcx
mov    -0x38(%rbp),%r8
lea    0xa68(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc0(%rbp),%rdx
xor    %esi,%esi
call   1060 <memset@plt>
mov    %rax,-0x20(%rbp)
mov    0x272f(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xa65(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movq   $0x0,-0xc8(%rbp)
mov    -0xc8(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
jae    192a <main+0x75a>
mov    -0x28(%rbp),%rdx
mov    -0x118(%rbp),%rax
mov    -0xc8(%rbp),%rcx
movslq 0x4(%rax,%rcx,4),%rax
imul   -0x38(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x28(%rbp),%rax
mov    -0x118(%rbp),%rcx
mov    -0xc8(%rbp),%rsi
movslq (%rcx,%rsi,4),%rcx
imul   -0x38(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xc8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xc8(%rbp)
jmp    18b8 <main+0x6e8>
mov    0x2697(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x18(%rbp),%rax
sub    %rax,%rdx
lea    0x9d9(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x28(%rbp),%rdx
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    -0x50(%rbp),%esi
sub    $0x1,%esi
movslq %esi,%rsi
imul   %rsi,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xb4(%rbp),%edi
mov    -0x4c(%rbp),%esi
call   1070 <pin_cpu@plt>
cmp    $0xffffffff,%eax
jne    19a5 <main+0x7d5>
mov    $0x1,%edi
lea    0x9b9(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
jmp    19b8 <main+0x7e8>
cvtsi2sdl -0x4c(%rbp),%xmm0
lea    0x9bd(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
cvtsi2sdl -0x64(%rbp),%xmm0
mov    -0x60(%rbp),%esi
mov    -0x50(%rbp),%edx
mov    -0x54(%rbp),%ecx
mov    -0xc0(%rbp),%r8
lea    0x9bd(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   10b0 <_rdtsc@plt>
mov    %rax,-0x98(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    1a45 <main+0x875>
mov    $0x0,%al
call   10b0 <_rdtsc@plt>
mov    %rax,-0x80(%rbp)
mov    -0x60(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1030 <reader@plt>
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   10b0 <_rdtsc@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rax
sub    -0x80(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    19f0 <main+0x820>
xor    %eax,%eax
call   10b0 <_rdtsc@plt>
mov    %rax,-0xa0(%rbp)
mov    -0xa0(%rbp),%rax
mov    -0x98(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0xa8(%rbp)
movq   -0xa8(%rbp),%xmm0
ff
movaps 0x586(%rip),%xmm1
movaps %xmm1,-0x160(%rbp)
punpckldq %xmm1,%xmm0
movapd 0x583(%rip),%xmm1
movaps %xmm1,-0x150(%rbp)
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
lea    0x95a(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movaps -0x160(%rbp),%xmm2
movaps -0x150(%rbp),%xmm1
movq   -0xa8(%rbp),%xmm0
ff
punpckldq %xmm2,%xmm0
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x78(%rbp),%xmm0
lea    0x92f(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x6c(%rbp),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
cmp    $0x5,%edi
jg     121b <main+0x4b>
mov    0x2dd9(%rip),%rax
mov    (%rax),%edi
lea    0xf60(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
xor    %eax,%eax
call   10c0 <usage@plt>
lea    0xfb6(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1090 <err@plt>
mov    $0x20,%eax
mov    %rax,0x38(%rsp)
mov    $0x1000,%ecx
movl   $0x1,0x14(%rsp)
lea    0xfae(%rip),%r14
lea    0xe78(%rip),%r15
mov    %rax,0x20(%rsp)
xor    %edx,%edx
jmp    1267 <main+0x97>
mov    0x2da8(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %eax,0x14(%rsp)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rcx
mov    0x8(%rsp),%edx
mov    %edx,0x8(%rsp)
mov    %rcx,%r12
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r14,%rdx
call   10e0 <getopt@plt>
lea    -0x4c(%rax),%edx
cmp    $0x27,%edx
ja     1301 <main+0x131>
mov    $0x200000,%ecx
movslq (%r15,%rdx,4),%rsi
add    %r15,%rsi
mov    $0x1,%edx
jmp    *%rsi
mov    0x2d5b(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %rax,0x38(%rsp)
jmp    1260 <main+0x90>
mov    0x2d46(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %eax,%r13d
jmp    1260 <main+0x90>
mov    0x2d33(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %rax,0x20(%rsp)
jmp    1260 <main+0x90>
mov    0x2d1e(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %eax,0x5c(%rsp)
jmp    1260 <main+0x90>
mov    0x2d07(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %eax,0x10(%rsp)
jmp    1260 <main+0x90>
cmp    $0xffffffff,%eax
je     1320 <main+0x150>
mov    $0x1,%edi
lea    0xee3(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1090 <err@plt>
jmp    1260 <main+0x90>
mov    0x2ca1(%rip),%r14
mov    (%r14),%edi
lea    0xed6(%rip),%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
xor    %edi,%edi
mov    %r13d,%esi
call   1070 <pin_cpu@plt>
cmp    $0xffffffff,%eax
je     1362 <main+0x192>
mov    (%r14),%edi
lea    0xedd(%rip),%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1375 <main+0x1a5>
lea    0xeb3(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1090 <err@plt>
mov    0x38(%rsp),%r15
lea    0x0(,%r15,4),%edi
call   10a0 <malloc@plt>
mov    %rax,0x40(%rsp)
test   %rax,%rax
jne    13b8 <main+0x1e8>
mov    (%r14),%edi
lea    0xeb4(%rip),%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xecc(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1090 <err@plt>
mov    0x10(%rsp),%r13d
imul   %r12d,%r13d
or     $0x40,%r13d
movslq 0x20(%rsp),%rax
movslq %r13d,%rsi
imul   %rsi,%rax
mov    %rax,%rcx
or     %r12,%rcx
shr    $0x20,%rcx
mov    %r13d,0x10(%rsp)
je     13ec <main+0x21c>
xor    %edx,%edx
div    %r12
mov    %rax,%rbp
jmp    13f3 <main+0x223>
xor    %edx,%edx
div    %r12d
mov    %eax,%ebp
mov    %rsi,0x60(%rsp)
add    $0x2,%rbp
mov    0x20(%rsp),%rax
lea    0x0(,%rax,4),%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    143e <main+0x26e>
mov    (%r14),%edi
lea    0xe72(%rip),%rsi
mov    0x20(%rsp),%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xe93(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1090 <err@plt>
imul   %r12,%rbp
cmp    $0x1,%r15d
mov    %rbx,0x18(%rsp)
mov    %rbp,0x50(%rsp)
jne    147a <main+0x2aa>
cmpl   $0x2,0x20(%rsp)
mov    0x14(%rsp),%r12d
jl     16fc <main+0x52c>
mov    0x20(%rsp),%rax
add    $0xffffffff,%eax
cmp    $0x8,%eax
jae    159b <main+0x3cb>
xor    %ecx,%ecx
jmp    16e5 <main+0x515>
mov    0x40(%rsp),%rdi
mov    %r15d,%esi
call   10d0 <rndm_list@plt>
mov    0x20(%rsp),%rcx
mov    %ecx,%eax
cltd
idiv   %r15d
mov    %eax,%r9d
imul   %r15d,%eax
cmp    %ecx,%eax
mov    %r9d,0x4c(%rsp)
je     14ce <main+0x2fe>
mov    (%r14),%edi
lea    0xe30(%rip),%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xe62(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1090 <err@plt>
mov    0x4c(%rsp),%r9d
test   %r9d,%r9d
mov    0x14(%rsp),%r12d
jle    16fc <main+0x52c>
mov    0x38(%rsp),%rax
lea    -0x1(%rax),%ebx
mov    %eax,%edi
shl    $0x2,%rbx
shl    $0x2,%rdi
mov    0x18(%rsp),%rax
add    $0x4,%rax
mov    %rax,0x68(%rsp)
xor    %r14d,%r14d
mov    $0x1,%r8d
xor    %r13d,%r13d
mov    %rdi,0x70(%rsp)
jmp    1522 <main+0x352>
nop
add    $0x1,%r13d
cmp    %r9d,%r13d
mov    0x14(%rsp),%r12d
je     16fc <main+0x52c>
cmpl   $0x0,0x38(%rsp)
jle    1510 <main+0x340>
movslq %r14d,%rax
mov    0x68(%rsp),%rsi
lea    (%rsi,%rax,4),%r15
xor    %r12d,%r12d
xor    %ebp,%ebp
jmp    154d <main+0x37d>
nopl   0x0(%rax)
add    $0x4,%r12
add    $0x1,%r14d
cmp    %r12,%rdi
je     1510 <main+0x340>
cmp    %r12,%rbx
cmove  %r8d,%ebp
mov    0x40(%rsp),%rax
mov    (%rax,%r12,1),%esi
imul   %r9d,%esi
add    %ebp,%esi
add    %r13d,%esi
mov    %esi,(%r15,%r12,1)
cmp    0x20(%rsp),%esi
jl     1540 <main+0x370>
lea    0x1(%r14),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xdad(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x1,%r8d
mov    0x70(%rsp),%rdi
mov    0x4c(%rsp),%r9d
jmp    1540 <main+0x370>
mov    %eax,%ecx
and    $0xfffffff8,%ecx
lea    -0x8(%rcx),%rdi
mov    %rdi,%rsi
shr    $0x3,%rsi
add    $0x1,%rsi
mov    %esi,%edx
and    $0x3,%edx
cmp    $0x18,%rdi
mov    0x18(%rsp),%rbp
jae    15ce <main+0x3fe>
movdqa 0xa39(%rip),%xmm0
xor    %edi,%edi
jmp    1699 <main+0x4c9>
and    $0xfffffffffffffffc,%rsi
movdqa 0xa26(%rip),%xmm0
xor    %edi,%edi
movdqa 0xa2b(%rip),%xmm8
movdqa 0xa32(%rip),%xmm9
movdqa 0xa39(%rip),%xmm10
movdqa 0xa41(%rip),%xmm4
movdqa 0xa49(%rip),%xmm5
movdqa 0xa51(%rip),%xmm6
movdqa 0xa59(%rip),%xmm7
movdqa 0xa61(%rip),%xmm1
nop
movdqa %xmm0,%xmm2
paddd  %xmm8,%xmm2
movdqu %xmm0,0x0(%rbp,%rdi,4)
movdqu %xmm2,0x10(%rbp,%rdi,4)
movdqa %xmm0,%xmm2
paddd  %xmm9,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm10,%xmm3
movdqu %xmm2,0x20(%rbp,%rdi,4)
movdqu %xmm3,0x30(%rbp,%rdi,4)
movdqa %xmm0,%xmm2
paddd  %xmm4,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm5,%xmm3
movdqu %xmm2,0x40(%rbp,%rdi,4)
movdqu %xmm3,0x50(%rbp,%rdi,4)
movdqa %xmm0,%xmm2
paddd  %xmm6,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm7,%xmm3
movdqu %xmm2,0x60(%rbp,%rdi,4)
movdqu %xmm3,0x70(%rbp,%rdi,4)
add    $0x20,%rdi
paddd  %xmm1,%xmm0
add    $0xfffffffffffffffc,%rsi
jne    1620 <main+0x450>
test   %rdx,%rdx
je     16e0 <main+0x510>
lea    0x10(,%rdi,4),%rsi
add    %rbp,%rsi
shl    $0x5,%rdx
xor    %edi,%edi
movdqa 0x959(%rip),%xmm1
movdqa 0x961(%rip),%xmm2
nop
movdqa %xmm0,%xmm3
paddd  %xmm1,%xmm3
movdqu %xmm0,-0x10(%rsi,%rdi,1)
movdqu %xmm3,(%rsi,%rdi,1)
paddd  %xmm2,%xmm0
add    $0x20,%rdi
cmp    %rdi,%rdx
jne    16c0 <main+0x4f0>
cmp    %rax,%rcx
je     16fc <main+0x52c>
mov    0x18(%rsp),%rdx
nopw   0x0(%rax,%rax,1)
mov    %ecx,(%rdx,%rcx,4)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    16f0 <main+0x520>
mov    0x60(%rsp),%r13
shr    $0x3,%r13
mov    0x18(%rsp),%rax
movl   $0x0,(%rax)
mov    0x28d9(%rip),%rax
mov    0x28a2(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
xor    %ecx,%ecx
cmpl   $0x1,0x8(%rsp)
mov    0x2880(%rip),%rax
mov    (%rax),%eax
cmove  %eax,%ecx
mov    0x28a4(%rip),%rsi
cmove  (%rsi),%eax
mov    0x2872(%rip),%rsi
or     (%rsi),%ecx
or     %eax,%ecx
xor    %edi,%edi
mov    0x50(%rsp),%rbx
mov    %rbx,%rsi
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%rbp
mov    0x283c(%rip),%rax
cmp    %rbp,(%rax)
mov    0x2852(%rip),%r15
jne    179c <main+0x5cc>
mov    (%r15),%edi
lea    0xbc6(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xbc5(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1090 <err@plt>
imul   $0x64,%r12d,%eax
mov    %eax,0x40(%rsp)
mov    (%r15),%edi
lea    0xbb3(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbx,%rcx
shr    $0x3,%rcx
mov    (%r15),%edi
lea    0xba4(%rip),%rsi
mov    %rbx,%rdx
mov    %r13,%r8
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbp,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1060 <memset@plt>
mov    (%r15),%edi
lea    0xbb6(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x20(%rsp),%rax
add    $0xffffffff,%eax
movslq %eax,%r14
test   %r14d,%r14d
je     18b5 <main+0x6e5>
cmp    $0x2,%r14
mov    $0x1,%edx
mov    $0x1,%r8d
cmovae %r14,%r8
mov    0x18(%rsp),%rax
mov    (%rax),%eax
cmp    $0x1,%r14d
je     188c <main+0x6bc>
mov    %r8,%rsi
and    $0xfffffffffffffffe,%rsi
neg    %rsi
mov    $0x1,%edx
mov    0x18(%rsp),%rbx
nop
movslq (%rbx,%rdx,4),%rdi
imul   %r13,%rdi
lea    0x0(,%rdi,8),%rcx
add    %rbp,%rcx
cltq
imul   %r13,%rax
mov    %rcx,0x0(%rbp,%rax,8)
movslq 0x4(%rbx,%rdx,4),%rax
mov    %rax,%rcx
imul   %r13,%rcx
lea    0x0(,%rcx,8),%rcx
add    %rbp,%rcx
mov    %rcx,0x0(%rbp,%rdi,8)
lea    (%rsi,%rdx,1),%rcx
add    $0x2,%rcx
add    $0x2,%rdx
cmp    $0x1,%rcx
jne    1840 <main+0x670>
test   $0x1,%r8b
je     18b5 <main+0x6e5>
mov    0x18(%rsp),%rcx
movslq (%rcx,%rdx,4),%rcx
imul   %r13,%rcx
lea    0x0(,%rcx,8),%rcx
add    %rbp,%rcx
cltq
imul   %r13,%rax
mov    %rcx,0x0(%rbp,%rax,8)
cvtsi2sdl 0x40(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    (%r15),%edi
mov    0x0(%rbp,%r14,8),%rdx
sub    %rbp,%rdx
lea    0xaf0(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
imul   %r14,%r13
mov    %rbp,0x0(%rbp,%r13,8)
xor    %edi,%edi
mov    0x5c(%rsp),%ebx
mov    %ebx,%esi
call   1070 <pin_cpu@plt>
cmp    $0xffffffff,%eax
je     190c <main+0x73c>
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
lea    0xb03(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    191f <main+0x74f>
lea    0xad7(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1090 <err@plt>
mov    0x10(%rsp),%ecx
mov    0x50(%rsp),%r8
lea    0xafa(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x9c4000,%esi
mov    0x20(%rsp),%rdx
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
call   10b0 <_rdtsc@plt>
mov    %rax,%r15
test   %r12d,%r12d
jle    1990 <main+0x7c0>
mov    0x40(%rsp),%eax
cmp    $0x2,%eax
mov    $0x1,%ebx
cmovge %eax,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   10b0 <_rdtsc@plt>
mov    $0x9c4000,%edi
mov    %rbp,%rsi
call   1030 <reader@plt>
xor    %eax,%eax
call   10b0 <_rdtsc@plt>
add    $0xffffffff,%ebx
jne    1970 <main+0x7a0>
movsd  0x8(%rsp),%xmm0
mulsd  0x712(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10b0 <_rdtsc@plt>
sub    %r15,%rax
movq   %rax,%xmm1
punpckldq 0x6d5(%rip),%xmm1
subpd  0x6dd(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
movapd %xmm0,0x20(%rsp)
lea    0xac0(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movapd 0x20(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
lea    0xab7(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [109 x i8] c"the random walker requires at least 6 arguments (only the 7th in the list below is optional), there were %d\0A\00"
@.str.1 = [34 x i8] c"insufficient invocation arguments\00"
@.str.2 = [14 x i8] c"i:r:l:s:S:m:L\00"
@optarg = global i32 0
@.str.3 = [18 x i8] c"unknown option %c\00"
@.str.4 = [21 x i8] c"size_t in %zd bytes\0A\00"
@.str.5 = [23 x i8] c"failed to set affinity\00"
@.str.6 = [28 x i8] c" process pinned to core %d\0A\00"
@.str.7 = [41 x i8] c" failed to malloc pattern for size = %d\0A\00"
@.str.8 = [25 x i8] c"malloc of pattern failed\00"
@.str.9 = [52 x i8] c" failed to malloc index array for line_count of %d\0A\00"
@.str.10 = [23 x i8] c"failed to malloc index\00"
@.str.11 = [67 x i8] c" line count must be a multiple of the fifth argument num_seg = %d\0A\00"
@.str.12 = [16 x i8] c" bad line_count\00"
@.str.13 = [25 x i8] c" count = %d, index = %d\0A\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_ANON = global i32 0
@MAP_HUGETLB = global i32 0
@MAP_FAILED = global i8* null
@.str.14 = [13 x i8] c"mmap failed\0A\00"
@.str.15 = [12 x i8] c"mmap failed\00"
@.str.16 = [12 x i8] c" buf1 = %p\0A\00"
@.str.17 = [54 x i8] c" buf_size = %zu, zero_loop = %zu, array_stride = %zd\0A\00"
@.str.18 = [32 x i8] c" finished zeroing buf ret = %p\0A\00"
@.str.19 = [39 x i8] c" target of last element in loop = %zx\0A\00"
@.str.20 = [28 x i8] c"cannot set cpu run affinity\00"
@.str.21 = [35 x i8] c" process pinned to core %d to run\0A\00"
@.str.22 = [115 x i8] c" calling walker %d times which loops %d times on buffer of %d lines with a stride of %d, for a total size of %zu\0A\00"
@.str.23 = [17 x i8] c" run time = %zd\0A\00"
@.str.24 = [36 x i8] c" average cycles per iteration = %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca double
%25 = alloca i64
%26 = alloca i64
%27 = alloca i64
%28 = alloca i64
%29 = alloca i64
%30 = alloca i64
%31 = alloca i64
%32 = alloca i32
%33 = alloca i64
%34 = alloca i64
%35 = alloca i64
%36 = alloca i64
%37 = alloca i64
%38 = alloca i64
%39 = alloca i64
%40 = alloca i64
%41 = alloca i32
%42 = alloca i32
%43 = alloca i32*
%44 = alloca i32
%45 = alloca i32
%46 = alloca i32*
%47 = alloca i32
%48 = alloca i32
%49 = alloca i32
%50 = alloca i32
%51 = alloca i32
%52 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %9
store i32 -1, i32* %18
store i32 0, i32* %19
store i32 10240000, i32* %20
store i32 100, i32* %21
store i32 1, i32* %22
store i32 0, i32* %23
store i64 0, i64* %31
store i32 0, i32* %32
store i32 32, i32* %49
store i32 0, i32* %50
store i64 4096, i64* %39
%53 = load i32, i32* %4
%54 = icmp slt i32 %53, 6
br i1 %54, label %55, label %61
55: ; preds = %2
%56 = load i32, i32* @stderr
%57 = load i32, i32* %4
%58 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0), i32 %57)
%59 = call i32 (...) @usage()
%60 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %61
61: ; preds = %55, %2
br label %62
62: ; preds = %91, %61
%63 = load i32, i32* %4
%64 = load i8**, i8*** %5
%65 = call i32 @getopt(i32 %63, i8** %64, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
store i32 %65, i32* %45
%66 = icmp ne i32 %65, -1
br i1 %66, label %67, label %92
67: ; preds = %62
%68 = load i32, i32* %45
switch i32 %68, label %88 [
i32 105, label %69
i32 114, label %72
i32 108, label %75
i32 115, label %78
i32 83, label %81
i32 109, label %84
i32 76, label %87
]
69: ; preds = %67
%70 = load i32, i32* @optarg
%71 = call i32 @atoi(i32 %70)
store i32 %71, i32* %14
br label %91
72: ; preds = %67
%73 = load i32, i32* @optarg
%74 = call i32 @atoi(i32 %73)
store i32 %74, i32* %15
br label %91
75: ; preds = %67
%76 = load i32, i32* @optarg
%77 = call i32 @atoi(i32 %76)
store i32 %77, i32* %16
br label %91
78: ; preds = %67
%79 = load i32, i32* @optarg
%80 = call i32 @atoi(i32 %79)
store i32 %80, i32* %17
br label %91
81: ; preds = %67
%82 = load i32, i32* @optarg
%83 = call i32 @atoi(i32 %82)
store i32 %83, i32* %49
br label %91
84: ; preds = %67
%85 = load i32, i32* @optarg
%86 = call i32 @atoi(i32 %85)
store i32 %86, i32* %22
br label %91
87: ; preds = %67
store i32 1, i32* %50
store i64 2097152, i64* %39
br label %91
88: ; preds = %67
%89 = load i32, i32* %45
%90 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %89)
br label %91
91: ; preds = %88, %87, %84, %81, %78, %75, %72, %69
br label %62
92: ; preds = %62
%93 = load i32, i32* %21
%94 = load i32, i32* %22
%95 = mul nsw i32 %93, %94
store i32 %95, i32* %21
store i64 8, i64* %40
%96 = load i32, i32* @stderr
%97 = load i64, i64* %40
%98 = call i32 (i32, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i64 %97)
%99 = load i32, i32* %32
%100 = load i32, i32* %14
%101 = call i32 @pin_cpu(i32 %99, i32 %100)
%102 = icmp eq i32 %101, -1
br i1 %102, label %103, label %105
103: ; preds = %92
%104 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %109
105: ; preds = %92
%106 = load i32, i32* @stderr
%107 = load i32, i32* %14
%108 = call i32 (i32, i8*, ...) @fprintf(i32 %106, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i32 %107)
br label %109
109: ; preds = %105, %103
%110 = load i32, i32* %49
%111 = sext i32 %110 to i64
%112 = mul i64 %111, 4
%113 = trunc i64 %112 to i32
%114 = call i64 @malloc(i32 %113)
%115 = inttoptr i64 %114 to i32*
store i32* %115, i32** %43
%116 = load i32*, i32** %43
%117 = icmp eq i32* %116, null
br i1 %117, label %118, label %123
118: ; preds = %109
%119 = load i32, i32* @stderr
%120 = load i32, i32* %49
%121 = call i32 (i32, i8*, ...) @fprintf(i32 %119, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0), i32 %120)
%122 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0))
br label %123
123: ; preds = %118, %109
%124 = load i64, i64* %39
%125 = load i32, i32* %17
%126 = sext i32 %125 to i64
%127 = mul i64 %124, %126
%128 = add i64 %127, 64
%129 = trunc i64 %128 to i32
store i32 %129, i32* %17
%130 = load i32, i32* %16
%131 = sext i32 %130 to i64
%132 = load i32, i32* %17
%133 = sext i32 %132 to i64
%134 = mul i64 %131, %133
store i64 %134, i64* %33
%135 = load i64, i64* %33
%136 = load i64, i64* %39
%137 = udiv i64 %135, %136
%138 = add i64 %137, 2
store i64 %138, i64* %38
%139 = load i64, i64* %39
%140 = load i64, i64* %38
%141 = mul i64 %139, %140
store i64 %141, i64* %33
%142 = load i32, i32* %17
%143 = sext i32 %142 to i64
%144 = udiv i64 %143, 8
store i64 %144, i64* %10
%145 = load i32, i32* %21
%146 = sitofp i32 %145 to double
%147 = load i32, i32* %20
%148 = sitofp i32 %147 to double
%149 = fmul double %146, %148
store double %149, double* %24
%150 = load i32, i32* %16
%151 = sext i32 %150 to i64
%152 = mul i64 %151, 4
%153 = trunc i64 %152 to i32
%154 = call i64 @malloc(i32 %153)
%155 = inttoptr i64 %154 to i32*
store i32* %155, i32** %46
%156 = load i32*, i32** %46
%157 = icmp eq i32* %156, null
br i1 %157, label %158, label %163
158: ; preds = %123
%159 = load i32, i32* @stderr
%160 = load i32, i32* %16
%161 = call i32 (i32, i8*, ...) @fprintf(i32 %159, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.9, i64 0, i64 0), i32 %160)
%162 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0))
br label %163
163: ; preds = %158, %123
%164 = load i32, i32* %49
%165 = icmp eq i32 %164, 1
br i1 %165, label %166, label %182
166: ; preds = %163
store i32 0, i32* %11
br label %167
167: ; preds = %178, %166
%168 = load i32, i32* %11
%169 = load i32, i32* %16
%170 = sub nsw i32 %169, 1
%171 = icmp slt i32 %168, %170
br i1 %171, label %172, label %181
172: ; preds = %167
%173 = load i32, i32* %11
%174 = load i32*, i32** %46
%175 = load i32, i32* %11
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds i32, i32* %174, i64 %176
store i32 %173, i32* %177
br label %178
178: ; preds = %172
%179 = load i32, i32* %11
%180 = add nsw i32 %179, 1
store i32 %180, i32* %11
br label %167
181: ; preds = %167
br label %265
182: ; preds = %163
%183 = load i32*, i32** %43
%184 = load i32, i32* %49
%185 = call i32 @rndm_list(i32* %183, i32 %184)
%186 = load i32, i32* %16
%187 = load i32, i32* %49
%188 = sdiv i32 %186, %187
store i32 %188, i32* %47
%189 = load i32, i32* %47
%190 = load i32, i32* %49
%191 = mul nsw i32 %189, %190
%192 = load i32, i32* %16
%193 = icmp ne i32 %191, %192
br i1 %193, label %194, label %199
194: ; preds = %182
%195 = load i32, i32* @stderr
%196 = load i32, i32* %49
%197 = call i32 (i32, i8*, ...) @fprintf(i32 %195, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.11, i64 0, i64 0), i32 %196)
%198 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
br label %199
199: ; preds = %194, %182
store i32 0, i32* %48
%200 = load i64, i64* %33
%201 = load i32, i32* %49
%202 = sext i32 %201 to i64
%203 = udiv i64 %200, %202
store i64 %203, i64* %36
store i32 0, i32* %11
br label %204
204: ; preds = %261, %199
%205 = load i32, i32* %11
%206 = load i32, i32* %47
%207 = icmp slt i32 %205, %206
br i1 %207, label %208, label %264
208: ; preds = %204
store i32 0, i32* %44
store i32 0, i32* %12
br label %209
209: ; preds = %257, %208
%210 = load i32, i32* %12
%211 = load i32, i32* %49
%212 = icmp slt i32 %210, %211
br i1 %212, label %213, label %260
213: ; preds = %209
%214 = load i32, i32* %48
%215 = add nsw i32 %214, 1
store i32 %215, i32* %48
%216 = load i32, i32* %12
%217 = load i32, i32* %49
%218 = sub nsw i32 %217, 1
%219 = icmp eq i32 %216, %218
br i1 %219, label %220, label %221
220: ; preds = %213
store i32 1, i32* %44
br label %221
221: ; preds = %220, %213
%222 = load i32, i32* %47
%223 = load i32*, i32** %43
%224 = load i32, i32* %12
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds i32, i32* %223, i64 %225
%227 = load i32, i32* %226
%228 = mul nsw i32 %222, %227
%229 = sext i32 %228 to i64
store i64 %229, i64* %37
%230 = load i64, i64* %37
%231 = trunc i64 %230 to i32
%232 = load i32, i32* %11
%233 = add nsw i32 %231, %232
%234 = load i32, i32* %44
%235 = add nsw i32 %233, %234
%236 = load i32*, i32** %46
%237 = load i32, i32* %48
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds i32, i32* %236, i64 %238
store i32 %235, i32* %239
%240 = load i32*, i32** %46
%241 = load i32, i32* %48
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds i32, i32* %240, i64 %242
%244 = load i32, i32* %243
%245 = load i32, i32* %16
%246 = icmp sge i32 %244, %245
br i1 %246, label %247, label %256
247: ; preds = %221
%248 = load i32, i32* %48
%249 = sitofp i32 %248 to double
%250 = load i32*, i32** %46
%251 = load i32, i32* %48
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds i32, i32* %250, i64 %252
%254 = load i32, i32* %253
%255 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0), double %249, i32 %254)
br label %256
256: ; preds = %247, %221
br label %257
257: ; preds = %256
%258 = load i32, i32* %12
%259 = add nsw i32 %258, 1
store i32 %259, i32* %12
br label %209
260: ; preds = %209
br label %261
261: ; preds = %260
%262 = load i32, i32* %11
%263 = add nsw i32 %262, 1
store i32 %263, i32* %11
br label %204
264: ; preds = %204
br label %265
265: ; preds = %264, %181
%266 = load i32*, i32** %46
%267 = getelementptr inbounds i32, i32* %266, i64 0
store i32 0, i32* %267
%268 = load i32, i32* %50
%269 = icmp eq i32 %268, 0
br i1 %269, label %270, label %282
270: ; preds = %265
%271 = load i64, i64* %33
%272 = load i32, i32* @PROT_READ
%273 = load i32, i32* @PROT_WRITE
%274 = or i32 %272, %273
%275 = load i32, i32* @MAP_PRIVATE
%276 = load i32, i32* @MAP_ANON
%277 = or i32 %275, %276
%278 = load i32, i32* %18
%279 = load i32, i32* %19
%280 = call i64 @mmap(i32* null, i64 %271, i32 %274, i32 %277, i32 %278, i32 %279)
%281 = inttoptr i64 %280 to i8*
store i8* %281, i8** %6
br label %282
282: ; preds = %270, %265
%283 = load i32, i32* %50
%284 = icmp eq i32 %283, 1
br i1 %284, label %285, label %299
285: ; preds = %282
%286 = load i64, i64* %33
%287 = load i32, i32* @PROT_READ
%288 = load i32, i32* @PROT_WRITE
%289 = or i32 %287, %288
%290 = load i32, i32* @MAP_PRIVATE
%291 = load i32, i32* @MAP_ANON
%292 = or i32 %290, %291
%293 = load i32, i32* @MAP_HUGETLB
%294 = or i32 %292, %293
%295 = load i32, i32* %18
%296 = load i32, i32* %19
%297 = call i64 @mmap(i32* null, i64 %286, i32 %289, i32 %294, i32 %295, i32 %296)
%298 = inttoptr i64 %297 to i8*
store i8* %298, i8** %6
br label %299
299: ; preds = %285, %282
%300 = load i8*, i8** %6
%301 = load i8*, i8** @MAP_FAILED
%302 = icmp eq i8* %300, %301
br i1 %302, label %303, label %307
303: ; preds = %299
%304 = load i32, i32* @stderr
%305 = call i32 (i32, i8*, ...) @fprintf(i32 %304, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0))
%306 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0))
br label %307
307: ; preds = %303, %299
%308 = load i32, i32* @stderr
%309 = load i8*, i8** %6
%310 = call i32 (i32, i8*, ...) @fprintf(i32 %308, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0), i8* %309)
%311 = load i64, i64* %33
%312 = load i64, i64* %40
%313 = udiv i64 %311, %312
store i64 %313, i64* %35
%314 = load i32, i32* @stderr
%315 = load i64, i64* %33
%316 = load i64, i64* %35
%317 = load i64, i64* %10
%318 = call i32 (i32, i8*, ...) @fprintf(i32 %314, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.17, i64 0, i64 0), i64 %315, i64 %316, i64 %317)
%319 = load i8*, i8** %6
%320 = bitcast i8* %319 to i64*
store i64* %320, i64** %8
%321 = load i8*, i8** %6
%322 = load i64, i64* %33
%323 = call i8* @memset(i8* %321, i32 0, i64 %322)
store i8* %323, i8** %7
%324 = load i32, i32* @stderr
%325 = load i8*, i8** %7
%326 = call i32 (i32, i8*, ...) @fprintf(i32 %324, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.18, i64 0, i64 0), i8* %325)
store i64 0, i64* %34
br label %327
327: ; preds = %354, %307
%328 = load i64, i64* %34
%329 = load i32, i32* %16
%330 = sub nsw i32 %329, 1
%331 = sext i32 %330 to i64
%332 = icmp ult i64 %328, %331
br i1 %332, label %333, label %357
333: ; preds = %327
%334 = load i64*, i64** %8
%335 = load i32*, i32** %46
%336 = load i64, i64* %34
%337 = add i64 %336, 1
%338 = getelementptr inbounds i32, i32* %335, i64 %337
%339 = load i32, i32* %338
%340 = sext i32 %339 to i64
%341 = load i64, i64* %10
%342 = mul i64 %340, %341
%343 = getelementptr inbounds i64, i64* %334, i64 %342
%344 = ptrtoint i64* %343 to i64
%345 = load i64*, i64** %8
%346 = load i32*, i32** %46
%347 = load i64, i64* %34
%348 = getelementptr inbounds i32, i32* %346, i64 %347
%349 = load i32, i32* %348
%350 = sext i32 %349 to i64
%351 = load i64, i64* %10
%352 = mul i64 %350, %351
%353 = getelementptr inbounds i64, i64* %345, i64 %352
store i64 %344, i64* %353
br label %354
354: ; preds = %333
%355 = load i64, i64* %34
%356 = add i64 %355, 1
store i64 %356, i64* %34
br label %327
357: ; preds = %327
%358 = load i32, i32* @stderr
%359 = load i64*, i64** %8
%360 = load i32, i32* %16
%361 = sub nsw i32 %360, 1
%362 = sext i32 %361 to i64
%363 = getelementptr inbounds i64, i64* %359, i64 %362
%364 = load i64, i64* %363
%365 = load i8*, i8** %6
%366 = ptrtoint i8* %365 to i64
%367 = sub i64 %364, %366
%368 = call i32 (i32, i8*, ...) @fprintf(i32 %358, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.19, i64 0, i64 0), i64 %367)
%369 = load i64*, i64** %8
%370 = getelementptr inbounds i64, i64* %369, i64 0
%371 = ptrtoint i64* %370 to i64
%372 = load i64*, i64** %8
%373 = load i64, i64* %10
%374 = load i32, i32* %16
%375 = sub nsw i32 %374, 1
%376 = sext i32 %375 to i64
%377 = mul i64 %373, %376
%378 = getelementptr inbounds i64, i64* %372, i64 %377
store i64 %371, i64* %378
%379 = load i32, i32* %32
%380 = load i32, i32* %15
%381 = call i32 @pin_cpu(i32 %379, i32 %380)
%382 = icmp eq i32 %381, -1
br i1 %382, label %383, label %385
383: ; preds = %357
%384 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.20, i64 0, i64 0))
br label %389
385: ; preds = %357
%386 = load i32, i32* %15
%387 = sitofp i32 %386 to double
%388 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.21, i64 0, i64 0), double %387)
br label %389
389: ; preds = %385, %383
%390 = load i32, i32* %21
%391 = sitofp i32 %390 to double
%392 = load i32, i32* %20
%393 = load i32, i32* %16
%394 = load i32, i32* %17
%395 = load i64, i64* %33
%396 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str.22, i64 0, i64 0), double %391, i32 %392, i32 %393, i32 %394, i64 %395)
%397 = call i64 (...) @_rdtsc()
store i64 %397, i64* %28
store i32 0, i32* %11
br label %398
398: ; preds = %411, %389
%399 = load i32, i32* %11
%400 = load i32, i32* %21
%401 = icmp slt i32 %399, %400
br i1 %401, label %402, label %414
402: ; preds = %398
%403 = call i64 (...) @_rdtsc()
store i64 %403, i64* %25
%404 = load i32, i32* %20
%405 = load i64*, i64** %8
%406 = call i64 @reader(i32 %404, i64* %405)
store i64 %406, i64* %9
%407 = call i64 (...) @_rdtsc()
store i64 %407, i64* %26
%408 = load i64, i64* %26
%409 = load i64, i64* %25
%410 = sub i64 %408, %409
store i64 %410, i64* %27
br label %411
411: ; preds = %402
%412 = load i32, i32* %11
%413 = add nsw i32 %412, 1
store i32 %413, i32* %11
br label %398
414: ; preds = %398
%415 = call i64 (...) @_rdtsc()
store i64 %415, i64* %29
%416 = load i64, i64* %29
%417 = load i64, i64* %28
%418 = sub i64 %416, %417
store i64 %418, i64* %30
%419 = load i64, i64* %30
%420 = uitofp i64 %419 to double
%421 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), double %420)
%422 = load i64, i64* %30
%423 = uitofp i64 %422 to double
%424 = load double, double* %24
%425 = fdiv double %423, %424
%426 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.24, i64 0, i64 0), double %425)
%427 = load i32, i32* %23
ret i32 %427
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [109 x i8] c"the random walker requires at least 6 arguments (only the 7th in the list below is optional), there were %d\0A\00"
@.str.1 = [34 x i8] c"insufficient invocation arguments\00"
@.str.2 = [14 x i8] c"i:r:l:s:S:m:L\00"
@optarg = global i32 0
@.str.3 = [18 x i8] c"unknown option %c\00"
@.str.4 = [21 x i8] c"size_t in %zd bytes\0A\00"
@.str.5 = [23 x i8] c"failed to set affinity\00"
@.str.6 = [28 x i8] c" process pinned to core %d\0A\00"
@.str.7 = [41 x i8] c" failed to malloc pattern for size = %d\0A\00"
@.str.8 = [25 x i8] c"malloc of pattern failed\00"
@.str.9 = [52 x i8] c" failed to malloc index array for line_count of %d\0A\00"
@.str.10 = [23 x i8] c"failed to malloc index\00"
@.str.11 = [67 x i8] c" line count must be a multiple of the fifth argument num_seg = %d\0A\00"
@.str.12 = [16 x i8] c" bad line_count\00"
@.str.13 = [25 x i8] c" count = %d, index = %d\0A\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_ANON = global i32 0
@MAP_HUGETLB = global i32 0
@MAP_FAILED = global i8* null
@.str.14 = [13 x i8] c"mmap failed\0A\00"
@.str.15 = [12 x i8] c"mmap failed\00"
@.str.16 = [12 x i8] c" buf1 = %p\0A\00"
@.str.17 = [54 x i8] c" buf_size = %zu, zero_loop = %zu, array_stride = %zd\0A\00"
@.str.18 = [32 x i8] c" finished zeroing buf ret = %p\0A\00"
@.str.19 = [39 x i8] c" target of last element in loop = %zx\0A\00"
@.str.20 = [28 x i8] c"cannot set cpu run affinity\00"
@.str.21 = [35 x i8] c" process pinned to core %d to run\0A\00"
@.str.22 = [115 x i8] c" calling walker %d times which loops %d times on buffer of %d lines with a stride of %d, for a total size of %zu\0A\00"
@.str.23 = [17 x i8] c" run time = %zd\0A\00"
@.str.24 = [36 x i8] c" average cycles per iteration = %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 6
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 (...) @usage()
%8 = tail call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %4, %2
br label %10
10: ; preds = %20, %9
%11 = phi i32 [ 1, %9 ], [ %21, %20 ]
%12 = phi i64 [ 4096, %9 ], [ %22, %20 ]
%13 = phi i32 [ undef, %9 ], [ %23, %20 ]
%14 = phi i32 [ undef, %9 ], [ %24, %20 ]
%15 = phi i32 [ undef, %9 ], [ %25, %20 ]
%16 = phi i32 [ undef, %9 ], [ %26, %20 ]
%17 = phi i32 [ 32, %9 ], [ %27, %20 ]
%18 = phi i32 [ 0, %9 ], [ %28, %20 ]
%19 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
switch i32 %19, label %47 [
i32 -1, label %49
i32 105, label %29
i32 114, label %32
i32 108, label %35
i32 115, label %38
i32 83, label %41
i32 109, label %44
i32 76, label %20
]
20: ; preds = %10, %47, %44, %41, %38, %35, %32, %29
%21 = phi i32 [ %11, %47 ], [ %46, %44 ], [ %11, %41 ], [ %11, %38 ], [ %11, %35 ], [ %11, %32 ], [ %11, %29 ], [ %11, %10 ]
%22 = phi i64 [ %12, %47 ], [ %12, %44 ], [ %12, %41 ], [ %12, %38 ], [ %12, %35 ], [ %12, %32 ], [ %12, %29 ], [ 2097152, %10 ]
%23 = phi i32 [ %13, %47 ], [ %13, %44 ], [ %13, %41 ], [ %40, %38 ], [ %13, %35 ], [ %13, %32 ], [ %13, %29 ], [ %13, %10 ]
%24 = phi i32 [ %14, %47 ], [ %14, %44 ], [ %14, %41 ], [ %14, %38 ], [ %37, %35 ], [ %14, %32 ], [ %14, %29 ], [ %14, %10 ]
%25 = phi i32 [ %15, %47 ], [ %15, %44 ], [ %15, %41 ], [ %15, %38 ], [ %15, %35 ], [ %34, %32 ], [ %15, %29 ], [ %15, %10 ]
%26 = phi i32 [ %16, %47 ], [ %16, %44 ], [ %16, %41 ], [ %16, %38 ], [ %16, %35 ], [ %16, %32 ], [ %31, %29 ], [ %16, %10 ]
%27 = phi i32 [ %17, %47 ], [ %17, %44 ], [ %43, %41 ], [ %17, %38 ], [ %17, %35 ], [ %17, %32 ], [ %17, %29 ], [ %17, %10 ]
%28 = phi i32 [ %18, %47 ], [ %18, %44 ], [ %18, %41 ], [ %18, %38 ], [ %18, %35 ], [ %18, %32 ], [ %18, %29 ], [ 1, %10 ]
br label %10
29: ; preds = %10
%30 = load i32, i32* @optarg
%31 = tail call i32 @atoi(i32 %30)
br label %20
32: ; preds = %10
%33 = load i32, i32* @optarg
%34 = tail call i32 @atoi(i32 %33)
br label %20
35: ; preds = %10
%36 = load i32, i32* @optarg
%37 = tail call i32 @atoi(i32 %36)
br label %20
38: ; preds = %10
%39 = load i32, i32* @optarg
%40 = tail call i32 @atoi(i32 %39)
br label %20
41: ; preds = %10
%42 = load i32, i32* @optarg
%43 = tail call i32 @atoi(i32 %42)
br label %20
44: ; preds = %10
%45 = load i32, i32* @optarg
%46 = tail call i32 @atoi(i32 %45)
br label %20
47: ; preds = %10
%48 = tail call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %19)
br label %20
49: ; preds = %10
%50 = mul i32 %11, 100
%51 = load i32, i32* @stderr
%52 = tail call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i64 8)
%53 = tail call i32 @pin_cpu(i32 0, i32 %16)
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %57
55: ; preds = %49
%56 = tail call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %60
57: ; preds = %49
%58 = load i32, i32* @stderr
%59 = tail call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i32 %16)
br label %60
60: ; preds = %57, %55
%61 = shl i32 %17, 2
%62 = tail call i64 @malloc(i32 %61)
%63 = inttoptr i64 %62 to i32*
%64 = icmp eq i64 %62, 0
br i1 %64, label %65, label %69
65: ; preds = %60
%66 = load i32, i32* @stderr
%67 = tail call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0), i32 %17)
%68 = tail call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0))
br label %69
69: ; preds = %65, %60
%70 = trunc i64 %12 to i32
%71 = mul i32 %13, %70
%72 = or i32 %71, 64
%73 = sext i32 %14 to i64
%74 = sext i32 %72 to i64
%75 = mul nsw i64 %74, %73
%76 = udiv i64 %75, %12
%77 = add i64 %76, 2
%78 = mul i64 %77, %12
%79 = lshr exact i64 %74, 3
%80 = sitofp i32 %50 to double
%81 = shl i32 %14, 2
%82 = tail call i64 @malloc(i32 %81)
%83 = inttoptr i64 %82 to i32*
%84 = icmp eq i64 %82, 0
br i1 %84, label %85, label %89
85: ; preds = %69
%86 = load i32, i32* @stderr
%87 = tail call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.9, i64 0, i64 0), i32 %14)
%88 = tail call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0))
br label %89
89: ; preds = %85, %69
%90 = icmp eq i32 %17, 1
br i1 %90, label %91, label %167
91: ; preds = %89
%92 = icmp sgt i32 %14, 1
br i1 %92, label %93, label %215
93: ; preds = %91
%94 = add nsw i32 %14, -1
%95 = zext i32 %94 to i64
%96 = icmp ult i32 %94, 8
br i1 %96, label %159, label %97
97: ; preds = %93
%98 = and i64 %95, 4294967288
%99 = add nsw i64 %98, -8
%100 = lshr exact i64 %99, 3
%101 = add nuw nsw i64 %100, 1
%102 = and i64 %101, 3
%103 = icmp ult i64 %99, 24
br i1 %103, label %140, label %104
104: ; preds = %97
%105 = and i64 %101, 4611686018427387900
br label %106
106: ; preds = %106, %104
%107 = phi i64 [ 0, %104 ], [ %136, %106 ]
%108 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %104 ], [ %137, %106 ]
%109 = phi i64 [ 0, %104 ], [ %138, %106 ]
%110 = add <4 x i32> %108, <i32 4, i32 4, i32 4, i32 4>
%111 = getelementptr inbounds i32, i32* %83, i64 %107
%112 = bitcast i32* %111 to <4 x i32>*
store <4 x i32> %108, <4 x i32>* %112
%113 = getelementptr inbounds i32, i32* %111, i64 4
%114 = bitcast i32* %113 to <4 x i32>*
store <4 x i32> %110, <4 x i32>* %114
%115 = or i64 %107, 8
%116 = add <4 x i32> %108, <i32 8, i32 8, i32 8, i32 8>
%117 = add <4 x i32> %108, <i32 12, i32 12, i32 12, i32 12>
%118 = getelementptr inbounds i32, i32* %83, i64 %115
%119 = bitcast i32* %118 to <4 x i32>*
store <4 x i32> %116, <4 x i32>* %119
%120 = getelementptr inbounds i32, i32* %118, i64 4
%121 = bitcast i32* %120 to <4 x i32>*
store <4 x i32> %117, <4 x i32>* %121
%122 = or i64 %107, 16
%123 = add <4 x i32> %108, <i32 16, i32 16, i32 16, i32 16>
%124 = add <4 x i32> %108, <i32 20, i32 20, i32 20, i32 20>
%125 = getelementptr inbounds i32, i32* %83, i64 %122
%126 = bitcast i32* %125 to <4 x i32>*
store <4 x i32> %123, <4 x i32>* %126
%127 = getelementptr inbounds i32, i32* %125, i64 4
%128 = bitcast i32* %127 to <4 x i32>*
store <4 x i32> %124, <4 x i32>* %128
%129 = or i64 %107, 24
%130 = add <4 x i32> %108, <i32 24, i32 24, i32 24, i32 24>
%131 = add <4 x i32> %108, <i32 28, i32 28, i32 28, i32 28>
%132 = getelementptr inbounds i32, i32* %83, i64 %129
%133 = bitcast i32* %132 to <4 x i32>*
store <4 x i32> %130, <4 x i32>* %133
%134 = getelementptr inbounds i32, i32* %132, i64 4
%135 = bitcast i32* %134 to <4 x i32>*
store <4 x i32> %131, <4 x i32>* %135
%136 = add nuw i64 %107, 32
%137 = add <4 x i32> %108, <i32 32, i32 32, i32 32, i32 32>
%138 = add i64 %109, 4
%139 = icmp eq i64 %138, %105
br i1 %139, label %140, label %106
140: ; preds = %106, %97
%141 = phi i64 [ 0, %97 ], [ %136, %106 ]
%142 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %97 ], [ %137, %106 ]
%143 = icmp eq i64 %102, 0
br i1 %143, label %157, label %144
144: ; preds = %140, %144
%145 = phi i64 [ %153, %144 ], [ %141, %140 ]
%146 = phi <4 x i32> [ %154, %144 ], [ %142, %140 ]
%147 = phi i64 [ %155, %144 ], [ 0, %140 ]
%148 = add <4 x i32> %146, <i32 4, i32 4, i32 4, i32 4>
%149 = getelementptr inbounds i32, i32* %83, i64 %145
%150 = bitcast i32* %149 to <4 x i32>*
store <4 x i32> %146, <4 x i32>* %150
%151 = getelementptr inbounds i32, i32* %149, i64 4
%152 = bitcast i32* %151 to <4 x i32>*
store <4 x i32> %148, <4 x i32>* %152
%153 = add nuw i64 %145, 8
%154 = add <4 x i32> %146, <i32 8, i32 8, i32 8, i32 8>
%155 = add i64 %147, 1
%156 = icmp eq i64 %155, %102
br i1 %156, label %157, label %144
157: ; preds = %144, %140
%158 = icmp eq i64 %98, %95
br i1 %158, label %215, label %159
159: ; preds = %93, %157
%160 = phi i64 [ 0, %93 ], [ %98, %157 ]
br label %161
161: ; preds = %159, %161
%162 = phi i64 [ %165, %161 ], [ %160, %159 ]
%163 = getelementptr inbounds i32, i32* %83, i64 %162
%164 = trunc i64 %162 to i32
store i32 %164, i32* %163
%165 = add nuw nsw i64 %162, 1
%166 = icmp eq i64 %165, %95
br i1 %166, label %215, label %161
167: ; preds = %89
%168 = tail call i32 @rndm_list(i32* %63, i32 %17)
%169 = sdiv i32 %14, %17
%170 = mul nsw i32 %169, %17
%171 = icmp eq i32 %170, %14
br i1 %171, label %176, label %172
172: ; preds = %167
%173 = load i32, i32* @stderr
%174 = tail call i32 (i32, i8*, ...) @fprintf(i32 %173, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.11, i64 0, i64 0), i32 %17)
%175 = tail call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
br label %176
176: ; preds = %172, %167
%177 = icmp sgt i32 %169, 0
br i1 %177, label %178, label %215
178: ; preds = %176
%179 = icmp sgt i32 %17, 0
%180 = add nsw i32 %17, -1
%181 = zext i32 %180 to i64
%182 = zext i32 %17 to i64
br label %183
183: ; preds = %178, %211
%184 = phi i32 [ 0, %178 ], [ %212, %211 ]
%185 = phi i32 [ 0, %178 ], [ %213, %211 ]
br i1 %179, label %186, label %211
186: ; preds = %183
%187 = sext i32 %184 to i64
br label %188
188: ; preds = %186, %206
%189 = phi i64 [ 0, %186 ], [ %207, %206 ]
%190 = phi i64 [ %187, %186 ], [ %192, %206 ]
%191 = phi i32 [ 0, %186 ], [ %194, %206 ]
%192 = add nsw i64 %190, 1
%193 = icmp eq i64 %189, %181
%194 = select i1 %193, i32 1, i32 %191
%195 = getelementptr inbounds i32, i32* %63, i64 %189
%196 = load i32, i32* %195
%197 = mul nsw i32 %196, %169
%198 = add i32 %194, %185
%199 = add i32 %198, %197
%200 = getelementptr inbounds i32, i32* %83, i64 %192
store i32 %199, i32* %200
%201 = icmp slt i32 %199, %14
br i1 %201, label %206, label %202
202: ; preds = %188
%203 = trunc i64 %192 to i32
%204 = sitofp i32 %203 to double
%205 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0), double %204, i32 %199)
br label %206
206: ; preds = %188, %202
%207 = add nuw nsw i64 %189, 1
%208 = icmp eq i64 %207, %182
br i1 %208, label %209, label %188
209: ; preds = %206
%210 = trunc i64 %192 to i32
br label %211
211: ; preds = %209, %183
%212 = phi i32 [ %184, %183 ], [ %210, %209 ]
%213 = add nuw nsw i32 %185, 1
%214 = icmp eq i32 %213, %169
br i1 %214, label %215, label %183
215: ; preds = %211, %161, %157, %176, %91
store i32 0, i32* %83
%216 = icmp eq i32 %18, 1
%217 = load i32, i32* @PROT_READ
%218 = load i32, i32* @PROT_WRITE
%219 = or i32 %218, %217
%220 = load i32, i32* @MAP_ANON
%221 = load i32, i32* @MAP_PRIVATE
%222 = select i1 %216, i32 %221, i32 0
%223 = or i32 %220, %222
%224 = load i32, i32* @MAP_HUGETLB
%225 = select i1 %216, i32 %224, i32 %221
%226 = or i32 %223, %225
%227 = tail call i64 @mmap(i32* null, i64 %78, i32 %219, i32 %226, i32 -1, i32 0)
%228 = inttoptr i64 %227 to i8*
%229 = load i8*, i8** @MAP_FAILED
%230 = icmp eq i8* %229, %228
br i1 %230, label %231, label %235
231: ; preds = %215
%232 = load i32, i32* @stderr
%233 = tail call i32 (i32, i8*, ...) @fprintf(i32 %232, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0))
%234 = tail call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0))
br label %235
235: ; preds = %231, %215
%236 = load i32, i32* @stderr
%237 = tail call i32 (i32, i8*, ...) @fprintf(i32 %236, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0), i8* %228)
%238 = lshr exact i64 %78, 3
%239 = load i32, i32* @stderr
%240 = tail call i32 (i32, i8*, ...) @fprintf(i32 %239, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.17, i64 0, i64 0), i64 %78, i64 %238, i64 %79)
%241 = inttoptr i64 %227 to i64*
tail call void @llvm.memset.p0i8.i64(i8* align 1 %228, i8 0, i64 %78, i1 false)
%242 = load i32, i32* @stderr
%243 = tail call i32 (i32, i8*, ...) @fprintf(i32 %242, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.18, i64 0, i64 0), i8* %228)
%244 = add nsw i32 %14, -1
%245 = sext i32 %244 to i64
%246 = icmp eq i32 %244, 0
br i1 %246, label %296, label %247
247: ; preds = %235
%248 = call i64 @llvm.umax.i64(i64 %245, i64 1)
%249 = load i32, i32* %83
%250 = and i64 %248, 1
%251 = icmp eq i32 %244, 1
br i1 %251, label %282, label %252
252: ; preds = %247
%253 = and i64 %248, -2
br label %254
254: ; preds = %254, %252
%255 = phi i32 [ %249, %252 ], [ %270, %254 ]
%256 = phi i64 [ 0, %252 ], [ %268, %254 ]
%257 = phi i64 [ 0, %252 ], [ %278, %254 ]
%258 = or i64 %256, 1
%259 = getelementptr inbounds i32, i32* %83, i64 %258
%260 = load i32, i32* %259
%261 = sext i32 %260 to i64
%262 = mul i64 %79, %261
%263 = getelementptr inbounds i64, i64* %241, i64 %262
%264 = ptrtoint i64* %263 to i64
%265 = sext i32 %255 to i64
%266 = mul i64 %79, %265
%267 = getelementptr inbounds i64, i64* %241, i64 %266
store i64 %264, i64* %267
%268 = add nuw i64 %256, 2
%269 = getelementptr inbounds i32, i32* %83, i64 %268
%270 = load i32, i32* %269
%271 = sext i32 %270 to i64
%272 = mul i64 %79, %271
%273 = getelementptr inbounds i64, i64* %241, i64 %272
%274 = ptrtoint i64* %273 to i64
%275 = sext i32 %260 to i64
%276 = mul i64 %79, %275
%277 = getelementptr inbounds i64, i64* %241, i64 %276
store i64 %274, i64* %277
%278 = add i64 %257, 2
%279 = icmp eq i64 %278, %253
br i1 %279, label %280, label %254
280: ; preds = %254
%281 = add i64 %256, 3
br label %282
282: ; preds = %280, %247
%283 = phi i32 [ %249, %247 ], [ %270, %280 ]
%284 = phi i64 [ 1, %247 ], [ %281, %280 ]
%285 = icmp eq i64 %250, 0
br i1 %285, label %296, label %286
286: ; preds = %282
%287 = getelementptr inbounds i32, i32* %83, i64 %284
%288 = load i32, i32* %287
%289 = sext i32 %288 to i64
%290 = mul i64 %79, %289
%291 = getelementptr inbounds i64, i64* %241, i64 %290
%292 = ptrtoint i64* %291 to i64
%293 = sext i32 %283 to i64
%294 = mul i64 %79, %293
%295 = getelementptr inbounds i64, i64* %241, i64 %294
store i64 %292, i64* %295
br label %296
296: ; preds = %286, %282, %235
%297 = load i32, i32* @stderr
%298 = getelementptr inbounds i64, i64* %241, i64 %245
%299 = load i64, i64* %298
%300 = sub i64 %299, %227
%301 = tail call i32 (i32, i8*, ...) @fprintf(i32 %297, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.19, i64 0, i64 0), i64 %300)
%302 = mul i64 %79, %245
%303 = getelementptr inbounds i64, i64* %241, i64 %302
store i64 %227, i64* %303
%304 = tail call i32 @pin_cpu(i32 0, i32 %15)
%305 = icmp eq i32 %304, -1
br i1 %305, label %306, label %308
306: ; preds = %296
%307 = tail call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.20, i64 0, i64 0))
br label %311
308: ; preds = %296
%309 = sitofp i32 %15 to double
%310 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.21, i64 0, i64 0), double %309)
br label %311
311: ; preds = %308, %306
%312 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str.22, i64 0, i64 0), double %80, i32 10240000, i32 %14, i32 %72, i64 %78)
%313 = tail call i64 (...) @_rdtsc()
%314 = icmp sgt i32 %11, 0
br i1 %314, label %315, label %324
315: ; preds = %311
%316 = call i32 @llvm.smax.i32(i32 %50, i32 1)
br label %317
317: ; preds = %315, %317
%318 = phi i32 [ %322, %317 ], [ 0, %315 ]
%319 = tail call i64 (...) @_rdtsc()
%320 = tail call i64 @reader(i32 10240000, i64* %241)
%321 = tail call i64 (...) @_rdtsc()
%322 = add nuw nsw i32 %318, 1
%323 = icmp eq i32 %322, %316
br i1 %323, label %324, label %317
324: ; preds = %317, %311
%325 = fmul double %80, 1.024000e+07
%326 = tail call i64 (...) @_rdtsc()
%327 = sub i64 %326, %313
%328 = uitofp i64 %327 to double
%329 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), double %328)
%330 = fdiv double %328, %325
%331 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.24, i64 0, i64 0), double %330)
ret i32 0
}