#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 double uint64_t;

/* Variables and functions */
int /*<<< orphan*/ free(double *);
double *malloc(size_t);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ run_openmp_test(long, long, double *, double *);
int /*<<< orphan*/ run_pthread_test(long, long, double *, double *);
int /*<<< orphan*/ run_single_test(long, long, double *, double *);
double sqrt(double);
int run_test(long runs, long iters, int with_loop) {
  double *run_times;
  do {
    size_t to_alloc = sizeof(*(run_times)) * (runs);
    if ((to_alloc / (runs)) != sizeof(*(run_times))) {
      run_times = NULL;
    } else {
      run_times = malloc(to_alloc);
    }
  } while (0);
  uint64_t *iter_bits;
  do {
    size_t to_alloc = sizeof(*(iter_bits)) * (iters);
    if ((to_alloc / (iters)) != sizeof(*(iter_bits))) {
      iter_bits = NULL;
    } else {
      iter_bits = malloc(to_alloc);
    }
  } while (0);
  if (run_times == NULL) {
    printf("Couldn't alloc %ld doubles.\n", runs);
    return 1;
  }
  if (iter_bits == NULL) {
    printf("Couldn't alloc %ld uint64_ts.\n", iters);
    return 1;
  }
  for (long run = 0; run < runs; run++) {
    run_times[run] = 0.0;
  }
  for (long iter = 0; iter < iters; iter++) {
    iter_bits[iter] = iter & 0xFFFF;
  }
  switch (with_loop) {
  case 0:
    run_single_test(runs, iters, run_times, iter_bits);
    break;
  case 1:
    run_openmp_test(runs, iters, run_times, iter_bits);
    break;
  case 2:
    run_pthread_test(runs, iters, run_times, iter_bits);
    break;
  }
  uint64_t ac = 0;
  for (long iter = 0; iter < iters; iter++) {
    ac += iter_bits[iter];
  }
  double sum = 0;
  for (long run = 0; run < runs; run++) {
    sum += run_times[run];
  }
  double mean = sum / (double)runs;
  double sum_squared_diff = 0;
  for (long run = 0; run < runs; run++) {
    double diff = run_times[run] - mean;
    sum_squared_diff += (diff * diff);
  }
  double variance = sum_squared_diff / (double)runs;
  double std_dev = sqrt(variance);
  double top = 0;
  for (long run = 0; run < runs; run++) {
    if (run_times[run] > top) {
      top = run_times[run];
    }
  }
  double bot = top;
  for (long run = 0; run < runs; run++) {
    if (run_times[run] < bot) {
      bot = run_times[run];
    }
  }
  printf("Garbage sum: %lu.\n", (unsigned long)ac);
  printf("(garbage should be equal between different loop types)\n");
  printf("times: mean %fus, std_dev %fus.\n", mean, std_dev);
  printf("times: min %fus, max %fus.\n", bot, top);
  long howmany, prev_howmany = 0;
  double threshold = 0, each_diff = top / 25.0;
  do {
    howmany = 0;
    for (long run = 0; run < runs; run++) {
      if (run_times[run] >= threshold) {
        howmany++;
      }
    }
    if ((howmany > 1) && (prev_howmany != howmany)) {
      printf("runs: %9ld took >=%fus\n", howmany, threshold);
    }
    threshold += each_diff;
    prev_howmany = howmany;
  } while (howmany > 1);
  printf("runs: %9ld took ==%fus\n", 1L, top);
  free(run_times);
  run_times = NULL;
  free(iter_bits);
  iter_bits = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<run_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
cmp    $0x8,%rax
je     11b5 <run_test+0x45>
movq   $0x0,-0x28(%rbp)
jmp    11c2 <run_test+0x52>
mov    -0x30(%rbp),%rdi
call   1070 <malloc@plt>
mov    %rax,-0x28(%rbp)
jmp    11c7 <run_test+0x57>
jmp    11cc <run_test+0x5c>
mov    -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
cmp    $0x8,%rax
je     11fb <run_test+0x8b>
movq   $0x0,-0x38(%rbp)
jmp    1208 <run_test+0x98>
mov    -0x40(%rbp),%rdi
call   1070 <malloc@plt>
mov    %rax,-0x38(%rbp)
jmp    120d <run_test+0x9d>
cmpq   $0x0,-0x28(%rbp)
jne    1236 <run_test+0xc6>
mov    -0x10(%rbp),%rsi
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    177d <run_test+0x60d>
cmpq   $0x0,-0x38(%rbp)
jne    125f <run_test+0xef>
mov    -0x18(%rbp),%rsi
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    177d <run_test+0x60d>
movq   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1296 <run_test+0x126>
mov    -0x28(%rbp),%rax
mov    -0x48(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    1267 <run_test+0xf7>
movq   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    12d9 <run_test+0x169>
mov    -0x50(%rbp),%rax
and    $0xffff,%rax
cvtsi2sd %rax,%xmm0
mov    -0x38(%rbp),%rax
mov    -0x50(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
jmp    129e <run_test+0x12e>
mov    -0x1c(%rbp),%eax
mov    %eax,-0xec(%rbp)
test   %eax,%eax
je     1317 <run_test+0x1a7>
jmp    12ef <run_test+0x17f>
mov    -0xec(%rbp),%eax
sub    $0x1,%eax
je     1331 <run_test+0x1c1>
jmp    1303 <run_test+0x193>
mov    -0xec(%rbp),%eax
sub    $0x2,%eax
je     134b <run_test+0x1db>
jmp    1360 <run_test+0x1f0>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x38(%rbp),%rcx
call   1040 <run_single_test@plt>
jmp    1360 <run_test+0x1f0>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x38(%rbp),%rcx
call   1060 <run_openmp_test@plt>
jmp    1360 <run_test+0x1f0>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x38(%rbp),%rcx
call   1080 <run_pthread_test@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movq   $0x0,-0x60(%rbp)
mov    -0x60(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    13a6 <run_test+0x236>
mov    -0x38(%rbp),%rax
mov    -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x60(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x60(%rbp)
jmp    1370 <run_test+0x200>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movq   $0x0,-0x70(%rbp)
mov    -0x70(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    13ec <run_test+0x27c>
mov    -0x28(%rbp),%rax
mov    -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x70(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x70(%rbp)
jmp    13b6 <run_test+0x246>
movsd  -0x68(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
movq   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    147a <run_test+0x30a>
mov    -0x28(%rbp),%rax
mov    -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x88(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
jmp    1413 <run_test+0x2a3>
movsd  -0x80(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
call   1090 <sqrt@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movq   $0x0,-0xb0(%rbp)
mov    -0xb0(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    151f <run_test+0x3af>
mov    -0x28(%rbp),%rax
mov    -0xb0(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0xa8(%rbp),%xmm0
ff
jbe    1503 <run_test+0x393>
mov    -0x28(%rbp),%rax
mov    -0xb0(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    1508 <run_test+0x398>
mov    -0xb0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xb0(%rbp)
jmp    14bc <run_test+0x34c>
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movq   $0x0,-0xc0(%rbp)
mov    -0xc0(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    15a1 <run_test+0x431>
mov    -0x28(%rbp),%rax
mov    -0xc0(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    1585 <run_test+0x415>
mov    -0x28(%rbp),%rax
mov    -0xc0(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    158a <run_test+0x41a>
mov    -0xc0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xc0(%rbp)
jmp    153a <run_test+0x3ca>
movsd  -0x58(%rbp),%xmm0
movsd  0xa5a(%rip),%xmm2
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rax
cvttsd2si %xmm0,%rsi
mov    %rsi,%rcx
sar    $0x3f,%rcx
and    %rcx,%rax
or     %rax,%rsi
lea    0xa79(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xa7e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsd  -0x78(%rbp),%xmm0
movsd  -0xa0(%rbp),%xmm1
ff
lea    0xa9b(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movsd  -0xb8(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm1
ff
lea    0xa9e(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movq   $0x0,-0xd0(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  0x9b9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movq   $0x0,-0xc8(%rbp)
movq   $0x0,-0xe8(%rbp)
mov    -0xe8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    16c6 <run_test+0x556>
mov    -0x28(%rbp),%rax
mov    -0xe8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0xd8(%rbp),%xmm0
ff
jb     16aa <run_test+0x53a>
mov    -0xc8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xc8(%rbp)
jmp    16af <run_test+0x53f>
mov    -0xe8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xe8(%rbp)
jmp    1669 <run_test+0x4f9>
cmpq   $0x1,-0xc8(%rbp)
01
jle    1705 <run_test+0x595>
mov    -0xd0(%rbp),%rax
cmp    -0xc8(%rbp),%rax
je     1705 <run_test+0x595>
mov    -0xc8(%rbp),%rsi
movsd  -0xd8(%rbp),%xmm0
ff
lea    0x9d6(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0xe0(%rbp),%xmm0
ff
addsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
mov    -0xc8(%rbp),%rax
mov    %rax,-0xd0(%rbp)
cmpq   $0x1,-0xc8(%rbp)
01
jg     1653 <run_test+0x4e3>
movsd  -0xa8(%rbp),%xmm0
ff
lea    0x9a4(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x28(%rbp)
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x38(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_test>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %edx,%r13d
mov    %rsi,%r12
mov    %rdi,%r14
lea    0x0(,%rdi,8),%rbp
mov    %rbp,%rax
or     %rdi,%rax
shr    $0x20,%rax
je     1248 <run_test+0xb8>
mov    %rbp,%rax
xor    %edx,%edx
div    %r14
cmp    $0x8,%rax
jne    1259 <run_test+0xc9>
mov    %rbp,%rdi
call   1090 <malloc@plt>
mov    %rax,%rbx
lea    0x0(,%r12,8),%rdi
mov    %rdi,%rax
or     %r12,%rax
shr    $0x20,%rax
je     127d <run_test+0xed>
mov    %rdi,%rax
xor    %edx,%edx
div    %r12
cmp    $0x8,%rax
jne    128e <run_test+0xfe>
call   1090 <malloc@plt>
test   %rbx,%rbx
je     12b1 <run_test+0x121>
mov    %rax,%r15
test   %rax,%rax
je     1293 <run_test+0x103>
test   %r14,%r14
jle    122e <run_test+0x9e>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %rbp,%rdx
call   1070 <memset@plt>
test   %r12,%r12
jle    1429 <run_test+0x299>
cmp    $0x4,%r12
jae    12da <run_test+0x14a>
xor    %eax,%eax
jmp    1410 <run_test+0x280>
mov    %ebp,%eax
xor    %edx,%edx
div    %r14d
cmp    $0x8,%rax
je     11d1 <run_test+0x41>
lea    0x0(,%r12,8),%rdi
mov    %rdi,%rax
or     %r12,%rax
shr    $0x20,%rax
je     129f <run_test+0x10f>
mov    %rdi,%rax
xor    %edx,%edx
div    %r12
cmp    $0x8,%rax
je     12ac <run_test+0x11c>
jmp    12b1 <run_test+0x121>
mov    %edi,%eax
xor    %edx,%edx
div    %r12d
cmp    $0x8,%rax
je     1206 <run_test+0x76>
test   %rbx,%rbx
je     12b1 <run_test+0x121>
lea    0xde3(%rip),%rdi
mov    %r12,%rsi
jmp    12bb <run_test+0x12b>
mov    %edi,%eax
xor    %edx,%edx
div    %r12d
cmp    $0x8,%rax
jne    12b1 <run_test+0x121>
call   1090 <malloc@plt>
lea    0xda8(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%r13d
mov    %r13d,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r12,%rax
and    $0xfffffffffffffffc,%rax
lea    -0x4(%rax),%rcx
mov    %rcx,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     13bd <run_test+0x22d>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
movdqa 0xcf8(%rip),%xmm0
xor    %ecx,%ecx
movdqa 0xcfe(%rip),%xmm1
pxor   %xmm2,%xmm2
movdqa 0xd02(%rip),%xmm3
movdqa 0xd0a(%rip),%xmm4
movdqa 0xd12(%rip),%xmm5
xchg   %ax,%ax
movdqa %xmm0,%xmm6
paddq  %xmm1,%xmm6
pshufd $0xe8,%xmm0,%xmm7
pshuflw $0xe8,%xmm7,%xmm7
punpcklwd %xmm2,%xmm7
cvtdq2pd %xmm7,%xmm7
pshufd $0xe8,%xmm6,%xmm6
pshuflw $0xe8,%xmm6,%xmm6
punpcklwd %xmm2,%xmm6
cvtdq2pd %xmm6,%xmm6
movups %xmm7,(%r15,%rcx,8)
movups %xmm6,0x10(%r15,%rcx,8)
movdqa %xmm0,%xmm6
paddq  %xmm3,%xmm6
movdqa %xmm0,%xmm7
paddq  %xmm4,%xmm7
pshufd $0xe8,%xmm6,%xmm6
pshuflw $0xe8,%xmm6,%xmm6
punpcklwd %xmm2,%xmm6
cvtdq2pd %xmm6,%xmm6
pshufd $0xe8,%xmm7,%xmm7
pshuflw $0xe8,%xmm7,%xmm7
punpcklwd %xmm2,%xmm7
cvtdq2pd %xmm7,%xmm7
movdqu %xmm6,0x20(%r15,%rcx,8)
movupd %xmm7,0x30(%r15,%rcx,8)
add    $0x8,%rcx
paddq  %xmm5,%xmm0
add    $0xfffffffffffffffe,%rsi
jne    1330 <run_test+0x1a0>
jmp    13c7 <run_test+0x237>
movdqa 0xc3b(%rip),%xmm0
xor    %ecx,%ecx
test   $0x1,%dl
je     1409 <run_test+0x279>
pshufd $0xe8,%xmm0,%xmm1
paddq  0xc37(%rip),%xmm0
pxor   %xmm2,%xmm2
pshuflw $0xe8,%xmm1,%xmm1
punpcklwd %xmm2,%xmm1
cvtdq2pd %xmm1,%xmm1
pshufd $0xe8,%xmm0,%xmm0
pshuflw $0xe8,%xmm0,%xmm0
punpcklwd %xmm2,%xmm0
cvtdq2pd %xmm0,%xmm0
movdqu %xmm1,(%r15,%rcx,8)
movdqu %xmm0,0x10(%r15,%rcx,8)
cmp    %r12,%rax
je     1429 <run_test+0x299>
xchg   %ax,%ax
movzwl %ax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
movsd  %xmm0,(%r15,%rax,8)
add    $0x1,%rax
cmp    %rax,%r12
jne    1410 <run_test+0x280>
test   %r13d,%r13d
je     144d <run_test+0x2bd>
cmp    $0x1,%r13d
je     1460 <run_test+0x2d0>
cmp    $0x2,%r13d
jne    1471 <run_test+0x2e1>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %r15,%rcx
call   10a0 <run_pthread_test@plt>
jmp    1471 <run_test+0x2e1>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %r15,%rcx
call   1050 <run_single_test@plt>
jmp    1471 <run_test+0x2e1>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %r15,%rcx
call   1080 <run_openmp_test@plt>
test   %r12,%r12
jle    148f <run_test+0x2ff>
lea    -0x1(%r12),%rcx
mov    %r12d,%eax
and    $0x7,%eax
cmp    $0x7,%rcx
jae    14b0 <run_test+0x320>
pxor   %xmm0,%xmm0
xor    %ecx,%ecx
jmp    1500 <run_test+0x370>
xor    %r12d,%r12d
test   %r14,%r14
jg     1546 <run_test+0x3b6>
xorps  %xmm1,%xmm1
cvtsi2sd %r14,%xmm1
pxor   %xmm4,%xmm4
divsd  %xmm1,%xmm4
jmp    15fa <run_test+0x46a>
and    $0xfffffffffffffff8,%r12
pxor   %xmm0,%xmm0
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
addsd  (%r15,%rcx,8),%xmm0
addsd  0x8(%r15,%rcx,8),%xmm0
addsd  0x10(%r15,%rcx,8),%xmm0
addsd  0x18(%r15,%rcx,8),%xmm0
addsd  0x20(%r15,%rcx,8),%xmm0
addsd  0x28(%r15,%rcx,8),%xmm0
addsd  0x30(%r15,%rcx,8),%xmm0
addsd  0x38(%r15,%rcx,8),%xmm0
add    $0x8,%rcx
cmp    %rcx,%r12
jne    14c0 <run_test+0x330>
test   %rax,%rax
je     151e <run_test+0x38e>
lea    (%r15,%rcx,8),%rcx
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
addsd  (%rcx,%rdx,8),%xmm0
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1510 <run_test+0x380>
cvttsd2si %xmm0,%rax
mov    %rax,%rcx
sar    $0x3f,%rcx
subsd  0xb1e(%rip),%xmm0
cvttsd2si %xmm0,%r12
and    %rcx,%r12
or     %rax,%r12
test   %r14,%r14
jle    149b <run_test+0x30b>
lea    -0x1(%r14),%rbp
mov    %r14d,%eax
and    $0x7,%eax
cmp    $0x7,%rbp
jae    155e <run_test+0x3ce>
pxor   %xmm4,%xmm4
xor    %ecx,%ecx
jmp    15a8 <run_test+0x418>
mov    %r14,%rdx
and    $0xfffffffffffffff8,%rdx
pxor   %xmm4,%xmm4
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
addsd  (%rbx,%rcx,8),%xmm4
addsd  0x8(%rbx,%rcx,8),%xmm4
addsd  0x10(%rbx,%rcx,8),%xmm4
addsd  0x18(%rbx,%rcx,8),%xmm4
addsd  0x20(%rbx,%rcx,8),%xmm4
addsd  0x28(%rbx,%rcx,8),%xmm4
addsd  0x30(%rbx,%rcx,8),%xmm4
addsd  0x38(%rbx,%rcx,8),%xmm4
add    $0x8,%rcx
cmp    %rcx,%rdx
jne    1570 <run_test+0x3e0>
test   %rax,%rax
je     15ce <run_test+0x43e>
lea    (%rbx,%rcx,8),%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
addsd  (%rcx,%rdx,8),%xmm4
add    $0x1,%rdx
cmp    %rdx,%rax
jne    15c0 <run_test+0x430>
xorps  %xmm1,%xmm1
cvtsi2sd %r14,%xmm1
divsd  %xmm1,%xmm4
test   %r14,%r14
jle    15fa <run_test+0x46a>
mov    %r14d,%eax
and    $0x3,%eax
cmp    $0x3,%rbp
jae    1878 <run_test+0x6e8>
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
jmp    18e0 <run_test+0x750>
pxor   %xmm2,%xmm2
xorpd  %xmm0,%xmm0
divsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
movsd  %xmm4,0x20(%rsp)
xorpd  %xmm1,%xmm1
jb     1622 <run_test+0x492>
movsd  %xmm1,0x10(%rsp)
sqrtsd %xmm0,%xmm0
jmp    162d <run_test+0x49d>
movsd  %xmm1,0x10(%rsp)
call   10b0 <sqrt@plt>
movsd  %xmm0,0x18(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xa58(%rip),%rdi
xor    %r13d,%r13d
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xac4(%rip),%rdi
call   1040 <puts@plt>
lea    0xa4b(%rip),%rdi
movsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mov    $0x2,%al
call   1060 <printf@plt>
lea    0xa52(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    $0x2,%al
call   1060 <printf@plt>
movsd  0x10(%rsp),%xmm0
test   %r14,%r14
jle    1850 <run_test+0x6c0>
movapd %xmm0,%xmm9
divsd  0x9aa(%rip),%xmm9
lea    -0x4(%r14),%rax
mov    %rax,0x8(%rsp)
mov    %rax,%rcx
shr    $0x2,%rcx
add    $0x1,%rcx
mov    %r14,%r12
and    $0xfffffffffffffffc,%r12
mov    %rcx,%rax
mov    %rcx,0x40(%rsp)
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0x38(%rsp)
xorpd  %xmm10,%xmm10
xor    %eax,%eax
movsd  %xmm9,0x18(%rsp)
jmp    170b <run_test+0x57b>
nopw   0x0(%rax,%rax,1)
cmp    $0x2,%rbp
jb     1850 <run_test+0x6c0>
addsd  %xmm9,%xmm10
mov    %rbp,%rax
test   %r14,%r14
jle    1850 <run_test+0x6c0>
cmp    $0x4,%r14
jae    1720 <run_test+0x590>
xor    %ecx,%ecx
xor    %ebp,%ebp
jmp    17f0 <run_test+0x660>
nopw   0x0(%rax,%rax,1)
movapd %xmm10,%xmm8
unpcklpd %xmm10,%xmm8
cmpq   $0x4,0x8(%rsp)
jae    1740 <run_test+0x5b0>
pxor   %xmm6,%xmm6
xor    %ecx,%ecx
xorpd  %xmm2,%xmm2
jmp    17a9 <run_test+0x619>
xchg   %ax,%ax
pxor   %xmm6,%xmm6
mov    0x38(%rsp),%rdx
xor    %ecx,%ecx
xorpd  %xmm2,%xmm2
nop
movupd (%rbx,%rcx,8),%xmm3
movupd 0x10(%rbx,%rcx,8),%xmm4
movupd 0x20(%rbx,%rcx,8),%xmm5
movupd 0x30(%rbx,%rcx,8),%xmm1
movapd %xmm8,%xmm7
cmplepd %xmm3,%xmm7
psubq  %xmm7,%xmm6
movapd %xmm8,%xmm3
cmplepd %xmm4,%xmm3
psubq  %xmm3,%xmm2
movapd %xmm8,%xmm3
cmplepd %xmm5,%xmm3
psubq  %xmm3,%xmm6
movapd %xmm8,%xmm3
cmplepd %xmm1,%xmm3
psubq  %xmm3,%xmm2
add    $0x8,%rcx
add    $0xfffffffffffffffe,%rdx
jne    1750 <run_test+0x5c0>
testb  $0x1,0x40(%rsp)
je     17d4 <run_test+0x644>
movupd (%rbx,%rcx,8),%xmm3
movupd 0x10(%rbx,%rcx,8),%xmm4
movapd %xmm8,%xmm5
cmplepd %xmm3,%xmm5
psubq  %xmm5,%xmm6
cmplepd %xmm4,%xmm8
psubq  %xmm8,%xmm2
paddq  %xmm2,%xmm6
pshufd $0xee,%xmm6,%xmm1
paddq  %xmm6,%xmm1
movq   %xmm1,%rbp
mov    %r12,%rcx
cmp    %r14,%r12
je     1807 <run_test+0x677>
xchg   %ax,%ax
movsd  (%rbx,%rcx,8),%xmm1
ucomisd %xmm10,%xmm1
sbb    $0xffffffffffffffff,%rbp
add    $0x1,%rcx
cmp    %rcx,%r14
jne    17f0 <run_test+0x660>
cmp    $0x2,%rbp
jb     16f0 <run_test+0x560>
cmp    %rbp,%rax
je     16f0 <run_test+0x560>
lea    0x8cb(%rip),%rdi
mov    %rbp,%rsi
movapd %xmm10,%xmm0
mov    $0x1,%al
movapd %xmm10,0x20(%rsp)
call   1060 <printf@plt>
movapd 0x20(%rsp),%xmm10
movsd  0x18(%rsp),%xmm9
movsd  0x10(%rsp),%xmm0
jmp    16fa <run_test+0x56a>
lea    0x8ad(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%al
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
jmp    12c8 <run_test+0x138>
mov    %r14,%rdx
and    $0xfffffffffffffffc,%rdx
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rbx,%rcx,8),%xmm2
movsd  0x8(%rbx,%rcx,8),%xmm3
subsd  %xmm4,%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
subsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm3
addsd  %xmm2,%xmm3
movsd  0x10(%rbx,%rcx,8),%xmm2
subsd  %xmm4,%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
movsd  0x18(%rbx,%rcx,8),%xmm0
subsd  %xmm4,%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
add    $0x4,%rcx
cmp    %rcx,%rdx
jne    1890 <run_test+0x700>
test   %rax,%rax
je     190a <run_test+0x77a>
lea    (%rbx,%rcx,8),%rcx
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movsd  (%rcx,%rdx,8),%xmm2
subsd  %xmm4,%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm0
add    $0x1,%rdx
cmp    %rdx,%rax
jne    18f0 <run_test+0x760>
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  %xmm4,0x20(%rsp)
xorpd  %xmm1,%xmm1
jb     192e <run_test+0x79e>
movsd  %xmm1,0x10(%rsp)
sqrtsd %xmm0,%xmm0
jmp    1939 <run_test+0x7a9>
movsd  %xmm1,0x10(%rsp)
call   10b0 <sqrt@plt>
test   %r14,%r14
movsd  %xmm0,0x18(%rsp)
jle    1958 <run_test+0x7c8>
mov    %r14d,%eax
and    $0x3,%eax
cmp    $0x3,%rbp
jae    1967 <run_test+0x7d7>
pxor   %xmm3,%xmm3
xor    %ecx,%ecx
jmp    19b0 <run_test+0x820>
xorpd  %xmm1,%xmm1
movsd  %xmm1,0x8(%rsp)
jmp    163d <run_test+0x4ad>
mov    %r14,%rdx
and    $0xfffffffffffffffc,%rdx
pxor   %xmm3,%xmm3
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rbx,%rcx,8),%xmm1
maxsd  %xmm3,%xmm1
movsd  0x8(%rbx,%rcx,8),%xmm2
maxsd  %xmm1,%xmm2
movsd  0x10(%rbx,%rcx,8),%xmm1
maxsd  %xmm2,%xmm1
movsd  0x18(%rbx,%rcx,8),%xmm3
maxsd  %xmm1,%xmm3
add    $0x4,%rcx
cmp    %rcx,%rdx
jne    1980 <run_test+0x7f0>
movapd %xmm3,%xmm2
test   %rax,%rax
je     19d6 <run_test+0x846>
lea    (%rbx,%rcx,8),%rcx
xor    %edx,%edx
nop
movsd  (%rcx,%rdx,8),%xmm2
maxsd  %xmm3,%xmm2
add    $0x1,%rdx
movapd %xmm2,%xmm3
cmp    %rdx,%rax
jne    19c0 <run_test+0x830>
test   %r14,%r14
movsd  %xmm2,0x10(%rsp)
jle    19f5 <run_test+0x865>
mov    %r14d,%eax
and    $0x3,%eax
cmp    $0x3,%rbp
jae    1a00 <run_test+0x870>
xor    %ecx,%ecx
movapd %xmm2,%xmm4
jmp    1a40 <run_test+0x8b0>
movsd  %xmm2,0x8(%rsp)
jmp    163d <run_test+0x4ad>
mov    %r14,%rdx
and    $0xfffffffffffffffc,%rdx
xor    %ecx,%ecx
movapd %xmm2,%xmm4
nopl   (%rax)
movsd  (%rbx,%rcx,8),%xmm3
minsd  %xmm4,%xmm3
movsd  0x8(%rbx,%rcx,8),%xmm1
minsd  %xmm3,%xmm1
movsd  0x10(%rbx,%rcx,8),%xmm3
minsd  %xmm1,%xmm3
movsd  0x18(%rbx,%rcx,8),%xmm4
minsd  %xmm3,%xmm4
add    $0x4,%rcx
cmp    %rcx,%rdx
jne    1a10 <run_test+0x880>
test   %rax,%rax
je     1a66 <run_test+0x8d6>
lea    (%rbx,%rcx,8),%rcx
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movapd %xmm4,%xmm0
movsd  (%rcx,%rdx,8),%xmm4
minsd  %xmm0,%xmm4
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1a50 <run_test+0x8c0>
movsd  %xmm4,0x8(%rsp)
jmp    163d <run_test+0x4ad>

LLVM IR (-O0):
@.str = [29 x i8] c"Couldn't alloc %ld doubles.\0A\00"
@.str.1 = [31 x i8] c"Couldn't alloc %ld uint64_ts.\0A\00"
@.str.2 = [19 x i8] c"Garbage sum: %lu.\0A\00"
@.str.3 = [56 x i8] c"(garbage should be equal between different loop types)\0A\00"
@.str.4 = [33 x i8] c"times: mean %fus, std_dev %fus.\0A\00"
@.str.5 = [28 x i8] c"times: min %fus, max %fus.\0A\00"
@.str.6 = [24 x i8] c"runs: %9ld took >=%fus\0A\00"
@.str.7 = [24 x i8] c"runs: %9ld took ==%fus\0A\00"
define i32 @run_test(i64 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca double*
%9 = alloca i64
%10 = alloca double*
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca double
%15 = alloca i64
%16 = alloca double
%17 = alloca i64
%18 = alloca double
%19 = alloca double
%20 = alloca i64
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca i64
%26 = alloca double
%27 = alloca i64
%28 = alloca i64
%29 = alloca i64
%30 = alloca double
%31 = alloca double
%32 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
br label %33
33: ; preds = %3
%34 = load i64, i64* %5
%35 = mul i64 8, %34
store i64 %35, i64* %9
%36 = load i64, i64* %9
%37 = load i64, i64* %5
%38 = udiv i64 %36, %37
%39 = icmp ne i64 %38, 8
br i1 %39, label %40, label %41
40: ; preds = %33
store double* null, double** %8
br label %44
41: ; preds = %33
%42 = load i64, i64* %9
%43 = call double* @malloc(i64 %42)
store double* %43, double** %8
br label %44
44: ; preds = %41, %40
br label %45
45: ; preds = %44
br label %46
46: ; preds = %45
%47 = load i64, i64* %6
%48 = mul i64 8, %47
store i64 %48, i64* %11
%49 = load i64, i64* %11
%50 = load i64, i64* %6
%51 = udiv i64 %49, %50
%52 = icmp ne i64 %51, 8
br i1 %52, label %53, label %54
53: ; preds = %46
store double* null, double** %10
br label %57
54: ; preds = %46
%55 = load i64, i64* %11
%56 = call double* @malloc(i64 %55)
store double* %56, double** %10
br label %57
57: ; preds = %54, %53
br label %58
58: ; preds = %57
%59 = load double*, double** %8
%60 = icmp eq double* %59, null
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = load i64, i64* %5
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %62)
store i32 1, i32* %4
br label %277
64: ; preds = %58
%65 = load double*, double** %10
%66 = icmp eq double* %65, null
br i1 %66, label %67, label %70
67: ; preds = %64
%68 = load i64, i64* %6
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i64 %68)
store i32 1, i32* %4
br label %277
70: ; preds = %64
store i64 0, i64* %12
br label %71
71: ; preds = %79, %70
%72 = load i64, i64* %12
%73 = load i64, i64* %5
%74 = icmp slt i64 %72, %73
br i1 %74, label %75, label %82
75: ; preds = %71
%76 = load double*, double** %8
%77 = load i64, i64* %12
%78 = getelementptr inbounds double, double* %76, i64 %77
store double 0.000000e+00, double* %78
br label %79
79: ; preds = %75
%80 = load i64, i64* %12
%81 = add nsw i64 %80, 1
store i64 %81, i64* %12
br label %71
82: ; preds = %71
store i64 0, i64* %13
br label %83
83: ; preds = %94, %82
%84 = load i64, i64* %13
%85 = load i64, i64* %6
%86 = icmp slt i64 %84, %85
br i1 %86, label %87, label %97
87: ; preds = %83
%88 = load i64, i64* %13
%89 = and i64 %88, 65535
%90 = sitofp i64 %89 to double
%91 = load double*, double** %10
%92 = load i64, i64* %13
%93 = getelementptr inbounds double, double* %91, i64 %92
store double %90, double* %93
br label %94
94: ; preds = %87
%95 = load i64, i64* %13
%96 = add nsw i64 %95, 1
store i64 %96, i64* %13
br label %83
97: ; preds = %83
%98 = load i32, i32* %7
switch i32 %98, label %117 [
i32 0, label %99
i32 1, label %105
i32 2, label %111
]
99: ; preds = %97
%100 = load i64, i64* %5
%101 = load i64, i64* %6
%102 = load double*, double** %8
%103 = load double*, double** %10
%104 = call i32 @run_single_test(i64 %100, i64 %101, double* %102, double* %103)
br label %117
105: ; preds = %97
%106 = load i64, i64* %5
%107 = load i64, i64* %6
%108 = load double*, double** %8
%109 = load double*, double** %10
%110 = call i32 @run_openmp_test(i64 %106, i64 %107, double* %108, double* %109)
br label %117
111: ; preds = %97
%112 = load i64, i64* %5
%113 = load i64, i64* %6
%114 = load double*, double** %8
%115 = load double*, double** %10
%116 = call i32 @run_pthread_test(i64 %112, i64 %113, double* %114, double* %115)
br label %117
117: ; preds = %97, %111, %105, %99
store double 0.000000e+00, double* %14
store i64 0, i64* %15
br label %118
118: ; preds = %129, %117
%119 = load i64, i64* %15
%120 = load i64, i64* %6
%121 = icmp slt i64 %119, %120
br i1 %121, label %122, label %132
122: ; preds = %118
%123 = load double*, double** %10
%124 = load i64, i64* %15
%125 = getelementptr inbounds double, double* %123, i64 %124
%126 = load double, double* %125
%127 = load double, double* %14
%128 = fadd double %127, %126
store double %128, double* %14
br label %129
129: ; preds = %122
%130 = load i64, i64* %15
%131 = add nsw i64 %130, 1
store i64 %131, i64* %15
br label %118
132: ; preds = %118
store double 0.000000e+00, double* %16
store i64 0, i64* %17
br label %133
133: ; preds = %144, %132
%134 = load i64, i64* %17
%135 = load i64, i64* %5
%136 = icmp slt i64 %134, %135
br i1 %136, label %137, label %147
137: ; preds = %133
%138 = load double*, double** %8
%139 = load i64, i64* %17
%140 = getelementptr inbounds double, double* %138, i64 %139
%141 = load double, double* %140
%142 = load double, double* %16
%143 = fadd double %142, %141
store double %143, double* %16
br label %144
144: ; preds = %137
%145 = load i64, i64* %17
%146 = add nsw i64 %145, 1
store i64 %146, i64* %17
br label %133
147: ; preds = %133
%148 = load double, double* %16
%149 = load i64, i64* %5
%150 = sitofp i64 %149 to double
%151 = fdiv double %148, %150
store double %151, double* %18
store double 0.000000e+00, double* %19
store i64 0, i64* %20
br label %152
152: ; preds = %167, %147
%153 = load i64, i64* %20
%154 = load i64, i64* %5
%155 = icmp slt i64 %153, %154
br i1 %155, label %156, label %170
156: ; preds = %152
%157 = load double*, double** %8
%158 = load i64, i64* %20
%159 = getelementptr inbounds double, double* %157, i64 %158
%160 = load double, double* %159
%161 = load double, double* %18
%162 = fsub double %160, %161
store double %162, double* %21
%163 = load double, double* %21
%164 = load double, double* %21
%165 = load double, double* %19
%166 = call double @llvm.fmuladd.f64(double %163, double %164, double %165)
store double %166, double* %19
br label %167
167: ; preds = %156
%168 = load i64, i64* %20
%169 = add nsw i64 %168, 1
store i64 %169, i64* %20
br label %152
170: ; preds = %152
%171 = load double, double* %19
%172 = load i64, i64* %5
%173 = sitofp i64 %172 to double
%174 = fdiv double %171, %173
store double %174, double* %22
%175 = load double, double* %22
%176 = call double @sqrt(double %175)
store double %176, double* %23
store double 0.000000e+00, double* %24
store i64 0, i64* %25
br label %177
177: ; preds = %194, %170
%178 = load i64, i64* %25
%179 = load i64, i64* %5
%180 = icmp slt i64 %178, %179
br i1 %180, label %181, label %197
181: ; preds = %177
%182 = load double*, double** %8
%183 = load i64, i64* %25
%184 = getelementptr inbounds double, double* %182, i64 %183
%185 = load double, double* %184
%186 = load double, double* %24
%187 = fcmp ogt double %185, %186
br i1 %187, label %188, label %193
188: ; preds = %181
%189 = load double*, double** %8
%190 = load i64, i64* %25
%191 = getelementptr inbounds double, double* %189, i64 %190
%192 = load double, double* %191
store double %192, double* %24
br label %193
193: ; preds = %188, %181
br label %194
194: ; preds = %193
%195 = load i64, i64* %25
%196 = add nsw i64 %195, 1
store i64 %196, i64* %25
br label %177
197: ; preds = %177
%198 = load double, double* %24
store double %198, double* %26
store i64 0, i64* %27
br label %199
199: ; preds = %216, %197
%200 = load i64, i64* %27
%201 = load i64, i64* %5
%202 = icmp slt i64 %200, %201
br i1 %202, label %203, label %219
203: ; preds = %199
%204 = load double*, double** %8
%205 = load i64, i64* %27
%206 = getelementptr inbounds double, double* %204, i64 %205
%207 = load double, double* %206
%208 = load double, double* %26
%209 = fcmp olt double %207, %208
br i1 %209, label %210, label %215
210: ; preds = %203
%211 = load double*, double** %8
%212 = load i64, i64* %27
%213 = getelementptr inbounds double, double* %211, i64 %212
%214 = load double, double* %213
store double %214, double* %26
br label %215
215: ; preds = %210, %203
br label %216
216: ; preds = %215
%217 = load i64, i64* %27
%218 = add nsw i64 %217, 1
store i64 %218, i64* %27
br label %199
219: ; preds = %199
%220 = load double, double* %14
%221 = fptoui double %220 to i64
%222 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i64 %221)
%223 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
%224 = load double, double* %18
%225 = load double, double* %23
%226 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), double %224, double %225)
%227 = load double, double* %26
%228 = load double, double* %24
%229 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), double %227, double %228)
store i64 0, i64* %29
store double 0.000000e+00, double* %30
%230 = load double, double* %24
%231 = fdiv double %230, 2.500000e+01
store double %231, double* %31
br label %232
232: ; preds = %267, %219
store i64 0, i64* %28
store i64 0, i64* %32
br label %233
233: ; preds = %248, %232
%234 = load i64, i64* %32
%235 = load i64, i64* %5
%236 = icmp slt i64 %234, %235
br i1 %236, label %237, label %251
237: ; preds = %233
%238 = load double*, double** %8
%239 = load i64, i64* %32
%240 = getelementptr inbounds double, double* %238, i64 %239
%241 = load double, double* %240
%242 = load double, double* %30
%243 = fcmp oge double %241, %242
br i1 %243, label %244, label %247
244: ; preds = %237
%245 = load i64, i64* %28
%246 = add nsw i64 %245, 1
store i64 %246, i64* %28
br label %247
247: ; preds = %244, %237
br label %248
248: ; preds = %247
%249 = load i64, i64* %32
%250 = add nsw i64 %249, 1
store i64 %250, i64* %32
br label %233
251: ; preds = %233
%252 = load i64, i64* %28
%253 = icmp sgt i64 %252, 1
br i1 %253, label %254, label %262
254: ; preds = %251
%255 = load i64, i64* %29
%256 = load i64, i64* %28
%257 = icmp ne i64 %255, %256
br i1 %257, label %258, label %262
258: ; preds = %254
%259 = load i64, i64* %28
%260 = load double, double* %30
%261 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i64 %259, double %260)
br label %262
262: ; preds = %258, %254, %251
%263 = load double, double* %31
%264 = load double, double* %30
%265 = fadd double %264, %263
store double %265, double* %30
%266 = load i64, i64* %28
store i64 %266, i64* %29
br label %267
267: ; preds = %262
%268 = load i64, i64* %28
%269 = icmp sgt i64 %268, 1
br i1 %269, label %232, label %270
270: ; preds = %267
%271 = load double, double* %24
%272 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i64 1, double %271)
%273 = load double*, double** %8
%274 = call i32 @free(double* %273)
store double* null, double** %8
%275 = load double*, double** %10
%276 = call i32 @free(double* %275)
store double* null, double** %10
store i32 0, i32* %4
br label %277
277: ; preds = %270, %67, %61
%278 = load i32, i32* %4
ret i32 %278
}

LLVM IR (-O2):
@.str = [29 x i8] c"Couldn't alloc %ld doubles.\0A\00"
@.str.1 = [31 x i8] c"Couldn't alloc %ld uint64_ts.\0A\00"
@.str.2 = [19 x i8] c"Garbage sum: %lu.\0A\00"
@.str.4 = [33 x i8] c"times: mean %fus, std_dev %fus.\0A\00"
@.str.5 = [28 x i8] c"times: min %fus, max %fus.\0A\00"
@.str.6 = [24 x i8] c"runs: %9ld took >=%fus\0A\00"
@.str.7 = [24 x i8] c"runs: %9ld took ==%fus\0A\00"
@str = [55 x i8] c"(garbage should be equal between different loop types)\00"
define i32 @run_test(i64 %0, i64 %1, i32 %2) {
%4 = shl i64 %0, 3
%5 = udiv i64 %4, %0
%6 = icmp eq i64 %5, 8
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = tail call double* @malloc(i64 %4)
%9 = bitcast double* %8 to i8*
%10 = shl i64 %1, 3
%11 = udiv i64 %10, %1
%12 = icmp eq i64 %11, 8
br i1 %12, label %19, label %22
13: ; preds = %3
%14 = shl i64 %1, 3
%15 = udiv i64 %14, %1
%16 = icmp eq i64 %15, 8
br i1 %16, label %17, label %24
17: ; preds = %13
%18 = tail call double* @malloc(i64 %14)
br label %24
19: ; preds = %7
%20 = tail call double* @malloc(i64 %10)
%21 = icmp eq double* %8, null
br i1 %21, label %24, label %26
22: ; preds = %7
%23 = icmp eq double* %8, null
br i1 %23, label %24, label %31
24: ; preds = %17, %13, %22, %19
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %502
26: ; preds = %19
%27 = icmp eq double* %20, null
br i1 %27, label %31, label %28
28: ; preds = %26
%29 = icmp sgt i64 %0, 0
br i1 %29, label %30, label %33
30: ; preds = %28
br label %33
31: ; preds = %22, %26
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i64 %1)
br label %502
33: ; preds = %30, %28
%34 = icmp sgt i64 %1, 0
br i1 %34, label %35, label %92
35: ; preds = %33
%36 = icmp ult i64 %1, 4
br i1 %36, label %90, label %37
37: ; preds = %35
%38 = and i64 %1, -4
%39 = add i64 %38, -4
%40 = lshr exact i64 %39, 2
%41 = add nuw nsw i64 %40, 1
%42 = and i64 %41, 1
%43 = icmp eq i64 %39, 0
br i1 %43, label %74, label %44
44: ; preds = %37
%45 = and i64 %41, 9223372036854775806
br label %46
46: ; preds = %46, %44
%47 = phi i64 [ 0, %44 ], [ %70, %46 ]
%48 = phi <2 x i64> [ <i64 0, i64 1>, %44 ], [ %71, %46 ]
%49 = phi i64 [ 0, %44 ], [ %72, %46 ]
%50 = add <2 x i64> %48, <i64 2, i64 2>
%51 = and <2 x i64> %48, <i64 65535, i64 65535>
%52 = and <2 x i64> %50, <i64 65535, i64 65535>
%53 = sitofp <2 x i64> %51 to <2 x double>
%54 = sitofp <2 x i64> %52 to <2 x double>
%55 = getelementptr inbounds double, double* %20, i64 %47
%56 = bitcast double* %55 to <2 x double>*
store <2 x double> %53, <2 x double>* %56
%57 = getelementptr inbounds double, double* %55, i64 2
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> %54, <2 x double>* %58
%59 = or i64 %47, 4
%60 = add <2 x i64> %48, <i64 4, i64 4>
%61 = add <2 x i64> %48, <i64 6, i64 6>
%62 = and <2 x i64> %60, <i64 65535, i64 65535>
%63 = and <2 x i64> %61, <i64 65535, i64 65535>
%64 = sitofp <2 x i64> %62 to <2 x double>
%65 = sitofp <2 x i64> %63 to <2 x double>
%66 = getelementptr inbounds double, double* %20, i64 %59
%67 = bitcast double* %66 to <2 x double>*
store <2 x double> %64, <2 x double>* %67
%68 = getelementptr inbounds double, double* %66, i64 2
%69 = bitcast double* %68 to <2 x double>*
store <2 x double> %65, <2 x double>* %69
%70 = add nuw i64 %47, 8
%71 = add <2 x i64> %48, <i64 8, i64 8>
%72 = add i64 %49, 2
%73 = icmp eq i64 %72, %45
br i1 %73, label %74, label %46
74: ; preds = %46, %37
%75 = phi i64 [ 0, %37 ], [ %70, %46 ]
%76 = phi <2 x i64> [ <i64 0, i64 1>, %37 ], [ %71, %46 ]
%77 = icmp eq i64 %42, 0
br i1 %77, label %88, label %78
78: ; preds = %74
%79 = add <2 x i64> %76, <i64 2, i64 2>
%80 = and <2 x i64> %76, <i64 65535, i64 65535>
%81 = and <2 x i64> %79, <i64 65535, i64 65535>
%82 = sitofp <2 x i64> %80 to <2 x double>
%83 = sitofp <2 x i64> %81 to <2 x double>
%84 = getelementptr inbounds double, double* %20, i64 %75
%85 = bitcast double* %84 to <2 x double>*
store <2 x double> %82, <2 x double>* %85
%86 = getelementptr inbounds double, double* %84, i64 2
%87 = bitcast double* %86 to <2 x double>*
store <2 x double> %83, <2 x double>* %87
br label %88
88: ; preds = %74, %78
%89 = icmp eq i64 %38, %1
br i1 %89, label %92, label %90
90: ; preds = %35, %88
%91 = phi i64 [ 0, %35 ], [ %38, %88 ]
br label %93
92: ; preds = %93, %88, %33
switch i32 %2, label %106 [
i32 0, label %100
i32 1, label %102
i32 2, label %104
]
93: ; preds = %90, %93
%94 = phi i64 [ %98, %93 ], [ %91, %90 ]
%95 = and i64 %94, 65535
%96 = sitofp i64 %95 to double
%97 = getelementptr inbounds double, double* %20, i64 %94
store double %96, double* %97
%98 = add nuw nsw i64 %94, 1
%99 = icmp eq i64 %98, %1
br i1 %99, label %92, label %93
100: ; preds = %92
%101 = tail call i32 @run_single_test(i64 %0, i64 %1, double* %8, double* %20)
br label %106
102: ; preds = %92
%103 = tail call i32 @run_openmp_test(i64 %0, i64 %1, double* %8, double* %20)
br label %106
104: ; preds = %92
%105 = tail call i32 @run_pthread_test(i64 %0, i64 %1, double* %8, double* %20)
br label %106
106: ; preds = %92, %104, %102, %100
br i1 %34, label %107, label %131
107: ; preds = %106
%108 = add i64 %1, -1
%109 = and i64 %1, 7
%110 = icmp ult i64 %108, 7
br i1 %110, label %113, label %111
111: ; preds = %107
%112 = and i64 %1, -8
br label %142
113: ; preds = %142, %107
%114 = phi double [ undef, %107 ], [ %176, %142 ]
%115 = phi i64 [ 0, %107 ], [ %177, %142 ]
%116 = phi double [ 0.000000e+00, %107 ], [ %176, %142 ]
%117 = icmp eq i64 %109, 0
br i1 %117, label %128, label %118
118: ; preds = %113, %118
%119 = phi i64 [ %125, %118 ], [ %115, %113 ]
%120 = phi double [ %124, %118 ], [ %116, %113 ]
%121 = phi i64 [ %126, %118 ], [ 0, %113 ]
%122 = getelementptr inbounds double, double* %20, i64 %119
%123 = load double, double* %122
%124 = fadd double %120, %123
%125 = add nuw nsw i64 %119, 1
%126 = add i64 %121, 1
%127 = icmp eq i64 %126, %109
br i1 %127, label %128, label %118
128: ; preds = %118, %113
%129 = phi double [ %114, %113 ], [ %124, %118 ]
%130 = fptoui double %129 to i64
br label %131
131: ; preds = %128, %106
%132 = phi i64 [ 0, %106 ], [ %130, %128 ]
br i1 %29, label %133, label %139
133: ; preds = %131
%134 = add i64 %0, -1
%135 = and i64 %0, 7
%136 = icmp ult i64 %134, 7
br i1 %136, label %180, label %137
137: ; preds = %133
%138 = and i64 %0, -8
br label %204
139: ; preds = %131
%140 = sitofp i64 %0 to double
%141 = fdiv double 0.000000e+00, %140
br label %242
142: ; preds = %142, %111
%143 = phi i64 [ 0, %111 ], [ %177, %142 ]
%144 = phi double [ 0.000000e+00, %111 ], [ %176, %142 ]
%145 = phi i64 [ 0, %111 ], [ %178, %142 ]
%146 = getelementptr inbounds double, double* %20, i64 %143
%147 = load double, double* %146
%148 = fadd double %144, %147
%149 = or i64 %143, 1
%150 = getelementptr inbounds double, double* %20, i64 %149
%151 = load double, double* %150
%152 = fadd double %148, %151
%153 = or i64 %143, 2
%154 = getelementptr inbounds double, double* %20, i64 %153
%155 = load double, double* %154
%156 = fadd double %152, %155
%157 = or i64 %143, 3
%158 = getelementptr inbounds double, double* %20, i64 %157
%159 = load double, double* %158
%160 = fadd double %156, %159
%161 = or i64 %143, 4
%162 = getelementptr inbounds double, double* %20, i64 %161
%163 = load double, double* %162
%164 = fadd double %160, %163
%165 = or i64 %143, 5
%166 = getelementptr inbounds double, double* %20, i64 %165
%167 = load double, double* %166
%168 = fadd double %164, %167
%169 = or i64 %143, 6
%170 = getelementptr inbounds double, double* %20, i64 %169
%171 = load double, double* %170
%172 = fadd double %168, %171
%173 = or i64 %143, 7
%174 = getelementptr inbounds double, double* %20, i64 %173
%175 = load double, double* %174
%176 = fadd double %172, %175
%177 = add nuw nsw i64 %143, 8
%178 = add i64 %145, 8
%179 = icmp eq i64 %178, %112
br i1 %179, label %113, label %142
180: ; preds = %204, %133
%181 = phi double [ undef, %133 ], [ %238, %204 ]
%182 = phi i64 [ 0, %133 ], [ %239, %204 ]
%183 = phi double [ 0.000000e+00, %133 ], [ %238, %204 ]
%184 = icmp eq i64 %135, 0
br i1 %184, label %195, label %185
185: ; preds = %180, %185
%186 = phi i64 [ %192, %185 ], [ %182, %180 ]
%187 = phi double [ %191, %185 ], [ %183, %180 ]
%188 = phi i64 [ %193, %185 ], [ 0, %180 ]
%189 = getelementptr inbounds double, double* %8, i64 %186
%190 = load double, double* %189
%191 = fadd double %187, %190
%192 = add nuw nsw i64 %186, 1
%193 = add i64 %188, 1
%194 = icmp eq i64 %193, %135
br i1 %194, label %195, label %185
195: ; preds = %185, %180
%196 = phi double [ %181, %180 ], [ %191, %185 ]
%197 = sitofp i64 %0 to double
%198 = fdiv double %196, %197
br i1 %29, label %199, label %242
199: ; preds = %195
%200 = and i64 %0, 3
%201 = icmp ult i64 %134, 3
br i1 %201, label %247, label %202
202: ; preds = %199
%203 = and i64 %0, -4
br label %272
204: ; preds = %204, %137
%205 = phi i64 [ 0, %137 ], [ %239, %204 ]
%206 = phi double [ 0.000000e+00, %137 ], [ %238, %204 ]
%207 = phi i64 [ 0, %137 ], [ %240, %204 ]
%208 = getelementptr inbounds double, double* %8, i64 %205
%209 = load double, double* %208
%210 = fadd double %206, %209
%211 = or i64 %205, 1
%212 = getelementptr inbounds double, double* %8, i64 %211
%213 = load double, double* %212
%214 = fadd double %210, %213
%215 = or i64 %205, 2
%216 = getelementptr inbounds double, double* %8, i64 %215
%217 = load double, double* %216
%218 = fadd double %214, %217
%219 = or i64 %205, 3
%220 = getelementptr inbounds double, double* %8, i64 %219
%221 = load double, double* %220
%222 = fadd double %218, %221
%223 = or i64 %205, 4
%224 = getelementptr inbounds double, double* %8, i64 %223
%225 = load double, double* %224
%226 = fadd double %222, %225
%227 = or i64 %205, 5
%228 = getelementptr inbounds double, double* %8, i64 %227
%229 = load double, double* %228
%230 = fadd double %226, %229
%231 = or i64 %205, 6
%232 = getelementptr inbounds double, double* %8, i64 %231
%233 = load double, double* %232
%234 = fadd double %230, %233
%235 = or i64 %205, 7
%236 = getelementptr inbounds double, double* %8, i64 %235
%237 = load double, double* %236
%238 = fadd double %234, %237
%239 = add nuw nsw i64 %205, 8
%240 = add i64 %207, 8
%241 = icmp eq i64 %240, %138
br i1 %241, label %180, label %204
242: ; preds = %139, %195
%243 = phi double [ %141, %139 ], [ %198, %195 ]
%244 = phi double [ %140, %139 ], [ %197, %195 ]
%245 = fdiv double 0.000000e+00, %244
%246 = tail call double @sqrt(double %245)
br label %363
247: ; preds = %272, %199
%248 = phi double [ undef, %199 ], [ %294, %272 ]
%249 = phi i64 [ 0, %199 ], [ %295, %272 ]
%250 = phi double [ 0.000000e+00, %199 ], [ %294, %272 ]
%251 = icmp eq i64 %200, 0
br i1 %251, label %263, label %252
252: ; preds = %247, %252
%253 = phi i64 [ %260, %252 ], [ %249, %247 ]
%254 = phi double [ %259, %252 ], [ %250, %247 ]
%255 = phi i64 [ %261, %252 ], [ 0, %247 ]
%256 = getelementptr inbounds double, double* %8, i64 %253
%257 = load double, double* %256
%258 = fsub double %257, %198
%259 = tail call double @llvm.fmuladd.f64(double %258, double %258, double %254)
%260 = add nuw nsw i64 %253, 1
%261 = add i64 %255, 1
%262 = icmp eq i64 %261, %200
br i1 %262, label %263, label %252
263: ; preds = %252, %247
%264 = phi double [ %248, %247 ], [ %259, %252 ]
%265 = fdiv double %264, %197
%266 = tail call double @sqrt(double %265)
br i1 %29, label %267, label %363
267: ; preds = %263
%268 = and i64 %0, 3
%269 = icmp ult i64 %134, 3
br i1 %269, label %298, label %270
270: ; preds = %267
%271 = and i64 %0, -4
br label %321
272: ; preds = %272, %202
%273 = phi i64 [ 0, %202 ], [ %295, %272 ]
%274 = phi double [ 0.000000e+00, %202 ], [ %294, %272 ]
%275 = phi i64 [ 0, %202 ], [ %296, %272 ]
%276 = getelementptr inbounds double, double* %8, i64 %273
%277 = load double, double* %276
%278 = fsub double %277, %198
%279 = tail call double @llvm.fmuladd.f64(double %278, double %278, double %274)
%280 = or i64 %273, 1
%281 = getelementptr inbounds double, double* %8, i64 %280
%282 = load double, double* %281
%283 = fsub double %282, %198
%284 = tail call double @llvm.fmuladd.f64(double %283, double %283, double %279)
%285 = or i64 %273, 2
%286 = getelementptr inbounds double, double* %8, i64 %285
%287 = load double, double* %286
%288 = fsub double %287, %198
%289 = tail call double @llvm.fmuladd.f64(double %288, double %288, double %284)
%290 = or i64 %273, 3
%291 = getelementptr inbounds double, double* %8, i64 %290
%292 = load double, double* %291
%293 = fsub double %292, %198
%294 = tail call double @llvm.fmuladd.f64(double %293, double %293, double %289)
%295 = add nuw nsw i64 %273, 4
%296 = add i64 %275, 4
%297 = icmp eq i64 %296, %203
br i1 %297, label %247, label %272
298: ; preds = %321, %267
%299 = phi double [ undef, %267 ], [ %343, %321 ]
%300 = phi i64 [ 0, %267 ], [ %344, %321 ]
%301 = phi double [ 0.000000e+00, %267 ], [ %343, %321 ]
%302 = icmp eq i64 %268, 0
br i1 %302, label %314, label %303
303: ; preds = %298, %303
%304 = phi i64 [ %311, %303 ], [ %300, %298 ]
%305 = phi double [ %310, %303 ], [ %301, %298 ]
%306 = phi i64 [ %312, %303 ], [ 0, %298 ]
%307 = getelementptr inbounds double, double* %8, i64 %304
%308 = load double, double* %307
%309 = fcmp ogt double %308, %305
%310 = select i1 %309, double %308, double %305
%311 = add nuw nsw i64 %304, 1
%312 = add i64 %306, 1
%313 = icmp eq i64 %312, %268
br i1 %313, label %314, label %303
314: ; preds = %303, %298
%315 = phi double [ %299, %298 ], [ %310, %303 ]
br i1 %29, label %316, label %363
316: ; preds = %314
%317 = and i64 %0, 3
%318 = icmp ult i64 %134, 3
br i1 %318, label %347, label %319
319: ; preds = %316
%320 = and i64 %0, -4
br label %384
321: ; preds = %321, %270
%322 = phi i64 [ 0, %270 ], [ %344, %321 ]
%323 = phi double [ 0.000000e+00, %270 ], [ %343, %321 ]
%324 = phi i64 [ 0, %270 ], [ %345, %321 ]
%325 = getelementptr inbounds double, double* %8, i64 %322
%326 = load double, double* %325
%327 = fcmp ogt double %326, %323
%328 = select i1 %327, double %326, double %323
%329 = or i64 %322, 1
%330 = getelementptr inbounds double, double* %8, i64 %329
%331 = load double, double* %330
%332 = fcmp ogt double %331, %328
%333 = select i1 %332, double %331, double %328
%334 = or i64 %322, 2
%335 = getelementptr inbounds double, double* %8, i64 %334
%336 = load double, double* %335
%337 = fcmp ogt double %336, %333
%338 = select i1 %337, double %336, double %333
%339 = or i64 %322, 3
%340 = getelementptr inbounds double, double* %8, i64 %339
%341 = load double, double* %340
%342 = fcmp ogt double %341, %338
%343 = select i1 %342, double %341, double %338
%344 = add nuw nsw i64 %322, 4
%345 = add i64 %324, 4
%346 = icmp eq i64 %345, %271
br i1 %346, label %298, label %321
347: ; preds = %384, %316
%348 = phi double [ undef, %316 ], [ %406, %384 ]
%349 = phi i64 [ 0, %316 ], [ %407, %384 ]
%350 = phi double [ %315, %316 ], [ %406, %384 ]
%351 = icmp eq i64 %317, 0
br i1 %351, label %363, label %352
352: ; preds = %347, %352
%353 = phi i64 [ %360, %352 ], [ %349, %347 ]
%354 = phi double [ %359, %352 ], [ %350, %347 ]
%355 = phi i64 [ %361, %352 ], [ 0, %347 ]
%356 = getelementptr inbounds double, double* %8, i64 %353
%357 = load double, double* %356
%358 = fcmp olt double %357, %354
%359 = select i1 %358, double %357, double %354
%360 = add nuw nsw i64 %353, 1
%361 = add i64 %355, 1
%362 = icmp eq i64 %361, %317
br i1 %362, label %363, label %352
363: ; preds = %347, %352, %263, %242, %314
%364 = phi double [ %315, %314 ], [ 0.000000e+00, %242 ], [ 0.000000e+00, %263 ], [ %315, %352 ], [ %315, %347 ]
%365 = phi double [ %198, %314 ], [ %243, %242 ], [ %198, %263 ], [ %198, %352 ], [ %198, %347 ]
%366 = phi double [ %266, %314 ], [ %246, %242 ], [ %266, %263 ], [ %266, %352 ], [ %266, %347 ]
%367 = phi double [ %315, %314 ], [ 0.000000e+00, %242 ], [ 0.000000e+00, %263 ], [ %348, %347 ], [ %359, %352 ]
%368 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i64 %132)
%369 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%370 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), double %365, double %366)
%371 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), double %367, double %364)
%372 = fdiv double %364, 2.500000e+01
br i1 %29, label %373, label %498
373: ; preds = %363
%374 = add i64 %0, -4
%375 = lshr i64 %374, 2
%376 = add nuw nsw i64 %375, 1
%377 = icmp ult i64 %0, 4
%378 = and i64 %0, -4
%379 = and i64 %376, 1
%380 = icmp ult i64 %374, 4
%381 = and i64 %376, 9223372036854775806
%382 = icmp eq i64 %379, 0
%383 = icmp eq i64 %378, %0
br label %410
384: ; preds = %384, %319
%385 = phi i64 [ 0, %319 ], [ %407, %384 ]
%386 = phi double [ %315, %319 ], [ %406, %384 ]
%387 = phi i64 [ 0, %319 ], [ %408, %384 ]
%388 = getelementptr inbounds double, double* %8, i64 %385
%389 = load double, double* %388
%390 = fcmp olt double %389, %386
%391 = select i1 %390, double %389, double %386
%392 = or i64 %385, 1
%393 = getelementptr inbounds double, double* %8, i64 %392
%394 = load double, double* %393
%395 = fcmp olt double %394, %391
%396 = select i1 %395, double %394, double %391
%397 = or i64 %385, 2
%398 = getelementptr inbounds double, double* %8, i64 %397
%399 = load double, double* %398
%400 = fcmp olt double %399, %396
%401 = select i1 %400, double %399, double %396
%402 = or i64 %385, 3
%403 = getelementptr inbounds double, double* %8, i64 %402
%404 = load double, double* %403
%405 = fcmp olt double %404, %401
%406 = select i1 %405, double %404, double %401
%407 = add nuw nsw i64 %385, 4
%408 = add i64 %387, 4
%409 = icmp eq i64 %408, %320
br i1 %409, label %347, label %384
410: ; preds = %373, %496
%411 = phi double [ %497, %496 ], [ 0.000000e+00, %373 ]
%412 = phi i64 [ %479, %496 ], [ 0, %373 ]
br i1 %377, label %475, label %413
413: ; preds = %410
%414 = insertelement <2 x double> poison, double %411, i64 0
%415 = shufflevector <2 x double> %414, <2 x double> poison, <2 x i32> zeroinitializer
%416 = insertelement <2 x double> poison, double %411, i64 0
%417 = shufflevector <2 x double> %416, <2 x double> poison, <2 x i32> zeroinitializer
br i1 %380, label %451, label %418
418: ; preds = %413, %418
%419 = phi i64 [ %448, %418 ], [ 0, %413 ]
%420 = phi <2 x i64> [ %446, %418 ], [ zeroinitializer, %413 ]
%421 = phi <2 x i64> [ %447, %418 ], [ zeroinitializer, %413 ]
%422 = phi i64 [ %449, %418 ], [ 0, %413 ]
%423 = getelementptr inbounds double, double* %8, i64 %419
%424 = bitcast double* %423 to <2 x double>*
%425 = load <2 x double>, <2 x double>* %424
%426 = getelementptr inbounds double, double* %423, i64 2
%427 = bitcast double* %426 to <2 x double>*
%428 = load <2 x double>, <2 x double>* %427
%429 = fcmp oge <2 x double> %425, %415
%430 = fcmp oge <2 x double> %428, %417
%431 = zext <2 x i1> %429 to <2 x i64>
%432 = zext <2 x i1> %430 to <2 x i64>
%433 = add <2 x i64> %420, %431
%434 = add <2 x i64> %421, %432
%435 = or i64 %419, 4
%436 = getelementptr inbounds double, double* %8, i64 %435
%437 = bitcast double* %436 to <2 x double>*
%438 = load <2 x double>, <2 x double>* %437
%439 = getelementptr inbounds double, double* %436, i64 2
%440 = bitcast double* %439 to <2 x double>*
%441 = load <2 x double>, <2 x double>* %440
%442 = fcmp oge <2 x double> %438, %415
%443 = fcmp oge <2 x double> %441, %417
%444 = zext <2 x i1> %442 to <2 x i64>
%445 = zext <2 x i1> %443 to <2 x i64>
%446 = add <2 x i64> %433, %444
%447 = add <2 x i64> %434, %445
%448 = add nuw i64 %419, 8
%449 = add i64 %422, 2
%450 = icmp eq i64 %449, %381
br i1 %450, label %451, label %418
451: ; preds = %418, %413
%452 = phi <2 x i64> [ undef, %413 ], [ %446, %418 ]
%453 = phi <2 x i64> [ undef, %413 ], [ %447, %418 ]
%454 = phi i64 [ 0, %413 ], [ %448, %418 ]
%455 = phi <2 x i64> [ zeroinitializer, %413 ], [ %446, %418 ]
%456 = phi <2 x i64> [ zeroinitializer, %413 ], [ %447, %418 ]
br i1 %382, label %470, label %457
457: ; preds = %451
%458 = getelementptr inbounds double, double* %8, i64 %454
%459 = bitcast double* %458 to <2 x double>*
%460 = load <2 x double>, <2 x double>* %459
%461 = getelementptr inbounds double, double* %458, i64 2
%462 = bitcast double* %461 to <2 x double>*
%463 = load <2 x double>, <2 x double>* %462
%464 = fcmp oge <2 x double> %460, %415
%465 = fcmp oge <2 x double> %463, %417
%466 = zext <2 x i1> %464 to <2 x i64>
%467 = zext <2 x i1> %465 to <2 x i64>
%468 = add <2 x i64> %455, %466
%469 = add <2 x i64> %456, %467
br label %470
470: ; preds = %451, %457
%471 = phi <2 x i64> [ %452, %451 ], [ %468, %457 ]
%472 = phi <2 x i64> [ %453, %451 ], [ %469, %457 ]
%473 = add <2 x i64> %472, %471
%474 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %473)
br i1 %383, label %478, label %475
475: ; preds = %410, %470
%476 = phi i64 [ 0, %410 ], [ %378, %470 ]
%477 = phi i64 [ 0, %410 ], [ %474, %470 ]
br label %483
478: ; preds = %483, %470
%479 = phi i64 [ %474, %470 ], [ %490, %483 ]
%480 = icmp ugt i64 %479, 1
%481 = icmp ne i64 %412, %479
%482 = and i1 %480, %481
br i1 %482, label %493, label %495
483: ; preds = %475, %483
%484 = phi i64 [ %491, %483 ], [ %476, %475 ]
%485 = phi i64 [ %490, %483 ], [ %477, %475 ]
%486 = getelementptr inbounds double, double* %8, i64 %484
%487 = load double, double* %486
%488 = fcmp oge double %487, %411
%489 = zext i1 %488 to i64
%490 = add nuw nsw i64 %485, %489
%491 = add nuw nsw i64 %484, 1
%492 = icmp eq i64 %491, %0
br i1 %492, label %478, label %483
493: ; preds = %478
%494 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i64 %479, double %411)
br label %496
495: ; preds = %478
br i1 %480, label %496, label %498
496: ; preds = %495, %493
%497 = fadd double %372, %411
br i1 %29, label %410, label %498
498: ; preds = %495, %496, %363
%499 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i64 1, double %364)
%500 = tail call i32 @free(double* %8)
%501 = tail call i32 @free(double* %20)
br label %502
502: ; preds = %498, %31, %24
%503 = phi i32 [ 1, %24 ], [ 1, %31 ], [ 0, %498 ]
ret i32 %503
}