void lm_qrsolv(const int n, double *const r, const int ldr, int *const ipvt,
               double *const diag, double *const qtb, double *const x,
               double *const sdiag, double *const wa) {
  int i, kk, j, k, nsing;
  double qtbpj, sum, temp;
  double _sin, _cos, _tan, _cot;
  for (j = 0; j < n; j++) {
    for (i = j; i < n; i++)
      r[j * ldr + i] = r[i * ldr + j];
    x[j] = r[j * ldr + j];
    wa[j] = qtb[j];
  }
  for (j = 0; j < n; j++) {
    if (diag[ipvt[j]] == 0)
      goto L90;
    for (k = j; k < n; k++)
      sdiag[k] = 0;
    sdiag[j] = diag[ipvt[j]];
    qtbpj = 0;
    for (k = j; k < n; k++) {
      if (sdiag[k] == 0)
        continue;
      kk = k + ldr * k;
      if (fabs(r[kk]) < fabs(sdiag[k])) {
        _cot = r[kk] / sdiag[k];
        _sin = 1 / sqrt(1 + (_cot) * (_cot));
        _cos = _sin * _cot;
      } else {
        _tan = sdiag[k] / r[kk];
        _cos = 1 / sqrt(1 + (_tan) * (_tan));
        _sin = _cos * _tan;
      }
      r[kk] = _cos * r[kk] + _sin * sdiag[k];
      temp = _cos * wa[k] + _sin * qtbpj;
      qtbpj = -_sin * wa[k] + _cos * qtbpj;
      wa[k] = temp;
      for (i = k + 1; i < n; i++) {
        temp = _cos * r[k * ldr + i] + _sin * sdiag[i];
        sdiag[i] = -_sin * r[k * ldr + i] + _cos * sdiag[i];
        r[k * ldr + i] = temp;
      }
    }
  L90:
    sdiag[j] = r[j * ldr + j];
    r[j * ldr + j] = x[j];
  }
  nsing = n;
  for (j = 0; j < n; j++) {
    if (sdiag[j] == 0 && nsing == n)
      nsing = j;
    if (nsing < n)
      wa[j] = 0;
  }
  for (j = nsing - 1; j >= 0; j--) {
    sum = 0;
    for (i = j + 1; i < nsing; i++)
      sum += r[j * ldr + i] * wa[i];
    wa[j] = (wa[j] - sum) / sdiag[j];
  }
  for (j = 0; j < n; j++)
    x[ipvt[j]] = wa[j];
}


