#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(int, 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 len, mem_level, level_size[4], cpu, cpu_run, bytes_per, scale;
  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 = 4 * 8192 * 8 * 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] = 16 * 1024;
  level_size[1] = 256 * 1024;
  level_size[2] = 8 * 1024 * 1024;
  level_size[3] = 4 * 8192 * 8 * 1024;
  fprintf(stderr, "len = %d, mem_level = %d, iter = %d, mult = %d\n", len,
          mem_level, iter, mult);
  len = level_size[mem_level] / 32;
  fprintf(stderr, "len = %d, mem_level = %d, iter = %d, mult = %d\n", len,
          mem_level, iter, mult);
  scale = level_size[3] / (32 * len);
  fprintf(stderr,
          "len = %d, mem_level = %d, iter = %d, mult = %d, scale = %d\n", len,
          mem_level, iter, mult, scale);
  iter = iter * scale * mult;
  fprintf(stderr, "len = %d, 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 = %d\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    $0x110,%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,-0xe8(%rbp)
movl   $0x0,-0xec(%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>
movl   $0x10000000,-0x88(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xedd(%rip),%rdx
call   10b0 <getopt@plt>
mov    %eax,-0x84(%rbp)
cmp    $0xffffffff,%eax
je     1366 <main+0x1c6>
mov    -0x84(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x100(%rbp)
sub    $0x11,%eax
ja     1348 <main+0x1a8>
mov    -0x100(%rbp),%rax
lea    0xda4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2d4c(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0xa4(%rbp)
jmp    1361 <main+0x1c1>
mov    0x2d33(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0xa8(%rbp)
jmp    1361 <main+0x1c1>
mov    0x2d1a(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0x8c(%rbp)
jmp    1361 <main+0x1c1>
mov    0x2d01(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0x7c(%rbp)
jmp    1361 <main+0x1c1>
mov    0x2ceb(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0x70(%rbp)
jmp    1361 <main+0x1c1>
mov    0x2cd5(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0x74(%rbp)
jmp    1361 <main+0x1c1>
mov    0x2cbf(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0x78(%rbp)
jmp    1361 <main+0x1c1>
mov    -0x84(%rbp),%edx
mov    $0x1,%edi
lea    0xdf0(%rip),%rsi
mov    $0x0,%al
call   1070 <err@plt>
jmp    1251 <main+0xb1>
mov    -0x80(%rbp),%eax
imul   -0x7c(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0xec(%rbp),%edi
mov    -0xa4(%rbp),%esi
call   1040 <pin_cpu@plt>
cmp    $0xffffffff,%eax
jne    13a2 <main+0x202>
mov    $0x1,%edi
lea    0xdc6(%rip),%rsi
mov    $0x0,%al
call   1070 <err@plt>
jmp    13bf <main+0x21f>
mov    0x2c2f(%rip),%rax
mov    (%rax),%edi
mov    -0xa4(%rbp),%edx
lea    0xdbb(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x4000,-0xa0(%rbp)
movl   $0x40000,-0x9c(%rbp)
movl   $0x800000,-0x98(%rbp)
movl   $0x10000000,-0x94(%rbp)
mov    0x2bea(%rip),%rax
mov    (%rax),%edi
mov    -0x88(%rbp),%edx
mov    -0x8c(%rbp),%ecx
mov    -0x80(%rbp),%r8d
mov    -0x7c(%rbp),%r9d
lea    0xd97(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movslq -0x8c(%rbp),%rax
mov    -0xa0(%rbp,%rax,4),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,-0x88(%rbp)
mov    0x2ba3(%rip),%rax
mov    (%rax),%edi
mov    -0x88(%rbp),%edx
mov    -0x8c(%rbp),%ecx
mov    -0x80(%rbp),%r8d
mov    -0x7c(%rbp),%r9d
lea    0xd50(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x94(%rbp),%eax
mov    -0x88(%rbp),%ecx
shl    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0xb0(%rbp)
mov    0x2b60(%rip),%rax
mov    (%rax),%edi
mov    -0x88(%rbp),%edx
mov    -0x8c(%rbp),%ecx
mov    -0x80(%rbp),%r8d
mov    -0x7c(%rbp),%r9d
mov    -0xb0(%rbp),%eax
lea    0xd37(%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    0x2b1b(%rip),%rax
mov    (%rax),%edi
mov    -0x88(%rbp),%edx
mov    -0x8c(%rbp),%ecx
mov    -0x80(%rbp),%r8d
mov    -0x7c(%rbp),%r9d
lea    0xcc8(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movslq -0x88(%rbp),%rax
shl    $0x3,%rax
add    $0x1000,%rax
add    $0x400,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    0x2ace(%rip),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%rdx
lea    0xcf7(%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    0x2a8c(%rip),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%rdx
lea    0xcb5(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x50(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0x88(%rbp),%rax
shl    $0x3,%rax
add    $0x1000,%rax
add    $0x400,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    0x2a47(%rip),%rax
mov    (%rax),%edi
mov    -0x58(%rbp),%rdx
lea    0xc7c(%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    0x2a05(%rip),%rax
mov    (%rax),%edi
mov    -0x58(%rbp),%rdx
lea    0xc3a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x58(%rbp),%rax
mov    %rax,-0x20(%rbp)
movslq -0x88(%rbp),%rax
shl    $0x3,%rax
add    $0x1000,%rax
add    $0x400,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    0x29c0(%rip),%rax
mov    (%rax),%edi
mov    -0x60(%rbp),%rdx
lea    0xc01(%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    0x297e(%rip),%rax
mov    (%rax),%edi
mov    -0x60(%rbp),%rdx
lea    0xbbf(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x60(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x88(%rbp),%eax
jge    16d4 <main+0x534>
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  0x964(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  0x94f(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    167d <main+0x4dd>
mov    -0xec(%rbp),%edi
mov    -0xa8(%rbp),%esi
call   1040 <pin_cpu@plt>
cmp    $0xffffffff,%eax
jne    1706 <main+0x566>
mov    $0x1,%edi
lea    0xa62(%rip),%rsi
mov    $0x0,%al
call   1070 <err@plt>
jmp    1723 <main+0x583>
mov    0x28cb(%rip),%rax
mov    (%rax),%edi
mov    -0xa8(%rbp),%edx
lea    0xb16(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x80(%rbp),%esi
mov    -0x88(%rbp),%edx
lea    0xb29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1090 <_rdtsc@plt>
mov    %rax,-0xd0(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x80(%rbp),%eax
jge    1869 <main+0x6c9>
xor    %eax,%eax
mov    %al,-0x101(%rbp)
call   1090 <_rdtsc@plt>
mov    %rax,-0xb8(%rbp)
mov    -0x88(%rbp),%edi
movsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1060 <triad@plt>
mov    %eax,%ecx
mov    -0x101(%rbp),%al
mov    %ecx,-0xac(%rbp)
call   1090 <_rdtsc@plt>
mov    %rax,-0xc0(%rbp)
mov    -0xc0(%rbp),%rax
mov    -0xb8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0xc8(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0x83e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x88(%rbp),%eax
mov    -0xac(%rbp),%ecx
imul   %ecx,%eax
movslq %eax,%rcx
mov    -0xe8(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0xe8(%rbp)
mov    -0x88(%rbp),%eax
mov    -0xac(%rbp),%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movaps 0x810(%rip),%xmm2
movq   -0xc8(%rbp),%xmm1
ff
punpckldq %xmm2,%xmm1
movapd 0x80c(%rip),%xmm2
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    1856 <main+0x6b6>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    185b <main+0x6bb>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    174f <main+0x5af>
xor    %eax,%eax
call   1090 <_rdtsc@plt>
mov    %rax,-0xd8(%rbp)
mov    -0xd8(%rbp),%rax
mov    -0xd0(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0xe0(%rbp)
movaps 0x78a(%rip),%xmm3
movq   -0xe8(%rbp),%xmm0
ff
punpckldq %xmm3,%xmm0
movapd 0x786(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0xe0(%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    -0xe8(%rbp),%rsi
mov    -0x8c(%rbp),%edx
mov    -0xc8(%rbp),%rcx
mov    -0xe0(%rbp),%r8
lea    0x984(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x40(%rbp),%xmm0
lea    0x9c9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x48(%rbp),%xmm0
lea    0x9d1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x110,%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,%rbx
mov    %edi,%ebp
cmp    $0x2,%edi
jg     1211 <main+0x51>
lea    0x10a2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaa(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   10c0 <usage@plt>
lea    0xe9f(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1090 <err@plt>
movl   $0x1,0x8(%rsp)
lea    0xe92(%rip),%r13
lea    0xe29(%rip),%r14
mov    0x2dca(%rip),%r15
movl   $0x0,0x30(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x10(%rsp)
jmp    1260 <main+0xa0>
mov    (%r15),%edi
call   10e0 <atoi@plt>
mov    %eax,0x30(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r13,%rdx
call   10d0 <getopt@plt>
lea    -0x61(%rax),%ecx
cmp    $0x11,%ecx
ja     12d1 <main+0x111>
movslq (%r14,%rcx,4),%rcx
add    %r14,%rcx
jmp    *%rcx
mov    (%r15),%edi
call   10e0 <atoi@plt>
mov    %eax,0x10(%rsp)
jmp    1260 <main+0xa0>
mov    (%r15),%edi
call   10e0 <atoi@plt>
mov    %eax,0x18(%rsp)
jmp    1260 <main+0xa0>
mov    (%r15),%edi
call   10e0 <atoi@plt>
mov    %eax,%r12d
jmp    1260 <main+0xa0>
mov    (%r15),%edi
call   10e0 <atoi@plt>
mov    %eax,0x24(%rsp)
jmp    1260 <main+0xa0>
mov    (%r15),%edi
call   10e0 <atoi@plt>
mov    %eax,0x8(%rsp)
jmp    1260 <main+0xa0>
mov    (%r15),%edi
call   10e0 <atoi@plt>
mov    %eax,0x50(%rsp)
jmp    1260 <main+0xa0>
cmp    $0xffffffff,%eax
je     12f0 <main+0x130>
mov    $0x1,%edi
lea    0xdde(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1090 <err@plt>
jmp    1260 <main+0xa0>
imul   $0x64,0x8(%rsp),%r13d
xor    %edi,%edi
mov    %r12d,%esi
call   1060 <pin_cpu@plt>
cmp    $0xffffffff,%eax
je     1321 <main+0x161>
mov    0x2ccc(%rip),%rax
mov    (%rax),%edi
lea    0xdd4(%rip),%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1334 <main+0x174>
lea    0xdaa(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1090 <err@plt>
movapd 0xcc4(%rip),%xmm0
movapd %xmm0,0x70(%rsp)
mov    0x2c8f(%rip),%r14
mov    (%r14),%edi
lea    0xdc5(%rip),%rsi
mov    $0x10000000,%edx
mov    0x24(%rsp),%ebx
mov    %ebx,%ecx
mov    %r13d,%r8d
mov    0x8(%rsp),%r12d
mov    %r12d,%r9d
xor    %eax,%eax
call   1070 <fprintf@plt>
movslq %ebx,%r15
mov    0x70(%rsp,%r15,4),%eax
mov    %rax,0x28(%rsp)
lea    0x1f(%rax),%ebx
test   %eax,%eax
cmovns %eax,%ebx
mov    %ebx,%ebp
sar    $0x5,%ebp
mov    (%r14),%edi
lea    0xd84(%rip),%rsi
mov    %ebp,%edx
mov    %r15d,%ecx
mov    %r13d,%r8d
mov    %r12d,%r9d
xor    %eax,%eax
call   1070 <fprintf@plt>
and    $0xffffffe0,%ebx
mov    $0x10000000,%eax
xor    %edx,%edx
idiv   %ebx
mov    %eax,%ebx
mov    (%r14),%edi
mov    %eax,(%rsp)
lea    0xd87(%rip),%rsi
mov    %ebp,%edx
mov    %r15d,%ecx
mov    %r13d,%r8d
mov    %r12d,%r9d
xor    %eax,%eax
call   1070 <fprintf@plt>
imul   %r12d,%r13d
imul   %ebx,%r13d
mov    (%r14),%edi
lea    0xd33(%rip),%rsi
mov    %ebp,%edx
mov    %r15d,%ecx
mov    %r13d,%r8d
mov    %r12d,%r9d
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbp,0x48(%rsp)
lea    0x1400(,%rbp,8),%ebx
mov    %ebx,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbp
mov    (%r14),%edi
lea    0xd6d(%rip),%r15
mov    %r15,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %ebp,%eax
neg    %eax
and    $0xfff,%eax
add    %rbp,%rax
movslq 0x10(%rsp),%rcx
add    %rax,%rcx
mov    (%r14),%edi
mov    %r15,%rsi
mov    %rcx,%rdx
mov    %rcx,0x58(%rsp)
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %ebx,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbp
mov    (%r14),%edi
mov    %r14,%r15
lea    0xd2c(%rip),%r12
mov    %r12,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %ebp,%r14d
neg    %r14d
and    $0xfff,%r14d
mov    %rbp,0x8(%rsp)
lea    (%r14,%rbp,1),%rcx
movslq 0x18(%rsp),%rbp
mov    %rcx,0x60(%rsp)
lea    (%rcx,%rbp,1),%rdx
mov    (%r15),%edi
mov    %r12,%rsi
mov    %rdx,0x18(%rsp)
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %ebx,%edi
call   10a0 <malloc@plt>
mov    %rax,%r12
mov    (%r15),%edi
lea    0xce1(%rip),%rbx
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r12d,%r15d
neg    %r15d
and    $0xfff,%r15d
mov    %r12,0x68(%rsp)
lea    (%r12,%r15,1),%rcx
movslq 0x30(%rsp),%r12
mov    %rcx,0x30(%rsp)
lea    (%rcx,%r12,1),%rdx
mov    %rdx,0x10(%rsp)
mov    0x2ae0(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
cmpl   $0x20,0x28(%rsp)
jl     16a1 <main+0x4e1>
mov    %rbp,0x28(%rsp)
mov    0x48(%rsp),%rbp
lea    -0x1(%rbp),%eax
lea    0x8(,%rax,8),%rdx
xor    %ebx,%ebx
mov    0x58(%rsp),%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    %ebp,%eax
cmp    $0x4,%ebp
jae    1548 <main+0x388>
mov    0x18(%rsp),%rdx
mov    0x10(%rsp),%rsi
jmp    167e <main+0x4be>
mov    %eax,%ebx
and    $0xfffffffc,%ebx
lea    -0x4(%rbx),%rsi
mov    %rsi,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
mov    %edx,%ecx
and    $0x3,%ecx
cmp    $0xc,%rsi
jae    156e <main+0x3ae>
xor    %esi,%esi
jmp    1609 <main+0x449>
and    $0xfffffffffffffffc,%rdx
mov    0x28(%rsp),%rsi
mov    0x60(%rsp),%rdi
add    %rsi,%rdi
add    $0x70,%rdi
mov    0x30(%rsp),%rsi
lea    (%r12,%rsi,1),%rbp
add    $0x70,%rbp
xor    %esi,%esi
movapd 0xa76(%rip),%xmm0
nopw   0x0(%rax,%rax,1)
movupd %xmm0,-0x70(%rdi,%rsi,8)
movupd %xmm0,-0x60(%rdi,%rsi,8)
movupd %xmm0,-0x70(%rbp,%rsi,8)
movupd %xmm0,-0x60(%rbp,%rsi,8)
movupd %xmm0,-0x50(%rdi,%rsi,8)
movupd %xmm0,-0x40(%rdi,%rsi,8)
movupd %xmm0,-0x50(%rbp,%rsi,8)
movupd %xmm0,-0x40(%rbp,%rsi,8)
movupd %xmm0,-0x30(%rdi,%rsi,8)
movupd %xmm0,-0x20(%rdi,%rsi,8)
movupd %xmm0,-0x30(%rbp,%rsi,8)
movupd %xmm0,-0x20(%rbp,%rsi,8)
movupd %xmm0,-0x10(%rdi,%rsi,8)
movupd %xmm0,(%rdi,%rsi,8)
movupd %xmm0,-0x10(%rbp,%rsi,8)
movupd %xmm0,0x0(%rbp,%rsi,8)
add    $0x10,%rsi
add    $0xfffffffffffffffc,%rdx
jne    15a0 <main+0x3e0>
test   %rcx,%rcx
je     166f <main+0x4af>
lea    (%r15,%rsi,8),%rdx
add    0x68(%rsp),%rdx
add    %r12,%rdx
add    $0x10,%rdx
lea    (%r14,%rsi,8),%rsi
add    0x8(%rsp),%rsi
mov    0x28(%rsp),%rdi
add    %rdi,%rsi
add    $0x10,%rsi
shl    $0x5,%rcx
xor    %edi,%edi
movapd 0x9cf(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movupd %xmm0,-0x10(%rsi,%rdi,1)
movupd %xmm0,(%rsi,%rdi,1)
movupd %xmm0,-0x10(%rdx,%rdi,1)
movupd %xmm0,(%rdx,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%rcx
jne    1650 <main+0x490>
cmp    %rax,%rbx
mov    0x18(%rsp),%rdx
mov    0x10(%rsp),%rsi
je     16a1 <main+0x4e1>
movabs $0x4024000000000000,%rcx
nopl   0x0(%rax,%rax,1)
mov    %rcx,(%rdx,%rbx,8)
mov    %rcx,(%rsi,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rax
jne    1690 <main+0x4d0>
xor    %edi,%edi
mov    0x50(%rsp),%ebx
mov    %ebx,%esi
call   1060 <pin_cpu@plt>
cmp    $0xffffffff,%eax
je     16ce <main+0x50e>
mov    0x291e(%rip),%rax
mov    (%rax),%edi
lea    0xae5(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    16e1 <main+0x521>
lea    0x9fd(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1090 <err@plt>
lea    0xaea(%rip),%rdi
xor    %ebp,%ebp
mov    %r13d,%esi
mov    0x48(%rsp),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   10b0 <_rdtsc@plt>
mov    %rax,0x50(%rsp)
test   %r13d,%r13d
jle    17cd <main+0x60d>
movsd  0x92a(%rip),%xmm1
movsd  0x92a(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %ebp,%ebp
mov    0x48(%rsp),%r15
nopl   0x0(%rax,%rax,1)
movsd  %xmm1,0x30(%rsp)
xor    %eax,%eax
call   10b0 <_rdtsc@plt>
mov    %rax,%r14
mov    %r15d,%edi
movsd  0x8(%rsp),%xmm0
mov    0x58(%rsp),%rsi
mov    0x18(%rsp),%rdx
mov    0x10(%rsp),%rcx
call   1080 <triad@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   10b0 <_rdtsc@plt>
mov    %rax,%rbx
sub    %r14,%rbx
movsd  0x8(%rsp),%xmm0
addsd  0x8cd(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
imul   %r15d,%r12d
movslq %r12d,%rax
add    %rax,%rbp
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
movq   %rbx,%xmm0
punpckldq 0x881(%rip),%xmm0
subpd  0x889(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm2
maxsd  0x30(%rsp),%xmm2
movapd %xmm2,%xmm1
add    $0xffffffff,%r13d
jne    1730 <main+0x570>
jmp    17d5 <main+0x615>
movsd  0x86b(%rip),%xmm2
movsd  %xmm2,0x8(%rsp)
xor    %eax,%eax
call   10b0 <_rdtsc@plt>
sub    0x50(%rsp),%rax
movq   %rbp,%xmm0
movdqa 0x82c(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0x830(%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,0x30(%rsp)
lea    0x9bf(%rip),%rdi
mov    %rbp,%rsi
mov    0x24(%rsp),%edx
mov    %rbx,%rcx
mov    %rax,%r8
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x9fc(%rip),%rdi
movaps 0x30(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xa04(%rip),%rdi
movsd  0x8(%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 = [48 x i8] c"len = %d, mem_level = %d, iter = %d, mult = %d\0A\00"
@.str.8 = [60 x i8] c"len = %d, 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 = [39 x i8] c" calling triad %d times with len = %d\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 i32
%26 = alloca [4 x i32]
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%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 i32 268435456, i32* %24
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* %27
br label %81
60: ; preds = %55
%61 = load i32, i32* @optarg
%62 = call i32 @atoi(i32 %61)
store i32 %62, i32* %28
br label %81
63: ; preds = %55
%64 = load i32, i32* @optarg
%65 = call i32 @atoi(i32 %64)
store i32 %65, i32* %25
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* %27
%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* %27
%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]* %26, i64 0, i64 0
store i32 16384, i32* %97
%98 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 1
store i32 262144, i32* %98
%99 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 2
store i32 8388608, i32* %99
%100 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 3
store i32 268435456, i32* %100
%101 = load i32, i32* @stderr
%102 = load i32, i32* %24
%103 = load i32, i32* %25
%104 = load i32, i32* %22
%105 = load i32, i32* %21
%106 = call i32 (i32, i8*, ...) @fprintf(i32 %101, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i32 %102, i32 %103, i32 %104, i32 %105)
%107 = load i32, i32* %25
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 %108
%110 = load i32, i32* %109
%111 = sdiv i32 %110, 32
store i32 %111, i32* %24
%112 = load i32, i32* @stderr
%113 = load i32, i32* %24
%114 = load i32, i32* %25
%115 = load i32, i32* %22
%116 = load i32, i32* %21
%117 = call i32 (i32, i8*, ...) @fprintf(i32 %112, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i32 %113, i32 %114, i32 %115, i32 %116)
%118 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 3
%119 = load i32, i32* %118
%120 = load i32, i32* %24
%121 = mul nsw i32 32, %120
%122 = sdiv i32 %119, %121
store i32 %122, i32* %30
%123 = load i32, i32* @stderr
%124 = load i32, i32* %24
%125 = load i32, i32* %25
%126 = load i32, i32* %22
%127 = load i32, i32* %21
%128 = load i32, i32* %30
%129 = call i32 (i32, i8*, ...) @fprintf(i32 %123, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0), i32 %124, i32 %125, i32 %126, i32 %127, i32 %128)
%130 = load i32, i32* %22
%131 = load i32, i32* %30
%132 = mul nsw i32 %130, %131
%133 = load i32, i32* %21
%134 = mul nsw i32 %132, %133
store i32 %134, i32* %22
%135 = load i32, i32* @stderr
%136 = load i32, i32* %24
%137 = load i32, i32* %25
%138 = load i32, i32* %22
%139 = load i32, i32* %21
%140 = call i32 (i32, i8*, ...) @fprintf(i32 %135, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i32 %136, i32 %137, i32 %138, i32 %139)
%141 = load i32, i32* %24
%142 = sext i32 %141 to i64
%143 = mul i64 8, %142
%144 = add i64 %143, 4096
%145 = add i64 %144, 1024
%146 = trunc i64 %145 to i32
%147 = call i8* @malloc(i32 %146)
store i8* %147, i8** %12
%148 = load i32, i32* @stderr
%149 = load i8*, i8** %12
%150 = call i32 (i32, i8*, ...) @fprintf(i32 %148, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %149)
%151 = load i8*, i8** %12
%152 = load i8*, i8** %12
%153 = ptrtoint i8* %152 to i32
%154 = sub i32 4096, %153
%155 = and i32 %154, 4095
%156 = zext i32 %155 to i64
%157 = getelementptr inbounds i8, i8* %151, i64 %156
%158 = load i32, i32* %18
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds i8, i8* %157, i64 %159
store i8* %160, i8** %12
%161 = load i32, i32* @stderr
%162 = load i8*, i8** %12
%163 = call i32 (i32, i8*, ...) @fprintf(i32 %161, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %162)
%164 = load i8*, i8** %12
%165 = bitcast i8* %164 to double*
store double* %165, double** %5
%166 = load i32, i32* %24
%167 = sext i32 %166 to i64
%168 = mul i64 8, %167
%169 = add i64 %168, 4096
%170 = add i64 %169, 1024
%171 = trunc i64 %170 to i32
%172 = call i8* @malloc(i32 %171)
store i8* %172, i8** %13
%173 = load i32, i32* @stderr
%174 = load i8*, i8** %13
%175 = call i32 (i32, i8*, ...) @fprintf(i32 %173, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %174)
%176 = load i8*, i8** %13
%177 = load i8*, i8** %13
%178 = ptrtoint i8* %177 to i32
%179 = sub i32 4096, %178
%180 = and i32 %179, 4095
%181 = zext i32 %180 to i64
%182 = getelementptr inbounds i8, i8* %176, i64 %181
%183 = load i32, i32* %19
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds i8, i8* %182, i64 %184
store i8* %185, i8** %13
%186 = load i32, i32* @stderr
%187 = load i8*, i8** %13
%188 = call i32 (i32, i8*, ...) @fprintf(i32 %186, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %187)
%189 = load i8*, i8** %13
%190 = bitcast i8* %189 to double*
store double* %190, double** %6
%191 = load i32, i32* %24
%192 = sext i32 %191 to i64
%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 = %233, %96
%217 = load i32, i32* %15
%218 = load i32, i32* %24
%219 = icmp slt i32 %217, %218
br i1 %219, label %220, label %236
220: ; preds = %216
%221 = load double*, double** %5
%222 = load i32, i32* %15
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds double, double* %221, i64 %223
store double 0.000000e+00, double* %224
%225 = load double*, double** %6
%226 = load i32, i32* %15
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds double, double* %225, i64 %227
store double 1.000000e+01, double* %228
%229 = load double*, double** %7
%230 = load i32, i32* %15
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds double, double* %229, i64 %231
store double 1.000000e+01, double* %232
br label %233
233: ; preds = %220
%234 = load i32, i32* %15
%235 = add nsw i32 %234, 1
store i32 %235, i32* %15
br label %216
236: ; preds = %216
%237 = load i32, i32* %38
%238 = load i32, i32* %28
%239 = call i32 @pin_cpu(i32 %237, i32 %238)
%240 = icmp eq i32 %239, -1
br i1 %240, label %241, label %243
241: ; preds = %236
%242 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %247
243: ; preds = %236
%244 = load i32, i32* @stderr
%245 = load i32, i32* %28
%246 = call i32 (i32, i8*, ...) @fprintf(i32 %244, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.12, i64 0, i64 0), i32 %245)
br label %247
247: ; preds = %243, %241
%248 = load i32, i32* %22
%249 = load i32, i32* %24
%250 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0), i32 %248, i32 %249)
%251 = call i64 (...) @_rdtsc()
store i64 %251, i64* %34
store i32 0, i32* %15
br label %252
252: ; preds = %289, %247
%253 = load i32, i32* %15
%254 = load i32, i32* %22
%255 = icmp slt i32 %253, %254
br i1 %255, label %256, label %292
256: ; preds = %252
%257 = call i64 (...) @_rdtsc()
store i64 %257, i64* %31
%258 = load i32, i32* %24
%259 = load double, double* %8
%260 = load double*, double** %5
%261 = load double*, double** %6
%262 = load double*, double** %7
%263 = call i32 @triad(i32 %258, double %259, double* %260, double* %261, double* %262)
store i32 %263, i32* %29
%264 = call i64 (...) @_rdtsc()
store i64 %264, i64* %32
%265 = load i64, i64* %32
%266 = load i64, i64* %31
%267 = sub i64 %265, %266
store i64 %267, i64* %33
%268 = load double, double* %8
%269 = fadd double %268, 1.000000e-02
store double %269, double* %8
%270 = load i32, i32* %24
%271 = load i32, i32* %29
%272 = mul nsw i32 %270, %271
%273 = sext i32 %272 to i64
%274 = load i64, i64* %37
%275 = add i64 %274, %273
store i64 %275, i64* %37
%276 = load i32, i32* %24
%277 = load i32, i32* %29
%278 = mul nsw i32 %276, %277
%279 = sitofp i32 %278 to double
%280 = load i64, i64* %33
%281 = uitofp i64 %280 to double
%282 = fdiv double %279, %281
store double %282, double* %9
%283 = load double, double* %9
%284 = load double, double* %11
%285 = fcmp ogt double %283, %284
br i1 %285, label %286, label %288
286: ; preds = %256
%287 = load double, double* %9
store double %287, double* %11
br label %288
288: ; preds = %286, %256
br label %289
289: ; preds = %288
%290 = load i32, i32* %15
%291 = add nsw i32 %290, 1
store i32 %291, i32* %15
br label %252
292: ; preds = %252
%293 = call i64 (...) @_rdtsc()
store i64 %293, i64* %35
%294 = load i64, i64* %35
%295 = load i64, i64* %34
%296 = sub i64 %294, %295
store i64 %296, i64* %36
%297 = load i64, i64* %37
%298 = uitofp i64 %297 to double
%299 = load i64, i64* %36
%300 = uitofp i64 %299 to double
%301 = fdiv double %298, %300
store double %301, double* %10
%302 = load i64, i64* %37
%303 = load i32, i32* %25
%304 = load i64, i64* %33
%305 = load i64, i64* %36
%306 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.14, i64 0, i64 0), i64 %302, i32 %303, i64 %304, i64 %305)
%307 = load double, double* %10
%308 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i64 0, i64 0), double %307)
%309 = load double, double* %11
%310 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.16, i64 0, i64 0), double %309)
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 = [48 x i8] c"len = %d, mem_level = %d, iter = %d, mult = %d\0A\00"
@.str.8 = [60 x i8] c"len = %d, 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 = [39 x i8] c" calling triad %d times with len = %d\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 ], [ %13, %24 ], [ %23, %21 ]
%46 = phi i32 [ %14, %42 ], [ %14, %39 ], [ %14, %36 ], [ %14, %33 ], [ %14, %30 ], [ %14, %27 ], [ %26, %24 ], [ %14, %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 %13)
%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 %13)
br label %61
61: ; preds = %58, %56
store <4 x i32> <i32 16384, i32 262144, i32 8388608, i32 268435456>, <4 x i32>* %3
%62 = load i32, i32* @stderr
%63 = tail call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i32 268435456, 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 = load i32, i32* @stderr
%69 = tail call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i32 %67, i32 %15, i32 %53, i32 %16)
%70 = shl nsw i32 %67, 5
%71 = sdiv i32 268435456, %70
%72 = load i32, i32* @stderr
%73 = tail call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0), i32 %67, i32 %15, i32 %53, i32 %16, i32 %71)
%74 = mul i32 %53, %16
%75 = mul i32 %74, %71
%76 = load i32, i32* @stderr
%77 = tail call i32 (i32, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i32 %67, i32 %15, i32 %75, i32 %16)
%78 = shl nsw i32 %67, 3
%79 = add nsw i32 %78, 5120
%80 = tail call i8* @malloc(i32 %79)
%81 = load i32, i32* @stderr
%82 = tail call i32 (i32, i8*, ...) @fprintf(i32 %81, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %80)
%83 = ptrtoint i8* %80 to i64
%84 = sub i64 0, %83
%85 = and i64 %84, 4095
%86 = getelementptr inbounds i8, i8* %80, i64 %85
%87 = sext i32 %19 to i64
%88 = getelementptr inbounds i8, i8* %86, i64 %87
%89 = load i32, i32* @stderr
%90 = tail call i32 (i32, i8*, ...) @fprintf(i32 %89, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %88)
%91 = bitcast i8* %88 to double*
%92 = tail call i8* @malloc(i32 %79)
%93 = load i32, i32* @stderr
%94 = tail call i32 (i32, i8*, ...) @fprintf(i32 %93, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %92)
%95 = ptrtoint i8* %92 to i64
%96 = sub i64 0, %95
%97 = and i64 %96, 4095
%98 = getelementptr inbounds i8, i8* %92, i64 %97
%99 = sext i32 %18 to i64
%100 = getelementptr inbounds i8, i8* %98, i64 %99
%101 = load i32, i32* @stderr
%102 = tail call i32 (i32, i8*, ...) @fprintf(i32 %101, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %100)
%103 = bitcast i8* %100 to double*
%104 = tail call i8* @malloc(i32 %79)
%105 = load i32, i32* @stderr
%106 = tail call i32 (i32, i8*, ...) @fprintf(i32 %105, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* %104)
%107 = ptrtoint i8* %104 to i64
%108 = sub i64 0, %107
%109 = and i64 %108, 4095
%110 = getelementptr inbounds i8, i8* %104, i64 %109
%111 = sext i32 %17 to i64
%112 = getelementptr inbounds i8, i8* %110, i64 %111
%113 = load i32, i32* @stderr
%114 = tail call i32 (i32, i8*, ...) @fprintf(i32 %113, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* %112)
%115 = bitcast i8* %112 to double*
%116 = icmp sgt i32 %66, 31
br i1 %116, label %117, label %201
117: ; preds = %61
%118 = add nsw i32 %67, -1
%119 = zext i32 %118 to i64
%120 = shl nuw nsw i64 %119, 3
%121 = add nuw nsw i64 %120, 8
%122 = zext i32 %67 to i64
%123 = icmp ult i32 %67, 4
br i1 %123, label %193, label %124
124: ; preds = %117
%125 = and i64 %122, 4294967292
%126 = add nsw 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* %103, 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* %115, 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* %103, 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* %115, 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* %103, 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* %115, 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* %103, 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* %115, 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* %103, 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* %115, 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 %125, %122
br i1 %192, label %201, label %193
193: ; preds = %117, %191
%194 = phi i64 [ 0, %117 ], [ %125, %191 ]
br label %195
195: ; preds = %193, %195
%196 = phi i64 [ %199, %195 ], [ %194, %193 ]
%197 = getelementptr inbounds double, double* %103, i64 %196
store double 1.000000e+01, double* %197
%198 = getelementptr inbounds double, double* %115, i64 %196
store double 1.000000e+01, double* %198
%199 = add nuw nsw i64 %196, 1
%200 = icmp eq i64 %199, %122
br i1 %200, label %201, label %195
201: ; preds = %195, %191, %61
%202 = tail call i32 @pin_cpu(i32 0, i32 %14)
%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 %14)
br label %209
209: ; preds = %206, %204
%210 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0), i32 %75, i32 %67)
%211 = tail call i64 (...) @_rdtsc()
%212 = icmp sgt i32 %75, 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(i32 %67, double %214, double* %91, double* %103, double* %115)
%220 = tail call i64 (...) @_rdtsc()
%221 = sub i64 %220, %218
%222 = fadd double %214, 1.000000e-02
%223 = mul nsw i32 %219, %67
%224 = sext i32 %223 to i64
%225 = add i64 %217, %224
%226 = sitofp i32 %223 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, %75
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
}