void ldl_mprove(double **A, int n, double *d, double *b, double *x,
                double *rms_resid, int *ok) {
  double sdp;
  double *resid, rms_resid_new = 0, *dvector();
  int j, i, pd;
  void ldl_dcmp(), free_dvector();
  resid = dvector(1, n);
  for (i = 1; i <= n; i++) {
    sdp = b[i];
    for (j = 1; j <= n; j++) {
      if (i <= j)
        sdp -= A[i][j] * x[j];
      else
        sdp -= A[j][i] * x[j];
    }
    resid[i] = sdp;
  }
  ldl_dcmp(A, n, d, resid, resid, 0, 1, &pd);
  for (i = 1; i <= n; i++)
    rms_resid_new += resid[i] * resid[i];
  rms_resid_new = sqrt(rms_resid_new / (double)n);
  *ok = 0;
  if (rms_resid_new / *rms_resid < 0.90) {
    for (i = 1; i <= n; i++)
      x[i] += resid[i];
    *rms_resid = rms_resid_new;
    *ok = 1;
  }
  free_dvector(resid, 1, n);
  return;
}


x86 assembly (clang, -O0):
<ldl_mprove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <dvector@plt>
mov    %rax,-0x40(%rbp)
movl   $0x1,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1290 <ldl_mprove+0x150>
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1270 <ldl_mprove+0x130>
mov    -0x50(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jg     1212 <ldl_mprove+0xd2>
mov    -0x8(%rbp),%rax
movslq -0x50(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x38(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    125d <ldl_mprove+0x11d>
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x38(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1262 <ldl_mprove+0x122>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11aa <ldl_mprove+0x6a>
movsd  -0x38(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1185 <ldl_mprove+0x45>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    -0x40(%rbp),%r8
xor    %r9d,%r9d
lea    -0x54(%rbp),%rax
movl   $0x1,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1030 <ldl_dcmp@plt>
movl   $0x1,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     130a <ldl_mprove+0x1ca>
mov    -0x40(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    12c4 <ldl_mprove+0x184>
movsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
mov    0x10(%rbp),%rax
movl   $0x0,(%rax)
movsd  -0x48(%rbp),%xmm1
mov    -0x30(%rbp),%rax
divsd  (%rax),%xmm1
movsd  0xcbf(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    13a2 <ldl_mprove+0x262>
movl   $0x1,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     138b <ldl_mprove+0x24b>
mov    -0x40(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1352 <ldl_mprove+0x212>
movsd  -0x48(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x40(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
mov    $0x0,%al
call   1050 <free_dvector@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldl_mprove>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r12
mov    %r8,%r15
mov    %rcx,%r14
mov    %rdx,0x10(%rsp)
mov    %esi,%ebx
mov    %rdi,%rbp
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <dvector@plt>
mov    %rax,%r13
test   %ebx,%ebx
jle    12c2 <ldl_mprove+0x182>
mov    %r12,0x8(%rsp)
mov    %ebx,(%rsp)
mov    %ebx,%r12d
lea    0x1(%r12),%r8
lea    -0x1(%r12),%r9
mov    %r12d,%ecx
and    $0xfffffffe,%ecx
mov    $0x1,%ebx
mov    0x10(%rsp),%rdx
jmp    11b4 <ldl_mprove+0x74>
nop
movsd  %xmm0,0x0(%r13,%rbx,8)
add    $0x1,%rbx
cmp    %r8,%rbx
je     1279 <ldl_mprove+0x139>
movsd  (%r14,%rbx,8),%xmm0
test   %r9,%r9
je     1240 <ldl_mprove+0x100>
mov    $0x2,%esi
nopl   0x0(%rax,%rax,1)
mov    %rsi,%rdi
add    $0xffffffffffffffff,%rsi
cmp    %rsi,%rbx
mov    %rbx,%rax
cmova  %rsi,%rax
cmova  %rbx,%rsi
mov    0x0(%rbp,%rax,8),%rax
movsd  (%rax,%rsi,8),%xmm1
mulsd  -0x8(%r15,%rdi,8),%xmm1
cmp    %rdi,%rbx
mov    %rbx,%rax
cmova  %rdi,%rax
mov    %rdi,%rsi
cmova  %rbx,%rsi
mov    0x0(%rbp,%rax,8),%rax
movsd  (%rax,%rsi,8),%xmm2
mulsd  (%r15,%rdi,8),%xmm2
subsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
lea    0x2(%rdi),%rsi
cmp    %rcx,%rdi
jne    11d0 <ldl_mprove+0x90>
add    $0xffffffffffffffff,%rsi
test   $0x1,%r12b
je     11a0 <ldl_mprove+0x60>
jmp    124f <ldl_mprove+0x10f>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%esi
test   $0x1,%r12b
je     11a0 <ldl_mprove+0x60>
cmp    %rsi,%rbx
mov    %rbx,%rax
cmova  %rsi,%rax
mov    %rsi,%rdi
cmova  %rbx,%rdi
mov    0x0(%rbp,%rax,8),%rax
movsd  (%rax,%rdi,8),%xmm1
mulsd  (%r15,%rsi,8),%xmm1
subsd  %xmm1,%xmm0
jmp    11a0 <ldl_mprove+0x60>
mov    %r9,%rbx
lea    0x4(%rsp),%r10
mov    %rbp,%rdi
mov    (%rsp),%ebp
mov    %ebp,%esi
mov    %r13,%rcx
mov    %r13,%r8
xor    %r9d,%r9d
xor    %eax,%eax
push   %r10
push   $0x1
call   1030 <ldl_dcmp@plt>
add    $0x10,%rsp
test   %ebp,%ebp
jle    12f2 <ldl_mprove+0x1b2>
mov    %r12d,%eax
and    $0x3,%eax
cmp    $0x3,%rbx
jae    1303 <ldl_mprove+0x1c3>
xorpd  %xmm0,%xmm0
mov    $0x1,%ecx
mov    (%rsp),%ebx
jmp    1359 <ldl_mprove+0x219>
lea    0x4(%rsp),%r10
mov    %rbp,%rdi
mov    %ebx,%esi
mov    0x10(%rsp),%rdx
mov    %r13,%rcx
mov    %r13,%r8
xor    %r9d,%r9d
xor    %eax,%eax
push   %r10
push   $0x1
call   1030 <ldl_dcmp@plt>
add    $0x10,%rsp
xorpd  %xmm0,%xmm0
jmp    1386 <ldl_mprove+0x246>
xorpd  %xmm0,%xmm0
mov    (%rsp),%ebx
mov    0x8(%rsp),%r12
jmp    1386 <ldl_mprove+0x246>
and    $0xfffffffc,%r12d
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
mov    (%rsp),%ebx
movsd  0x8(%r13,%rcx,8),%xmm1
movsd  0x10(%r13,%rcx,8),%xmm2
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
movsd  0x18(%r13,%rcx,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0x20(%r13,%rcx,8),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
add    $0x4,%rcx
cmp    %rcx,%r12
jne    1310 <ldl_mprove+0x1d0>
add    $0x1,%rcx
test   %rax,%rax
mov    0x8(%rsp),%r12
je     1386 <ldl_mprove+0x246>
lea    0x0(,%rcx,8),%rcx
add    %r13,%rcx
xor    %edx,%edx
movsd  (%rcx,%rdx,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1370 <ldl_mprove+0x230>
mov    0x50(%rsp),%r14
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     13a6 <ldl_mprove+0x266>
sqrtsd %xmm0,%xmm0
jmp    13ab <ldl_mprove+0x26b>
call   1060 <sqrt@plt>
movl   $0x0,(%r14)
movapd %xmm0,%xmm1
divsd  (%r12),%xmm1
movsd  0xc3c(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    15a8 <ldl_mprove+0x468>
test   %ebx,%ebx
jle    159b <ldl_mprove+0x45b>
mov    %ebx,%edx
lea    0x1(%rdx),%rax
mov    $0x1,%ecx
cmp    $0x4,%ebx
jb     14ef <ldl_mprove+0x3af>
lea    0x8(%r15),%rsi
lea    0x0(,%rax,8),%rdi
add    %r13,%rdi
cmp    %rdi,%rsi
jae    1412 <ldl_mprove+0x2d2>
lea    (%r15,%rax,8),%rsi
mov    %r13,%rdi
add    $0x8,%rdi
cmp    %rsi,%rdi
jb     14ef <ldl_mprove+0x3af>
mov    %edx,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rsi
mov    %rsi,%rbp
shr    $0x2,%rbp
add    $0x1,%rbp
test   %rsi,%rsi
je     15c8 <ldl_mprove+0x488>
mov    %rbp,%rdi
and    $0xfffffffffffffffe,%rdi
mov    $0x1,%esi
nopl   0x0(%rax,%rax,1)
movupd 0x0(%r13,%rsi,8),%xmm1
movupd 0x10(%r13,%rsi,8),%xmm2
movupd (%r15,%rsi,8),%xmm3
addpd  %xmm1,%xmm3
movupd 0x10(%r15,%rsi,8),%xmm1
addpd  %xmm2,%xmm1
movupd 0x20(%r15,%rsi,8),%xmm2
movupd 0x30(%r15,%rsi,8),%xmm4
movupd %xmm3,(%r15,%rsi,8)
movupd %xmm1,0x10(%r15,%rsi,8)
movupd 0x20(%r13,%rsi,8),%xmm1
addpd  %xmm2,%xmm1
movupd 0x30(%r13,%rsi,8),%xmm2
addpd  %xmm4,%xmm2
movupd %xmm1,0x20(%r15,%rsi,8)
movupd %xmm2,0x30(%r15,%rsi,8)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1440 <ldl_mprove+0x300>
test   $0x1,%bpl
je     14e2 <ldl_mprove+0x3a2>
movupd 0x0(%r13,%rsi,8),%xmm1
movupd 0x10(%r13,%rsi,8),%xmm2
movupd (%r15,%rsi,8),%xmm3
addpd  %xmm1,%xmm3
movupd 0x10(%r15,%rsi,8),%xmm1
addpd  %xmm2,%xmm1
movupd %xmm3,(%r15,%rsi,8)
movupd %xmm1,0x10(%r15,%rsi,8)
cmp    %rcx,%rdx
je     159b <ldl_mprove+0x45b>
or     $0x1,%rcx
mov    %eax,%esi
sub    %ecx,%esi
mov    %rcx,%rdx
not    %rdx
add    %rax,%rdx
and    $0x3,%rsi
je     152d <ldl_mprove+0x3ed>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  0x0(%r13,%rcx,8),%xmm1
addsd  (%r15,%rcx,8),%xmm1
movsd  %xmm1,(%r15,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    1510 <ldl_mprove+0x3d0>
cmp    $0x3,%rdx
jb     159b <ldl_mprove+0x45b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  0x0(%r13,%rcx,8),%xmm1
addsd  (%r15,%rcx,8),%xmm1
movsd  %xmm1,(%r15,%rcx,8)
movsd  0x8(%r13,%rcx,8),%xmm1
addsd  0x8(%r15,%rcx,8),%xmm1
movsd  %xmm1,0x8(%r15,%rcx,8)
movsd  0x10(%r13,%rcx,8),%xmm1
addsd  0x10(%r15,%rcx,8),%xmm1
movsd  %xmm1,0x10(%r15,%rcx,8)
movsd  0x18(%r13,%rcx,8),%xmm1
addsd  0x18(%r15,%rcx,8),%xmm1
movsd  %xmm1,0x18(%r15,%rcx,8)
add    $0x4,%rcx
cmp    %rcx,%rax
jne    1540 <ldl_mprove+0x400>
movsd  %xmm0,(%r12)
movl   $0x1,(%r14)
mov    %r13,%rdi
mov    $0x1,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <free_dvector@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%esi
test   $0x1,%bpl
jne    14b2 <ldl_mprove+0x372>
jmp    14e2 <ldl_mprove+0x3a2>

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

LLVM IR (-O2):
define void @ldl_mprove(double** %0, i32 %1, double* %2, double* nocapture %3, double* nocapture %4, double* nocapture %5, i32* nocapture writeonly %6) {
%8 = alloca i32
%9 = bitcast i32* %8 to i8*
%10 = tail call double* (i32, i32, ...) bitcast (double* (...)* @dvector to double* (i32, i32, ...)*)(i32 1, i32 %1)
%11 = icmp slt i32 %1, 1
br i1 %11, label %12, label %13
12: ; preds = %7
br label %120
13: ; preds = %7
%14 = add nuw i32 %1, 1
%15 = zext i32 %14 to i64
%16 = add nsw i64 %15, -1
%17 = add nsw i64 %15, -2
%18 = and i64 %16, 1
%19 = icmp eq i64 %17, 0
%20 = and i64 %16, -2
%21 = icmp eq i64 %18, 0
br label %22
22: ; preds = %72, %13
%23 = phi i64 [ 1, %13 ], [ %75, %72 ]
%24 = getelementptr inbounds double, double* %3, i64 %23
%25 = load double, double* %24
br i1 %19, label %56, label %26
26: ; preds = %22, %26
%27 = phi i64 [ %53, %26 ], [ 1, %22 ]
%28 = phi double [ %52, %26 ], [ %25, %22 ]
%29 = phi i64 [ %54, %26 ], [ 0, %22 ]
%30 = icmp ugt i64 %23, %27
%31 = select i1 %30, i64 %27, i64 %23
%32 = getelementptr inbounds double*, double** %0, i64 %31
%33 = select i1 %30, i64 %23, i64 %27
%34 = load double*, double** %32
%35 = getelementptr inbounds double, double* %34, i64 %33
%36 = load double, double* %35
%37 = getelementptr inbounds double, double* %4, i64 %27
%38 = load double, double* %37
%39 = fneg double %36
%40 = tail call double @llvm.fmuladd.f64(double %39, double %38, double %28)
%41 = add nuw nsw i64 %27, 1
%42 = icmp ugt i64 %23, %41
%43 = select i1 %42, i64 %41, i64 %23
%44 = getelementptr inbounds double*, double** %0, i64 %43
%45 = select i1 %42, i64 %23, i64 %41
%46 = load double*, double** %44
%47 = getelementptr inbounds double, double* %46, i64 %45
%48 = load double, double* %47
%49 = getelementptr inbounds double, double* %4, i64 %41
%50 = load double, double* %49
%51 = fneg double %48
%52 = tail call double @llvm.fmuladd.f64(double %51, double %50, double %40)
%53 = add nuw nsw i64 %27, 2
%54 = add i64 %29, 2
%55 = icmp eq i64 %54, %20
br i1 %55, label %56, label %26
56: ; preds = %26, %22
%57 = phi double [ undef, %22 ], [ %52, %26 ]
%58 = phi i64 [ 1, %22 ], [ %53, %26 ]
%59 = phi double [ %25, %22 ], [ %52, %26 ]
br i1 %21, label %72, label %60
60: ; preds = %56
%61 = icmp ugt i64 %23, %58
%62 = select i1 %61, i64 %58, i64 %23
%63 = getelementptr inbounds double*, double** %0, i64 %62
%64 = select i1 %61, i64 %23, i64 %58
%65 = load double*, double** %63
%66 = getelementptr inbounds double, double* %65, i64 %64
%67 = load double, double* %66
%68 = getelementptr inbounds double, double* %4, i64 %58
%69 = load double, double* %68
%70 = fneg double %67
%71 = tail call double @llvm.fmuladd.f64(double %70, double %69, double %59)
br label %72
72: ; preds = %56, %60
%73 = phi double [ %57, %56 ], [ %71, %60 ]
%74 = getelementptr inbounds double, double* %10, i64 %23
store double %73, double* %74
%75 = add nuw nsw i64 %23, 1
%76 = icmp eq i64 %75, %15
br i1 %76, label %77, label %22
77: ; preds = %72
br i1 %11, label %120, label %78
78: ; preds = %77
%79 = and i64 %16, 3
%80 = icmp ult i64 %17, 3
br i1 %80, label %105, label %81
81: ; preds = %78
%82 = and i64 %16, -4
br label %83
83: ; preds = %83, %81
%84 = phi i64 [ 1, %81 ], [ %102, %83 ]
%85 = phi double [ 0.000000e+00, %81 ], [ %101, %83 ]
%86 = phi i64 [ 0, %81 ], [ %103, %83 ]
%87 = getelementptr inbounds double, double* %10, i64 %84
%88 = load double, double* %87
%89 = call double @llvm.fmuladd.f64(double %88, double %88, double %85)
%90 = add nuw nsw i64 %84, 1
%91 = getelementptr inbounds double, double* %10, i64 %90
%92 = load double, double* %91
%93 = call double @llvm.fmuladd.f64(double %92, double %92, double %89)
%94 = add nuw nsw i64 %84, 2
%95 = getelementptr inbounds double, double* %10, i64 %94
%96 = load double, double* %95
%97 = call double @llvm.fmuladd.f64(double %96, double %96, double %93)
%98 = add nuw nsw i64 %84, 3
%99 = getelementptr inbounds double, double* %10, i64 %98
%100 = load double, double* %99
%101 = call double @llvm.fmuladd.f64(double %100, double %100, double %97)
%102 = add nuw nsw i64 %84, 4
%103 = add i64 %86, 4
%104 = icmp eq i64 %103, %82
br i1 %104, label %105, label %83
105: ; preds = %83, %78
%106 = phi double [ undef, %78 ], [ %101, %83 ]
%107 = phi i64 [ 1, %78 ], [ %102, %83 ]
%108 = phi double [ 0.000000e+00, %78 ], [ %101, %83 ]
%109 = icmp eq i64 %79, 0
br i1 %109, label %120, label %110
110: ; preds = %105, %110
%111 = phi i64 [ %117, %110 ], [ %107, %105 ]
%112 = phi double [ %116, %110 ], [ %108, %105 ]
%113 = phi i64 [ %118, %110 ], [ 0, %105 ]
%114 = getelementptr inbounds double, double* %10, i64 %111
%115 = load double, double* %114
%116 = call double @llvm.fmuladd.f64(double %115, double %115, double %112)
%117 = add nuw nsw i64 %111, 1
%118 = add i64 %113, 1
%119 = icmp eq i64 %118, %79
br i1 %119, label %120, label %110
120: ; preds = %105, %110, %12, %77
%121 = phi double [ 0.000000e+00, %77 ], [ 0.000000e+00, %12 ], [ %106, %105 ], [ %116, %110 ]
%122 = sitofp i32 %1 to double
%123 = fdiv double %121, %122
%124 = call double @sqrt(double %123)
store i32 0, i32* %6
%125 = load double, double* %5
%126 = fdiv double %124, %125
%127 = fcmp olt double %126, 9.000000e-01
br i1 %127, label %128, label %265
128: ; preds = %120
br i1 %11, label %264, label %129
129: ; preds = %128
%130 = add nuw i32 %1, 1
%131 = zext i32 %130 to i64
%132 = add nsw i64 %131, -1
%133 = icmp ult i64 %132, 4
br i1 %133, label %216, label %134
134: ; preds = %129
%135 = getelementptr double, double* %4, i64 1
%136 = getelementptr double, double* %4, i64 %131
%137 = getelementptr double, double* %10, i64 1
%138 = getelementptr double, double* %10, i64 %131
%139 = icmp ult double* %135, %138
%140 = icmp ult double* %137, %136
%141 = and i1 %139, %140
br i1 %141, label %216, label %142
142: ; preds = %134
%143 = and i64 %132, -4
%144 = or i64 %143, 1
%145 = add nsw i64 %143, -4
%146 = lshr exact i64 %145, 2
%147 = add nuw nsw i64 %146, 1
%148 = and i64 %147, 1
%149 = icmp eq i64 %145, 0
br i1 %149, label %194, label %150
150: ; preds = %142
%151 = and i64 %147, 9223372036854775806
br label %152
152: ; preds = %152, %150
%153 = phi i64 [ 0, %150 ], [ %189, %152 ]
%154 = phi i64 [ 0, %150 ], [ %190, %152 ]
%155 = or i64 %153, 1
%156 = getelementptr inbounds double, double* %10, i64 %155
%157 = bitcast double* %156 to <2 x double>*
%158 = load <2 x double>, <2 x double>* %157
%159 = getelementptr inbounds double, double* %156, i64 2
%160 = bitcast double* %159 to <2 x double>*
%161 = load <2 x double>, <2 x double>* %160
%162 = getelementptr inbounds double, double* %4, i64 %155
%163 = bitcast double* %162 to <2 x double>*
%164 = load <2 x double>, <2 x double>* %163
%165 = getelementptr inbounds double, double* %162, i64 2
%166 = bitcast double* %165 to <2 x double>*
%167 = load <2 x double>, <2 x double>* %166
%168 = fadd <2 x double> %158, %164
%169 = fadd <2 x double> %161, %167
%170 = bitcast double* %162 to <2 x double>*
store <2 x double> %168, <2 x double>* %170
%171 = bitcast double* %165 to <2 x double>*
store <2 x double> %169, <2 x double>* %171
%172 = or i64 %153, 5
%173 = getelementptr inbounds double, double* %10, i64 %172
%174 = bitcast double* %173 to <2 x double>*
%175 = load <2 x double>, <2 x double>* %174
%176 = getelementptr inbounds double, double* %173, i64 2
%177 = bitcast double* %176 to <2 x double>*
%178 = load <2 x double>, <2 x double>* %177
%179 = getelementptr inbounds double, double* %4, i64 %172
%180 = bitcast double* %179 to <2 x double>*
%181 = load <2 x double>, <2 x double>* %180
%182 = getelementptr inbounds double, double* %179, i64 2
%183 = bitcast double* %182 to <2 x double>*
%184 = load <2 x double>, <2 x double>* %183
%185 = fadd <2 x double> %175, %181
%186 = fadd <2 x double> %178, %184
%187 = bitcast double* %179 to <2 x double>*
store <2 x double> %185, <2 x double>* %187
%188 = bitcast double* %182 to <2 x double>*
store <2 x double> %186, <2 x double>* %188
%189 = add nuw i64 %153, 8
%190 = add i64 %154, 2
%191 = icmp eq i64 %190, %151
br i1 %191, label %192, label %152
192: ; preds = %152
%193 = or i64 %189, 1
br label %194
194: ; preds = %192, %142
%195 = phi i64 [ 1, %142 ], [ %193, %192 ]
%196 = icmp eq i64 %148, 0
br i1 %196, label %214, label %197
197: ; preds = %194
%198 = getelementptr inbounds double, double* %10, i64 %195
%199 = bitcast double* %198 to <2 x double>*
%200 = load <2 x double>, <2 x double>* %199
%201 = getelementptr inbounds double, double* %198, i64 2
%202 = bitcast double* %201 to <2 x double>*
%203 = load <2 x double>, <2 x double>* %202
%204 = getelementptr inbounds double, double* %4, i64 %195
%205 = bitcast double* %204 to <2 x double>*
%206 = load <2 x double>, <2 x double>* %205
%207 = getelementptr inbounds double, double* %204, i64 2
%208 = bitcast double* %207 to <2 x double>*
%209 = load <2 x double>, <2 x double>* %208
%210 = fadd <2 x double> %200, %206
%211 = fadd <2 x double> %203, %209
%212 = bitcast double* %204 to <2 x double>*
store <2 x double> %210, <2 x double>* %212
%213 = bitcast double* %207 to <2 x double>*
store <2 x double> %211, <2 x double>* %213
br label %214
214: ; preds = %194, %197
%215 = icmp eq i64 %132, %143
br i1 %215, label %264, label %216
216: ; preds = %134, %129, %214
%217 = phi i64 [ 1, %134 ], [ 1, %129 ], [ %144, %214 ]
%218 = sub nsw i64 %131, %217
%219 = xor i64 %217, -1
%220 = add nsw i64 %219, %131
%221 = and i64 %218, 3
%222 = icmp eq i64 %221, 0
br i1 %222, label %234, label %223
223: ; preds = %216, %223
%224 = phi i64 [ %231, %223 ], [ %217, %216 ]
%225 = phi i64 [ %232, %223 ], [ 0, %216 ]
%226 = getelementptr inbounds double, double* %10, i64 %224
%227 = load double, double* %226
%228 = getelementptr inbounds double, double* %4, i64 %224
%229 = load double, double* %228
%230 = fadd double %227, %229
store double %230, double* %228
%231 = add nuw nsw i64 %224, 1
%232 = add i64 %225, 1
%233 = icmp eq i64 %232, %221
br i1 %233, label %234, label %223
234: ; preds = %223, %216
%235 = phi i64 [ %217, %216 ], [ %231, %223 ]
%236 = icmp ult i64 %220, 3
br i1 %236, label %264, label %237
237: ; preds = %234, %237
%238 = phi i64 [ %262, %237 ], [ %235, %234 ]
%239 = getelementptr inbounds double, double* %10, i64 %238
%240 = load double, double* %239
%241 = getelementptr inbounds double, double* %4, i64 %238
%242 = load double, double* %241
%243 = fadd double %240, %242
store double %243, double* %241
%244 = add nuw nsw i64 %238, 1
%245 = getelementptr inbounds double, double* %10, i64 %244
%246 = load double, double* %245
%247 = getelementptr inbounds double, double* %4, i64 %244
%248 = load double, double* %247
%249 = fadd double %246, %248
store double %249, double* %247
%250 = add nuw nsw i64 %238, 2
%251 = getelementptr inbounds double, double* %10, i64 %250
%252 = load double, double* %251
%253 = getelementptr inbounds double, double* %4, i64 %250
%254 = load double, double* %253
%255 = fadd double %252, %254
store double %255, double* %253
%256 = add nuw nsw i64 %238, 3
%257 = getelementptr inbounds double, double* %10, i64 %256
%258 = load double, double* %257
%259 = getelementptr inbounds double, double* %4, i64 %256
%260 = load double, double* %259
%261 = fadd double %258, %260
store double %261, double* %259
%262 = add nuw nsw i64 %238, 4
%263 = icmp eq i64 %262, %131
br i1 %263, label %264, label %237
264: ; preds = %234, %237, %214, %128
store double %124, double* %5
store i32 1, i32* %6
br label %265
265: ; preds = %264, %120
ret void
}