#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 */
struct timespec {
  int dummy;
};
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;
void *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 *, ...);
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, *pnt, element, 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, line_size;
  int cpu_setsize;
  cpu_set_t mask;
  int *pattern;
  int step, c, bad;
  int *index, *index_test, lc_by_num_seg, count, num_seg = 32, huge = 0;
  unsigned int bitmask, *intstar;
  struct timespec start_t, stop_t;
  page_size = 4096;
  line_size = 64;
  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:c")) != -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;
    case 'c':
      line_size = atoi(optarg);
      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 + line_size;
  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");
  }
  index_test = (int *)malloc(line_count * sizeof(int));
  if (index_test == NULL) {
    fprintf(stderr, " failed to malloc index_test array for line_count of %d\n",
            line_count);
    err(1, "failed to malloc index_test");
  }
  for (i = 0; i < line_count; i++)
    index_test[i] = 0;
  if (num_seg == 1) {
    for (i = 0; i < line_count; 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 = i * num_seg;
      for (j = 0; j < num_seg - 1; j++) {
        count++;
        ind = lc_by_num_seg * pattern[j];
        index[count] = (int)pattern[j] + step;
        if (index[count] >= line_count)
          printf(" count = %d, index = %d\n", count, index[count]);
      }
      count++;
      index[count] = (i + 1) * num_seg;
    }
    index[count] = 0;
  }
  index[0] = 0;
  for (i = 0; i < line_count; i++) {
    if (index[i] > line_count)
      err(1, "index[%d] = %d", i, index[i]);
    index_test[index[i]]++;
  }
  bad = 0;
  for (i = 0; i < line_count; i++) {
    if (index_test[i] != 1) {
      bad++;
      if (bad < 64)
        fprintf(stderr, "index_test[%d] = %d\n", i, index_test[i]);
    }
  }
  fprintf(stderr, "bad = %d\n", bad);
  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)index[line_count - 1]] =
      (size_t)&array[0];
  bad = 0;
  pnt = array;
  fprintf(stderr, " array address = %p value = %lx\n", pnt, *pnt);
  while (bad < line_count + 4) {
    pnt = (size_t *)*pnt;
    element = (size_t)(pnt - array);
    element = element / var_size;
    bad++;
    if (bad > line_count - 4)
      fprintf(stderr, "index = %d,element = %ld, address = %p, value = %lx\n",
              bad, element, pnt, *pnt);
  }
  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);
  for (i = 0; i < iter; i++) {
    ret_val = reader(len, array);
  }
  printf(" done\n");
  return main_ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x40(%rbp)
