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

/* Variables and functions */
unsigned long long _rdtsc();
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ err(int, char *, ...);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getopt(int, char **, char *);
char *malloc(int);
int /*<<< orphan*/ optarg;
int pin_cpu(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int triad(size_t, double, double *, double *, double *);
int /*<<< orphan*/ usage();
void main(int argc, char **argv) {
  double *a, *b, *c, xx = 0.01, bw, avg_bw, best_bw = -1.0;
  char *buf1, *buf2, *buf3;
  int i, j, k, offset_a = 0, offset_b = 0, offset_c = 0, mult = 1, iter = 100,
               c_val;
  int mem_level, level_size[4], cpu, cpu_run, bytes_per, scale;
  size_t len;
  unsigned long long start, stop, run_time, call_start, call_stop,
      call_run_time, total_bytes = 0;
  __pid_t pid = 0;
  int cpu_setsize;
  cpu_set_t mask;
  if (argc < 3) {
    printf("triad driver needs at least 3 arguments, cpu_init, cpu_run, "
           "cache_level, [call count multiplier  def = 1], [offset a, "
           "offset_b, offset_c  defaults = 0] \n");
    printf(" argc = %d\n", argc);
    usage();
    err(1, "bad arguments");
  }
  len = 1024 * 1024 * 1024;
  while ((c_val = getopt(argc, argv, "i:r:l:m:a:b:c")) != -1) {
    switch (c_val) {
    case 'i':
      cpu = atoi(optarg);
      break;
    case 'r':
      cpu_run = atoi(optarg);
      break;
    case 'l':
      mem_level = atoi(optarg);
      break;
    case 'm':
      mult = atoi(optarg);
      break;
    case 'a':
      offset_a = atoi(optarg);
      break;
    case 'b':
      offset_b = atoi(optarg);
      break;
    case 'c':
      offset_c = atoi(optarg);
      break;
    default:
      err(1, "unknown option %c", c_val);
    }
  }
  iter = iter * mult;
  if (pin_cpu(pid, cpu) == -1) {
    err(1, "failed to set affinity");
  } else {
    fprintf(stderr, " process pinned to core %d for initialization\n", cpu);
  }
  level_size[0] = 32 * 1024;
  level_size[1] = 512 * 1024;
  level_size[2] = 16 * 1024 * 1024;
  level_size[3] = 1024 * 1024 * 1024;
  fprintf(stderr, "len = %zd, mem_level = %d, iter = %d, mult = %d\n", len,
          mem_level, iter, mult);
  len = level_size[mem_level] / 32;
  fprintf(stderr, "len = %zd, mem_level = %d, iter = %d, mult = %d\n", len,
          mem_level, iter, mult);
  scale = level_size[3] / (32 * len);
  fprintf(stderr,
          "len = %zd, mem_level = %d, iter = %d, mult = %d, scale = %d\n", len,
          mem_level, iter, mult, scale);
  iter = iter * scale * mult;
  fprintf(stderr, "len = %zd, mem_level = %d, iter = %d, mult = %d\n", len,
          mem_level, iter, mult);
  buf1 = malloc(sizeof(double) * len + 4096 + 1024);
  fprintf(stderr, " buf1 = %p\n", buf1);
  buf1 = buf1 + (0x1000 - (unsigned int)buf1 & 0xFFF) + offset_a;
  fprintf(stderr, " buf1 = %p\n", buf1);
  a = (double *)buf1;
  buf2 = malloc(sizeof(double) * len + 4096 + 1024);
  fprintf(stderr, " buf2 = %p\n", buf2);
  buf2 = buf2 + (0x1000 - (unsigned int)buf2 & 0xFFF) + offset_b;
  fprintf(stderr, " buf2 = %p\n", buf2);
  b = (double *)buf2;
  buf3 = malloc(sizeof(double) * len + 4096 + 1024);
  fprintf(stderr, " buf3 = %p\n", buf3);
  buf3 = buf3 + (0x1000 - (unsigned int)buf3 & 0xFFF) + offset_c;
  fprintf(stderr, " buf3 = %p\n", buf3);
  c = (double *)buf3;
  for (i = 0; i < len; i++) {
    a[i] = 0.;
    b[i] = 10.;
    c[i] = 10.;
  }
  if (pin_cpu(pid, cpu_run) == -1) {
    err(1, "failed to set affinity");
  } else {
    fprintf(stderr, " process pinned to core %d for triad run\n", cpu_run);
  }
  printf(" calling triad %d times with len = %zd\n", iter, len);
  call_start = _rdtsc();
  for (i = 0; i < iter; i++) {
    start = _rdtsc();
    bytes_per = triad(len, xx, a, b, c);
    stop = _rdtsc();
    run_time = stop - start;
    xx += 0.01;
    total_bytes += len * bytes_per;
    bw = (double)(len * bytes_per) / (double)run_time;
    if (bw > best_bw)
      best_bw = bw;
  }
  call_stop = _rdtsc();
  call_run_time = call_stop - call_start;
  avg_bw = (double)(total_bytes) / (double)call_run_time;
  printf(" transfering %lld bytes from memory level %d took %lld cycles/call "
         "and a total of %lld\n",
         total_bytes, mem_level, run_time, call_run_time);
  printf(" average bytes/cycle = %f\n", avg_bw);
  printf(" best bytes/cycle = %f\n", best_bw);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xe4e(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe39(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x70(%rbp)
movl   $0x0,-0x74(%rbp)
movl   $0x0,-0x78(%rbp)
movl   $0x1,-0x7c(%rbp)
movl   $0x64,-0x80(%rbp)
movq   $0x0,-0xf0(%rbp)
movl   $0x0,-0xf4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    1247 <main+0xa7>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xefc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   10a0 <usage@plt>
mov    $0x1,%edi
lea    0xeee(%rip),%rsi
mov    $0x0,%al
call   1070 <err@plt>
movq   $0x40000000,-0xb8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xedc(%rip),%rdx
call   10b0 <getopt@plt>
mov    %eax,-0x84(%rbp)
cmp    $0xffffffff,%eax
je     1367 <main+0x1c7>
mov    -0x84(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x108(%rbp)
sub    $0x11,%eax
ja     1349 <main+0x1a9>
mov    -0x108(%rbp),%rax
lea    0xda3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2d4b(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0xa4(%rbp)
jmp    1362 <main+0x1c2>
mov    0x2d32(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0xa8(%rbp)
jmp    1362 <main+0x1c2>
mov    0x2d19(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0x88(%rbp)
jmp    1362 <main+0x1c2>
mov    0x2d00(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0x7c(%rbp)
jmp    1362 <main+0x1c2>
mov    0x2cea(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0x70(%rbp)
jmp    1362 <main+0x1c2>
mov    0x2cd4(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0x74(%rbp)
jmp    1362 <main+0x1c2>
mov    0x2cbe(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0x78(%rbp)
jmp    1362 <main+0x1c2>
mov    -0x84(%rbp),%edx
mov    $0x1,%edi
lea    0xdef(%rip),%rsi
mov    $0x0,%al
call   1070 <err@plt>
jmp    1252 <main+0xb2>
mov    -0x80(%rbp),%eax
imul   -0x7c(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0xf4(%rbp),%edi
mov    -0xa4(%rbp),%esi
call   1040 <pin_cpu@plt>
cmp    $0xffffffff,%eax
jne    13a3 <main+0x203>
mov    $0x1,%edi
lea    0xdc5(%rip),%rsi
mov    $0x0,%al
call   1070 <err@plt>
jmp    13c0 <main+0x220>
mov    0x2c2e(%rip),%rax
mov    (%rax),%edi
mov    -0xa4(%rbp),%edx
lea    0xdba(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x8000,-0xa0(%rbp)
movl   $0x80000,-0x9c(%rbp)
movl   $0x1000000,-0x98(%rbp)
movl   $0x40000000,-0x94(%rbp)
mov    0x2be9(%rip),%rax
mov    (%rax),%edi
mov    -0xb8(%rbp),%rdx
mov    -0x88(%rbp),%ecx
mov    -0x80(%rbp),%r8d
mov    -0x7c(%rbp),%r9d
lea    0xd95(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movslq -0x88(%rbp),%rax
mov    -0xa0(%rbp,%rax,4),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0xb8(%rbp)
mov    0x2b9e(%rip),%rax
mov    (%rax),%edi
mov    -0xb8(%rbp),%rdx
mov    -0x88(%rbp),%ecx
mov    -0x80(%rbp),%r8d
mov    -0x7c(%rbp),%r9d
lea    0xd4a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movslq -0x94(%rbp),%rax
mov    -0xb8(%rbp),%rcx
shl    $0x5,%rcx
xor    %edx,%edx
div    %rcx
mov    %eax,-0xb0(%rbp)
mov    0x2b55(%rip),%rax
mov    (%rax),%edi
mov    -0xb8(%rbp),%rdx
mov    -0x88(%rbp),%ecx
mov    -0x80(%rbp),%r8d
mov    -0x7c(%rbp),%r9d
mov    -0xb0(%rbp),%eax
lea    0xd2c(%rip),%rsi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x80(%rbp),%eax
imul   -0xb0(%rbp),%eax
imul   -0x7c(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    0x2b0f(%rip),%rax
mov    (%rax),%edi
mov    -0xb8(%rbp),%rdx
mov    -0x88(%rbp),%ecx
mov    -0x80(%rbp),%r8d
mov    -0x7c(%rbp),%r9d
lea    0xcbb(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0xb8(%rbp),%rax
shl    $0x3,%rax
add    $0x1000,%rax
add    $0x400,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    0x2ac1(%rip),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%rdx
lea    0xcec(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x50(%rbp),%rax
mov    -0x50(%rbp),%rcx
mov    %ecx,%edx
mov    $0x1000,%ecx
sub    %edx,%ecx
and    $0xfff,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
movslq -0x70(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    0x2a7f(%rip),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%rdx
lea    0xcaa(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x50(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xb8(%rbp),%rax
shl    $0x3,%rax
add    $0x1000,%rax
add    $0x400,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    0x2a3a(%rip),%rax
mov    (%rax),%edi
mov    -0x58(%rbp),%rdx
lea    0xc71(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x58(%rbp),%rax
mov    -0x58(%rbp),%rcx
mov    %ecx,%edx
mov    $0x1000,%ecx
sub    %edx,%ecx
and    $0xfff,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
movslq -0x74(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    0x29f8(%rip),%rax
mov    (%rax),%edi
mov    -0x58(%rbp),%rdx
lea    0xc2f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x58(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xb8(%rbp),%rax
shl    $0x3,%rax
add    $0x1000,%rax
add    $0x400,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    0x29b3(%rip),%rax
mov    (%rax),%edi
mov    -0x60(%rbp),%rdx
lea    0xbf6(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x60(%rbp),%rax
mov    -0x60(%rbp),%rcx
mov    %ecx,%edx
mov    $0x1000,%ecx
sub    %edx,%ecx
and    $0xfff,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
movslq -0x78(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    0x2971(%rip),%rax
mov    (%rax),%edi
mov    -0x60(%rbp),%rdx
lea    0xbb4(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x60(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x64(%rbp)
movslq -0x64(%rbp),%rax
cmp    -0xb8(%rbp),%rax
jae    16e3 <main+0x543>
mov    -0x18(%rbp),%rax
movslq -0x64(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  0x955(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  0x940(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    168a <main+0x4ea>
mov    -0xf4(%rbp),%edi
mov    -0xa8(%rbp),%esi
call   1040 <pin_cpu@plt>
cmp    $0xffffffff,%eax
jne    1715 <main+0x575>
mov    $0x1,%edi
lea    0xa53(%rip),%rsi
mov    $0x0,%al
call   1070 <err@plt>
jmp    1732 <main+0x592>
mov    0x28bc(%rip),%rax
mov    (%rax),%edi
mov    -0xa8(%rbp),%edx
lea    0xb09(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x80(%rbp),%esi
mov    -0xb8(%rbp),%rdx
lea    0xb1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1090 <_rdtsc@plt>
mov    %rax,-0xd8(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x80(%rbp),%eax
jge    1891 <main+0x6f1>
xor    %eax,%eax
mov    %al,-0x109(%rbp)
call   1090 <_rdtsc@plt>
mov    %rax,-0xc0(%rbp)
mov    -0xb8(%rbp),%rdi
movsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1060 <triad@plt>
mov    %eax,%ecx
mov    -0x109(%rbp),%al
mov    %ecx,-0xac(%rbp)
call   1090 <_rdtsc@plt>
mov    %rax,-0xc8(%rbp)
mov    -0xc8(%rbp),%rax
mov    -0xc0(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0xd0(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0x82d(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0xb8(%rbp),%rcx
movslq -0xac(%rbp),%rax
imul   %rax,%rcx
mov    -0xf0(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0xf0(%rbp)
mov    -0xb8(%rbp),%rax
movslq -0xac(%rbp),%rcx
imul   %rcx,%rax
movq   %rax,%xmm0
movaps 0x7fb(%rip),%xmm3
punpckldq %xmm3,%xmm0
movapd 0x7ff(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0xd0(%rbp),%xmm1
ff
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    187e <main+0x6de>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1883 <main+0x6e3>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    175f <main+0x5bf>
xor    %eax,%eax
call   1090 <_rdtsc@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rax
mov    -0xd8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0xe8(%rbp)
movaps 0x762(%rip),%xmm3
movq   -0xf0(%rbp),%xmm0
ff
punpckldq %xmm3,%xmm0
movapd 0x75e(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0xe8(%rbp),%xmm1
ff
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0xf0(%rbp),%rsi
mov    -0x88(%rbp),%edx
mov    -0xd0(%rbp),%rcx
mov    -0xe8(%rbp),%r8
lea    0x95f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x40(%rbp),%xmm0
lea    0x9a4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x48(%rbp),%xmm0
lea    0x9ac(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rsi,%rbp
mov    %edi,%r13d
cmp    $0x2,%edi
jg     1213 <main+0x53>
lea    0x10a4(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   10c0 <usage@plt>
lea    0xe9d(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1090 <err@plt>
movl   $0x1,0x10(%rsp)
lea    0xe90(%rip),%r12
lea    0xe27(%rip),%rbx
mov    0x2dc8(%rip),%r15
movl   $0x0,0x40(%rsp)
movl   $0x0,0x28(%rsp)
movl   $0x0,0x30(%rsp)
jmp    1260 <main+0xa0>
mov    (%r15),%edi
call   10e0 <atoi@plt>
mov    %eax,0x40(%rsp)
cs nopw 0x0(%rax,%rax,1)
mov    %r13d,%edi
mov    %rbp,%rsi
mov    %r12,%rdx
call   10d0 <getopt@plt>
lea    -0x61(%rax),%ecx
cmp    $0x11,%ecx
ja     12d2 <main+0x112>
movslq (%rbx,%rcx,4),%rcx
add    %rbx,%rcx
jmp    *%rcx
mov    (%r15),%edi
call   10e0 <atoi@plt>
mov    %eax,0x30(%rsp)
jmp    1260 <main+0xa0>
mov    (%r15),%edi
call   10e0 <atoi@plt>
mov    %eax,0x28(%rsp)
jmp    1260 <main+0xa0>
mov    (%r15),%edi
call   10e0 <atoi@plt>
mov    %eax,%r14d
jmp    1260 <main+0xa0>
mov    (%r15),%edi
call   10e0 <atoi@plt>
mov    %eax,0xc(%rsp)
jmp    1260 <main+0xa0>
mov    (%r15),%edi
call   10e0 <atoi@plt>
mov    %eax,0x10(%rsp)
jmp    1260 <main+0xa0>
mov    (%r15),%edi
call   10e0 <atoi@plt>
mov    %eax,0x50(%rsp)
jmp    1260 <main+0xa0>
cmp    $0xffffffff,%eax
je     12f1 <main+0x131>
mov    $0x1,%edi
lea    0xddd(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1090 <err@plt>
jmp    1260 <main+0xa0>
imul   $0x64,0x10(%rsp),%r15d
xor    %edi,%edi
mov    %r14d,%esi
call   1060 <pin_cpu@plt>
cmp    $0xffffffff,%eax
je     1322 <main+0x162>
mov    0x2ccb(%rip),%rax
mov    (%rax),%edi
lea    0xdd3(%rip),%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1335 <main+0x175>
lea    0xda9(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1090 <err@plt>
movapd 0xcc3(%rip),%xmm0
movapd %xmm0,0x70(%rsp)
mov    0x2c8e(%rip),%r13
mov    0x0(%r13),%edi
lea    0xdc3(%rip),%rsi
xor    %r14d,%r14d
mov    $0x40000000,%edx
mov    0xc(%rsp),%ebx
mov    %ebx,%ecx
mov    %r15d,%r8d
mov    0x10(%rsp),%r12d
mov    %r12d,%r9d
xor    %eax,%eax
call   1070 <fprintf@plt>
movslq %ebx,%rcx
mov    0x70(%rsp,%rcx,4),%eax
lea    0x1f(%rax),%edx
test   %eax,%eax
mov    %edx,0x20(%rsp)
cmovs  %edx,%eax
sar    $0x5,%eax
movslq %eax,%rbp
mov    0x0(%r13),%edi
lea    0xd7f(%rip),%rsi
mov    %rbp,%rdx
mov    %r15d,%r8d
mov    %r12d,%r9d
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbp,%rcx
shl    $0x5,%rcx
cmp    $0x40000000,%rcx
ja     13c5 <main+0x205>
mov    $0x40000000,%eax
xor    %edx,%edx
div    %ecx
mov    %eax,%r14d
mov    0x2c0c(%rip),%rax
mov    (%rax),%edi
mov    %rax,%r13
mov    %r14d,(%rsp)
lea    0xd6d(%rip),%rsi
mov    %rbp,%rdx
mov    0xc(%rsp),%r12d
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    0x10(%rsp),%ebx
mov    %ebx,%r9d
xor    %eax,%eax
call   1070 <fprintf@plt>
imul   %ebx,%r15d
imul   %r14d,%r15d
mov    0x0(%r13),%edi
mov    %r13,%r14
lea    0xd0a(%rip),%rsi
mov    %rbp,%rdx
mov    %r12d,%ecx
mov    %r15d,0x8(%rsp)
mov    %r15d,%r8d
mov    %ebx,%r9d
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbp,0x38(%rsp)
lea    0x1400(,%rbp,8),%r13d
mov    %r13d,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbp
mov    %r14,%rbx
mov    (%r14),%edi
lea    0xd3b(%rip),%r12
mov    %r12,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %ebp,%eax
neg    %eax
and    $0xfff,%eax
add    %rbp,%rax
movslq 0x30(%rsp),%rdx
add    %rax,%rdx
mov    (%r14),%edi
mov    %r12,%rsi
mov    %rdx,0x30(%rsp)
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r13d,%edi
call   10a0 <malloc@plt>
mov    %rax,%r12
mov    (%r14),%edi
mov    %r14,%r15
lea    0xcfc(%rip),%rbx
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r12d,%r14d
neg    %r14d
and    $0xfff,%r14d
lea    (%r12,%r14,1),%rdx
movslq 0x28(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    %rdx,0x60(%rsp)
add    %rdx,%rax
mov    (%r15),%edi
mov    %rbx,%rsi
mov    %rax,%rbx
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r13d,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbp
mov    (%r15),%edi
lea    0xcb0(%rip),%r15
mov    %r15,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %ebp,%r13d
neg    %r13d
and    $0xfff,%r13d
mov    %rbp,0x68(%rsp)
mov    %rbp,%rcx
add    %r13,%rcx
movslq 0x40(%rsp),%rbp
mov    %rcx,0x40(%rsp)
lea    (%rcx,%rbp,1),%rdx
mov    %rdx,0x28(%rsp)
mov    0x2aab(%rip),%rax
mov    (%rax),%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
cmpl   $0x3f,0x20(%rsp)
jb     16f1 <main+0x531>
mov    %rbp,0x20(%rsp)
mov    %r12,0x58(%rsp)
mov    0x38(%rsp),%rax
cmp    $0x2,%rax
mov    $0x1,%r15d
cmovae %rax,%r15
lea    0x0(,%r15,8),%rdx
xor    %ebp,%ebp
mov    0x30(%rsp),%rdi
xor    %esi,%esi
call   1050 <memset@plt>
cmp    $0x4,%r15
jae    1587 <main+0x3c7>
mov    0x28(%rsp),%rcx
jmp    16c9 <main+0x509>
mov    %r15,%rbp
and    $0xfffffffffffffffc,%rbp
lea    -0x4(%rbp),%rdx
mov    %rdx,%rcx
shr    $0x2,%rcx
add    $0x1,%rcx
mov    %ecx,%eax
and    $0x3,%eax
cmp    $0xc,%rdx
jae    15b4 <main+0x3f4>
xor    %edx,%edx
mov    0x10(%rsp),%r8
jmp    1658 <main+0x498>
and    $0xfffffffffffffffc,%rcx
mov    0x10(%rsp),%r8
mov    0x60(%rsp),%rdx
lea    (%r8,%rdx,1),%rsi
add    $0x70,%rsi
mov    0x20(%rsp),%rdx
mov    0x40(%rsp),%rdi
add    %rdx,%rdi
add    $0x70,%rdi
xor    %edx,%edx
movapd 0xa2b(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nop
movupd %xmm0,-0x70(%rsi,%rdx,8)
movupd %xmm0,-0x60(%rsi,%rdx,8)
movupd %xmm0,-0x70(%rdi,%rdx,8)
movupd %xmm0,-0x60(%rdi,%rdx,8)
movupd %xmm0,-0x50(%rsi,%rdx,8)
movupd %xmm0,-0x40(%rsi,%rdx,8)
movupd %xmm0,-0x50(%rdi,%rdx,8)
movupd %xmm0,-0x40(%rdi,%rdx,8)
movupd %xmm0,-0x30(%rsi,%rdx,8)
movupd %xmm0,-0x20(%rsi,%rdx,8)
movupd %xmm0,-0x30(%rdi,%rdx,8)
movupd %xmm0,-0x20(%rdi,%rdx,8)
movupd %xmm0,-0x10(%rsi,%rdx,8)
movupd %xmm0,(%rsi,%rdx,8)
movupd %xmm0,-0x10(%rdi,%rdx,8)
movupd %xmm0,(%rdi,%rdx,8)
add    $0x10,%rdx
add    $0xfffffffffffffffc,%rcx
jne    15f0 <main+0x430>
test   %rax,%rax
je     16bf <main+0x4ff>
lea    0x0(,%rdx,8),%rcx
add    %r13,%rcx
add    0x68(%rsp),%rcx
mov    0x20(%rsp),%rsi
add    %rsi,%rcx
add    $0x10,%rcx
lea    (%r14,%rdx,8),%rdx
add    0x58(%rsp),%rdx
add    %r8,%rdx
add    $0x10,%rdx
shl    $0x5,%rax
xor    %esi,%esi
movapd 0x979(%rip),%xmm0
nopw   0x0(%rax,%rax,1)
movupd %xmm0,-0x10(%rdx,%rsi,1)
movupd %xmm0,(%rdx,%rsi,1)
movupd %xmm0,-0x10(%rcx,%rsi,1)
movupd %xmm0,(%rcx,%rsi,1)
add    $0x20,%rsi
cmp    %rsi,%rax
jne    16a0 <main+0x4e0>
cmp    %rbp,%r15
mov    0x28(%rsp),%rcx
je     16f1 <main+0x531>
movabs $0x4024000000000000,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rax,(%rbx,%rbp,8)
mov    %rax,(%rcx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r15
jne    16e0 <main+0x520>
mov    %rbx,%r15
xor    %edi,%edi
mov    0x50(%rsp),%ebp
mov    %ebp,%esi
call   1060 <pin_cpu@plt>
cmp    $0xffffffff,%eax
je     1721 <main+0x561>
mov    0x28cb(%rip),%rax
mov    (%rax),%edi
lea    0xa94(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1734 <main+0x574>
lea    0x9aa(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1090 <err@plt>
mov    0x8(%rsp),%ebp
mov    0x38(%rsp),%rbx
lea    0xa90(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   10b0 <_rdtsc@plt>
mov    %rax,0x20(%rsp)
test   %ebp,%ebp
jle    1851 <main+0x691>
movsd  0x8d4(%rip),%xmm1
movsd  0x8d4(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
xor    %r14d,%r14d
xor    %ebp,%ebp
mov    %r15,0x50(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm1,0x40(%rsp)
xor    %eax,%eax
call   10b0 <_rdtsc@plt>
mov    %rax,%r15
mov    %rbx,%rdi
movsd  0x10(%rsp),%xmm0
mov    0x30(%rsp),%rsi
mov    0x50(%rsp),%rdx
mov    0x28(%rsp),%rcx
call   1080 <triad@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   10b0 <_rdtsc@plt>
mov    %rax,%r13
sub    %r15,%r13
movsd  0x10(%rsp),%xmm0
addsd  0x86d(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movslq %r12d,%rax
mov    0x38(%rsp),%rbx
imul   %rbx,%rax
add    %rax,%rbp
movq   %rax,%xmm0
movdqa 0x823(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0x827(%rip),%xmm3
subpd  %xmm3,%xmm0
movapd %xmm0,%xmm2
unpckhpd %xmm0,%xmm2
addsd  %xmm0,%xmm2
movq   %r13,%xmm0
punpckldq %xmm1,%xmm0
subpd  %xmm3,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm2
maxsd  0x40(%rsp),%xmm2
add    $0x1,%r14d
movapd %xmm2,%xmm1
cmp    0x8(%rsp),%r14d
jne    1790 <main+0x5d0>
jmp    185b <main+0x69b>
movsd  0x7e7(%rip),%xmm2
xor    %ebp,%ebp
movapd %xmm2,0x10(%rsp)
xor    %eax,%eax
call   10b0 <_rdtsc@plt>
sub    0x20(%rsp),%rax
movq   %rbp,%xmm0
movdqa 0x7a6(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0x7aa(%rip),%xmm2
subpd  %xmm2,%xmm0
movapd %xmm0,%xmm3
unpckhpd %xmm0,%xmm3
addsd  %xmm0,%xmm3
movq   %rax,%xmm0
punpckldq %xmm1,%xmm0
subpd  %xmm2,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm3
movapd %xmm3,0x40(%rsp)
lea    0x93c(%rip),%rdi
mov    %rbp,%rsi
mov    0xc(%rsp),%edx
mov    %r13,%rcx
mov    %rax,%r8
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x979(%rip),%rdi
movaps 0x40(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0x981(%rip),%rdi
movaps 0x10(%rsp),%xmm0
mov    $0x1,%al
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [154 x i8] c"triad driver needs at least 3 arguments, cpu_init, cpu_run, cache_level, [call count multiplier def = 1], [offset a, offset_b, offset_c defaults = 0] \0A\00"
@.str.1 = [12 x i8] c" argc = %d\0A\00"
@.str.2 = [14 x i8] c"bad arguments\00"
@.str.3 = [14 x i8] c"i:r:l:m:a:b:c\00"
@optarg = global i32 0
@.str.4 = [18 x i8] c"unknown option %c\00"
@.str.5 = [23 x i8] c"failed to set affinity\00"
@stderr = global i32 0
@.str.6 = [47 x i8] c" process pinned to core %d for initialization\0A\00"
@.str.7 = [49 x i8] c"len = %zd, mem_level = %d, iter = %d, mult = %d\0A\00"
@.str.8 = [61 x i8] c"len = %zd, mem_level = %d, iter = %d, mult = %d, scale = %d\0A\00"
@.str.9 = [12 x i8] c" buf1 = %p\0A\00"
@.str.10 = [12 x i8] c" buf2 = %p\0A\00"
@.str.11 = [12 x i8] c" buf3 = %p\0A\00"
@.str.12 = [42 x i8] c" process pinned to core %d for triad run\0A\00"
@.str.13 = [40 x i8] c" calling triad %d times with len = %zd\0A\00"
@.str.14 = [88 x i8] c" transfering %lld bytes from memory level %d took %lld cycles/call and a total of %lld\0A\00"
@.str.15 = [27 x i8] c" average bytes/cycle = %f\0A\00"
@.str.16 = [24 x i8] c" best bytes/cycle = %f\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%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 [4 x i32]
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i64
%31 = alloca i64
%32 = alloca i64
%33 = alloca i64
%34 = alloca i64
%35 = alloca i64
%36 = alloca i64
%37 = alloca i64
%38 = alloca i32
%39 = alloca i32
%40 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store double 1.000000e-02, double* %8
store double -1.000000e+00, double* %11
store i32 0, i32* %18
store i32 0, i32* %19
store i32 0, i32* %20
store i32 1, i32* %21
store i32 100, i32* %22
store i64 0, i64* %37
store i32 0, i32* %38
%41 = load i32, i32* %3
%42 = icmp slt i32 %41, 3
br i1 %42, label %43, label %49
43: ; preds = %2
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0))
%45 = load i32, i32* %3
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %45)
%47 = call i32 (...) @usage()
%48 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %49
49: ; preds = %43, %2
store i64 1073741824, i64* %30
br label %50
50: ; preds = %81, %49
%51 = load i32, i32* %3
%52 = load i8**, i8*** %4
%53 = call i32 @getopt(i32 %51, i8** %52, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
store i32 %53, i32* %23
%54 = icmp ne i32 %53, -1
br i1 %54, label %55, label %82
55: ; preds = %50
%56 = load i32, i32* %23
switch i32 %56, label %78 [
i32 105, label %57
i32 114, label %60
i32 108, label %63
i32 109, label %66
i32 97, label %69
i32 98, label %72
i32 99, label %75
]
57: ; preds = %55
%58 = load i32, i32* @optarg
%59 = call i32 @atoi(i32 %58)
store i32 %59, i32* %26
br label %81
60: ; preds = %55
%61 = load i32, i32* @optarg
%62 = call i32 @atoi(i32 %61)
store i32 %62, i32* %27
br label %81
63: ; preds = %55
%64 = load i32, i32* @optarg
%65 = call i32 @atoi(i32 %64)
store i32 %65, i32* %24
br label %81
66: ; preds = %55
%67 = load i32, i32* @optarg
%68 = call i32 @atoi(i32 %67)
store i32 %68, i32* %21
br label %81
69: ; preds = %55
%70 = load i32, i32* @optarg
%71 = call i32 @atoi(i32 %70)
store i32 %71, i32* %18
br label %81
72: ; preds = %55
%73 = load i32, i32* @optarg
%74 = call i32 @atoi(i32 %73)
store i32 %74, i32* %19
br label %81
75: ; preds = %55
%76 = load i32, i32* @optarg
%77 = call i32 @atoi(i32 %76)
store i32 %77, i32* %20
br label %81
78: ; preds = %55
%79 = load i32, i32* %23
%80 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %79)
br label %81
81: ; preds = %78, %75, %72, %69, %66, %63, %60, %57
br label %50
82: ; preds = %50
%83 = load i32, i32* %22
%84 = load i32, i32* %21
%85 = mul nsw i32 %83, %84
store i32 %85, i32* %22
%86 = load i32, i32* %38
%87 = load i32, i32* %26
%88 = call i32 @pin_cpu(i32 %86, i32 %87)
%89 = icmp eq i32 %88, -1
br i1 %89, label %90, label %92
90: ; preds = %82
%91 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %96
92: ; preds = %82
%93 = load i32, i32* @stderr
%94 = load i32, i32* %26
%95 = call i32 (i32, i8*, ...) @fprintf(i32 %93, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), i32 %94)
br label %96
96: ; preds = %92, %90
%97 = getelementptr inbounds [4 x i32], [4 x i32]* %25, i64 0, i64 0
store i32 32768, i32* %97
%98 = getelementptr inbounds [4 x i32], [4 x i32]* %25, i64 0, i64 1
store i32 524288, i32* %98
%99 = getelementptr inbounds [4 x i32], [4 x i32]* %25, i64 0, i64 2
store i32 16777216, i32* %99
%100 = getelementptr inbounds [4 x i32], [4 x i32]* %25, i64 0, i64 3
store i32 1073741824, i32* %100
%101 = load i32, i32* @stderr
%102 = load i64, i64* %30
%103 = load i32, i32* %24
%104 = load i32, i32* %22
%105 = load i32, i32* %21
%106 = call i32 (i32, i8*, ...) @fprintf(i32 %101, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i64 %102, i32 %103, i32 %104, i32 %105)
%107 = load i32, i32* %24
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [4 x i32], [4 x i32]* %25, i64 0, i64 %108
%110 = load i32, i32* %109
%111 = sdiv i32 %110, 32
%112 = sext i32 %111 to i64
store i64 %112, i64* %30
%113 = load i32, i32* @stderr
%114 = load i64, i64* %30
%115 = load i32, i32* %24
%116 = load i32, i32* %22
%117 = load i32, i32* %21
%118 = call i32 (i32, i8*, ...) @fprintf(i32 %113, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i64 %114, i32 %115, i32 %116, i32 %117)
%119 = getelementptr inbounds [4 x i32], [4 x i32]* %25, i64 0, i64 3
%120 = load i32, i32* %119
%121 = sext i32 %120 to i64
%122 = load i64, i64* %30
%123 = mul i64 32, %122
%124 = udiv i64 %121, %123
%125 = trunc i64 %124 to i32
store i32 %125, i32* %29
%126 = load i32, i32* @stderr
%127 = load i64, i64* %30
%128 = load i32, i32* %24
%129 = load i32, i32* %22
%130 = load i32, i32* %21
%131 = load i32, i32* %29
%132 = call i32 (i32, i8*, ...) @fprintf(i32 %126, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.8, i64 0, i64 0), i64 %127, i32 %128, i32 %129, i32 %130, i32 %131)
%133 = load i32, i32* %22
%134 = load i32, i32* %29
%135 = mul nsw i32 %133, %134
%136 = load i32, i32* %21
%137 = mul nsw i32 %135, %136
store i32 %137, i32* %22
%138 = load i32, i32* @stderr
%139 = load i64, i64* %30
%140 = load i32, i32* %24
%141 = load i32, i32* %22
%142 = load i32, i32* %21
%143 = call i32 (i32, i8*, ...) @fprintf(i32 %138, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i64 %139, i32 %140, i32 %141, i32 %142)
%144 = load i64, i64* %30
%145 = mul i64 8, %144
%146 = add i64 %145, 4096
%147 = add i64 %146, 1024
%148 = trunc i64 %147 to i32
%149 = call i8* @malloc(i32 %148)
store i8* %149, i8** %12
%150 = load i32, i32* @stderr
%151 = load i8*, i8** %12
%152 = call i32 (i32, i8*, ...) @fprintf(i32 %150, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %151)
%153 = load i8*, i8** %12
%154 = load i8*, i8** %12
%155 = ptrtoint i8* %154 to i32
%156 = sub i32 4096, %155
%157 = and i32 %156, 4095
%158 = zext i32 %157 to i64
%159 = getelementptr inbounds i8, i8* %153, i64 %158
%160 = load i32, i32* %18
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds i8, i8* %159, i64 %161
store i8* %162, i8** %12
%163 = load i32, i32* @stderr
%164 = load i8*, i8** %12
%165 = call i32 (i32, i8*, ...) @fprintf(i32 %163, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %164)
%166 = load i8*, i8** %12
%167 = bitcast i8* %166 to double*
store double* %167, double** %5
%168 = load i64, i64* %30
%169 = mul i64 8, %168
%170 = add i64 %169, 4096
%171 = add i64 %170, 1024
%172 = trunc i64 %171 to i32
%173 = call i8* @malloc(i32 %172)
store i8* %173, i8** %13
%174 = load i32, i32* @stderr
%175 = load i8*, i8** %13
%176 = call i32 (i32, i8*, ...) @fprintf(i32 %174, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %175)
%177 = load i8*, i8** %13
%178 = load i8*, i8** %13
%179 = ptrtoint i8* %178 to i32
%180 = sub i32 4096, %179
%181 = and i32 %180, 4095
%182 = zext i32 %181 to i64
%183 = getelementptr inbounds i8, i8* %177, i64 %182
%184 = load i32, i32* %19
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds i8, i8* %183, i64 %185
store i8* %186, i8** %13
%187 = load i32, i32* @stderr
%188 = load i8*, i8** %13
%189 = call i32 (i32, i8*, ...) @fprintf(i32 %187, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %188)
%190 = load i8*, i8** %13
%191 = bitcast i8* %190 to double*
store double* %191, double** %6
%192 = load i64, i64* %30
%193 = mul i64 8, %192
%194 = add i64 %193, 4096
%195 = add i64 %194, 1024
%196 = trunc i64 %195 to i32
%197 = call i8* @malloc(i32 %196)
store i8* %197, i8** %14
%198 = load i32, i32* @stderr
%199 = load i8*, i8** %14
%200 = call i32 (i32, i8*, ...) @fprintf(i32 %198, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* %199)
%201 = load i8*, i8** %14
%202 = load i8*, i8** %14
%203 = ptrtoint i8* %202 to i32
%204 = sub i32 4096, %203
%205 = and i32 %204, 4095
%206 = zext i32 %205 to i64
%207 = getelementptr inbounds i8, i8* %201, i64 %206
%208 = load i32, i32* %20
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds i8, i8* %207, i64 %209
store i8* %210, i8** %14
%211 = load i32, i32* @stderr
%212 = load i8*, i8** %14
%213 = call i32 (i32, i8*, ...) @fprintf(i32 %211, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* %212)
%214 = load i8*, i8** %14
%215 = bitcast i8* %214 to double*
store double* %215, double** %7
store i32 0, i32* %15
br label %216
216: ; preds = %234, %96
%217 = load i32, i32* %15
%218 = sext i32 %217 to i64
%219 = load i64, i64* %30
%220 = icmp ult i64 %218, %219
br i1 %220, label %221, label %237
221: ; preds = %216
%222 = load double*, double** %5
%223 = load i32, i32* %15
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds double, double* %222, i64 %224
store double 0.000000e+00, double* %225
%226 = load double*, double** %6
%227 = load i32, i32* %15
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds double, double* %226, i64 %228
store double 1.000000e+01, double* %229
%230 = load double*, double** %7
%231 = load i32, i32* %15
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds double, double* %230, i64 %232
store double 1.000000e+01, double* %233
br label %234
234: ; preds = %221
%235 = load i32, i32* %15
%236 = add nsw i32 %235, 1
store i32 %236, i32* %15
br label %216
237: ; preds = %216
%238 = load i32, i32* %38
%239 = load i32, i32* %27
%240 = call i32 @pin_cpu(i32 %238, i32 %239)
%241 = icmp eq i32 %240, -1
br i1 %241, label %242, label %244
242: ; preds = %237
%243 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %248
244: ; preds = %237
%245 = load i32, i32* @stderr
%246 = load i32, i32* %27
%247 = call i32 (i32, i8*, ...) @fprintf(i32 %245, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.12, i64 0, i64 0), i32 %246)
br label %248
248: ; preds = %244, %242
%249 = load i32, i32* %22
%250 = load i64, i64* %30
%251 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.13, i64 0, i64 0), i32 %249, i64 %250)
%252 = call i64 (...) @_rdtsc()
store i64 %252, i64* %34
store i32 0, i32* %15
br label %253
253: ; preds = %291, %248
%254 = load i32, i32* %15
%255 = load i32, i32* %22
%256 = icmp slt i32 %254, %255
br i1 %256, label %257, label %294
257: ; preds = %253
%258 = call i64 (...) @_rdtsc()
store i64 %258, i64* %31
%259 = load i64, i64* %30
%260 = load double, double* %8
%261 = load double*, double** %5
%262 = load double*, double** %6
%263 = load double*, double** %7
%264 = call i32 @triad(i64 %259, double %260, double* %261, double* %262, double* %263)
store i32 %264, i32* %28
%265 = call i64 (...) @_rdtsc()
store i64 %265, i64* %32
%266 = load i64, i64* %32
%267 = load i64, i64* %31
%268 = sub i64 %266, %267
store i64 %268, i64* %33
%269 = load double, double* %8
%270 = fadd double %269, 1.000000e-02
store double %270, double* %8
%271 = load i64, i64* %30
%272 = load i32, i32* %28
%273 = sext i32 %272 to i64
%274 = mul i64 %271, %273
%275 = load i64, i64* %37
%276 = add i64 %275, %274
store i64 %276, i64* %37
%277 = load i64, i64* %30
%278 = load i32, i32* %28
%279 = sext i32 %278 to i64
%280 = mul i64 %277, %279
%281 = uitofp i64 %280 to double
%282 = load i64, i64* %33
%283 = uitofp i64 %282 to double
%284 = fdiv double %281, %283
store double %284, double* %9
%285 = load double, double* %9
%286 = load double, double* %11
%287 = fcmp ogt double %285, %286
br i1 %287, label %288, label %290
288: ; preds = %257
%289 = load double, double* %9
store double %289, double* %11
br label %290
290: ; preds = %288, %257
br label %291
291: ; preds = %290
%292 = load i32, i32* %15
%293 = add nsw i32 %292, 1
store i32 %293, i32* %15
br label %253
294: ; preds = %253
%295 = call i64 (...) @_rdtsc()
store i64 %295, i64* %35
%296 = load i64, i64* %35
%297 = load i64, i64* %34
%298 = sub i64 %296, %297
store i64 %298, i64* %36
%299 = load i64, i64* %37
%300 = uitofp i64 %299 to double
%301 = load i64, i64* %36
%302 = uitofp i64 %301 to double
%303 = fdiv double %300, %302
store double %303, double* %10
%304 = load i64, i64* %37
%305 = load i32, i32* %24
%306 = load i64, i64* %33
%307 = load i64, i64* %36
%308 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.14, i64 0, i64 0), i64 %304, i32 %305, i64 %306, i64 %307)
%309 = load double, double* %10
%310 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i64 0, i64 0), double %309)
%311 = load double, double* %11
%312 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.16, i64 0, i64 0), double %311)
ret void
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c" argc = %d\0A\00"
@.str.2 = [14 x i8] c"bad arguments\00"
@.str.3 = [14 x i8] c"i:r:l:m:a:b:c\00"
@optarg = global i32 0
@.str.4 = [18 x i8] c"unknown option %c\00"
@.str.5 = [23 x i8] c"failed to set affinity\00"
@stderr = global i32 0
@.str.6 = [47 x i8] c" process pinned to core %d for initialization\0A\00"
@.str.7 = [49 x i8] c"len = %zd, mem_level = %d, iter = %d, mult = %d\0A\00"
@.str.8 = [61 x i8] c"len = %zd, mem_level = %d, iter = %d, mult = %d, scale = %d\0A\00"
@.str.9 = [12 x i8] c" buf1 = %p\0A\00"
@.str.10 = [12 x i8] c" buf2 = %p\0A\00"
@.str.11 = [12 x i8] c" buf3 = %p\0A\00"
@.str.12 = [42 x i8] c" process pinned to core %d for triad run\0A\00"
@.str.13 = [40 x i8] c" calling triad %d times with len = %zd\0A\00"
@.str.14 = [88 x i8] c" transfering %lld bytes from memory level %d took %lld cycles/call and a total of %lld\0A\00"
@.str.15 = [27 x i8] c" average bytes/cycle = %f\0A\00"
@.str.16 = [24 x i8] c" best bytes/cycle = %f\0A\00"
@str = [153 x i8] c"triad driver needs at least 3 arguments, cpu_init, cpu_run, cache_level, [call count multiplier def = 1], [offset a, offset_b, offset_c defaults = 0] \00"
define void @main(i32 %0, i8** %1) {
%3 = alloca <4 x i32>
%4 = bitcast <4 x i32>* %3 to i8*
%5 = icmp slt i32 %0, 3
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([153 x i8], [153 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%9 = tail call i32 (...) @usage()
%10 = tail call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %6, %2
br label %12
12: ; preds = %44, %11
%13 = phi i32 [ undef, %11 ], [ %45, %44 ]
%14 = phi i32 [ undef, %11 ], [ %46, %44 ]
%15 = phi i32 [ undef, %11 ], [ %47, %44 ]
%16 = phi i32 [ 1, %11 ], [ %48, %44 ]
%17 = phi i32 [ 0, %11 ], [ %49, %44 ]
%18 = phi i32 [ 0, %11 ], [ %50, %44 ]
%19 = phi i32 [ 0, %11 ], [ %51, %44 ]
%20 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
switch i32 %20, label %42 [
i32 -1, label %52
i32 105, label %21
i32 114, label %24
i32 108, label %27
i32 109, label %30
i32 97, label %33
i32 98, label %36
i32 99, label %39
]
21: ; preds = %12
%22 = load i32, i32* @optarg
%23 = tail call i32 @atoi(i32 %22)
br label %44
24: ; preds = %12
%25 = load i32, i32* @optarg
%26 = tail call i32 @atoi(i32 %25)
br label %44
27: ; preds = %12
%28 = load i32, i32* @optarg
%29 = tail call i32 @atoi(i32 %28)
br label %44
30: ; preds = %12
%31 = load i32, i32* @optarg
%32 = tail call i32 @atoi(i32 %31)
br label %44
33: ; preds = %12
%34 = load i32, i32* @optarg
%35 = tail call i32 @atoi(i32 %34)
br label %44
36: ; preds = %12
%37 = load i32, i32* @optarg
%38 = tail call i32 @atoi(i32 %37)
br label %44
39: ; preds = %12
%40 = load i32, i32* @optarg
%41 = tail call i32 @atoi(i32 %40)
br label %44
42: ; preds = %12
%43 = tail call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %20)
br label %44
44: ; preds = %42, %39, %36, %33, %30, %27, %24, %21
%45 = phi i32 [ %13, %42 ], [ %13, %39 ], [ %13, %36 ], [ %13, %33 ], [ %13, %30 ], [ %13, %27 ], [ %26, %24 ], [ %13, %21 ]
%46 = phi i32 [ %14, %42 ], [ %14, %39 ], [ %14, %36 ], [ %14, %33 ], [ %14, %30 ], [ %14, %27 ], [ %14, %24 ], [ %23, %21 ]
%47 = phi i32 [ %15, %42 ], [ %15, %39 ], [ %15, %36 ], [ %15, %33 ], [ %15, %30 ], [ %29, %27 ], [ %15, %24 ], [ %15, %21 ]
%48 = phi i32 [ %16, %42 ], [ %16, %39 ], [ %16, %36 ], [ %16, %33 ], [ %32, %30 ], [ %16, %27 ], [ %16, %24 ], [ %16, %21 ]
%49 = phi i32 [ %17, %42 ], [ %41, %39 ], [ %17, %36 ], [ %17, %33 ], [ %17, %30 ], [ %17, %27 ], [ %17, %24 ], [ %17, %21 ]
%50 = phi i32 [ %18, %42 ], [ %18, %39 ], [ %38, %36 ], [ %18, %33 ], [ %18, %30 ], [ %18, %27 ], [ %18, %24 ], [ %18, %21 ]
%51 = phi i32 [ %19, %42 ], [ %19, %39 ], [ %19, %36 ], [ %35, %33 ], [ %19, %30 ], [ %19, %27 ], [ %19, %24 ], [ %19, %21 ]
br label %12
52: ; preds = %12
%53 = mul nsw i32 %16, 100
%54 = tail call i32 @pin_cpu(i32 0, i32 %14)
%55 = icmp eq i32 %54, -1
br i1 %55, label %56, label %58
56: ; preds = %52
%57 = 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 %61
58: ; preds = %52
%59 = load i32, i32* @stderr
%60 = tail call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), i32 %14)
br label %61
61: ; preds = %58, %56
store <4 x i32> <i32 32768, i32 524288, i32 16777216, i32 1073741824>, <4 x i32>* %3
%62 = load i32, i32* @stderr
%63 = tail call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i64 1073741824, i32 %15, i32 %53, i32 %16)
%64 = sext i32 %15 to i64
%65 = getelementptr inbounds <4 x i32>, <4 x i32>* %3, i64 0, i64 %64
%66 = load i32, i32* %65
%67 = sdiv i32 %66, 32
%68 = sext i32 %67 to i64
%69 = load i32, i32* @stderr
%70 = tail call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i64 %68, i32 %15, i32 %53, i32 %16)
%71 = shl nsw i64 %68, 5
%72 = udiv i64 1073741824, %71
%73 = trunc i64 %72 to i32
%74 = load i32, i32* @stderr
%75 = tail call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.8, i64 0, i64 0), i64 %68, i32 %15, i32 %53, i32 %16, i32 %73)
%76 = mul i32 %53, %16
%77 = mul i32 %76, %73
%78 = load i32, i32* @stderr
%79 = tail call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i64 %68, i32 %15, i32 %77, i32 %16)
%80 = shl nsw i32 %67, 3
%81 = add nsw i32 %80, 5120
%82 = tail call i8* @malloc(i32 %81)
%83 = load i32, i32* @stderr
%84 = tail call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %82)
%85 = ptrtoint i8* %82 to i64
%86 = sub i64 0, %85
%87 = and i64 %86, 4095
%88 = getelementptr inbounds i8, i8* %82, i64 %87
%89 = sext i32 %19 to i64
%90 = getelementptr inbounds i8, i8* %88, i64 %89
%91 = load i32, i32* @stderr
%92 = tail call i32 (i32, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %90)
%93 = bitcast i8* %90 to double*
%94 = tail call i8* @malloc(i32 %81)
%95 = load i32, i32* @stderr
%96 = tail call i32 (i32, i8*, ...) @fprintf(i32 %95, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %94)
%97 = ptrtoint i8* %94 to i64
%98 = sub i64 0, %97
%99 = and i64 %98, 4095
%100 = getelementptr inbounds i8, i8* %94, i64 %99
%101 = sext i32 %18 to i64
%102 = getelementptr inbounds i8, i8* %100, i64 %101
%103 = load i32, i32* @stderr
%104 = tail call i32 (i32, i8*, ...) @fprintf(i32 %103, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %102)
%105 = bitcast i8* %102 to double*
%106 = tail call i8* @malloc(i32 %81)
%107 = load i32, i32* @stderr
%108 = tail call i32 (i32, i8*, ...) @fprintf(i32 %107, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* %106)
%109 = ptrtoint i8* %106 to i64
%110 = sub i64 0, %109
%111 = and i64 %110, 4095
%112 = getelementptr inbounds i8, i8* %106, i64 %111
%113 = sext i32 %17 to i64
%114 = getelementptr inbounds i8, i8* %112, i64 %113
%115 = load i32, i32* @stderr
%116 = tail call i32 (i32, i8*, ...) @fprintf(i32 %115, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* %114)
%117 = bitcast i8* %114 to double*
%118 = add i32 %66, 31
%119 = icmp ult i32 %118, 63
br i1 %119, label %201, label %120
120: ; preds = %61
%121 = call i64 @llvm.umax.i64(i64 %68, i64 1)
%122 = shl nuw i64 %121, 3
%123 = icmp ult i64 %121, 4
br i1 %123, label %193, label %124
124: ; preds = %120
%125 = and i64 %121, -4
%126 = add i64 %125, -4
%127 = lshr exact i64 %126, 2
%128 = add nuw nsw i64 %127, 1
%129 = and i64 %128, 3
%130 = icmp ult i64 %126, 12
br i1 %130, label %174, label %131
131: ; preds = %124
%132 = and i64 %128, 9223372036854775804
br label %133
133: ; preds = %133, %131
%134 = phi i64 [ 0, %131 ], [ %171, %133 ]
%135 = phi i64 [ 0, %131 ], [ %172, %133 ]
%136 = getelementptr inbounds double, double* %105, i64 %134
%137 = bitcast double* %136 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %137
%138 = getelementptr inbounds double, double* %136, i64 2
%139 = bitcast double* %138 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %139
%140 = getelementptr inbounds double, double* %117, i64 %134
%141 = bitcast double* %140 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %141
%142 = getelementptr inbounds double, double* %140, i64 2
%143 = bitcast double* %142 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %143
%144 = or i64 %134, 4
%145 = getelementptr inbounds double, double* %105, i64 %144
%146 = bitcast double* %145 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %146
%147 = getelementptr inbounds double, double* %145, i64 2
%148 = bitcast double* %147 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %148
%149 = getelementptr inbounds double, double* %117, i64 %144
%150 = bitcast double* %149 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %150
%151 = getelementptr inbounds double, double* %149, i64 2
%152 = bitcast double* %151 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %152
%153 = or i64 %134, 8
%154 = getelementptr inbounds double, double* %105, i64 %153
%155 = bitcast double* %154 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %155
%156 = getelementptr inbounds double, double* %154, i64 2
%157 = bitcast double* %156 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %157
%158 = getelementptr inbounds double, double* %117, i64 %153
%159 = bitcast double* %158 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %159
%160 = getelementptr inbounds double, double* %158, i64 2
%161 = bitcast double* %160 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %161
%162 = or i64 %134, 12
%163 = getelementptr inbounds double, double* %105, i64 %162
%164 = bitcast double* %163 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %164
%165 = getelementptr inbounds double, double* %163, i64 2
%166 = bitcast double* %165 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %166
%167 = getelementptr inbounds double, double* %117, i64 %162
%168 = bitcast double* %167 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %168
%169 = getelementptr inbounds double, double* %167, i64 2
%170 = bitcast double* %169 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %170
%171 = add nuw i64 %134, 16
%172 = add nuw i64 %135, 4
%173 = icmp eq i64 %172, %132
br i1 %173, label %174, label %133
174: ; preds = %133, %124
%175 = phi i64 [ 0, %124 ], [ %171, %133 ]
%176 = icmp eq i64 %129, 0
br i1 %176, label %191, label %177
177: ; preds = %174, %177
%178 = phi i64 [ %188, %177 ], [ %175, %174 ]
%179 = phi i64 [ %189, %177 ], [ 0, %174 ]
%180 = getelementptr inbounds double, double* %105, i64 %178
%181 = bitcast double* %180 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %181
%182 = getelementptr inbounds double, double* %180, i64 2
%183 = bitcast double* %182 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %183
%184 = getelementptr inbounds double, double* %117, i64 %178
%185 = bitcast double* %184 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %185
%186 = getelementptr inbounds double, double* %184, i64 2
%187 = bitcast double* %186 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.000000e+01>, <2 x double>* %187
%188 = add nuw i64 %178, 4
%189 = add i64 %179, 1
%190 = icmp eq i64 %189, %129
br i1 %190, label %191, label %177
191: ; preds = %177, %174
%192 = icmp eq i64 %121, %125
br i1 %192, label %201, label %193
193: ; preds = %120, %191
%194 = phi i64 [ 0, %120 ], [ %125, %191 ]
br label %195
195: ; preds = %193, %195
%196 = phi i64 [ %199, %195 ], [ %194, %193 ]
%197 = getelementptr inbounds double, double* %105, i64 %196
store double 1.000000e+01, double* %197
%198 = getelementptr inbounds double, double* %117, i64 %196
store double 1.000000e+01, double* %198
%199 = add nuw nsw i64 %196, 1
%200 = icmp eq i64 %199, %121
br i1 %200, label %201, label %195
201: ; preds = %195, %191, %61
%202 = tail call i32 @pin_cpu(i32 0, i32 %13)
%203 = icmp eq i32 %202, -1
br i1 %203, label %204, label %206
204: ; preds = %201
%205 = 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 %209
206: ; preds = %201
%207 = load i32, i32* @stderr
%208 = tail call i32 (i32, i8*, ...) @fprintf(i32 %207, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.12, i64 0, i64 0), i32 %13)
br label %209
209: ; preds = %206, %204
%210 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.13, i64 0, i64 0), i32 %77, i64 %68)
%211 = tail call i64 (...) @_rdtsc()
%212 = icmp sgt i32 %77, 0
br i1 %212, label %213, label %233
213: ; preds = %209, %213
%214 = phi double [ %222, %213 ], [ 1.000000e-02, %209 ]
%215 = phi double [ %230, %213 ], [ -1.000000e+00, %209 ]
%216 = phi i32 [ %231, %213 ], [ 0, %209 ]
%217 = phi i64 [ %225, %213 ], [ 0, %209 ]
%218 = tail call i64 (...) @_rdtsc()
%219 = tail call i32 @triad(i64 %68, double %214, double* %93, double* %105, double* %117)
%220 = tail call i64 (...) @_rdtsc()
%221 = sub i64 %220, %218
%222 = fadd double %214, 1.000000e-02
%223 = sext i32 %219 to i64
%224 = mul nsw i64 %223, %68
%225 = add i64 %224, %217
%226 = uitofp i64 %224 to double
%227 = uitofp i64 %221 to double
%228 = fdiv double %226, %227
%229 = fcmp ogt double %228, %215
%230 = select i1 %229, double %228, double %215
%231 = add nuw nsw i32 %216, 1
%232 = icmp eq i32 %231, %77
br i1 %232, label %233, label %213
233: ; preds = %213, %209
%234 = phi i64 [ undef, %209 ], [ %221, %213 ]
%235 = phi i64 [ 0, %209 ], [ %225, %213 ]
%236 = phi double [ -1.000000e+00, %209 ], [ %230, %213 ]
%237 = tail call i64 (...) @_rdtsc()
%238 = sub i64 %237, %211
%239 = uitofp i64 %235 to double
%240 = uitofp i64 %238 to double
%241 = fdiv double %239, %240
%242 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @.str.14, i64 0, i64 0), i64 %235, i32 %15, i64 %234, i64 %238)
%243 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i64 0, i64 0), double %241)
%244 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.16, i64 0, i64 0), double %236)
ret void
}