#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double vdot(double *, double *, int);
void qrsolve_hh(double *qrt, int qrt_stride, double *d, double *bbt,
                int bbt_stride, int n, int m, int l) {
  int i;
  int j;
  int k;
  for (k = 0; k < n; k++) {
    double *qrtk;
    double e;
    qrtk = qrt + k * qrt_stride;
    e = qrtk[k];
    for (j = 0; j < l; j++) {
      double *bbtj;
      double s;
      bbtj = bbt + j * bbt_stride;
      s = -vdot(qrtk + k, bbtj + k, m - k) / e;
      for (i = k; i < m; i++)
        bbtj[i] += s * qrtk[i];
    }
  }
  for (k = n; k-- > 0;) {
    double *qrtk;
    qrtk = qrt + k * qrt_stride;
    for (j = 0; j < l; j++) {
      double *bbtj;
      bbtj = bbt + j * bbt_stride;
      bbtj[k] /= d[k];
      for (i = 0; i < k; i++)
        bbtj[i] -= bbtj[k] * qrtk[i];
    }
  }
}


x86 assembly (clang, -O0):
<qrsolve_hh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    125b <qrsolve_hh+0x14b>
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0xc(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    1248 <qrsolve_hh+0x138>
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x24(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rdi
movslq -0x34(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x50(%rbp),%rsi
movslq -0x34(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    0x10(%rbp),%edx
sub    -0x34(%rbp),%edx
call   1030 <vdot@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    1235 <qrsolve_hh+0x125>
movsd  -0x58(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x50(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11ef <qrsolve_hh+0xdf>
jmp    123a <qrsolve_hh+0x12a>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    117a <qrsolve_hh+0x6a>
jmp    124d <qrsolve_hh+0x13d>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    113c <qrsolve_hh+0x2c>
mov    -0x28(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x34(%rbp)
cmp    $0x0,%eax
jle    1361 <qrsolve_hh+0x251>
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0xc(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    135c <qrsolve_hh+0x24c>
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x24(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x68(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1349 <qrsolve_hh+0x239>
mov    -0x68(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x68(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12e4 <qrsolve_hh+0x1d4>
jmp    134e <qrsolve_hh+0x23e>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1295 <qrsolve_hh+0x185>
jmp    1261 <qrsolve_hh+0x151>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qrsolve_hh>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
test   %r9d,%r9d
jle    1638 <qrsolve_hh+0x528>
mov    %rdx,0x70(%rsp)
movslq %r8d,%rax
movslq 0x130(%rsp),%rbp
movslq %esi,%rdx
mov    %r9,0x78(%rsp)
mov    %r9d,%r12d
mov    %rbp,0xd8(%rsp)
mov    %ebp,%r13d
lea    0x0(,%rdx,8),%rsi
mov    %rsi,0x10(%rsp)
mov    %rdx,0x8(%rsp)
lea    0x8(,%rdx,8),%rdx
mov    %rdx,0x38(%rsp)
mov    %r13,%rdx
neg    %rdx
mov    %rdx,0xc8(%rsp)
lea    0x30(%rcx),%rdx
mov    %rdx,0x30(%rsp)
mov    %rax,0x68(%rsp)
lea    0x0(,%rax,8),%rax
mov    %rax,0x60(%rsp)
lea    0x30(%rdi),%rax
lea    -0x4(%r13),%rdx
mov    %rdx,0x28(%rsp)
lea    0x8(%rcx),%rdx
mov    %rdx,0x80(%rsp)
xor    %r9d,%r9d
mov    %rdi,0x20(%rsp)
mov    %rdi,%r15
mov    %r12,0x88(%rsp)
jmp    1200 <qrsolve_hh+0xf0>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r9
addq   $0x8,0x30(%rsp)
mov    0x40(%rsp),%rax
add    0x38(%rsp),%rax
addq   $0xffffffffffffffff,0x28(%rsp)
add    0x10(%rsp),%rdi
mov    0x88(%rsp),%r12
cmp    %r12,%r9
je     153b <qrsolve_hh+0x42b>
mov    %rax,0x40(%rsp)
cmpl   $0x0,0x138(%rsp)
jle    11d0 <qrsolve_hh+0xc0>
mov    0x28(%rsp),%rax
shr    $0x2,%rax
add    $0x1,%rax
and    $0xfffffffffffffffe,%rax
mov    %rax,0x90(%rsp)
mov    %r13,%rbp
sub    %r9,%rbp
lea    -0x4(%rbp),%rax
mov    %rax,0xb0(%rsp)
shr    $0x2,%rax
add    $0x1,%rax
mov    %rax,0xa8(%rsp)
mov    0x38(%rsp),%rax
imul   %r9,%rax
mov    0x20(%rsp),%rsi
add    %rsi,%rax
mov    %rax,0xb8(%rsp)
mov    %r9,%rax
imul   0x8(%rsp),%rax
lea    (%rax,%r13,1),%rdx
lea    (%rsi,%rdx,8),%rdx
mov    %rdx,0xc0(%rsp)
lea    (%rsi,%rax,8),%rax
lea    (%rax,%r9,8),%rdx
mov    %rdx,0xe0(%rsp)
mov    %rax,0x48(%rsp)
movsd  (%rax,%r9,8),%xmm0
movsd  %xmm0,0xd0(%rsp)
mov    0x130(%rsp),%eax
sub    %r9d,%eax
mov    %eax,0x1c(%rsp)
mov    %rbp,0x50(%rsp)
and    $0xfffffffffffffffc,%rbp
mov    %rbp,0xa0(%rsp)
lea    (%r9,%rbp,1),%rax
mov    %rax,0x98(%rsp)
mov    0x80(%rsp),%r14
mov    0x30(%rsp),%rbx
xor    %r12d,%r12d
mov    %rdi,0xe8(%rsp)
jmp    1317 <qrsolve_hh+0x207>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0xf0(%rsp),%r12
add    $0x1,%r12
mov    0x60(%rsp),%rax
add    %rax,%rbx
add    %rax,%r14
mov    0x138(%rsp),%eax
cmp    %rax,%r12
je     11d0 <qrsolve_hh+0xc0>
mov    %r12,0xf0(%rsp)
imul   0x68(%rsp),%r12
lea    (%rcx,%r12,8),%rax
mov    %rax,0x58(%rsp)
lea    (%rax,%r9,8),%rsi
mov    0xe0(%rsp),%rdi
mov    0x1c(%rsp),%edx
mov    %rcx,%rbp
mov    %r9,%r15
call   1030 <vdot@plt>
mov    0xe8(%rsp),%rdi
mov    %r15,%r9
mov    %rbp,%rcx
cmp    0xd8(%rsp),%r15
jge    12f0 <qrsolve_hh+0x1e0>
xorpd  0xc97(%rip),%xmm0
divsd  0xd0(%rsp),%xmm0
mov    %r9,%rax
cmpq   $0x4,0x50(%rsp)
jb     14c0 <qrsolve_hh+0x3b0>
lea    (%r9,%r12,1),%rax
lea    (%rcx,%rax,8),%rax
cmp    0xc0(%rsp),%rax
jae    13ab <qrsolve_hh+0x29b>
add    %r13,%r12
lea    (%rcx,%r12,8),%rdx
mov    %r9,%rax
cmp    %rdx,0xb8(%rsp)
jb     14c0 <qrsolve_hh+0x3b0>
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
cmpq   $0x4,0xb0(%rsp)
jae    13c5 <qrsolve_hh+0x2b5>
xor    %eax,%eax
jmp    144f <qrsolve_hh+0x33f>
mov    0x90(%rsp),%rdx
xor    %eax,%eax
mov    0x40(%rsp),%rsi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movupd -0x30(%rsi,%rax,8),%xmm2
movupd -0x20(%rsi,%rax,8),%xmm3
mulpd  %xmm1,%xmm2
movupd -0x30(%rbx,%rax,8),%xmm4
addpd  %xmm2,%xmm4
movupd -0x20(%rbx,%rax,8),%xmm2
movupd -0x10(%rbx,%rax,8),%xmm5
movupd (%rbx,%rax,8),%xmm6
mulpd  %xmm1,%xmm3
addpd  %xmm2,%xmm3
movupd %xmm4,-0x30(%rbx,%rax,8)
movupd %xmm3,-0x20(%rbx,%rax,8)
movupd -0x10(%rsi,%rax,8),%xmm2
movupd (%rsi,%rax,8),%xmm3
mulpd  %xmm1,%xmm2
addpd  %xmm5,%xmm2
mulpd  %xmm1,%xmm3
addpd  %xmm6,%xmm3
movupd %xmm2,-0x10(%rbx,%rax,8)
movupd %xmm3,(%rbx,%rax,8)
add    $0x8,%rax
add    $0xfffffffffffffffe,%rdx
jne    13e0 <qrsolve_hh+0x2d0>
testb  $0x1,0xa8(%rsp)
01
je     1497 <qrsolve_hh+0x387>
add    %r9,%rax
mov    0x48(%rsp),%rdx
movupd (%rdx,%rax,8),%xmm2
movupd 0x10(%rdx,%rax,8),%xmm3
mov    0x58(%rsp),%rdx
movupd (%rdx,%rax,8),%xmm4
movupd 0x10(%rdx,%rax,8),%xmm5
mulpd  %xmm1,%xmm2
addpd  %xmm4,%xmm2
mulpd  %xmm1,%xmm3
addpd  %xmm5,%xmm3
movupd %xmm2,(%rdx,%rax,8)
movupd %xmm3,0x10(%rdx,%rax,8)
mov    0x98(%rsp),%rax
mov    0xa0(%rsp),%rdx
cmp    %rdx,0x50(%rsp)
je     12f0 <qrsolve_hh+0x1e0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r13d,%edx
sub    %eax,%edx
mov    %rax,%rsi
test   $0x1,%dl
je     14ee <qrsolve_hh+0x3de>
mov    0x48(%rsp),%rdx
movsd  (%rdx,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
mov    0x58(%rsp),%rdx
addsd  (%rdx,%rax,8),%xmm1
movsd  %xmm1,(%rdx,%rax,8)
lea    0x1(%rax),%rsi
not    %rax
cmp    0xc8(%rsp),%rax
je     12f0 <qrsolve_hh+0x1e0>
nop
movsd  (%rdi,%rsi,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  -0x8(%r14,%rsi,8),%xmm1
movsd  %xmm1,-0x8(%r14,%rsi,8)
movsd  0x8(%rdi,%rsi,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%r14,%rsi,8),%xmm1
movsd  %xmm1,(%r14,%rsi,8)
add    $0x2,%rsi
cmp    %rsi,%r13
jne    1500 <qrsolve_hh+0x3f0>
jmp    12f0 <qrsolve_hh+0x1e0>
mov    0x78(%rsp),%r10
test   %r10d,%r10d
mov    0x70(%rsp),%r11
mov    0x20(%rsp),%r14
jle    1638 <qrsolve_hh+0x528>
add    $0xffffffff,%r10d
lea    -0x1(%r12),%rax
imul   0x8(%rsp),%rax
lea    (%r14,%rax,8),%rax
negq   0x10(%rsp)
jmp    1583 <qrsolve_hh+0x473>
nopl   (%rax)
add    $0xffffffffffffffff,%r10
add    0x10(%rsp),%rax
cmp    $0x2,%r9
jl     1638 <qrsolve_hh+0x528>
mov    %r12,%r9
add    $0xffffffffffffffff,%r12
cmpl   $0x0,0x138(%rsp)
jle    1570 <qrsolve_hh+0x460>
mov    %r12,%r8
imul   0x8(%rsp),%r8
mov    %rcx,%rsi
xor    %edx,%edx
jmp    15c5 <qrsolve_hh+0x4b5>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rdx
add    0x60(%rsp),%rsi
mov    0x138(%rsp),%edi
cmp    %rdi,%rdx
je     1570 <qrsolve_hh+0x460>
mov    %rdx,%rdi
imul   0x68(%rsp),%rdi
lea    (%rcx,%rdi,8),%rbp
movsd  0x0(%rbp,%r12,8),%xmm0
divsd  (%r11,%r12,8),%xmm0
movsd  %xmm0,0x0(%rbp,%r12,8)
cmp    $0x2,%r9
jb     15b0 <qrsolve_hh+0x4a0>
mulsd  (%r14,%r8,8),%xmm0
movsd  0x0(%rbp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x0(%rbp)
cmp    $0x1,%r10
je     15b0 <qrsolve_hh+0x4a0>
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
movsd  0x0(%rbp,%r12,8),%xmm0
movsd  (%rsi,%rbx,8),%xmm1
mulsd  (%rax,%rbx,8),%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r10
jne    1610 <qrsolve_hh+0x500>
jmp    15b0 <qrsolve_hh+0x4a0>
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @qrsolve_hh(double* %0, i32 %1, double* nocapture %2, double* %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = bitcast double* %0 to i8*
%10 = icmp sgt i32 %5, 0
br i1 %10, label %11, label %222
11: ; preds = %8
%12 = icmp sgt i32 %7, 0
%13 = sext i32 %4 to i64
%14 = sext i32 %6 to i64
%15 = sext i32 %1 to i64
%16 = zext i32 %5 to i64
%17 = zext i32 %7 to i64
%18 = zext i32 %6 to i64
%19 = shl nsw i64 %15, 3
%20 = add nsw i64 %19, 8
%21 = sub nsw i64 0, %18
br label %31
22: ; preds = %179
br i1 %10, label %23, label %222
23: ; preds = %22
%24 = icmp sgt i32 %7, 0
%25 = add nsw i32 %5, -1
%26 = sext i32 %4 to i64
%27 = zext i32 %25 to i64
%28 = zext i32 %5 to i64
%29 = sext i32 %1 to i64
%30 = zext i32 %7 to i64
br label %185
31: ; preds = %11, %179
%32 = phi i64 [ 0, %11 ], [ %180, %179 ]
%33 = sub nsw i64 %18, %32
%34 = add i64 %33, -4
%35 = lshr i64 %34, 2
%36 = add nuw nsw i64 %35, 1
%37 = sub nsw i64 %18, %32
%38 = mul i64 %20, %32
%39 = getelementptr i8, i8* %9, i64 %38
%40 = mul i64 %32, %15
%41 = add i64 %40, %18
%42 = getelementptr double, double* %0, i64 %41
%43 = mul nsw i64 %32, %15
%44 = getelementptr inbounds double, double* %0, i64 %43
%45 = getelementptr inbounds double, double* %44, i64 %32
%46 = load double, double* %45
br i1 %12, label %47, label %179
47: ; preds = %31
%48 = icmp slt i64 %32, %14
%49 = trunc i64 %32 to i32
%50 = sub i32 %6, %49
%51 = icmp ult i64 %37, 4
%52 = and i64 %37, -4
%53 = add i64 %32, %52
%54 = and i64 %36, 1
%55 = icmp ult i64 %34, 4
%56 = and i64 %36, 9223372036854775806
%57 = icmp eq i64 %54, 0
%58 = icmp eq i64 %37, %52
br label %59
59: ; preds = %47, %176
%60 = phi i64 [ 0, %47 ], [ %177, %176 ]
%61 = mul i64 %60, %13
%62 = add i64 %32, %61
%63 = getelementptr double, double* %3, i64 %62
%64 = add i64 %61, %18
%65 = getelementptr double, double* %3, i64 %64
%66 = bitcast double* %65 to i8*
%67 = mul nsw i64 %60, %13
%68 = getelementptr inbounds double, double* %3, i64 %67
%69 = getelementptr inbounds double, double* %68, i64 %32
%70 = tail call double @vdot(double* %45, double* %69, i32 %50)
%71 = fneg double %70
%72 = fdiv double %71, %46
br i1 %48, label %73, label %176
73: ; preds = %59
br i1 %51, label %145, label %74
74: ; preds = %73
%75 = icmp ult double* %63, %42
%76 = icmp ult i8* %39, %66
%77 = and i1 %75, %76
br i1 %77, label %145, label %78
78: ; preds = %74
%79 = insertelement <2 x double> poison, double %72, i64 0
%80 = shufflevector <2 x double> %79, <2 x double> poison, <2 x i32> zeroinitializer
%81 = insertelement <2 x double> poison, double %72, i64 0
%82 = shufflevector <2 x double> %81, <2 x double> poison, <2 x i32> zeroinitializer
br i1 %55, label %124, label %83
83: ; preds = %78, %83
%84 = phi i64 [ %121, %83 ], [ 0, %78 ]
%85 = phi i64 [ %122, %83 ], [ 0, %78 ]
%86 = add i64 %32, %84
%87 = getelementptr inbounds double, double* %44, i64 %86
%88 = bitcast double* %87 to <2 x double>*
%89 = load <2 x double>, <2 x double>* %88
%90 = getelementptr inbounds double, double* %87, i64 2
%91 = bitcast double* %90 to <2 x double>*
%92 = load <2 x double>, <2 x double>* %91
%93 = getelementptr inbounds double, double* %68, i64 %86
%94 = bitcast double* %93 to <2 x double>*
%95 = load <2 x double>, <2 x double>* %94
%96 = getelementptr inbounds double, double* %93, i64 2
%97 = bitcast double* %96 to <2 x double>*
%98 = load <2 x double>, <2 x double>* %97
%99 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %80, <2 x double> %89, <2 x double> %95)
%100 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %82, <2 x double> %92, <2 x double> %98)
%101 = bitcast double* %93 to <2 x double>*
store <2 x double> %99, <2 x double>* %101
%102 = bitcast double* %96 to <2 x double>*
store <2 x double> %100, <2 x double>* %102
%103 = or i64 %84, 4
%104 = add i64 %32, %103
%105 = getelementptr inbounds double, double* %44, i64 %104
%106 = bitcast double* %105 to <2 x double>*
%107 = load <2 x double>, <2 x double>* %106
%108 = getelementptr inbounds double, double* %105, i64 2
%109 = bitcast double* %108 to <2 x double>*
%110 = load <2 x double>, <2 x double>* %109
%111 = getelementptr inbounds double, double* %68, i64 %104
%112 = bitcast double* %111 to <2 x double>*
%113 = load <2 x double>, <2 x double>* %112
%114 = getelementptr inbounds double, double* %111, i64 2
%115 = bitcast double* %114 to <2 x double>*
%116 = load <2 x double>, <2 x double>* %115
%117 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %80, <2 x double> %107, <2 x double> %113)
%118 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %82, <2 x double> %110, <2 x double> %116)
%119 = bitcast double* %111 to <2 x double>*
store <2 x double> %117, <2 x double>* %119
%120 = bitcast double* %114 to <2 x double>*
store <2 x double> %118, <2 x double>* %120
%121 = add nuw i64 %84, 8
%122 = add i64 %85, 2
%123 = icmp eq i64 %122, %56
br i1 %123, label %124, label %83
124: ; preds = %83, %78
%125 = phi i64 [ 0, %78 ], [ %121, %83 ]
br i1 %57, label %144, label %126
126: ; preds = %124
%127 = add i64 %32, %125
%128 = getelementptr inbounds double, double* %44, i64 %127
%129 = bitcast double* %128 to <2 x double>*
%130 = load <2 x double>, <2 x double>* %129
%131 = getelementptr inbounds double, double* %128, i64 2
%132 = bitcast double* %131 to <2 x double>*
%133 = load <2 x double>, <2 x double>* %132
%134 = getelementptr inbounds double, double* %68, i64 %127
%135 = bitcast double* %134 to <2 x double>*
%136 = load <2 x double>, <2 x double>* %135
%137 = getelementptr inbounds double, double* %134, i64 2
%138 = bitcast double* %137 to <2 x double>*
%139 = load <2 x double>, <2 x double>* %138
%140 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %80, <2 x double> %130, <2 x double> %136)
%141 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %82, <2 x double> %133, <2 x double> %139)
%142 = bitcast double* %134 to <2 x double>*
store <2 x double> %140, <2 x double>* %142
%143 = bitcast double* %137 to <2 x double>*
store <2 x double> %141, <2 x double>* %143
br label %144
144: ; preds = %124, %126
br i1 %58, label %176, label %145
145: ; preds = %74, %73, %144
%146 = phi i64 [ %32, %74 ], [ %32, %73 ], [ %53, %144 ]
%147 = sub i64 %18, %146
%148 = xor i64 %146, -1
%149 = and i64 %147, 1
%150 = icmp eq i64 %149, 0
br i1 %150, label %158, label %151
151: ; preds = %145
%152 = getelementptr inbounds double, double* %44, i64 %146
%153 = load double, double* %152
%154 = getelementptr inbounds double, double* %68, i64 %146
%155 = load double, double* %154
%156 = tail call double @llvm.fmuladd.f64(double %72, double %153, double %155)
store double %156, double* %154
%157 = add nuw nsw i64 %146, 1
br label %158
158: ; preds = %151, %145
%159 = phi i64 [ %146, %145 ], [ %157, %151 ]
%160 = icmp eq i64 %148, %21
br i1 %160, label %176, label %161
161: ; preds = %158, %161
%162 = phi i64 [ %174, %161 ], [ %159, %158 ]
%163 = getelementptr inbounds double, double* %44, i64 %162
%164 = load double, double* %163
%165 = getelementptr inbounds double, double* %68, i64 %162
%166 = load double, double* %165
%167 = tail call double @llvm.fmuladd.f64(double %72, double %164, double %166)
store double %167, double* %165
%168 = add nuw nsw i64 %162, 1
%169 = getelementptr inbounds double, double* %44, i64 %168
%170 = load double, double* %169
%171 = getelementptr inbounds double, double* %68, i64 %168
%172 = load double, double* %171
%173 = tail call double @llvm.fmuladd.f64(double %72, double %170, double %172)
store double %173, double* %171
%174 = add nuw nsw i64 %162, 2
%175 = icmp eq i64 %174, %18
br i1 %175, label %176, label %161
176: ; preds = %158, %161, %144, %59
%177 = add nuw nsw i64 %60, 1
%178 = icmp eq i64 %177, %17
br i1 %178, label %179, label %59
179: ; preds = %176, %31
%180 = add nuw nsw i64 %32, 1
%181 = icmp eq i64 %180, %16
br i1 %181, label %22, label %31
182: ; preds = %219, %185
%183 = icmp sgt i64 %186, 1
%184 = add nsw i64 %187, -1
br i1 %183, label %185, label %222
185: ; preds = %23, %182
%186 = phi i64 [ %28, %23 ], [ %188, %182 ]
%187 = phi i64 [ %27, %23 ], [ %184, %182 ]
%188 = add nsw i64 %186, -1
%189 = mul nsw i64 %188, %29
%190 = getelementptr inbounds double, double* %0, i64 %189
br i1 %24, label %191, label %182
191: ; preds = %185
%192 = getelementptr inbounds double, double* %2, i64 %188
%193 = icmp ugt i64 %186, 1
%194 = icmp eq i64 %187, 1
br label %195
195: ; preds = %191, %219
%196 = phi i64 [ 0, %191 ], [ %220, %219 ]
%197 = mul nsw i64 %196, %26
%198 = getelementptr inbounds double, double* %3, i64 %197
%199 = load double, double* %192
%200 = getelementptr inbounds double, double* %198, i64 %188
%201 = load double, double* %200
%202 = fdiv double %201, %199
store double %202, double* %200
br i1 %193, label %203, label %219
203: ; preds = %195
%204 = load double, double* %190
%205 = load double, double* %198
%206 = fneg double %202
%207 = tail call double @llvm.fmuladd.f64(double %206, double %204, double %205)
store double %207, double* %198
br i1 %194, label %219, label %208
208: ; preds = %203, %208
%209 = phi i64 [ %217, %208 ], [ 1, %203 ]
%210 = load double, double* %200
%211 = getelementptr inbounds double, double* %190, i64 %209
%212 = load double, double* %211
%213 = getelementptr inbounds double, double* %198, i64 %209
%214 = load double, double* %213
%215 = fneg double %210
%216 = tail call double @llvm.fmuladd.f64(double %215, double %212, double %214)
store double %216, double* %213
%217 = add nuw nsw i64 %209, 1
%218 = icmp eq i64 %217, %187
br i1 %218, label %219, label %208
219: ; preds = %208, %203, %195
%220 = add nuw nsw i64 %196, 1
%221 = icmp eq i64 %220, %30
br i1 %221, label %182, label %195
222: ; preds = %182, %8, %22
ret void
}