movl   $0xffffffff,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
movl   $0x9c4000,-0x70(%rbp)
movl   $0x64,-0x74(%rbp)
movl   $0x1,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
movq   $0x0,-0xc0(%rbp)
movl   $0x0,-0xc4(%rbp)
movl   $0x20,-0x14c(%rbp)
movl   $0x0,-0x150(%rbp)
movq   $0x1000,-0x100(%rbp)
movq   $0x40,-0x110(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    1288 <main+0xc8>
mov    0x2d6d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe39(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x0,%al
call   10b0 <usage@plt>
mov    $0x1,%edi
lea    0xe8c(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
jmp    128d <main+0xcd>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe94(%rip),%rdx
call   10d0 <getopt@plt>
mov    %eax,-0x128(%rbp)
cmp    $0xffffffff,%eax
je     13ba <main+0x1fa>
mov    -0x128(%rbp),%eax
add    $0xffffffb4,%eax
mov    %eax,%ecx
mov    %rcx,-0x178(%rbp)
sub    $0x27,%eax
ja     139c <main+0x1dc>
mov    -0x178(%rbp),%rax
lea    0xd28(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2d10(%rip),%rax
mov    (%rax),%edi
call   10e0 <atoi@plt>
mov    %eax,-0x58(%rbp)
jmp    13b5 <main+0x1f5>
mov    0x2cfa(%rip),%rax
mov    (%rax),%edi
call   10e0 <atoi@plt>
mov    %eax,-0x5c(%rbp)
jmp    13b5 <main+0x1f5>
mov    0x2ce4(%rip),%rax
mov    (%rax),%edi
call   10e0 <atoi@plt>
mov    %eax,-0x60(%rbp)
jmp    13b5 <main+0x1f5>
mov    0x2cce(%rip),%rax
mov    (%rax),%edi
call   10e0 <atoi@plt>
mov    %eax,-0x64(%rbp)
jmp    13b5 <main+0x1f5>
mov    0x2cb8(%rip),%rax
mov    (%rax),%edi
call   10e0 <atoi@plt>
mov    %eax,-0x14c(%rbp)
jmp    13b5 <main+0x1f5>
mov    0x2c9f(%rip),%rax
mov    (%rax),%edi
call   10e0 <atoi@plt>
mov    %eax,-0x78(%rbp)
jmp    13b5 <main+0x1f5>
movl   $0x1,-0x150(%rbp)
movq   $0x200000,-0x100(%rbp)
jmp    13b5 <main+0x1f5>
mov    0x2c6f(%rip),%rax
mov    (%rax),%edi
call   10e0 <atoi@plt>
mov    %rax,-0x110(%rbp)
jmp    13b5 <main+0x1f5>
mov    -0x128(%rbp),%edx
mov    $0x1,%edi
lea    0xd91(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
jmp    128d <main+0xcd>
mov    -0x74(%rbp),%eax
imul   -0x78(%rbp),%eax
mov    %eax,-0x74(%rbp)
movq   $0x8,-0x108(%rbp)
mov    0x2bf2(%rip),%rax
mov    (%rax),%edi
mov    -0x108(%rbp),%rdx
lea    0xd6b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0xc4(%rbp),%edi
mov    -0x58(%rbp),%esi
call   1070 <pin_cpu@plt>
cmp    $0xffffffff,%eax
jne    141c <main+0x25c>
mov    $0x1,%edi
lea    0xd56(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
jmp    1436 <main+0x276>
mov    0x2ba5(%rip),%rax
mov    (%rax),%edi
mov    -0x58(%rbp),%edx
lea    0xd4e(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movslq -0x14c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x120(%rbp)
cmpq   $0x0,-0x120(%rbp)
jne    148d <main+0x2cd>
mov    0x2b64(%rip),%rax
mov    (%rax),%edi
mov    -0x14c(%rbp),%edx
lea    0xd26(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
lea    0xd3c(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
mov    -0x100(%rbp),%rax
movslq -0x64(%rbp),%rcx
imul   %rcx,%rax
add    -0x110(%rbp),%rax
mov    %eax,-0x64(%rbp)
movslq -0x60(%rbp),%rax
movslq -0x64(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0xd0(%rbp)
mov    -0xd0(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x100(%rbp)
add    $0x2,%rax
mov    %rax,-0xf8(%rbp)
mov    -0x100(%rbp),%rax
imul   -0xf8(%rbp),%rax
ff
mov    %rax,-0xd0(%rbp)
movslq -0x64(%rbp),%rax
shr    $0x3,%rax
mov    %rax,-0x48(%rbp)
cvtsi2sdl -0x74(%rbp),%xmm0
cvtsi2sdl -0x70(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movslq -0x60(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x138(%rbp)
cmpq   $0x0,-0x138(%rbp)
jne    155f <main+0x39f>
mov    0x2a8f(%rip),%rax
mov    (%rax),%edi
mov    -0x60(%rbp),%edx
lea    0xc96(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
lea    0xcb7(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
movslq -0x60(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x140(%rbp)
cmpq   $0x0,-0x140(%rbp)
jne    15b0 <main+0x3f0>
mov    0x2a3e(%rip),%rax
mov    (%rax),%edi
mov    -0x60(%rbp),%edx
lea    0xc90(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
lea    0xcb6(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x60(%rbp),%eax
jge    15e3 <main+0x423>
mov    -0x140(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    15b7 <main+0x3f7>
cmpl   $0x1,-0x14c(%rbp)
jne    1627 <main+0x467>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x60(%rbp),%eax
jge    1622 <main+0x462>
mov    -0x4c(%rbp),%edx
mov    -0x138(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    15f7 <main+0x437>
jmp    17e8 <main+0x628>
mov    -0x120(%rbp),%rdi
mov    -0x14c(%rbp),%esi
call   10c0 <rndm_list@plt>
mov    -0x60(%rbp),%eax
cltd
idivl  -0x14c(%rbp)
mov    %eax,-0x144(%rbp)
mov    -0x144(%rbp),%eax
imul   -0x14c(%rbp),%eax
cmp    -0x60(%rbp),%eax
je     168f <main+0x4cf>
mov    0x2962(%rip),%rax
mov    (%rax),%edi
mov    -0x14c(%rbp),%edx
lea    0xc06(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
lea    0xc36(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
movl   $0x0,-0x148(%rbp)
mov    -0xd0(%rbp),%rax
movslq -0x14c(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %rax,-0xe8(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x144(%rbp),%eax
jge    17d3 <main+0x613>
mov    -0x4c(%rbp),%eax
imul   -0x14c(%rbp),%eax
mov    %eax,-0x124(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
mov    -0x14c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1798 <main+0x5d8>
mov    -0x148(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x148(%rbp)
mov    -0x144(%rbp),%eax
mov    -0x120(%rbp),%rcx
movslq -0x50(%rbp),%rdx
imul   (%rcx,%rdx,4),%eax
cltq
mov    %rax,-0xf0(%rbp)
mov    -0x120(%rbp),%rax
movslq -0x50(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    -0x124(%rbp),%edx
mov    -0x138(%rbp),%rax
movslq -0x148(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x138(%rbp),%rax
movslq -0x148(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x60(%rbp),%eax
jl     1785 <main+0x5c5>
mov    -0x148(%rbp),%esi
mov    -0x138(%rbp),%rax
movslq -0x148(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xb50(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    178a <main+0x5ca>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    16e0 <main+0x520>
mov    -0x148(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x148(%rbp)
mov    -0x4c(%rbp),%edx
add    $0x1,%edx
imul   -0x14c(%rbp),%edx
mov    -0x138(%rbp),%rax
movslq -0x148(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    16ba <main+0x4fa>
mov    -0x138(%rbp),%rax
movslq -0x148(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x138(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x60(%rbp),%eax
jge    1870 <main+0x6b0>
mov    -0x138(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x60(%rbp),%eax
jle    1843 <main+0x683>
mov    -0x4c(%rbp),%edx
mov    -0x138(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    $0x1,%edi
lea    0xaab(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
mov    -0x140(%rbp),%rax
mov    -0x138(%rbp),%rcx
movslq -0x4c(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    17fc <main+0x63c>
movl   $0x0,-0x12c(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x60(%rbp),%eax
jge    18fe <main+0x73e>
mov    -0x140(%rbp),%rax
movslq -0x4c(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
je     18eb <main+0x72b>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
cmpl   $0x40,-0x12c(%rbp)
jge    18e6 <main+0x726>
mov    0x2703(%rip),%rax
mov    (%rax),%edi
mov    -0x4c(%rbp),%edx
mov    -0x140(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xa17(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    18eb <main+0x72b>
jmp    18f0 <main+0x730>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1881 <main+0x6c1>
mov    0x26c3(%rip),%rax
mov    (%rax),%edi
mov    -0x12c(%rbp),%edx
lea    0x9f7(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
cmpl   $0x0,-0x150(%rbp)
jne    1968 <main+0x7a8>
mov    -0xd0(%rbp),%rsi
mov    0x26ba(%rip),%rax
mov    (%rax),%edx
mov    0x2681(%rip),%rax
or     (%rax),%edx
mov    0x2668(%rip),%rax
mov    (%rax),%ecx
mov    0x2667(%rip),%rax
or     (%rax),%ecx
mov    -0x68(%rbp),%r8d
mov    -0x6c(%rbp),%r9d
xor    %eax,%eax
mov    %eax,%edi
call   1040 <mmap@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x150(%rbp)
jne    19be <main+0x7fe>
mov    -0xd0(%rbp),%rsi
mov    0x266d(%rip),%rax
mov    (%rax),%edx
mov    0x2634(%rip),%rax
or     (%rax),%edx
mov    0x261b(%rip),%rax
mov    (%rax),%ecx
mov    0x261a(%rip),%rax
or     (%rax),%ecx
mov    0x2639(%rip),%rax
or     (%rax),%ecx
mov    -0x68(%rbp),%r8d
mov    -0x6c(%rbp),%r9d
xor    %eax,%eax
mov    %eax,%edi
call   1040 <mmap@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x25df(%rip),%rcx
cmp    (%rcx),%rax
jne    19fc <main+0x83c>
mov    0x25ef(%rip),%rax
mov    (%rax),%edi
lea    0x933(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
lea    0x92d(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
mov    0x25c5(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0x91e(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0xd0(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x108(%rbp)
mov    %rax,-0xe0(%rbp)
mov    0x2591(%rip),%rax
mov    (%rax),%edi
mov    -0xd0(%rbp),%rdx
mov    -0xe0(%rbp),%rcx
mov    -0x48(%rbp),%r8
lea    0x8e8(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xd0(%rbp),%rdx
xor    %esi,%esi
call   1060 <memset@plt>
mov    %rax,-0x20(%rbp)
mov    0x254a(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0x8e5(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movq   $0x0,-0xd8(%rbp)
mov    -0xd8(%rbp),%rax
mov    -0x60(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
jae    1b0f <main+0x94f>
mov    -0x28(%rbp),%rdx
mov    -0x138(%rbp),%rax
mov    -0xd8(%rbp),%rcx
movslq 0x4(%rax,%rcx,4),%rax
imul   -0x48(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x28(%rbp),%rax
mov    -0x138(%rbp),%rcx
mov    -0xd8(%rbp),%rsi
movslq (%rcx,%rsi,4),%rcx
imul   -0x48(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xd8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xd8(%rbp)
jmp    1a9d <main+0x8dd>
mov    0x24b2(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rax
mov    -0x60(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x18(%rbp),%rax
sub    %rax,%rdx
lea    0x859(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x28(%rbp),%rdx
mov    -0x28(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    -0x138(%rbp),%rsi
mov    -0x60(%rbp),%edi
sub    $0x1,%edi
movslq %edi,%rdi
movslq (%rsi,%rdi,4),%rsi
imul   %rsi,%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x12c(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    0x2449(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rdx
mov    -0x30(%rbp),%rax
mov    (%rax),%rcx
lea    0x824(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x12c(%rbp),%eax
mov    -0x60(%rbp),%ecx
add    $0x4,%ecx
cmp    %ecx,%eax
jge    1c33 <main+0xa73>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    %rcx,%rax
sar    $0x3,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x108(%rbp)
mov    %rax,-0x38(%rbp)
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
mov    -0x12c(%rbp),%eax
mov    -0x60(%rbp),%ecx
sub    $0x4,%ecx
cmp    %ecx,%eax
jle    1c2e <main+0xa6e>
mov    0x23bf(%rip),%rax
mov    (%rax),%edi
mov    -0x12c(%rbp),%edx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x30(%rbp),%rax
mov    (%rax),%r9
lea    0x7b1(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1b9a <main+0x9da>
mov    -0xc4(%rbp),%edi
mov    -0x5c(%rbp),%esi
call   1070 <pin_cpu@plt>
cmp    $0xffffffff,%eax
jne    1c62 <main+0xaa2>
mov    $0x1,%edi
lea    0x7b7(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
jmp    1c73 <main+0xab3>
mov    -0x5c(%rbp),%esi
lea    0x7bd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x74(%rbp),%esi
mov    -0x70(%rbp),%edx
mov    -0x60(%rbp),%ecx
mov    -0x64(%rbp),%r8d
mov    -0xd0(%rbp),%r9
lea    0x7be(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x74(%rbp),%eax
jge    1cc6 <main+0xb06>
mov    -0x70(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1030 <reader@plt>
mov    %rax,-0x40(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1c9c <main+0xadc>
lea    0x7f2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x7c(%rbp),%eax
add    $0x180,%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    0xf38(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
xor    %eax,%eax
call   10c0 <usage@plt>
lea    0xf8e(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   10a0 <err@plt>
mov    $0x20,%eax
mov    %rax,0x20(%rsp)
mov    $0x1,%eax
mov    %rax,0x60(%rsp)
mov    $0x40,%eax
mov    %rax,0x18(%rsp)
mov    $0x1000,%ecx
lea    0xf7a(%rip),%r12
lea    0xe44(%rip),%r14
mov    %rax,0x30(%rsp)
mov    %rax,0x8(%rsp)
mov    %rax,0x58(%rsp)
mov    %rax,0x38(%rsp)
xor    %edx,%edx
jmp    1286 <main+0xb6>
mov    0x2d8d(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %rax,0x18(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %r13,%rcx
mov    %r15d,%edx
mov    %edx,%r15d
mov    %rcx,%r13
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r12,%rdx
call   10e0 <getopt@plt>
lea    -0x4c(%rax),%edx
cmp    $0x27,%edx
ja     133f <main+0x16f>
mov    $0x200000,%ecx
movslq (%r14,%rdx,4),%rsi
add    %r14,%rsi
mov    $0x1,%edx
jmp    *%rsi
mov    0x2d39(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %rax,0x20(%rsp)
jmp    1280 <main+0xb0>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %rax,0x38(%rsp)
jmp    1280 <main+0xb0>
mov    0x2d0f(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %rax,0x8(%rsp)
jmp    1280 <main+0xb0>
mov    0x2cfa(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %rax,0x60(%rsp)
jmp    1280 <main+0xb0>
mov    0x2ce2(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %rax,0x58(%rsp)
jmp    1280 <main+0xb0>
mov    0x2cca(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %rax,0x30(%rsp)
jmp    1280 <main+0xb0>
cmp    $0xffffffff,%eax
je     135e <main+0x18e>
mov    $0x1,%edi
lea    0xe7f(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   10a0 <err@plt>
jmp    1280 <main+0xb0>
mov    0x2c63(%rip),%rbx
mov    (%rbx),%edi
lea    0xe73(%rip),%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
xor    %edi,%edi
mov    0x38(%rsp),%rbp
mov    %ebp,%esi
call   1080 <pin_cpu@plt>
cmp    $0xffffffff,%eax
je     13a1 <main+0x1d1>
mov    (%rbx),%edi
lea    0xe77(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    13b4 <main+0x1e4>
lea    0xe4e(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   10a0 <err@plt>
mov    0x20(%rsp),%rbx
mov    0x18(%rsp),%r14
mov    0x30(%rsp),%rbp
lea    0x0(,%rbx,4),%edi
call   10b0 <malloc@plt>
mov    %rax,0x38(%rsp)
test   %rax,%rax
jne    1405 <main+0x235>
mov    0x2be8(%rip),%rax
mov    (%rax),%edi
lea    0xe40(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0xe59(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   10a0 <err@plt>
mov    %ebp,%edx
imul   %r13,%rdx
add    %r14,%rdx
movslq 0x8(%rsp),%rax
movslq %edx,%r14
imul   %r14,%rax
mov    %rax,%rcx
or     %r13,%rcx
shr    $0x20,%rcx
mov    %rdx,0x48(%rsp)
je     1435 <main+0x265>
xor    %edx,%edx
div    %r13
mov    %rax,%rbp
jmp    143c <main+0x26c>
xor    %edx,%edx
div    %r13d
mov    %eax,%ebp
mov    0x8(%rsp),%rax
lea    0x0(,%rax,4),%ebx
mov    %ebx,%edi
call   10b0 <malloc@plt>
mov    %rax,0x28(%rsp)
test   %rax,%rax
jne    1488 <main+0x2b8>
mov    0x2b68(%rip),%rax
mov    (%rax),%edi
lea    0xe02(%rip),%rsi
mov    0x8(%rsp),%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0xe23(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   10a0 <err@plt>
add    $0x2,%rbp
mov    %ebx,%edi
call   10b0 <malloc@plt>
mov    %rax,0x18(%rsp)
test   %rax,%rax
jne    14cc <main+0x2fc>
mov    0x2b24(%rip),%rax
mov    (%rax),%edi
lea    0xe09(%rip),%rsi
mov    0x8(%rsp),%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0xe2f(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   10a0 <err@plt>
mov    0x8(%rsp),%rax
mov    %eax,%ecx
imul   %r13,%rbp
mov    %rbp,0x50(%rsp)
test   %eax,%eax
mov    %rcx,0x10(%rsp)
mov    %r14,0x68(%rsp)
jle    152b <main+0x35b>
lea    0x0(,%rcx,4),%rdx
mov    0x18(%rsp),%rdi
xor    %esi,%esi
call   1070 <memset@plt>
mov    0x20(%rsp),%rbp
cmp    $0x1,%ebp
jne    1550 <main+0x380>
cmpl   $0x8,0x8(%rsp)
mov    0x2ab4(%rip),%r12
mov    0x28(%rsp),%r13
jae    1678 <main+0x4a8>
xor    %eax,%eax
mov    0x10(%rsp),%rdx
jmp    17e0 <main+0x610>
mov    0x20(%rsp),%rbp
cmp    $0x1,%ebp
jne    1550 <main+0x380>
mov    0x28(%rsp),%r13
movl   $0x0,0x0(%r13)
xor    %ebx,%ebx
mov    0x2a7d(%rip),%r12
jmp    18ab <main+0x6db>
mov    0x38(%rsp),%rdi
mov    %ebp,%esi
call   10d0 <rndm_list@plt>
mov    0x8(%rsp),%rcx
mov    %ecx,%eax
cltd
idiv   %ebp
mov    %eax,%r14d
imul   %ebp,%eax
cmp    %ecx,%eax
mov    0x2a53(%rip),%r12
mov    0x28(%rsp),%r13
je     15a3 <main+0x3d3>
mov    (%r12),%edi
lea    0xd84(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0xdb7(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   10a0 <err@plt>
xor    %eax,%eax
test   %r14d,%r14d
jle    1665 <main+0x495>
lea    -0x1(%rbp),%ebx
shl    $0x2,%rbx
add    $0x4,%r13
mov    %r13,0x70(%rsp)
xor    %r13d,%r13d
xor    %r12d,%r12d
mov    %r14d,0x44(%rsp)
jmp    15fb <main+0x42b>
nopl   0x0(%rax,%rax,1)
mov    0x30(%rsp),%r12d
add    $0x1,%r12d
mov    %r12d,%eax
mov    0x20(%rsp),%rbp
imul   %ebp,%eax
movslq %r13d,%rcx
add    $0x1,%r13d
mov    0x28(%rsp),%rdx
mov    %eax,0x4(%rdx,%rcx,4)
cmp    0x44(%rsp),%r12d
je     1656 <main+0x486>
cmp    $0x2,%ebp
mov    %r12d,0x30(%rsp)
jl     15d0 <main+0x400>
imul   %ebp,%r12d
movslq %r13d,%rax
mov    0x70(%rsp),%rcx
lea    (%rcx,%rax,4),%r14
xor    %ebp,%ebp
jmp    162d <main+0x45d>
nopl   0x0(%rax)
add    $0x4,%rbp
add    $0x1,%r13d
cmp    %rbp,%rbx
je     15d0 <main+0x400>
mov    0x38(%rsp),%rax
mov    (%rax,%rbp,1),%edx
add    %r12d,%edx
mov    %edx,(%r14,%rbp,1)
cmp    0x8(%rsp),%edx
jl     1620 <main+0x450>
lea    0x1(%r13),%esi
lea    0xd11(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1620 <main+0x450>
movslq %r13d,%rax
mov    0x2968(%rip),%r12
mov    0x28(%rsp),%r13
mov    0x10(%rsp),%rdx
movl   $0x0,0x0(%r13,%rax,4)
jmp    17ee <main+0x61e>
mov    0x10(%rsp),%rax
and    $0xfffffff8,%eax
lea    -0x8(%rax),%rsi
mov    %rsi,%rdx
shr    $0x3,%rdx
add    $0x1,%rdx
mov    %edx,%ecx
and    $0x3,%ecx
cmp    $0x18,%rsi
jae    16a9 <main+0x4d9>
movdqa 0x95e(%rip),%xmm0
xor    %esi,%esi
jmp    1785 <main+0x5b5>
and    $0xfffffffffffffffc,%rdx
movdqa 0x94b(%rip),%xmm0
xor    %esi,%esi
movdqa 0x950(%rip),%xmm8
movdqa 0x957(%rip),%xmm9
movdqa 0x95e(%rip),%xmm10
movdqa 0x966(%rip),%xmm4
movdqa 0x96e(%rip),%xmm5
movdqa 0x976(%rip),%xmm6
movdqa 0x97e(%rip),%xmm7
movdqa 0x986(%rip),%xmm1
nopw   0x0(%rax,%rax,1)
movdqa %xmm0,%xmm2
paddd  %xmm8,%xmm2
movdqu %xmm0,0x0(%r13,%rsi,4)
movdqu %xmm2,0x10(%r13,%rsi,4)
movdqa %xmm0,%xmm2
paddd  %xmm9,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm10,%xmm3
movdqu %xmm2,0x20(%r13,%rsi,4)
movdqu %xmm3,0x30(%r13,%rsi,4)
movdqa %xmm0,%xmm2
paddd  %xmm4,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm5,%xmm3
movdqu %xmm2,0x40(%r13,%rsi,4)
movdqu %xmm3,0x50(%r13,%rsi,4)
movdqa %xmm0,%xmm2
paddd  %xmm6,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm7,%xmm3
movdqu %xmm2,0x60(%r13,%rsi,4)
movdqu %xmm3,0x70(%r13,%rsi,4)
add    $0x20,%rsi
paddd  %xmm1,%xmm0
add    $0xfffffffffffffffc,%rdx
jne    1700 <main+0x530>
test   %rcx,%rcx
je     17d0 <main+0x600>
lea    0x10(,%rsi,4),%rdx
add    %r13,%rdx
shl    $0x5,%rcx
xor    %esi,%esi
movdqa 0x86d(%rip),%xmm1
movdqa 0x875(%rip),%xmm2
nopl   0x0(%rax,%rax,1)
movdqa %xmm0,%xmm3
paddd  %xmm1,%xmm3
movdqu %xmm0,-0x10(%rdx,%rsi,1)
movdqu %xmm3,(%rdx,%rsi,1)
paddd  %xmm2,%xmm0
add    $0x20,%rsi
cmp    %rsi,%rcx
jne    17b0 <main+0x5e0>
mov    0x10(%rsp),%rdx
cmp    %rdx,%rax
je     17ee <main+0x61e>
nopw   0x0(%rax,%rax,1)
mov    %eax,0x0(%r13,%rax,4)
add    $0x1,%rax
cmp    %rax,%rdx
jne    17e0 <main+0x610>
movl   $0x0,0x0(%r13)
cmpl   $0x0,0x8(%rsp)
jle    18a9 <main+0x6d9>
lea    -0x1(%rdx),%rbx
lea    0xb6b(%rip),%r14
xor    %ecx,%ecx
xor    %ebp,%ebp
cmp    %edx,%ecx
jle    1848 <main+0x678>
jmp    182d <main+0x65d>
cs nopw 0x0(%rax,%rax,1)
mov    0x4(%r13,%rbp,4),%ecx
add    $0x1,%rbp
cmp    %edx,%ecx
jle    1848 <main+0x678>
mov    $0x1,%edi
mov    %r14,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   10a0 <err@plt>
mov    0x10(%rsp),%rdx
mov    0x0(%r13,%rbp,4),%ecx
movslq %ecx,%rax
mov    0x18(%rsp),%rcx
addl   $0x1,(%rcx,%rax,4)
cmp    %rbp,%rbx
jne    1820 <main+0x650>
cmpl   $0x0,0x8(%rsp)
jle    18a9 <main+0x6d9>
lea    0xb1f(%rip),%r14
xor    %ebp,%ebp
xor    %eax,%eax
jmp    187d <main+0x6ad>
nopl   (%rax)
mov    %eax,%ebx
add    $0x1,%rbp
mov    %ebx,%eax
cmp    %rbp,%rdx
je     18ab <main+0x6db>
mov    0x18(%rsp),%rcx
mov    (%rcx,%rbp,4),%ecx
cmp    $0x1,%ecx
je     1870 <main+0x6a0>
lea    0x1(%rax),%ebx
cmp    $0x3e,%eax
jg     1872 <main+0x6a2>
mov    (%r12),%edi
mov    %r14,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x10(%rsp),%rdx
jmp    1872 <main+0x6a2>
xor    %ebx,%ebx
mov    0x68(%rsp),%r14
shr    $0x3,%r14
mov    (%r12),%edi
lea    0xadc(%rip),%rsi
xor    %ebp,%ebp
mov    %ebx,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x271f(%rip),%rax
mov    0x26e8(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
cmp    $0x1,%r15d
mov    0x26c9(%rip),%rax
mov    (%rax),%eax
cmove  %eax,%ebp
mov    0x26ed(%rip),%rcx
cmove  (%rcx),%eax
mov    0x26bb(%rip),%rcx
or     (%rcx),%ebp
or     %eax,%ebp
xor    %edi,%edi
mov    0x50(%rsp),%rbx
mov    %rbx,%rsi
mov    %ebp,%ecx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1050 <mmap@plt>
mov    %rax,%r15
mov    0x2683(%rip),%rax
cmp    %r15,(%rax)
jne    194f <main+0x77f>
mov    (%r12),%edi
lea    0xa70(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0xa6f(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   10a0 <err@plt>
mov    (%r12),%edi
lea    0xa64(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %rbx,%rcx
shr    $0x3,%rcx
mov    (%r12),%edi
lea    0xa54(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%r8
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1070 <memset@plt>
mov    (%r12),%edi
lea    0xa65(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x8(%rsp),%rax
add    $0xffffffff,%eax
movslq %eax,%rbx
test   %ebx,%ebx
je     1a4c <main+0x87c>
cmp    $0x2,%rbx
mov    $0x1,%edx
mov    $0x1,%r8d
cmovae %rbx,%r8
mov    0x0(%r13),%ecx
cmp    $0x1,%ebx
je     1a2e <main+0x85e>
mov    %r8,%rsi
and    $0xfffffffffffffffe,%rsi
neg    %rsi
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq 0x0(%r13,%rdx,4),%rdi
imul   %r14,%rdi
lea    (%r15,%rdi,8),%rbp
movslq %ecx,%rax
imul   %r14,%rax
mov    %rbp,(%r15,%rax,8)
movslq 0x4(%r13,%rdx,4),%rcx
mov    %rcx,%rax
imul   %r14,%rax
lea    (%r15,%rax,8),%rax
mov    %rax,(%r15,%rdi,8)
lea    (%rsi,%rdx,1),%rax
add    $0x2,%rax
add    $0x2,%rdx
cmp    $0x1,%rax
jne    19f0 <main+0x820>
test   $0x1,%r8b
je     1a4c <main+0x87c>
movslq 0x0(%r13,%rdx,4),%rax
imul   %r14,%rax
lea    (%r15,%rax,8),%rax
movslq %ecx,%rcx
imul   %r14,%rcx
mov    %rax,(%r15,%rcx,8)
mov    (%r12),%edi
mov    (%r15,%rbx,8),%rdx
sub    %r15,%rdx
lea    0x9c2(%rip),%rsi
xor    %ebp,%ebp
xor    %eax,%eax
call   1090 <fprintf@plt>
movslq 0x0(%r13,%rbx,4),%rax
imul   %rax,%r14
mov    %r15,(%r15,%r14,8)
mov    (%r12),%edi
mov    (%r15),%rcx
lea    0x9c5(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
cmpl   $0xfffffffd,0x8(%rsp)
jl     1aff <main+0x92f>
mov    0x8(%rsp),%rax
lea    0x3(%rax),%r12d
test   %r12d,%r12d
cmovle %ebp,%r12d
lea    -0x4(%rax),%r13d
add    $0x1,%r12d
lea    0x9b6(%rip),%r14
mov    %r15,%rbp
xor    %eax,%eax
jmp    1ac7 <main+0x8f7>
nopl   0x0(%rax)
mov    %ebx,%eax
cmp    %ebx,%r12d
je     1aff <main+0x92f>
mov    0x0(%rbp),%rbp
lea    0x1(%rax),%ebx
cmp    %r13d,%eax
jl     1ac0 <main+0x8f0>
mov    %rbp,%rcx
sub    %r15,%rcx
sar    $0x3,%rcx
shr    $0x3,%rcx
mov    0x24e0(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%r9
mov    %r14,%rsi
mov    %ebx,%edx
mov    %rbp,%r8
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    1ac0 <main+0x8f0>
mov    0x60(%rsp),%rbx
imul   $0x64,%ebx,%r14d
xor    %edi,%edi
mov    0x58(%rsp),%rbp
mov    %ebp,%esi
call   1080 <pin_cpu@plt>
cmp    $0xffffffff,%eax
je     1b2d <main+0x95d>
lea    0x997(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1b40 <main+0x970>
lea    0x969(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   10a0 <err@plt>
mov    0x48(%rsp),%r8
lea    0x990(%rip),%rdi
mov    %r14d,%esi
mov    $0x9c4000,%edx
mov    0x8(%rsp),%rcx
mov    0x50(%rsp),%r9
xor    %eax,%eax
call   1060 <printf@plt>
test   %ebx,%ebx
jle    1b92 <main+0x9c2>
cmp    $0x2,%r14d
mov    $0x1,%ebx
cmovge %r14d,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x9c4000,%edi
mov    %r15,%rsi
call   1040 <reader@plt>
add    $0xffffffff,%ebx
jne    1b80 <main+0x9b0>
lea    0x9b6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@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 = [16 x i8] c"i:r:l:s:S:m:L:c\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 = [57 x i8] c" failed to malloc index_test array for line_count of %d\0A\00"
@.str.12 = [28 x i8] c"failed to malloc index_test\00"
@.str.13 = [67 x i8] c" line count must be a multiple of the fifth argument num_seg = %d\0A\00"
@.str.14 = [16 x i8] c" bad line_count\00"
@.str.15 = [25 x i8] c" count = %d, index = %d\0A\00"
@.str.16 = [15 x i8] c"index[%d] = %d\00"
@.str.17 = [21 x i8] c"index_test[%d] = %d\0A\00"
@.str.18 = [10 x i8] c"bad = %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.19 = [13 x i8] c"mmap failed\0A\00"
@.str.20 = [12 x i8] c"mmap failed\00"
@.str.21 = [12 x i8] c" buf1 = %p\0A\00"
@.str.22 = [54 x i8] c" buf_size = %zu, zero_loop = %zu, array_stride = %zd\0A\00"
@.str.23 = [32 x i8] c" finished zeroing buf ret = %p\0A\00"
@.str.24 = [39 x i8] c" target of last element in loop = %zx\0A\00"
@.str.25 = [33 x i8] c" array address = %p value = %lx\0A\00"
@.str.26 = [53 x i8] c"index = %d,element = %ld, address = %p, value = %lx\0A\00"
@.str.27 = [28 x i8] c"cannot set cpu run affinity\00"
@.str.28 = [35 x i8] c" process pinned to core %d to run\0A\00"
@.str.29 = [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.30 = [7 x i8] c" done\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 i64
%12 = alloca i64
%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 i32
%25 = alloca i32
%26 = alloca double
%27 = alloca i64
%28 = alloca i64
%29 = alloca i64
%30 = alloca i64
%31 = alloca i64
%32 = alloca i64
%33 = alloca i64
%34 = alloca i32
%35 = alloca i64
%36 = alloca i64
%37 = alloca i64
%38 = alloca i64
%39 = alloca i64
%40 = alloca i64
%41 = alloca i64
%42 = alloca i64
%43 = alloca i64
%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
%53 = alloca i32
%54 = alloca i32
%55 = alloca i32
%56 = alloca i32
%57 = alloca i32*
%58 = alloca %struct.timespec
%59 = alloca %struct.timespec
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %11
store i32 -1, i32* %20
store i32 0, i32* %21
store i32 10240000, i32* %22
store i32 100, i32* %23
store i32 1, i32* %24
store i32 0, i32* %25
store i64 0, i64* %33
store i32 0, i32* %34
store i32 32, i32* %54
store i32 0, i32* %55
store i64 4096, i64* %41
store i64 64, i64* %43
%60 = load i32, i32* %4
%61 = icmp slt i32 %60, 6
br i1 %61, label %62, label %68
62: ; preds = %2
%63 = load i32, i32* @stderr
%64 = load i32, i32* %4
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0), i32 %64)
%66 = call i32 (...) @usage()
%67 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %68
68: ; preds = %62, %2
br label %69
69: ; preds = %108, %68
%70 = load i32, i32* %4
%71 = load i8**, i8*** %5
%72 = call i32 @getopt(i32 %70, i8** %71, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
store i32 %72, i32* %48
%73 = icmp ne i32 %72, -1
br i1 %73, label %74, label %109
74: ; preds = %69
%75 = load i32, i32* %48
switch i32 %75, label %105 [
i32 105, label %76
i32 114, label %80
i32 108, label %84
i32 115, label %88
i32 83, label %92
i32 109, label %96
i32 76, label %100
i32 99, label %101
]
76: ; preds = %74
%77 = load i32, i32* @optarg
%78 = call i8* @atoi(i32 %77)
%79 = ptrtoint i8* %78 to i32
store i32 %79, i32* %16
br label %108
80: ; preds = %74
%81 = load i32, i32* @optarg
%82 = call i8* @atoi(i32 %81)
%83 = ptrtoint i8* %82 to i32
store i32 %83, i32* %17
br label %108
84: ; preds = %74
%85 = load i32, i32* @optarg
%86 = call i8* @atoi(i32 %85)
%87 = ptrtoint i8* %86 to i32
store i32 %87, i32* %18
br label %108
88: ; preds = %74
%89 = load i32, i32* @optarg
%90 = call i8* @atoi(i32 %89)
%91 = ptrtoint i8* %90 to i32
store i32 %91, i32* %19
br label %108
92: ; preds = %74
%93 = load i32, i32* @optarg
%94 = call i8* @atoi(i32 %93)
%95 = ptrtoint i8* %94 to i32
store i32 %95, i32* %54
br label %108
96: ; preds = %74
%97 = load i32, i32* @optarg
%98 = call i8* @atoi(i32 %97)
%99 = ptrtoint i8* %98 to i32
store i32 %99, i32* %24
br label %108
100: ; preds = %74
store i32 1, i32* %55
store i64 2097152, i64* %41
br label %108
101: ; preds = %74
%102 = load i32, i32* @optarg
%103 = call i8* @atoi(i32 %102)
%104 = ptrtoint i8* %103 to i64
store i64 %104, i64* %43
br label %108
105: ; preds = %74
%106 = load i32, i32* %48
%107 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %106)
br label %108
108: ; preds = %105, %101, %100, %96, %92, %88, %84, %80, %76
br label %69
109: ; preds = %69
%110 = load i32, i32* %23
%111 = load i32, i32* %24
%112 = mul nsw i32 %110, %111
store i32 %112, i32* %23
store i64 8, i64* %42
%113 = load i32, i32* @stderr
%114 = load i64, i64* %42
%115 = call i32 (i32, i8*, ...) @fprintf(i32 %113, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i64 %114)
%116 = load i32, i32* %34
%117 = load i32, i32* %16
%118 = call i32 @pin_cpu(i32 %116, i32 %117)
%119 = icmp eq i32 %118, -1
br i1 %119, label %120, label %122
120: ; preds = %109
%121 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %126
122: ; preds = %109
%123 = load i32, i32* @stderr
%124 = load i32, i32* %16
%125 = call i32 (i32, i8*, ...) @fprintf(i32 %123, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i32 %124)
br label %126
126: ; preds = %122, %120
%127 = load i32, i32* %54
%128 = sext i32 %127 to i64
%129 = mul i64 %128, 4
%130 = trunc i64 %129 to i32
%131 = call i64 @malloc(i32 %130)
%132 = inttoptr i64 %131 to i32*
store i32* %132, i32** %46
%133 = load i32*, i32** %46
%134 = icmp eq i32* %133, null
br i1 %134, label %135, label %140
135: ; preds = %126
%136 = load i32, i32* @stderr
%137 = load i32, i32* %54
%138 = call i32 (i32, i8*, ...) @fprintf(i32 %136, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0), i32 %137)
%139 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0))
br label %140
140: ; preds = %135, %126
%141 = load i64, i64* %41
%142 = load i32, i32* %19
%143 = sext i32 %142 to i64
%144 = mul i64 %141, %143
%145 = load i64, i64* %43
%146 = add i64 %144, %145
%147 = trunc i64 %146 to i32
store i32 %147, i32* %19
%148 = load i32, i32* %18
%149 = sext i32 %148 to i64
%150 = load i32, i32* %19
%151 = sext i32 %150 to i64
%152 = mul i64 %149, %151
store i64 %152, i64* %35
%153 = load i64, i64* %35
%154 = load i64, i64* %41
%155 = udiv i64 %153, %154
%156 = add i64 %155, 2
store i64 %156, i64* %40
%157 = load i64, i64* %41
%158 = load i64, i64* %40
%159 = mul i64 %157, %158
store i64 %159, i64* %35
%160 = load i32, i32* %19
%161 = sext i32 %160 to i64
%162 = udiv i64 %161, 8
store i64 %162, i64* %12
%163 = load i32, i32* %23
%164 = sitofp i32 %163 to double
%165 = load i32, i32* %22
%166 = sitofp i32 %165 to double
%167 = fmul double %164, %166
store double %167, double* %26
%168 = load i32, i32* %18
%169 = sext i32 %168 to i64
%170 = mul i64 %169, 4
%171 = trunc i64 %170 to i32
%172 = call i64 @malloc(i32 %171)
%173 = inttoptr i64 %172 to i32*
store i32* %173, i32** %50
%174 = load i32*, i32** %50
%175 = icmp eq i32* %174, null
br i1 %175, label %176, label %181
176: ; preds = %140
%177 = load i32, i32* @stderr
%178 = load i32, i32* %18
%179 = call i32 (i32, i8*, ...) @fprintf(i32 %177, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.9, i64 0, i64 0), i32 %178)
%180 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0))
br label %181
181: ; preds = %176, %140
%182 = load i32, i32* %18
%183 = sext i32 %182 to i64
%184 = mul i64 %183, 4
%185 = trunc i64 %184 to i32
%186 = call i64 @malloc(i32 %185)
%187 = inttoptr i64 %186 to i32*
store i32* %187, i32** %51
%188 = load i32*, i32** %51
%189 = icmp eq i32* %188, null
br i1 %189, label %190, label %195
190: ; preds = %181
%191 = load i32, i32* @stderr
%192 = load i32, i32* %18
%193 = call i32 (i32, i8*, ...) @fprintf(i32 %191, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.11, i64 0, i64 0), i32 %192)
%194 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0))
br label %195
195: ; preds = %190, %181
store i32 0, i32* %13
br label %196
196: ; preds = %205, %195
%197 = load i32, i32* %13
%198 = load i32, i32* %18
%199 = icmp slt i32 %197, %198
br i1 %199, label %200, label %208
200: ; preds = %196
%201 = load i32*, i32** %51
%202 = load i32, i32* %13
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds i32, i32* %201, i64 %203
store i32 0, i32* %204
br label %205
205: ; preds = %200
%206 = load i32, i32* %13
%207 = add nsw i32 %206, 1
store i32 %207, i32* %13
br label %196
208: ; preds = %196
%209 = load i32, i32* %54
%210 = icmp eq i32 %209, 1
br i1 %210, label %211, label %226
211: ; preds = %208
store i32 0, i32* %13
br label %212
212: ; preds = %222, %211
%213 = load i32, i32* %13
%214 = load i32, i32* %18
%215 = icmp slt i32 %213, %214
br i1 %215, label %216, label %225
216: ; preds = %212
%217 = load i32, i32* %13
%218 = load i32*, i32** %50
%219 = load i32, i32* %13
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds i32, i32* %218, i64 %220
store i32 %217, i32* %221
br label %222
222: ; preds = %216
%223 = load i32, i32* %13
%224 = add nsw i32 %223, 1
store i32 %224, i32* %13
br label %212
225: ; preds = %212
br label %321
226: ; preds = %208
%227 = load i32*, i32** %46
%228 = load i32, i32* %54
%229 = call i32 @rndm_list(i32* %227, i32 %228)
%230 = load i32, i32* %18
%231 = load i32, i32* %54
%232 = sdiv i32 %230, %231
store i32 %232, i32* %52
%233 = load i32, i32* %52
%234 = load i32, i32* %54
%235 = mul nsw i32 %233, %234
%236 = load i32, i32* %18
%237 = icmp ne i32 %235, %236
br i1 %237, label %238, label %243
238: ; preds = %226
%239 = load i32, i32* @stderr
%240 = load i32, i32* %54
%241 = call i32 (i32, i8*, ...) @fprintf(i32 %239, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.13, i64 0, i64 0), i32 %240)
%242 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0))
br label %243
243: ; preds = %238, %226
store i32 0, i32* %53
%244 = load i64, i64* %35
%245 = load i32, i32* %54
%246 = sext i32 %245 to i64
%247 = udiv i64 %244, %246
store i64 %247, i64* %38
store i32 0, i32* %13
br label %248
248: ; preds = %313, %243
%249 = load i32, i32* %13
%250 = load i32, i32* %52
%251 = icmp slt i32 %249, %250
br i1 %251, label %252, label %316
252: ; preds = %248
%253 = load i32, i32* %13
%254 = load i32, i32* %54
%255 = mul nsw i32 %253, %254
store i32 %255, i32* %47
store i32 0, i32* %14
br label %256
256: ; preds = %299, %252
%257 = load i32, i32* %14
%258 = load i32, i32* %54
%259 = sub nsw i32 %258, 1
%260 = icmp slt i32 %257, %259
br i1 %260, label %261, label %302
261: ; preds = %256
%262 = load i32, i32* %53
%263 = add nsw i32 %262, 1
store i32 %263, i32* %53
%264 = load i32, i32* %52
%265 = load i32*, i32** %46
%266 = load i32, i32* %14
%267 = sext i32 %266 to i64
%268 = getelementptr inbounds i32, i32* %265, i64 %267
%269 = load i32, i32* %268
%270 = mul nsw i32 %264, %269
%271 = sext i32 %270 to i64
store i64 %271, i64* %39
%272 = load i32*, i32** %46
%273 = load i32, i32* %14
%274 = sext i32 %273 to i64
%275 = getelementptr inbounds i32, i32* %272, i64 %274
%276 = load i32, i32* %275
%277 = load i32, i32* %47
%278 = add nsw i32 %276, %277
%279 = load i32*, i32** %50
%280 = load i32, i32* %53
%281 = sext i32 %280 to i64
%282 = getelementptr inbounds i32, i32* %279, i64 %281
store i32 %278, i32* %282
%283 = load i32*, i32** %50
%284 = load i32, i32* %53
%285 = sext i32 %284 to i64
%286 = getelementptr inbounds i32, i32* %283, i64 %285
%287 = load i32, i32* %286
%288 = load i32, i32* %18
%289 = icmp sge i32 %287, %288
br i1 %289, label %290, label %298
290: ; preds = %261
%291 = load i32, i32* %53
%292 = load i32*, i32** %50
%293 = load i32, i32* %53
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds i32, i32* %292, i64 %294
%296 = load i32, i32* %295
%297 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i64 0, i64 0), i32 %291, i32 %296)
br label %298
298: ; preds = %290, %261
br label %299
299: ; preds = %298
%300 = load i32, i32* %14
%301 = add nsw i32 %300, 1
store i32 %301, i32* %14
br label %256
302: ; preds = %256
%303 = load i32, i32* %53
%304 = add nsw i32 %303, 1
store i32 %304, i32* %53
%305 = load i32, i32* %13
%306 = add nsw i32 %305, 1
%307 = load i32, i32* %54
%308 = mul nsw i32 %306, %307
%309 = load i32*, i32** %50
%310 = load i32, i32* %53
%311 = sext i32 %310 to i64
%312 = getelementptr inbounds i32, i32* %309, i64 %311
store i32 %308, i32* %312
br label %313
313: ; preds = %302
%314 = load i32, i32* %13
%315 = add nsw i32 %314, 1
store i32 %315, i32* %13
br label %248
316: ; preds = %248
%317 = load i32*, i32** %50
%318 = load i32, i32* %53
%319 = sext i32 %318 to i64
%320 = getelementptr inbounds i32, i32* %317, i64 %319
store i32 0, i32* %320
br label %321
321: ; preds = %316, %225
%322 = load i32*, i32** %50
%323 = getelementptr inbounds i32, i32* %322, i64 0
store i32 0, i32* %323
store i32 0, i32* %13
br label %324
324: ; preds = %355, %321
%325 = load i32, i32* %13
%326 = load i32, i32* %18
%327 = icmp slt i32 %325, %326
br i1 %327, label %328, label %358
328: ; preds = %324
%329 = load i32*, i32** %50
%330 = load i32, i32* %13
%331 = sext i32 %330 to i64
%332 = getelementptr inbounds i32, i32* %329, i64 %331
%333 = load i32, i32* %332
%334 = load i32, i32* %18
%335 = icmp sgt i32 %333, %334
br i1 %335, label %336, label %344
336: ; preds = %328
%337 = load i32, i32* %13
%338 = load i32*, i32** %50
%339 = load i32, i32* %13
%340 = sext i32 %339 to i64
%341 = getelementptr inbounds i32, i32* %338, i64 %340
%342 = load i32, i32* %341
%343 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0), i32 %337, i32 %342)
br label %344
344: ; preds = %336, %328
%345 = load i32*, i32** %51
%346 = load i32*, i32** %50
%347 = load i32, i32* %13
%348 = sext i32 %347 to i64
%349 = getelementptr inbounds i32, i32* %346, i64 %348
%350 = load i32, i32* %349
%351 = sext i32 %350 to i64
%352 = getelementptr inbounds i32, i32* %345, i64 %351
%353 = load i32, i32* %352
%354 = add nsw i32 %353, 1
store i32 %354, i32* %352
br label %355
355: ; preds = %344
%356 = load i32, i32* %13
%357 = add nsw i32 %356, 1
store i32 %357, i32* %13
br label %324
358: ; preds = %324
store i32 0, i32* %49
store i32 0, i32* %13
br label %359
359: ; preds = %386, %358
%360 = load i32, i32* %13
%361 = load i32, i32* %18
%362 = icmp slt i32 %360, %361
br i1 %362, label %363, label %389
363: ; preds = %359
%364 = load i32*, i32** %51
%365 = load i32, i32* %13
%366 = sext i32 %365 to i64
%367 = getelementptr inbounds i32, i32* %364, i64 %366
%368 = load i32, i32* %367
%369 = icmp ne i32 %368, 1
br i1 %369, label %370, label %385
370: ; preds = %363
%371 = load i32, i32* %49
%372 = add nsw i32 %371, 1
store i32 %372, i32* %49
%373 = load i32, i32* %49
%374 = icmp slt i32 %373, 64
br i1 %374, label %375, label %384
375: ; preds = %370
%376 = load i32, i32* @stderr
%377 = load i32, i32* %13
%378 = load i32*, i32** %51
%379 = load i32, i32* %13
%380 = sext i32 %379 to i64
%381 = getelementptr inbounds i32, i32* %378, i64 %380
%382 = load i32, i32* %381
%383 = call i32 (i32, i8*, ...) @fprintf(i32 %376, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0), i32 %377, i32 %382)
br label %384
384: ; preds = %375, %370
br label %385
385: ; preds = %384, %363
br label %386
386: ; preds = %385
%387 = load i32, i32* %13
%388 = add nsw i32 %387, 1
store i32 %388, i32* %13
br label %359
389: ; preds = %359
%390 = load i32, i32* @stderr
%391 = load i32, i32* %49
%392 = call i32 (i32, i8*, ...) @fprintf(i32 %390, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i32 %391)
%393 = load i32, i32* %55
%394 = icmp eq i32 %393, 0
br i1 %394, label %395, label %407
395: ; preds = %389
%396 = load i64, i64* %35
%397 = load i32, i32* @PROT_READ
%398 = load i32, i32* @PROT_WRITE
%399 = or i32 %397, %398
%400 = load i32, i32* @MAP_PRIVATE
%401 = load i32, i32* @MAP_ANON
%402 = or i32 %400, %401
%403 = load i32, i32* %20
%404 = load i32, i32* %21
%405 = call i64 @mmap(i32* null, i64 %396, i32 %399, i32 %402, i32 %403, i32 %404)
%406 = inttoptr i64 %405 to i8*
store i8* %406, i8** %6
br label %407
407: ; preds = %395, %389
%408 = load i32, i32* %55
%409 = icmp eq i32 %408, 1
br i1 %409, label %410, label %424
410: ; preds = %407
%411 = load i64, i64* %35
%412 = load i32, i32* @PROT_READ
%413 = load i32, i32* @PROT_WRITE
%414 = or i32 %412, %413
%415 = load i32, i32* @MAP_PRIVATE
%416 = load i32, i32* @MAP_ANON
%417 = or i32 %415, %416
%418 = load i32, i32* @MAP_HUGETLB
%419 = or i32 %417, %418
%420 = load i32, i32* %20
%421 = load i32, i32* %21
%422 = call i64 @mmap(i32* null, i64 %411, i32 %414, i32 %419, i32 %420, i32 %421)
%423 = inttoptr i64 %422 to i8*
store i8* %423, i8** %6
br label %424
424: ; preds = %410, %407
%425 = load i8*, i8** %6
%426 = load i8*, i8** @MAP_FAILED
%427 = icmp eq i8* %425, %426
br i1 %427, label %428, label %432
428: ; preds = %424
%429 = load i32, i32* @stderr
%430 = call i32 (i32, i8*, ...) @fprintf(i32 %429, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0))
%431 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.20, i64 0, i64 0))
br label %432
432: ; preds = %428, %424
%433 = load i32, i32* @stderr
%434 = load i8*, i8** %6
%435 = call i32 (i32, i8*, ...) @fprintf(i32 %433, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i64 0, i64 0), i8* %434)
%436 = load i64, i64* %35
%437 = load i64, i64* %42
%438 = udiv i64 %436, %437
store i64 %438, i64* %37
%439 = load i32, i32* @stderr
%440 = load i64, i64* %35
%441 = load i64, i64* %37
%442 = load i64, i64* %12
%443 = call i32 (i32, i8*, ...) @fprintf(i32 %439, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.22, i64 0, i64 0), i64 %440, i64 %441, i64 %442)
%444 = load i8*, i8** %6
%445 = bitcast i8* %444 to i64*
store i64* %445, i64** %8
%446 = load i8*, i8** %6
%447 = load i64, i64* %35
%448 = call i8* @memset(i8* %446, i32 0, i64 %447)
store i8* %448, i8** %7
%449 = load i32, i32* @stderr
%450 = load i8*, i8** %7
%451 = call i32 (i32, i8*, ...) @fprintf(i32 %449, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.23, i64 0, i64 0), i8* %450)
store i64 0, i64* %36
br label %452
452: ; preds = %479, %432
%453 = load i64, i64* %36
%454 = load i32, i32* %18
%455 = sub nsw i32 %454, 1
%456 = sext i32 %455 to i64
%457 = icmp ult i64 %453, %456
br i1 %457, label %458, label %482
458: ; preds = %452
%459 = load i64*, i64** %8
%460 = load i32*, i32** %50
%461 = load i64, i64* %36
%462 = add i64 %461, 1
%463 = getelementptr inbounds i32, i32* %460, i64 %462
%464 = load i32, i32* %463
%465 = sext i32 %464 to i64
%466 = load i64, i64* %12
%467 = mul i64 %465, %466
%468 = getelementptr inbounds i64, i64* %459, i64 %467
%469 = ptrtoint i64* %468 to i64
%470 = load i64*, i64** %8
%471 = load i32*, i32** %50
%472 = load i64, i64* %36
%473 = getelementptr inbounds i32, i32* %471, i64 %472
%474 = load i32, i32* %473
%475 = sext i32 %474 to i64
%476 = load i64, i64* %12
%477 = mul i64 %475, %476
%478 = getelementptr inbounds i64, i64* %470, i64 %477
store i64 %469, i64* %478
br label %479
479: ; preds = %458
%480 = load i64, i64* %36
%481 = add i64 %480, 1
store i64 %481, i64* %36
br label %452
482: ; preds = %452
%483 = load i32, i32* @stderr
%484 = load i64*, i64** %8
%485 = load i32, i32* %18
%486 = sub nsw i32 %485, 1
%487 = sext i32 %486 to i64
%488 = getelementptr inbounds i64, i64* %484, i64 %487
%489 = load i64, i64* %488
%490 = load i8*, i8** %6
%491 = ptrtoint i8* %490 to i64
%492 = sub i64 %489, %491
%493 = call i32 (i32, i8*, ...) @fprintf(i32 %483, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.24, i64 0, i64 0), i64 %492)
%494 = load i64*, i64** %8
%495 = getelementptr inbounds i64, i64* %494, i64 0
%496 = ptrtoint i64* %495 to i64
%497 = load i64*, i64** %8
%498 = load i64, i64* %12
%499 = load i32*, i32** %50
%500 = load i32, i32* %18
%501 = sub nsw i32 %500, 1
%502 = sext i32 %501 to i64
%503 = getelementptr inbounds i32, i32* %499, i64 %502
%504 = load i32, i32* %503
%505 = sext i32 %504 to i64
%506 = mul i64 %498, %505
%507 = getelementptr inbounds i64, i64* %497, i64 %506
store i64 %496, i64* %507
store i32 0, i32* %49
%508 = load i64*, i64** %8
store i64* %508, i64** %9
%509 = load i32, i32* @stderr
%510 = load i64*, i64** %9
%511 = load i64*, i64** %9
%512 = load i64, i64* %511
%513 = call i32 (i32, i8*, ...) @fprintf(i32 %509, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.25, i64 0, i64 0), i64* %510, i64 %512)
br label %514
514: ; preds = %546, %482
%515 = load i32, i32* %49
%516 = load i32, i32* %18
%517 = add nsw i32 %516, 4
%518 = icmp slt i32 %515, %517
br i1 %518, label %519, label %547
519: ; preds = %514
%520 = load i64*, i64** %9
%521 = load i64, i64* %520
%522 = inttoptr i64 %521 to i64*
store i64* %522, i64** %9
%523 = load i64*, i64** %9
%524 = load i64*, i64** %8
%525 = ptrtoint i64* %523 to i64
%526 = ptrtoint i64* %524 to i64
%527 = sub i64 %525, %526
%528 = sdiv exact i64 %527, 8
store i64 %528, i64* %10
%529 = load i64, i64* %10
%530 = load i64, i64* %42
%531 = udiv i64 %529, %530
store i64 %531, i64* %10
%532 = load i32, i32* %49
%533 = add nsw i32 %532, 1
store i32 %533, i32* %49
%534 = load i32, i32* %49
%535 = load i32, i32* %18
%536 = sub nsw i32 %535, 4
%537 = icmp sgt i32 %534, %536
br i1 %537, label %538, label %546
538: ; preds = %519
%539 = load i32, i32* @stderr
%540 = load i32, i32* %49
%541 = load i64, i64* %10
%542 = load i64*, i64** %9
%543 = load i64*, i64** %9
%544 = load i64, i64* %543
%545 = call i32 (i32, i8*, ...) @fprintf(i32 %539, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.26, i64 0, i64 0), i32 %540, i64 %541, i64* %542, i64 %544)
br label %546
546: ; preds = %538, %519
br label %514
547: ; preds = %514
%548 = load i32, i32* %34
%549 = load i32, i32* %17
%550 = call i32 @pin_cpu(i32 %548, i32 %549)
%551 = icmp eq i32 %550, -1
br i1 %551, label %552, label %554
552: ; preds = %547
%553 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.27, i64 0, i64 0))
br label %557
554: ; preds = %547
%555 = load i32, i32* %17
%556 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.28, i64 0, i64 0), i32 %555)
br label %557
557: ; preds = %554, %552
%558 = load i32, i32* %23
%559 = load i32, i32* %22
%560 = load i32, i32* %18
%561 = load i32, i32* %19
%562 = load i64, i64* %35
%563 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str.29, i64 0, i64 0), i32 %558, i32 %559, i32 %560, i32 %561, i64 %562)
store i32 0, i32* %13
br label %564
564: ; preds = %572, %557
%565 = load i32, i32* %13
%566 = load i32, i32* %23
%567 = icmp slt i32 %565, %566
br i1 %567, label %568, label %575
568: ; preds = %564
%569 = load i32, i32* %22
%570 = load i64*, i64** %8
%571 = call i64 @reader(i32 %569, i64* %570)
store i64 %571, i64* %11
br label %572
572: ; preds = %568
%573 = load i32, i32* %13
%574 = add nsw i32 %573, 1
store i32 %574, i32* %13
br label %564
575: ; preds = %564
%576 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.30, i64 0, i64 0))
%577 = load i32, i32* %25
ret i32 %577
}

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