int ti_adx(int size, double const *const *inputs, double const *options,
           double *const *outputs) {
  const double *high = inputs[0];
  const double *low = inputs[1];
  const double *close = inputs[2];
  const int period = (int)options[0];
  double *output = outputs[0];
  if (period < 2)
    return 1;
  if (size <= ti_adx_start(options))
    return 0;
  const double per = ((double)period - 1) / ((double)period);
  const double invper = 1.0 / ((double)period);
  double atr = 0;
  double dmup = 0;
  double dmdown = 0;
  int i;
  for (i = 1; i < period; ++i) {
    double truerange;
    do {
      const double l = low[i];
      const double h = high[i];
      const double c = close[i - 1];
      const double ych = fabs(h - c);
      const double ycl = fabs(l - c);
      double v = h - l;
      if (ych > v)
        v = ych;
      if (ycl > v)
        v = ycl;
      truerange = v;
    } while (0);
    atr += truerange;
    double dp, dm;
    do {
      dp = high[i] - high[i - 1];
      dm = low[i - 1] - low[i];
      if (dp < 0)
        dp = 0;
      else if (dp > dm)
        dm = 0;
      if (dm < 0)
        dm = 0;
      else if (dm > dp)
        dp = 0;
    } while (0);
    dmup += dp;
    dmdown += dm;
  }
  double adx = 0.0;
  {
    double di_up = dmup / atr;
    double di_down = dmdown / atr;
    double dm_diff = fabs(di_up - di_down);
    double dm_sum = di_up + di_down;
    double dx = dm_diff / dm_sum * 100;
    adx += dx;
  }
  for (i = period; i < size; ++i) {
    double truerange;
    do {
      const double l = low[i];
      const double h = high[i];
      const double c = close[i - 1];
      const double ych = fabs(h - c);
      const double ycl = fabs(l - c);
      double v = h - l;
      if (ych > v)
        v = ych;
      if (ycl > v)
        v = ycl;
      truerange = v;
    } while (0);
    atr = atr * per + truerange;
    double dp, dm;
    do {
      dp = high[i] - high[i - 1];
      dm = low[i - 1] - low[i];
      if (dp < 0)
        dp = 0;
      else if (dp > dm)
        dm = 0;
      if (dm < 0)
        dm = 0;
      else if (dm > dp)
        dp = 0;
    } while (0);
    dmup = dmup * per + dp;
    dmdown = dmdown * per + dm;
    double di_up = dmup / atr;
    double di_down = dmdown / atr;
    double dm_diff = fabs(di_up - di_down);
    double dm_sum = di_up + di_down;
    double dx = dm_diff / dm_sum * 100;
    if (i - period < period - 2) {
      adx += dx;
    } else if (i - period == period - 2) {
      adx += dx;
      *output++ = adx * invper;
    } else {
      adx = adx * per + dx;
      *output++ = adx * invper;
    }
  }
  assert(output - outputs[0] == size - ti_adx_start(options));
  return 0;
}