x86 assembly (clang, -O0):
<lm_qrsolv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11e7 <lm_qrsolv+0xd7>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    119c <lm_qrsolv+0x8c>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x3c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1156 <lm_qrsolv+0x46>
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x3c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1144 <lm_qrsolv+0x34>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    15b9 <lm_qrsolv+0x4a9>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1227 <lm_qrsolv+0x117>
jp     1227 <lm_qrsolv+0x117>
jmp    1565 <lm_qrsolv+0x455>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1257 <lm_qrsolv+0x147>
mov    0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    122d <lm_qrsolv+0x11d>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1560 <lm_qrsolv+0x450>
mov    0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12b8 <lm_qrsolv+0x1a8>
jp     12b8 <lm_qrsolv+0x1a8>
jmp    1552 <lm_qrsolv+0x442>
mov    -0x40(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x40(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xd25(%rip),%xmm0
pand   %xmm0,%xmm1
mov    0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xd0d(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1367 <lm_qrsolv+0x257>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcda(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xcc6(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    13c8 <lm_qrsolv+0x2b8>
mov    0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc74(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xc60(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x68(%rbp),%xmm1
mov    0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
mov    0x20(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    0x20(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    0x20(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    154d <lm_qrsolv+0x43d>
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x68(%rbp),%xmm1
mov    0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x70(%rbp),%xmm1
mov    0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1485 <lm_qrsolv+0x375>
jmp    1552 <lm_qrsolv+0x442>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1287 <lm_qrsolv+0x177>
jmp    1565 <lm_qrsolv+0x455>
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x3c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x3c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11ee <lm_qrsolv+0xde>
mov    -0x4(%rbp),%eax
mov    %eax,-0x44(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1633 <lm_qrsolv+0x523>
mov    0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1604 <lm_qrsolv+0x4f4>
jp     1604 <lm_qrsolv+0x4f4>
mov    -0x44(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    1604 <lm_qrsolv+0x4f4>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1620 <lm_qrsolv+0x510>
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1625 <lm_qrsolv+0x515>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    15c6 <lm_qrsolv+0x4b6>
mov    -0x44(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jl     16e0 <lm_qrsolv+0x5d0>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    16a6 <lm_qrsolv+0x596>
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1657 <lm_qrsolv+0x547>
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x58(%rbp),%xmm0
mov    0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3c(%rbp)
jmp    163c <lm_qrsolv+0x52c>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1723 <lm_qrsolv+0x613>
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    16e7 <lm_qrsolv+0x5d7>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lm_qrsolv>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %r8,0x70(%rsp)
mov    %edx,0xc(%rsp)
test   %edi,%edi
jle    1b48 <lm_qrsolv+0xa28>
mov    %r9,%rbx
mov    0x120(%rsp),%r10
mov    0x110(%rsp),%r8
movslq 0xc(%rsp),%r13
mov    %edi,%r9d
lea    0x8(,%r13,8),%r11
xor    %r14d,%r14d
mov    %r9,%rdx
mov    %rsi,(%rsp)
nop
xor    %eax,%eax
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rsi,%rbp,8)
add    $0x1,%rbp
add    %r13,%rax
cmp    %rbp,%rdx
jne    1180 <lm_qrsolv+0x60>
mov    %r14d,%eax
imul   0xc(%rsp),%eax
cltq
add    %r14,%rax
mov    (%rsp),%rbp
movsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,(%r8,%r14,8)
movsd  (%rbx,%r14,8),%xmm0
movsd  %xmm0,(%r10,%r14,8)
add    $0x1,%r14
add    %r11,%rsi
add    $0xffffffffffffffff,%rdx
cmp    %r9,%r14
jne    1170 <lm_qrsolv+0x50>
test   %edi,%edi
mov    0x118(%rsp),%rbp
mov    (%rsp),%r11
jle    1b48 <lm_qrsolv+0xa28>
mov    %edi,0x8(%rsp)
lea    0x8(%r11),%rax
mov    %rax,0xb0(%rsp)
lea    0x18(%rbp),%rax
mov    %rax,0x68(%rsp)
mov    $0x1,%eax
mov    %rax,0x60(%rsp)
mov    $0x3,%eax
mov    %rax,0x58(%rsp)
mov    $0x2,%eax
mov    %rax,0x50(%rsp)
movq   $0xfffffffffffffffd,0x48(%rsp)
ff ff
xor    %edx,%edx
xorpd  %xmm8,%xmm8
mov    %r9,0x28(%rsp)
mov    %rcx,0xa8(%rsp)
mov    %r13,0x80(%rsp)
jmp    12b5 <lm_qrsolv+0x195>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x38(%rsp),%rdx
mov    %rdx,%rax
imul   %r13,%rax
add    %rdx,%rax
movsd  (%r11,%rax,8),%xmm0
mov    0x78(%rsp),%rcx
movsd  %xmm0,(%rcx)
mov    0x110(%rsp),%r12
movsd  (%r12,%rdx,8),%xmm0
movsd  %xmm0,(%r11,%rax,8)
add    $0x1,%rdx
addq   $0x1,0x60(%rsp)
addq   $0x8,0x68(%rsp)
addq   $0x1,0x58(%rsp)
addq   $0x1,0x50(%rsp)
addq   $0xffffffffffffffff,0x48(%rsp)
cmp    %r9,%rdx
mov    0xa8(%rsp),%rcx
je     188b <lm_qrsolv+0x76b>
lea    0x0(,%rdx,8),%rax
add    %rbp,%rax
mov    %rax,0x78(%rsp)
mov    %rdx,0x38(%rsp)
movslq (%rcx,%rdx,4),%r14
mov    0x70(%rsp),%rax
movsd  (%rax,%r14,8),%xmm0
ucomisd %xmm8,%xmm0
jne    12e6 <lm_qrsolv+0x1c6>
jnp    1250 <lm_qrsolv+0x130>
mov    0x38(%rsp),%r15
lea    0x2(%r15),%rax
mov    %rax,0xd0(%rsp)
mov    %r15,%rax
not    %rax
mov    %rax,0xb8(%rsp)
mov    %r15d,%eax
not    %eax
add    0x8(%rsp),%eax
lea    0x8(,%rax,8),%rdx
mov    0x78(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
movsd  0xcf2(%rip),%xmm9
xorpd  %xmm8,%xmm8
mov    (%rsp),%r11
mov    0x118(%rsp),%rbp
mov    0x28(%rsp),%r9
mov    0x120(%rsp),%r10
mov    0x70(%rsp),%rax
movsd  (%rax,%r14,8),%xmm11
movsd  %xmm11,(%r12)
xorpd  %xmm10,%xmm10
mov    0x48(%rsp),%rax
mov    %rax,0x88(%rsp)
mov    0x50(%rsp),%rdi
mov    0x58(%rsp),%rsi
mov    0x68(%rsp),%rcx
mov    %rcx,0x10(%rsp)
xor    %edx,%edx
mov    %r15,0x18(%rsp)
mov    0x60(%rsp),%r8
jmp    13e5 <lm_qrsolv+0x2c5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x18(%rsp),%rax
add    $0x1,%rax
mov    0x10(%rsp),%rcx
cmp    %r9,%rax
je     1250 <lm_qrsolv+0x130>
add    $0x1,%r8
mov    %rax,0x18(%rsp)
movsd  0x0(%rbp,%rax,8),%xmm11
add    $0x1,%rdx
add    $0x8,%rcx
mov    %rcx,0x10(%rsp)
add    $0x1,%rsi
add    $0x1,%rdi
addq   $0xffffffffffffffff,0x88(%rsp)
cmp    %r9,%rdi
mov    %r9,%r15
cmova  %rdi,%r15
mov    0xd0(%rsp),%rax
lea    (%rax,%rdx,1),%r14
cmp    %r9,%r14
mov    %r9,%rcx
cmova  %r14,%rcx
cmp    %r9,%r14
mov    %r9,%rax
cmova  %r14,%rax
mov    %r9,%rbx
cmova  %r14,%rbx
ucomisd %xmm8,%xmm11
jne    141f <lm_qrsolv+0x2ff>
jnp    13a0 <lm_qrsolv+0x280>
mov    %rcx,0xc0(%rsp)
mov    %rax,0xc8(%rsp)
mov    %rsi,0x30(%rsp)
mov    0x18(%rsp),%rcx
mov    %ecx,%eax
imul   0xc(%rsp),%eax
movslq %eax,%r13
add    %rcx,%r13
movsd  (%r11,%r13,8),%xmm12
movapd %xmm12,%xmm0
movapd 0xba7(%rip),%xmm2
andpd  %xmm2,%xmm0
movapd %xmm11,%xmm1
andpd  %xmm2,%xmm1
ucomisd %xmm0,%xmm1
mov    %rdx,0x20(%rsp)
jbe    1495 <lm_qrsolv+0x375>
divsd  %xmm11,%xmm12
movapd %xmm12,%xmm0
mulsd  %xmm12,%xmm0
addsd  %xmm9,%xmm0
ucomisd %xmm8,%xmm0
jb     14b9 <lm_qrsolv+0x399>
sqrtsd %xmm0,%xmm0
jmp    1518 <lm_qrsolv+0x3f8>
divsd  %xmm12,%xmm11
movapd %xmm11,%xmm0
mulsd  %xmm11,%xmm0
addsd  %xmm9,%xmm0
ucomisd %xmm8,%xmm0
jb     1529 <lm_qrsolv+0x409>
sqrtsd %xmm0,%xmm0
jmp    1588 <lm_qrsolv+0x468>
movsd  %xmm10,0x40(%rsp)
mov    %rdi,%rbp
mov    %r8,%r12
movapd %xmm12,0x90(%rsp)
call   1040 <sqrt@plt>
movapd 0x90(%rsp),%xmm12
mov    %r12,%r8
mov    0x20(%rsp),%rdx
mov    %rbp,%rdi
movsd  0x40(%rsp),%xmm10
movsd  0xb26(%rip),%xmm9
xorpd  %xmm8,%xmm8
mov    (%rsp),%r11
mov    0x118(%rsp),%rbp
mov    0x28(%rsp),%r9
mov    0x120(%rsp),%r10
movapd %xmm9,%xmm11
divsd  %xmm0,%xmm11
mulsd  %xmm11,%xmm12
jmp    1597 <lm_qrsolv+0x477>
movsd  %xmm10,0x40(%rsp)
mov    %rdi,%rbp
mov    %r8,%r12
movapd %xmm11,0x90(%rsp)
call   1040 <sqrt@plt>
movapd 0x90(%rsp),%xmm11
mov    %r12,%r8
mov    0x20(%rsp),%rdx
mov    %rbp,%rdi
movsd  0x40(%rsp),%xmm10
movsd  0xab6(%rip),%xmm9
xorpd  %xmm8,%xmm8
mov    (%rsp),%r11
mov    0x118(%rsp),%rbp
mov    0x28(%rsp),%r9
mov    0x120(%rsp),%r10
movapd %xmm9,%xmm12
divsd  %xmm0,%xmm12
mulsd  %xmm12,%xmm11
mov    0x18(%rsp),%r12
movsd  0x0(%rbp,%r12,8),%xmm0
mulsd  %xmm11,%xmm0
movsd  (%r11,%r13,8),%xmm1
mulsd  %xmm12,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r11,%r13,8)
movsd  (%r10,%r12,8),%xmm0
movapd %xmm10,%xmm1
mulsd  %xmm11,%xmm1
movapd %xmm12,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm12,%xmm10
mulsd  %xmm11,%xmm0
subsd  %xmm0,%xmm10
movsd  %xmm2,(%r10,%r12,8)
lea    0x1(%r12),%rax
cmp    %r9,%rax
jge    16e8 <lm_qrsolv+0x5c8>
mov    0xb8(%rsp),%rcx
sub    %rdx,%rcx
mov    0xc8(%rsp),%rdx
add    %rcx,%rdx
mov    0x80(%rsp),%r13
imul   %r13,%r12
movapd %xmm11,%xmm0
xorpd  0x9e4(%rip),%xmm0
mov    %r8,%rsi
cmp    $0x2,%rdx
jb     180c <lm_qrsolv+0x6ec>
mov    %rdx,%r11
lea    0x0(,%r8,8),%rdx
add    %rbp,%rdx
lea    (%rbx,%r12,1),%rsi
mov    %rdi,%r10
mov    0xb0(%rsp),%rdi
lea    (%rdi,%rsi,8),%rsi
add    $0xfffffffffffffff8,%rsi
mov    %r10,%rdi
cmp    %rsi,%rdx
jae    16a1 <lm_qrsolv+0x581>
mov    0x38(%rsp),%rdx
mov    0x20(%rsp),%rsi
add    %rsi,%rdx
sub    %rdx,%rbx
lea    0x0(,%r14,8),%rdx
add    %rbp,%rdx
lea    -0x10(%rdx,%rbx,8),%rdx
lea    (%r8,%r12,1),%rsi
mov    (%rsp),%rdi
lea    (%rdi,%rsi,8),%rdi
mov    %r8,%rsi
cmp    %rdx,%rdi
mov    %r10,%rdi
jb     180c <lm_qrsolv+0x6ec>
mov    0xc0(%rsp),%rdx
add    %rcx,%rdx
add    $0xfffffffffffffffe,%rdx
mov    %rdx,%r10
shr    %r10
add    $0x1,%r10
movapd %xmm11,%xmm3
unpcklpd %xmm11,%xmm3
movapd %xmm12,%xmm1
unpcklpd %xmm12,%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
cmp    $0x2,%rdx
jae    16fa <lm_qrsolv+0x5da>
xor    %edx,%edx
mov    0x10(%rsp),%rcx
jmp    17a6 <lm_qrsolv+0x686>
mov    0x80(%rsp),%r13
mov    0x30(%rsp),%rsi
jmp    13a9 <lm_qrsolv+0x289>
add    0x88(%rsp),%r15
shr    %r15
add    $0x1,%r15
and    $0xfffffffffffffffe,%r15
mov    0x30(%rsp),%rdx
add    %r12,%rdx
mov    (%rsp),%rcx
lea    (%rcx,%rdx,8),%rsi
xor    %edx,%edx
mov    0x10(%rsp),%rcx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movupd -0x10(%rsi,%rdx,8),%xmm4
movupd -0x10(%rcx,%rdx,8),%xmm5
movapd %xmm3,%xmm6
mulpd  %xmm5,%xmm6
movapd %xmm1,%xmm7
mulpd  %xmm4,%xmm7
addpd  %xmm6,%xmm7
mulpd  %xmm1,%xmm5
mulpd  %xmm2,%xmm4
addpd  %xmm5,%xmm4
movupd %xmm4,-0x10(%rcx,%rdx,8)
movupd %xmm7,-0x10(%rsi,%rdx,8)
movupd (%rsi,%rdx,8),%xmm4
movupd (%rcx,%rdx,8),%xmm5
movapd %xmm3,%xmm6
mulpd  %xmm5,%xmm6
movapd %xmm1,%xmm7
mulpd  %xmm4,%xmm7
addpd  %xmm6,%xmm7
mulpd  %xmm1,%xmm5
mulpd  %xmm2,%xmm4
addpd  %xmm5,%xmm4
movupd %xmm4,(%rcx,%rdx,8)
movupd %xmm7,(%rsi,%rdx,8)
add    $0x4,%rdx
add    $0xfffffffffffffffe,%r15
jne    1730 <lm_qrsolv+0x610>
mov    %r11,%rbx
mov    %r11,%rsi
and    $0xfffffffffffffffe,%rsi
test   $0x1,%r10b
je     17f5 <lm_qrsolv+0x6d5>
add    %r8,%rdx
lea    (%rdx,%r12,1),%r10
mov    (%rsp),%r14
movupd (%r14,%r10,8),%xmm4
movupd 0x0(%rbp,%rdx,8),%xmm5
mulpd  %xmm5,%xmm3
movapd %xmm1,%xmm6
mulpd  %xmm4,%xmm6
addpd  %xmm3,%xmm6
mulpd  %xmm5,%xmm1
mulpd  %xmm4,%xmm2
addpd  %xmm1,%xmm2
movupd %xmm2,0x0(%rbp,%rdx,8)
movupd %xmm6,(%r14,%r10,8)
cmp    %rsi,%rbx
jne    1809 <lm_qrsolv+0x6e9>
mov    0x120(%rsp),%r10
mov    0x30(%rsp),%rsi
jmp    1874 <lm_qrsolv+0x754>
add    %r8,%rsi
mov    (%rsp),%rcx
lea    (%rcx,%r12,8),%rcx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rcx,%rsi,8),%xmm1
movsd  0x0(%rbp,%rsi,8),%xmm2
movapd %xmm11,%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm12,%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm3,%xmm4
mulsd  %xmm12,%xmm2
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x0(%rbp,%rsi,8)
movsd  %xmm4,(%rcx,%rsi,8)
add    $0x1,%rsi
cmp    %r9,%rsi
jb     1820 <lm_qrsolv+0x700>
mov    0x120(%rsp),%r10
mov    0x30(%rsp),%rsi
mov    0x10(%rsp),%rcx
mov    0x20(%rsp),%rdx
mov    (%rsp),%r11
cmp    %r9,%rax
jne    13b7 <lm_qrsolv+0x297>
jmp    1250 <lm_qrsolv+0x130>
mov    0x8(%rsp),%ebx
test   %ebx,%ebx
jle    1b48 <lm_qrsolv+0xa28>
mov    %r11,%r8
mov    %r9,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,0x18(%rsp)
je     1917 <lm_qrsolv+0x7f7>
mov    %r9d,%r11d
and    $0xfffffffe,%r11d
xor    %esi,%esi
xorpd  %xmm0,%xmm0
mov    %ebx,%edx
jmp    18c9 <lm_qrsolv+0x7a9>
nopl   0x0(%rax)
add    $0x1,%rsi
cmp    %r11,%rsi
je     1911 <lm_qrsolv+0x7f1>
mov    %rsi,%rax
cmp    %ebx,%edx
mov    %eax,%edi
cmovne %edx,%edi
ucomisd 0x0(%rbp,%rsi,8),%xmm0
cmovne %edx,%edi
cmovp  %edx,%edi
cmp    %ebx,%edi
jge    18eb <lm_qrsolv+0x7cb>
movq   $0x0,(%r10,%rax,8)
lea    0x1(%rax),%rsi
cmp    %ebx,%edi
mov    %esi,%edx
cmovne %edi,%edx
ucomisd 0x8(%rbp,%rax,8),%xmm0
cmovne %edi,%edx
cmovp  %edi,%edx
cmp    %ebx,%edx
jge    18c0 <lm_qrsolv+0x7a0>
movq   $0x0,0x8(%r10,%rax,8)
jmp    18c0 <lm_qrsolv+0x7a0>
add    $0x2,%rax
jmp    191b <lm_qrsolv+0x7fb>
xor    %eax,%eax
mov    %ebx,%edx
mov    %edx,%esi
test   $0x1,%r9b
je     1946 <lm_qrsolv+0x826>
cmp    %ebx,%edx
mov    %eax,%esi
cmovne %edx,%esi
xorpd  %xmm0,%xmm0
ucomisd 0x0(%rbp,%rax,8),%xmm0
cmovne %edx,%esi
cmovp  %edx,%esi
cmp    %ebx,%esi
jge    1946 <lm_qrsolv+0x826>
movq   $0x0,(%r10,%rax,8)
test   %esi,%esi
jle    1a9c <lm_qrsolv+0x97c>
mov    %r13,%rbp
mov    %esi,%r13d
mov    %r13,%r15
neg    %r15
mov    0x120(%rsp),%rax
lea    (%rax,%r13,8),%rsi
lea    -0x1(%r13),%rax
imul   %rbp,%rax
lea    (%rax,%r13,1),%rdx
lea    (%r8,%rdx,8),%rdi
shl    $0x3,%rbp
mov    %rbp,%r9
xor    $0xfffffffffffffff8,%r9
lea    (%r8,%rax,8),%rax
add    $0x10,%rax
neg    %rbp
mov    %rbp,%r8
xor    %edx,%edx
mov    %r13,%r10
jmp    19da <lm_qrsolv+0x8ba>
cs nopw 0x0(%rax,%rax,1)
movsd  (%rbx,%r10,8),%xmm1
subsd  %xmm0,%xmm1
mov    0x118(%rsp),%rbp
divsd  0x0(%rbp,%r10,8),%xmm1
movsd  %xmm1,(%rbx,%r10,8)
add    $0x1,%edx
add    $0x1,%r15
add    $0xfffffffffffffff8,%rsi
add    %r9,%rdi
add    %r8,%rax
cmp    $0x1,%r11
jle    1a9c <lm_qrsolv+0x97c>
mov    %r10,%r11
add    $0xffffffffffffffff,%r10
xorpd  %xmm0,%xmm0
cmp    %r13,%r11
mov    0x120(%rsp),%rbx
jge    19a0 <lm_qrsolv+0x880>
lea    -0x1(%rdx),%r14d
test   $0x3,%dl
je     1a2b <lm_qrsolv+0x90b>
mov    %edx,%ebx
and    $0x3,%ebx
xorpd  %xmm0,%xmm0
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
movsd  (%rdi,%rbp,8),%xmm1
mulsd  (%rsi,%rbp,8),%xmm1
addsd  %xmm1,%xmm0
add    $0x1,%rbp
cmp    %ebp,%ebx
jne    1a10 <lm_qrsolv+0x8f0>
sub    %r15,%rbp
jmp    1a32 <lm_qrsolv+0x912>
xorpd  %xmm0,%xmm0
mov    %r11,%rbp
cmp    $0x3,%r14d
mov    0x120(%rsp),%rbx
jb     19a0 <lm_qrsolv+0x880>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  -0x10(%rax,%rbp,8),%xmm1
movsd  -0x8(%rax,%rbp,8),%xmm2
mulsd  (%rbx,%rbp,8),%xmm1
mulsd  0x8(%rbx,%rbp,8),%xmm2
addsd  %xmm0,%xmm1
movsd  (%rax,%rbp,8),%xmm3
mulsd  0x10(%rbx,%rbp,8),%xmm3
addsd  %xmm1,%xmm2
movsd  0x8(%rax,%rbp,8),%xmm0
mulsd  0x18(%rbx,%rbp,8),%xmm0
addsd  %xmm2,%xmm3
addsd  %xmm3,%xmm0
add    $0x4,%rbp
cmp    %ebp,%r13d
jne    1a50 <lm_qrsolv+0x930>
jmp    19a0 <lm_qrsolv+0x880>
cmpl   $0x0,0x8(%rsp)
mov    0x120(%rsp),%rdi
mov    0x28(%rsp),%rax
jle    1b48 <lm_qrsolv+0xa28>
mov    %eax,%ebp
and    $0x3,%ebp
cmpq   $0x3,0x18(%rsp)
jae    1ac5 <lm_qrsolv+0x9a5>
xor    %esi,%esi
jmp    1b1b <lm_qrsolv+0x9fb>
and    $0xfffffffc,%eax
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
movsd  (%rdi,%rsi,8),%xmm0
movslq (%rcx,%rsi,4),%rdx
movsd  %xmm0,(%r12,%rdx,8)
movsd  0x8(%rdi,%rsi,8),%xmm0
movslq 0x4(%rcx,%rsi,4),%rdx
movsd  %xmm0,(%r12,%rdx,8)
movsd  0x10(%rdi,%rsi,8),%xmm0
movslq 0x8(%rcx,%rsi,4),%rdx
movsd  %xmm0,(%r12,%rdx,8)
movsd  0x18(%rdi,%rsi,8),%xmm0
movslq 0xc(%rcx,%rsi,4),%rdx
movsd  %xmm0,(%r12,%rdx,8)
add    $0x4,%rsi
cmp    %rsi,%rax
jne    1ad0 <lm_qrsolv+0x9b0>
test   %rbp,%rbp
je     1b48 <lm_qrsolv+0xa28>
lea    (%rcx,%rsi,4),%rdx
lea    (%rdi,%rsi,8),%rcx
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
movsd  (%rcx,%rsi,8),%xmm0
movslq (%rdx,%rsi,4),%rdi
movsd  %xmm0,(%r12,%rdi,8)
add    $0x1,%rsi
cmp    %rsi,%rbp
jne    1b30 <lm_qrsolv+0xa10>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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