x86 assembly (clang, -O0):
<ti_adx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
cvttsd2si (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
cmpl   $0x2,-0x3c(%rbp)
jge    1189 <ti_adx+0x69>
movl   $0x1,-0x4(%rbp)
jmp    18f0 <ti_adx+0x7d0>
mov    -0x8(%rbp),%eax
mov    %eax,-0x164(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <ti_adx_start@plt>
mov    %eax,%ecx
mov    -0x164(%rbp),%eax
cmp    %ecx,%eax
jg     11b9 <ti_adx+0x99>
movl   $0x0,-0x4(%rbp)
jmp    18f0 <ti_adx+0x7d0>
cvtsi2sdl -0x3c(%rbp),%xmm0
movsd  0xe3a(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
cvtsi2sdl -0x3c(%rbp),%xmm1
movsd  0xe1b(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x1,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    143b <ti_adx+0x31b>
jmp    121e <ti_adx+0xfe>
mov    -0x30(%rbp),%rax
movslq -0x74(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x28(%rbp),%rax
movslq -0x74(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x38(%rbp),%rax
mov    -0x74(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
subsd  -0x98(%rbp),%xmm0
ff
movaps 0xd97(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
subsd  -0x98(%rbp),%xmm0
ff
movaps 0xd74(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
subsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
ucomisd -0xb0(%rbp),%xmm0
ff
jbe    12e6 <ti_adx+0x1c6>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
ucomisd -0xb0(%rbp),%xmm0
ff
jbe    130c <ti_adx+0x1ec>
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x74(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x74(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x30(%rbp),%rax
mov    -0x74(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x74(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0xb8(%rbp),%xmm0
ff
jbe    1397 <ti_adx+0x277>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    13bd <ti_adx+0x29d>
movsd  -0xb8(%rbp),%xmm0
ff
ucomisd -0xc0(%rbp),%xmm0
ff
jbe    13b8 <ti_adx+0x298>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
jmp    13bd <ti_adx+0x29d>
xorps  %xmm0,%xmm0
ucomisd -0xc0(%rbp),%xmm0
ff
jbe    13de <ti_adx+0x2be>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
jmp    1404 <ti_adx+0x2e4>
movsd  -0xc0(%rbp),%xmm0
ff
ucomisd -0xb8(%rbp),%xmm0
ff
jbe    13ff <ti_adx+0x2df>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    1404 <ti_adx+0x2e4>
jmp    1409 <ti_adx+0x2e9>
movsd  -0xb8(%rbp),%xmm0
ff
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0xc0(%rbp),%xmm0
ff
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    120d <ti_adx+0xed>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
subsd  -0xd8(%rbp),%xmm0
ff
movaps 0xb8f(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
addsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
divsd  -0xe8(%rbp),%xmm0
ff
movsd  0xb4b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
addsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0x3c(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1896 <ti_adx+0x776>
jmp    14f8 <ti_adx+0x3d8>
mov    -0x30(%rbp),%rax
movslq -0x74(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
mov    -0x28(%rbp),%rax
movslq -0x74(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
mov    -0x38(%rbp),%rax
mov    -0x74(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x108(%rbp),%xmm0
ff
subsd  -0x110(%rbp),%xmm0
ff
movaps 0xabd(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x100(%rbp),%xmm0
ff
subsd  -0x110(%rbp),%xmm0
ff
movaps 0xa9a(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x108(%rbp),%xmm0
ff
subsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x118(%rbp),%xmm0
ff
ucomisd -0x128(%rbp),%xmm0
ff
jbe    15c0 <ti_adx+0x4a0>
movsd  -0x118(%rbp),%xmm0
ff
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x120(%rbp),%xmm0
ff
ucomisd -0x128(%rbp),%xmm0
ff
jbe    15e6 <ti_adx+0x4c6>
movsd  -0x120(%rbp),%xmm0
ff
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x128(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0xf8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x74(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x74(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
mov    -0x30(%rbp),%rax
mov    -0x74(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x74(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0x130(%rbp),%xmm0
ff
jbe    1684 <ti_adx+0x564>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
jmp    16aa <ti_adx+0x58a>
movsd  -0x130(%rbp),%xmm0
ff
ucomisd -0x138(%rbp),%xmm0
ff
jbe    16a5 <ti_adx+0x585>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
jmp    16aa <ti_adx+0x58a>
xorps  %xmm0,%xmm0
ucomisd -0x138(%rbp),%xmm0
ff
jbe    16cb <ti_adx+0x5ab>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
jmp    16f1 <ti_adx+0x5d1>
movsd  -0x138(%rbp),%xmm0
ff
ucomisd -0x130(%rbp),%xmm0
ff
jbe    16ec <ti_adx+0x5cc>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
jmp    16f1 <ti_adx+0x5d1>
jmp    16f6 <ti_adx+0x5d6>
movsd  -0x68(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x130(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x138(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x148(%rbp)
ff
movsd  -0x140(%rbp),%xmm0
ff
subsd  -0x148(%rbp),%xmm0
ff
movaps 0x8a1(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0x140(%rbp),%xmm0
ff
addsd  -0x148(%rbp),%xmm0
ff
movsd  %xmm0,-0x158(%rbp)
ff
movsd  -0x150(%rbp),%xmm0
ff
divsd  -0x158(%rbp),%xmm0
ff
movsd  0x85d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x160(%rbp)
ff
mov    -0x74(%rbp),%eax
sub    -0x3c(%rbp),%eax
mov    -0x3c(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    17e8 <ti_adx+0x6c8>
movsd  -0x160(%rbp),%xmm0
ff
addsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    1883 <ti_adx+0x763>
mov    -0x74(%rbp),%eax
sub    -0x3c(%rbp),%eax
mov    -0x3c(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jne    1839 <ti_adx+0x719>
movsd  -0x160(%rbp),%xmm0
ff
addsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
mulsd  -0x58(%rbp),%xmm0
mov    -0x48(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x48(%rbp)
movsd  %xmm0,(%rax)
jmp    187e <ti_adx+0x75e>
movsd  -0xc8(%rbp),%xmm0
ff
movsd  -0x50(%rbp),%xmm2
movsd  -0x160(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
mulsd  -0x58(%rbp),%xmm0
mov    -0x48(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x48(%rbp)
movsd  %xmm0,(%rax)
jmp    1883 <ti_adx+0x763>
jmp    1888 <ti_adx+0x768>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    14e7 <ti_adx+0x3c7>
mov    -0x48(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
sar    $0x3,%rax
mov    %rax,-0x170(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x174(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <ti_adx_start@plt>
mov    -0x174(%rbp),%ecx
mov    %eax,%edx
mov    -0x170(%rbp),%rax
sub    %edx,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x180,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_adx>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
cvttsd2si (%rdx),%ebx
mov    $0x1,%ebp
cmp    $0x2,%ebx
jl     145a <ti_adx+0x33a>
mov    (%rsi),%r14
mov    0x8(%rsi),%r12
mov    0x10(%rsi),%r15
mov    (%rcx),%rax
mov    %rax,0x10(%rsp)
xor    %ebp,%ebp
mov    %edi,0xc(%rsp)
mov    %rdx,%rdi
xor    %eax,%eax
mov    %rdx,0x20(%rsp)
mov    %rcx,%r13
call   1040 <ti_adx_start@plt>
mov    0x20(%rsp),%rdi
mov    0xc(%rsp),%edx
cmp    %edx,%eax
jge    145a <ti_adx+0x33a>
mov    %rbx,%r10
cvtsi2sd %r10d,%xmm0
movsd  0xe73(%rip),%xmm13
addsd  %xmm0,%xmm13
divsd  %xmm0,%xmm13
movsd  0xe69(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
mov    %r10d,%eax
movsd  (%r14),%xmm7
movsd  (%r12),%xmm1
add    $0xffffffffffffffff,%rax
xorpd  %xmm9,%xmm9
xor    %ecx,%ecx
movapd 0xe55(%rip),%xmm12
xorpd  %xmm3,%xmm3
xorpd  %xmm8,%xmm8
xorpd  %xmm10,%xmm10
jmp    122b <ti_adx+0x10b>
nopl   0x0(%rax,%rax,1)
movapd %xmm4,%xmm6
addsd  %xmm6,%xmm10
addsd  %xmm2,%xmm8
movsd  (%r15,%rcx,8),%xmm0
movapd %xmm7,%xmm2
subsd  %xmm0,%xmm2
andpd  %xmm12,%xmm2
movapd %xmm1,%xmm4
subsd  %xmm0,%xmm4
andpd  %xmm12,%xmm4
movapd %xmm7,%xmm0
subsd  %xmm1,%xmm0
maxsd  %xmm0,%xmm2
maxsd  %xmm2,%xmm4
addsd  %xmm4,%xmm3
add    $0x1,%rcx
cmp    %rcx,%rax
je     128f <ti_adx+0x16f>
movapd %xmm7,%xmm4
movapd %xmm1,%xmm0
movsd  0x8(%r12,%rcx,8),%xmm1
movsd  0x8(%r14,%rcx,8),%xmm7
movapd %xmm7,%xmm2
subsd  %xmm4,%xmm2
subsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm9
xorpd  %xmm5,%xmm5
ja     1266 <ti_adx+0x146>
xorpd  %xmm4,%xmm4
ucomisd %xmm0,%xmm2
movapd %xmm2,%xmm5
ja     127c <ti_adx+0x15c>
xorpd  %xmm6,%xmm6
ucomisd %xmm0,%xmm6
movapd %xmm5,%xmm2
movapd %xmm0,%xmm4
ja     11e4 <ti_adx+0xc4>
ucomisd %xmm2,%xmm4
jbe    11e0 <ti_adx+0xc0>
xorpd  %xmm2,%xmm2
jmp    11e0 <ti_adx+0xc0>
cmp    %edx,%r10d
jge    142b <ti_adx+0x30b>
movapd %xmm8,%xmm0
divsd  %xmm3,%xmm0
movapd %xmm10,%xmm1
divsd  %xmm3,%xmm1
movapd %xmm0,%xmm14
subsd  %xmm1,%xmm14
andpd  0xd63(%rip),%xmm14
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm14
mulsd  0xd41(%rip),%xmm14
xorpd  %xmm9,%xmm9
addsd  %xmm9,%xmm14
movslq %r10d,%rbp
add    $0xfffffffe,%r10d
movslq %r10d,%r9
movslq %edx,%rcx
lea    (%r12,%rbp,8),%rdx
lea    (%r14,%rbp,8),%rsi
lea    (%r15,%rbp,8),%rax
add    $0xfffffffffffffff8,%rax
sub    %rbp,%rcx
xor    %ebp,%ebp
movapd 0xd1d(%rip),%xmm5
movsd  0xd04(%rip),%xmm11
mov    0x10(%rsp),%rbx
jmp    1332 <ti_adx+0x212>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
addsd  %xmm0,%xmm14
add    $0x1,%rbp
cmp    %rbp,%rcx
je     1430 <ti_adx+0x310>
movsd  -0x8(%rdx,%rbp,8),%xmm6
movsd  (%rdx,%rbp,8),%xmm1
movsd  (%rsi,%rbp,8),%xmm2
movapd %xmm2,%xmm7
subsd  -0x8(%rsi,%rbp,8),%xmm7
subsd  %xmm1,%xmm6
ucomisd %xmm7,%xmm9
xorpd  %xmm4,%xmm4
ja     1369 <ti_adx+0x249>
xorpd  %xmm0,%xmm0
ucomisd %xmm6,%xmm7
movapd %xmm7,%xmm4
ja     137d <ti_adx+0x25d>
xorpd  %xmm15,%xmm15
ucomisd %xmm6,%xmm15
movapd %xmm6,%xmm0
movapd %xmm4,%xmm7
ja     138c <ti_adx+0x26c>
ucomisd %xmm7,%xmm0
jbe    1387 <ti_adx+0x267>
xorpd  %xmm7,%xmm7
movapd %xmm0,%xmm15
movsd  (%rax,%rbp,8),%xmm0
movapd %xmm2,%xmm4
subsd  %xmm0,%xmm4
andpd  %xmm12,%xmm4
subsd  %xmm1,%xmm2
subsd  %xmm0,%xmm1
andpd  %xmm12,%xmm1
maxsd  %xmm2,%xmm4
maxsd  %xmm4,%xmm1
mulsd  %xmm13,%xmm3
addsd  %xmm1,%xmm3
mulsd  %xmm13,%xmm8
addsd  %xmm7,%xmm8
mulsd  %xmm13,%xmm10
addsd  %xmm15,%xmm10
movapd %xmm8,%xmm1
divsd  %xmm3,%xmm1
movapd %xmm10,%xmm2
divsd  %xmm3,%xmm2
movapd %xmm1,%xmm0
subsd  %xmm2,%xmm0
andpd  %xmm5,%xmm0
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
mulsd  %xmm11,%xmm0
cmp    %r9,%rbp
jl     1320 <ti_adx+0x200>
cmp    %rbp,%r10
je     140e <ti_adx+0x2ee>
mulsd  %xmm13,%xmm14
addsd  %xmm0,%xmm14
movsd  0x18(%rsp),%xmm0
mulsd  %xmm14,%xmm0
movsd  %xmm0,(%rbx)
add    $0x8,%rbx
jmp    1325 <ti_adx+0x205>
mov    0x10(%rsp),%rbx
sub    0x0(%r13),%rbx
sar    $0x3,%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <ti_adx_start@plt>
mov    0xc(%rsp),%ecx
sub    %eax,%ecx
movslq %ecx,%rax
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
xor    %eax,%eax
call   1030 <assert@plt>
mov    %ebp,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ti_adx(i32 %0, double** %1, double* %2, double** %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double**
%8 = alloca double*
%9 = alloca double**
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca double*
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca i32
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca double
%39 = alloca double
%40 = alloca double
%41 = alloca double
%42 = alloca double
%43 = alloca double
%44 = alloca double
%45 = alloca double
%46 = alloca double
%47 = alloca double
%48 = alloca double
%49 = alloca double
store i32 %0, i32* %6
store double** %1, double*** %7
store double* %2, double** %8
store double** %3, double*** %9
%50 = load double**, double*** %7
%51 = getelementptr inbounds double*, double** %50, i64 0
%52 = load double*, double** %51
store double* %52, double** %10
%53 = load double**, double*** %7
%54 = getelementptr inbounds double*, double** %53, i64 1
%55 = load double*, double** %54
store double* %55, double** %11
%56 = load double**, double*** %7
%57 = getelementptr inbounds double*, double** %56, i64 2
%58 = load double*, double** %57
store double* %58, double** %12
%59 = load double*, double** %8
%60 = getelementptr inbounds double, double* %59, i64 0
%61 = load double, double* %60
%62 = fptosi double %61 to i32
store i32 %62, i32* %13
%63 = load double**, double*** %9
%64 = getelementptr inbounds double*, double** %63, i64 0
%65 = load double*, double** %64
store double* %65, double** %14
%66 = load i32, i32* %13
%67 = icmp slt i32 %66, 2
br i1 %67, label %68, label %69
68: ; preds = %4
store i32 1, i32* %5
br label %392
69: ; preds = %4
%70 = load i32, i32* %6
%71 = load double*, double** %8
%72 = call i32 (double*, ...) bitcast (i32 (...)* @ti_adx_start to i32 (double*, ...)*)(double* %71)
%73 = icmp sle i32 %70, %72
br i1 %73, label %74, label %75
74: ; preds = %69
store i32 0, i32* %5
br label %392
75: ; preds = %69
%76 = load i32, i32* %13
%77 = sitofp i32 %76 to double
%78 = fsub double %77, 1.000000e+00
%79 = load i32, i32* %13
%80 = sitofp i32 %79 to double
%81 = fdiv double %78, %80
store double %81, double* %15
%82 = load i32, i32* %13
%83 = sitofp i32 %82 to double
%84 = fdiv double 1.000000e+00, %83
store double %84, double* %16
store double 0.000000e+00, double* %17
store double 0.000000e+00, double* %18
store double 0.000000e+00, double* %19
store i32 1, i32* %20
br label %85
85: ; preds = %187, %75
%86 = load i32, i32* %20
%87 = load i32, i32* %13
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %190
89: ; preds = %85
br label %90
90: ; preds = %89
%91 = load double*, double** %11
%92 = load i32, i32* %20
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %91, i64 %93
%95 = load double, double* %94
store double %95, double* %22
%96 = load double*, double** %10
%97 = load i32, i32* %20
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %96, i64 %98
%100 = load double, double* %99
store double %100, double* %23
%101 = load double*, double** %12
%102 = load i32, i32* %20
%103 = sub nsw i32 %102, 1
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %101, i64 %104
%106 = load double, double* %105
store double %106, double* %24
%107 = load double, double* %23
%108 = load double, double* %24
%109 = fsub double %107, %108
%110 = call double @llvm.fabs.f64(double %109)
store double %110, double* %25
%111 = load double, double* %22
%112 = load double, double* %24
%113 = fsub double %111, %112
%114 = call double @llvm.fabs.f64(double %113)
store double %114, double* %26
%115 = load double, double* %23
%116 = load double, double* %22
%117 = fsub double %115, %116
store double %117, double* %27
%118 = load double, double* %25
%119 = load double, double* %27
%120 = fcmp ogt double %118, %119
br i1 %120, label %121, label %123
121: ; preds = %90
%122 = load double, double* %25
store double %122, double* %27
br label %123
123: ; preds = %121, %90
%124 = load double, double* %26
%125 = load double, double* %27
%126 = fcmp ogt double %124, %125
br i1 %126, label %127, label %129
127: ; preds = %123
%128 = load double, double* %26
store double %128, double* %27
br label %129
129: ; preds = %127, %123
%130 = load double, double* %27
store double %130, double* %21
br label %131
131: ; preds = %129
%132 = load double, double* %21
%133 = load double, double* %17
%134 = fadd double %133, %132
store double %134, double* %17
br label %135
135: ; preds = %131
%136 = load double*, double** %10
%137 = load i32, i32* %20
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds double, double* %136, i64 %138
%140 = load double, double* %139
%141 = load double*, double** %10
%142 = load i32, i32* %20
%143 = sub nsw i32 %142, 1
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds double, double* %141, i64 %144
%146 = load double, double* %145
%147 = fsub double %140, %146
store double %147, double* %28
%148 = load double*, double** %11
%149 = load i32, i32* %20
%150 = sub nsw i32 %149, 1
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds double, double* %148, i64 %151
%153 = load double, double* %152
%154 = load double*, double** %11
%155 = load i32, i32* %20
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double, double* %154, i64 %156
%158 = load double, double* %157
%159 = fsub double %153, %158
store double %159, double* %29
%160 = load double, double* %28
%161 = fcmp olt double %160, 0.000000e+00
br i1 %161, label %162, label %163
162: ; preds = %135
store double 0.000000e+00, double* %28
br label %169
163: ; preds = %135
%164 = load double, double* %28
%165 = load double, double* %29
%166 = fcmp ogt double %164, %165
br i1 %166, label %167, label %168
167: ; preds = %163
store double 0.000000e+00, double* %29
br label %168
168: ; preds = %167, %163
br label %169
169: ; preds = %168, %162
%170 = load double, double* %29
%171 = fcmp olt double %170, 0.000000e+00
br i1 %171, label %172, label %173
172: ; preds = %169
store double 0.000000e+00, double* %29
br label %179
173: ; preds = %169
%174 = load double, double* %29
%175 = load double, double* %28
%176 = fcmp ogt double %174, %175
br i1 %176, label %177, label %178
177: ; preds = %173
store double 0.000000e+00, double* %28
br label %178
178: ; preds = %177, %173
br label %179
179: ; preds = %178, %172
br label %180
180: ; preds = %179
%181 = load double, double* %28
%182 = load double, double* %18
%183 = fadd double %182, %181
store double %183, double* %18
%184 = load double, double* %29
%185 = load double, double* %19
%186 = fadd double %185, %184
store double %186, double* %19
br label %187
187: ; preds = %180
%188 = load i32, i32* %20
%189 = add nsw i32 %188, 1
store i32 %189, i32* %20
br label %85
190: ; preds = %85
store double 0.000000e+00, double* %30
%191 = load double, double* %18
%192 = load double, double* %17
%193 = fdiv double %191, %192
store double %193, double* %31
%194 = load double, double* %19
%195 = load double, double* %17
%196 = fdiv double %194, %195
store double %196, double* %32
%197 = load double, double* %31
%198 = load double, double* %32
%199 = fsub double %197, %198
%200 = call double @llvm.fabs.f64(double %199)
store double %200, double* %33
%201 = load double, double* %31
%202 = load double, double* %32
%203 = fadd double %201, %202
store double %203, double* %34
%204 = load double, double* %33
%205 = load double, double* %34
%206 = fdiv double %204, %205
%207 = fmul double %206, 1.000000e+02
store double %207, double* %35
%208 = load double, double* %35
%209 = load double, double* %30
%210 = fadd double %209, %208
store double %210, double* %30
%211 = load i32, i32* %13
store i32 %211, i32* %20
br label %212
212: ; preds = %372, %190
%213 = load i32, i32* %20
%214 = load i32, i32* %6
%215 = icmp slt i32 %213, %214
br i1 %215, label %216, label %375
216: ; preds = %212
br label %217
217: ; preds = %216
%218 = load double*, double** %11
%219 = load i32, i32* %20
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds double, double* %218, i64 %220
%222 = load double, double* %221
store double %222, double* %37
%223 = load double*, double** %10
%224 = load i32, i32* %20
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds double, double* %223, i64 %225
%227 = load double, double* %226
store double %227, double* %38
%228 = load double*, double** %12
%229 = load i32, i32* %20
%230 = sub nsw i32 %229, 1
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds double, double* %228, i64 %231
%233 = load double, double* %232
store double %233, double* %39
%234 = load double, double* %38
%235 = load double, double* %39
%236 = fsub double %234, %235
%237 = call double @llvm.fabs.f64(double %236)
store double %237, double* %40
%238 = load double, double* %37
%239 = load double, double* %39
%240 = fsub double %238, %239
%241 = call double @llvm.fabs.f64(double %240)
store double %241, double* %41
%242 = load double, double* %38
%243 = load double, double* %37
%244 = fsub double %242, %243
store double %244, double* %42
%245 = load double, double* %40
%246 = load double, double* %42
%247 = fcmp ogt double %245, %246
br i1 %247, label %248, label %250
248: ; preds = %217
%249 = load double, double* %40
store double %249, double* %42
br label %250
250: ; preds = %248, %217
%251 = load double, double* %41
%252 = load double, double* %42
%253 = fcmp ogt double %251, %252
br i1 %253, label %254, label %256
254: ; preds = %250
%255 = load double, double* %41
store double %255, double* %42
br label %256
256: ; preds = %254, %250
%257 = load double, double* %42
store double %257, double* %36
br label %258
258: ; preds = %256
%259 = load double, double* %17
%260 = load double, double* %15
%261 = load double, double* %36
%262 = call double @llvm.fmuladd.f64(double %259, double %260, double %261)
store double %262, double* %17
br label %263
263: ; preds = %258
%264 = load double*, double** %10
%265 = load i32, i32* %20
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds double, double* %264, i64 %266
%268 = load double, double* %267
%269 = load double*, double** %10
%270 = load i32, i32* %20
%271 = sub nsw i32 %270, 1
%272 = sext i32 %271 to i64
%273 = getelementptr inbounds double, double* %269, i64 %272
%274 = load double, double* %273
%275 = fsub double %268, %274
store double %275, double* %43
%276 = load double*, double** %11
%277 = load i32, i32* %20
%278 = sub nsw i32 %277, 1
%279 = sext i32 %278 to i64
%280 = getelementptr inbounds double, double* %276, i64 %279
%281 = load double, double* %280
%282 = load double*, double** %11
%283 = load i32, i32* %20
%284 = sext i32 %283 to i64
%285 = getelementptr inbounds double, double* %282, i64 %284
%286 = load double, double* %285
%287 = fsub double %281, %286
store double %287, double* %44
%288 = load double, double* %43
%289 = fcmp olt double %288, 0.000000e+00
br i1 %289, label %290, label %291
290: ; preds = %263
store double 0.000000e+00, double* %43
br label %297
291: ; preds = %263
%292 = load double, double* %43
%293 = load double, double* %44
%294 = fcmp ogt double %292, %293
br i1 %294, label %295, label %296
295: ; preds = %291
store double 0.000000e+00, double* %44
br label %296
296: ; preds = %295, %291
br label %297
297: ; preds = %296, %290
%298 = load double, double* %44
%299 = fcmp olt double %298, 0.000000e+00
br i1 %299, label %300, label %301
300: ; preds = %297
store double 0.000000e+00, double* %44
br label %307
301: ; preds = %297
%302 = load double, double* %44
%303 = load double, double* %43
%304 = fcmp ogt double %302, %303
br i1 %304, label %305, label %306
305: ; preds = %301
store double 0.000000e+00, double* %43
br label %306
306: ; preds = %305, %301
br label %307
307: ; preds = %306, %300
br label %308
308: ; preds = %307
%309 = load double, double* %18
%310 = load double, double* %15
%311 = load double, double* %43
%312 = call double @llvm.fmuladd.f64(double %309, double %310, double %311)
store double %312, double* %18
%313 = load double, double* %19
%314 = load double, double* %15
%315 = load double, double* %44
%316 = call double @llvm.fmuladd.f64(double %313, double %314, double %315)
store double %316, double* %19
%317 = load double, double* %18
%318 = load double, double* %17
%319 = fdiv double %317, %318
store double %319, double* %45
%320 = load double, double* %19
%321 = load double, double* %17
%322 = fdiv double %320, %321
store double %322, double* %46
%323 = load double, double* %45
%324 = load double, double* %46
%325 = fsub double %323, %324
%326 = call double @llvm.fabs.f64(double %325)
store double %326, double* %47
%327 = load double, double* %45
%328 = load double, double* %46
%329 = fadd double %327, %328
store double %329, double* %48
%330 = load double, double* %47
%331 = load double, double* %48
%332 = fdiv double %330, %331
%333 = fmul double %332, 1.000000e+02
store double %333, double* %49
%334 = load i32, i32* %20
%335 = load i32, i32* %13
%336 = sub nsw i32 %334, %335
%337 = load i32, i32* %13
%338 = sub nsw i32 %337, 2
%339 = icmp slt i32 %336, %338
br i1 %339, label %340, label %344
340: ; preds = %308
%341 = load double, double* %49
%342 = load double, double* %30
%343 = fadd double %342, %341
store double %343, double* %30
br label %371
344: ; preds = %308
%345 = load i32, i32* %20
%346 = load i32, i32* %13
%347 = sub nsw i32 %345, %346
%348 = load i32, i32* %13
%349 = sub nsw i32 %348, 2
%350 = icmp eq i32 %347, %349
br i1 %350, label %351, label %360
351: ; preds = %344
%352 = load double, double* %49
%353 = load double, double* %30
%354 = fadd double %353, %352
store double %354, double* %30
%355 = load double, double* %30
%356 = load double, double* %16
%357 = fmul double %355, %356
%358 = load double*, double** %14
%359 = getelementptr inbounds double, double* %358, i32 1
store double* %359, double** %14
store double %357, double* %358
br label %370
360: ; preds = %344
%361 = load double, double* %30
%362 = load double, double* %15
%363 = load double, double* %49
%364 = call double @llvm.fmuladd.f64(double %361, double %362, double %363)
store double %364, double* %30
%365 = load double, double* %30
%366 = load double, double* %16
%367 = fmul double %365, %366
%368 = load double*, double** %14
%369 = getelementptr inbounds double, double* %368, i32 1
store double* %369, double** %14
store double %367, double* %368
br label %370
370: ; preds = %360, %351
br label %371
371: ; preds = %370, %340
br label %372
372: ; preds = %371
%373 = load i32, i32* %20
%374 = add nsw i32 %373, 1
store i32 %374, i32* %20
br label %212
375: ; preds = %212
%376 = load double*, double** %14
%377 = load double**, double*** %9
%378 = getelementptr inbounds double*, double** %377, i64 0
%379 = load double*, double** %378
%380 = ptrtoint double* %376 to i64
%381 = ptrtoint double* %379 to i64
%382 = sub i64 %380, %381
%383 = sdiv exact i64 %382, 8
%384 = load i32, i32* %6
%385 = load double*, double** %8
%386 = call i32 (double*, ...) bitcast (i32 (...)* @ti_adx_start to i32 (double*, ...)*)(double* %385)
%387 = sub nsw i32 %384, %386
%388 = sext i32 %387 to i64
%389 = icmp eq i64 %383, %388
%390 = zext i1 %389 to i32
%391 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %390)
store i32 0, i32* %5
br label %392
392: ; preds = %375, %74, %68
%393 = load i32, i32* %5
ret i32 %393
}

LLVM IR (-O2):
define i32 @ti_adx(i32 %0, double** nocapture %1, double* %2, double** nocapture %3) {
%5 = load double*, double** %1
%6 = getelementptr inbounds double*, double** %1, i64 1
%7 = load double*, double** %6
%8 = getelementptr inbounds double*, double** %1, i64 2
%9 = load double*, double** %8
%10 = load double, double* %2
%11 = fptosi double %10 to i32
%12 = load double*, double** %3
%13 = icmp slt i32 %11, 2
br i1 %13, label %170, label %14
14: ; preds = %4
%15 = tail call i32 (double*, ...) bitcast (i32 (...)* @ti_adx_start to i32 (double*, ...)*)(double* %2)
%16 = icmp slt i32 %15, %0
br i1 %16, label %17, label %170
17: ; preds = %14
%18 = sitofp i32 %11 to double
%19 = fadd double %18, -1.000000e+00
%20 = fdiv double %19, %18
%21 = fdiv double 1.000000e+00, %18
%22 = zext i32 %11 to i64
%23 = load double, double* %5
%24 = load double, double* %7
br label %25
25: ; preds = %17, %62
%26 = phi double [ %24, %17 ], [ %33, %62 ]
%27 = phi double [ %23, %17 ], [ %35, %62 ]
%28 = phi i64 [ 1, %17 ], [ %67, %62 ]
%29 = phi double [ 0.000000e+00, %17 ], [ %48, %62 ]
%30 = phi double [ 0.000000e+00, %17 ], [ %65, %62 ]
%31 = phi double [ 0.000000e+00, %17 ], [ %66, %62 ]
%32 = getelementptr inbounds double, double* %7, i64 %28
%33 = load double, double* %32
%34 = getelementptr inbounds double, double* %5, i64 %28
%35 = load double, double* %34
%36 = add nsw i64 %28, -1
%37 = getelementptr inbounds double, double* %9, i64 %36
%38 = load double, double* %37
%39 = fsub double %35, %38
%40 = tail call double @llvm.fabs.f64(double %39)
%41 = fsub double %33, %38
%42 = tail call double @llvm.fabs.f64(double %41)
%43 = fsub double %35, %33
%44 = fcmp ogt double %40, %43
%45 = select i1 %44, double %40, double %43
%46 = fcmp ogt double %42, %45
%47 = select i1 %46, double %42, double %45
%48 = fadd double %29, %47
%49 = fsub double %35, %27
%50 = fsub double %26, %33
%51 = fcmp olt double %49, 0.000000e+00
br i1 %51, label %54, label %52
52: ; preds = %25
%53 = fcmp ogt double %49, %50
br i1 %53, label %57, label %54
54: ; preds = %25, %52
%55 = phi double [ %49, %52 ], [ 0.000000e+00, %25 ]
%56 = fcmp olt double %50, 0.000000e+00
br i1 %56, label %62, label %57
57: ; preds = %52, %54
%58 = phi double [ %55, %54 ], [ %49, %52 ]
%59 = phi double [ %50, %54 ], [ 0.000000e+00, %52 ]
%60 = fcmp ogt double %59, %58
br i1 %60, label %61, label %62
61: ; preds = %57
br label %62
62: ; preds = %54, %57, %61
%63 = phi double [ %59, %61 ], [ %59, %57 ], [ 0.000000e+00, %54 ]
%64 = phi double [ 0.000000e+00, %61 ], [ %58, %57 ], [ %55, %54 ]
%65 = fadd double %30, %64
%66 = fadd double %31, %63
%67 = add nuw nsw i64 %28, 1
%68 = icmp eq i64 %67, %22
br i1 %68, label %69, label %25
69: ; preds = %62
%70 = fdiv double %65, %48
%71 = fdiv double %66, %48
%72 = icmp slt i32 %11, %0
br i1 %72, label %73, label %157
73: ; preds = %69
%74 = fsub double %70, %71
%75 = tail call double @llvm.fabs.f64(double %74)
%76 = fadd double %70, %71
%77 = fdiv double %75, %76
%78 = fmul double %77, 1.000000e+02
%79 = fadd double %78, 0.000000e+00
%80 = add nsw i32 %11, -2
%81 = sext i32 %11 to i64
%82 = sext i32 %80 to i64
%83 = zext i32 %80 to i64
%84 = sext i32 %0 to i64
br label %85
85: ; preds = %73, %152
%86 = phi i64 [ %81, %73 ], [ %155, %152 ]
%87 = phi double* [ %12, %73 ], [ %154, %152 ]
%88 = phi double [ %48, %73 ], [ %108, %152 ]
%89 = phi double [ %65, %73 ], [ %129, %152 ]
%90 = phi double [ %66, %73 ], [ %130, %152 ]
%91 = phi double [ %79, %73 ], [ %153, %152 ]
%92 = getelementptr inbounds double, double* %7, i64 %86
%93 = load double, double* %92
%94 = getelementptr inbounds double, double* %5, i64 %86
%95 = load double, double* %94
%96 = add nsw i64 %86, -1
%97 = getelementptr inbounds double, double* %9, i64 %96
%98 = load double, double* %97
%99 = fsub double %95, %98
%100 = tail call double @llvm.fabs.f64(double %99)
%101 = fsub double %93, %98
%102 = tail call double @llvm.fabs.f64(double %101)
%103 = fsub double %95, %93
%104 = fcmp ogt double %100, %103
%105 = select i1 %104, double %100, double %103
%106 = fcmp ogt double %102, %105
%107 = select i1 %106, double %102, double %105
%108 = tail call double @llvm.fmuladd.f64(double %88, double %20, double %107)
%109 = getelementptr inbounds double, double* %5, i64 %96
%110 = load double, double* %109
%111 = fsub double %95, %110
%112 = getelementptr inbounds double, double* %7, i64 %96
%113 = load double, double* %112
%114 = fsub double %113, %93
%115 = fcmp olt double %111, 0.000000e+00
br i1 %115, label %118, label %116
116: ; preds = %85
%117 = fcmp ogt double %111, %114
br i1 %117, label %121, label %118
118: ; preds = %85, %116
%119 = phi double [ %111, %116 ], [ 0.000000e+00, %85 ]
%120 = fcmp olt double %114, 0.000000e+00
br i1 %120, label %126, label %121
121: ; preds = %116, %118
%122 = phi double [ %114, %118 ], [ 0.000000e+00, %116 ]
%123 = phi double [ %119, %118 ], [ %111, %116 ]
%124 = fcmp ogt double %122, %123
br i1 %124, label %125, label %126
125: ; preds = %121
br label %126
126: ; preds = %118, %121, %125
%127 = phi double [ 0.000000e+00, %125 ], [ %123, %121 ], [ %119, %118 ]
%128 = phi double [ %122, %125 ], [ %122, %121 ], [ 0.000000e+00, %118 ]
%129 = tail call double @llvm.fmuladd.f64(double %89, double %20, double %127)
%130 = tail call double @llvm.fmuladd.f64(double %90, double %20, double %128)
%131 = fdiv double %129, %108
%132 = fdiv double %130, %108
%133 = fsub double %131, %132
%134 = tail call double @llvm.fabs.f64(double %133)
%135 = fadd double %131, %132
%136 = fdiv double %134, %135
%137 = fmul double %136, 1.000000e+02
%138 = sub nsw i64 %86, %81
%139 = icmp slt i64 %138, %82
br i1 %139, label %140, label %142
140: ; preds = %126
%141 = fadd double %91, %137
br label %152
142: ; preds = %126
%143 = icmp eq i64 %138, %83
br i1 %143, label %144, label %148
144: ; preds = %142
%145 = fadd double %91, %137
%146 = fmul double %21, %145
%147 = getelementptr inbounds double, double* %87, i64 1
store double %146, double* %87
br label %152
148: ; preds = %142
%149 = tail call double @llvm.fmuladd.f64(double %91, double %20, double %137)
%150 = fmul double %21, %149
%151 = getelementptr inbounds double, double* %87, i64 1
store double %150, double* %87
br label %152
152: ; preds = %144, %148, %140
%153 = phi double [ %141, %140 ], [ %145, %144 ], [ %149, %148 ]
%154 = phi double* [ %87, %140 ], [ %147, %144 ], [ %151, %148 ]
%155 = add nsw i64 %86, 1
%156 = icmp eq i64 %155, %84
br i1 %156, label %157, label %85
157: ; preds = %152, %69
%158 = phi double* [ %12, %69 ], [ %154, %152 ]
%159 = load double*, double** %3
%160 = ptrtoint double* %158 to i64
%161 = ptrtoint double* %159 to i64
%162 = sub i64 %160, %161
%163 = ashr exact i64 %162, 3
%164 = tail call i32 (double*, ...) bitcast (i32 (...)* @ti_adx_start to i32 (double*, ...)*)(double* %2)
%165 = sub nsw i32 %0, %164
%166 = sext i32 %165 to i64
%167 = icmp eq i64 %163, %166
%168 = zext i1 %167 to i32
%169 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %168)
br label %170
170: ; preds = %14, %4, %157
%171 = phi i32 [ 0, %157 ], [ 1, %4 ], [ 0, %14 ]
ret i32 %171
}