void ldl_mprove_pm(double **A, int n, double *d, double *b, double *x,
                   double *c, int *q, int *r, double *rms_resid, int *ok) {
  double sdp;
  double *dx, *dc, rms_resid_new = 0.0, *dvector();
  int j, i, pd;
  void ldl_dcmp(), free_dvector();
  dx = dvector(1, n);
  dc = dvector(1, n);
  for (i = 1; i <= n; i++)
    dx[i] = 0.0;
  for (i = 1; i <= n; i++) {
    if (q[i]) {
      sdp = b[i];
      for (j = 1; j <= n; j++) {
        if (q[j]) {
          if (i <= j)
            sdp -= A[i][j] * x[j];
          else
            sdp -= A[j][i] * x[j];
        }
      }
      for (j = 1; j <= n; j++)
        if (r[j])
          sdp -= A[i][j] * x[j];
      dx[i] = sdp;
    }
  }
  ldl_dcmp_pm(A, n, d, dx, dx, dc, q, r, 0, 1, &pd);
  for (i = 1; i <= n; i++)
    if (q[i])
      rms_resid_new += dx[i] * dx[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++) {
      if (q[i])
        x[i] += dx[i];
      if (r[i])
        c[i] += dc[i];
    }
    *rms_resid = rms_resid_new;
    *ok = 1;
  }
  free_dvector(dx, 1, n);
  free_dvector(dc, 1, n);
  return;
}


x86 assembly (clang, -O0):
<ldl_mprove_pm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
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,-0x50(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <dvector@plt>
mov    %rax,-0x40(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <dvector@plt>
mov    %rax,-0x48(%rbp)
movl   $0x1,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11d1 <ldl_mprove_pm+0x91>
mov    -0x40(%rbp),%rax
movslq -0x58(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    11a7 <ldl_mprove_pm+0x67>
movl   $0x1,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1394 <ldl_mprove_pm+0x254>
mov    0x10(%rbp),%rax
movslq -0x58(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1381 <ldl_mprove_pm+0x241>
mov    -0x20(%rbp),%rax
movslq -0x58(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x1,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     12ec <ldl_mprove_pm+0x1ac>
mov    0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     12d9 <ldl_mprove_pm+0x199>
mov    -0x58(%rbp),%eax
cmp    -0x54(%rbp),%eax
jg     1289 <ldl_mprove_pm+0x149>
mov    -0x8(%rbp),%rax
movslq -0x58(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x54(%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    12d4 <ldl_mprove_pm+0x194>
mov    -0x8(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x58(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x54(%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    12d9 <ldl_mprove_pm+0x199>
jmp    12de <ldl_mprove_pm+0x19e>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    120f <ldl_mprove_pm+0xcf>
movl   $0x1,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     136f <ldl_mprove_pm+0x22f>
mov    0x18(%rbp),%rax
movslq -0x54(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     135c <ldl_mprove_pm+0x21c>
mov    -0x8(%rbp),%rax
movslq -0x58(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x54(%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    1361 <ldl_mprove_pm+0x221>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    12f3 <ldl_mprove_pm+0x1b3>
movsd  -0x38(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x58(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1386 <ldl_mprove_pm+0x246>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    11d8 <ldl_mprove_pm+0x98>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    -0x48(%rbp),%r9
mov    0x10(%rbp),%r11
mov    0x18(%rbp),%r10
xor    %eax,%eax
lea    -0x5c(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x1,0x18(%rsp)
mov    %rax,0x20(%rsp)
mov    $0x0,%al
call   1060 <ldl_dcmp_pm@plt>
movl   $0x1,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1442 <ldl_mprove_pm+0x302>
mov    0x10(%rbp),%rax
movslq -0x58(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     142f <ldl_mprove_pm+0x2ef>
mov    -0x40(%rbp),%rax
movslq -0x58(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x58(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1434 <ldl_mprove_pm+0x2f4>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    13e5 <ldl_mprove_pm+0x2a5>
movsd  -0x50(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x50(%rbp)
mov    0x28(%rbp),%rax
movl   $0x0,(%rax)
movsd  -0x50(%rbp),%xmm1
mov    0x20(%rbp),%rax
divsd  (%rax),%xmm1
movsd  0xb87(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1522 <ldl_mprove_pm+0x3e2>
movl   $0x1,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     150b <ldl_mprove_pm+0x3cb>
mov    0x10(%rbp),%rax
movslq -0x58(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     14c7 <ldl_mprove_pm+0x387>
mov    -0x40(%rbp),%rax
movslq -0x58(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x58(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x18(%rbp),%rax
movslq -0x58(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     14f8 <ldl_mprove_pm+0x3b8>
mov    -0x48(%rbp),%rax
movslq -0x58(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x58(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    14fd <ldl_mprove_pm+0x3bd>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    148a <ldl_mprove_pm+0x34a>
movsd  -0x50(%rbp),%xmm0
mov    0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x28(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x40(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <free_dvector@plt>
mov    -0x48(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <free_dvector@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldl_mprove_pm>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,0x38(%rsp)
mov    %r8,%r12
mov    %rcx,0x18(%rsp)
mov    %rdx,0x30(%rsp)
mov    %esi,%ebx
mov    %rdi,%r13
mov    0x88(%rsp),%r14
mov    0x80(%rsp),%r15
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <dvector@plt>
mov    %rax,%rbp
mov    $0x1,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <dvector@plt>
test   %ebx,%ebx
mov    %ebx,0xc(%rsp)
mov    %rax,0x20(%rsp)
mov    %rbp,0x10(%rsp)
jle    13bf <ldl_mprove_pm+0x26f>
mov    %rbp,%rdi
add    $0x8,%rdi
mov    %ebx,%ebx
lea    0x0(,%rbx,8),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,%r8
mov    0x20(%rsp),%r9
lea    0x1(%rbx),%rax
lea    -0x1(%rbx),%rcx
mov    %rcx,0x40(%rsp)
mov    %r8d,%r10d
and    $0xfffffffe,%r10d
neg    %r10
mov    $0x1,%ebp
mov    0x30(%rsp),%rdx
mov    0x10(%rsp),%rcx
mov    0x18(%rsp),%r11
jmp    1222 <ldl_mprove_pm+0xd2>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  %xmm0,(%rcx,%rbp,8)
add    $0x1,%rbp
cmp    %rax,%rbp
je     1313 <ldl_mprove_pm+0x1c3>
cmpl   $0x0,(%r15,%rbp,4)
je     1215 <ldl_mprove_pm+0xc5>
movsd  (%r11,%rbp,8),%xmm0
mov    $0x1,%esi
jmp    1249 <ldl_mprove_pm+0xf9>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rsi
cmp    %rsi,%rax
je     1280 <ldl_mprove_pm+0x130>
cmpl   $0x0,(%r15,%rsi,4)
je     1240 <ldl_mprove_pm+0xf0>
cmp    %rsi,%rbp
mov    %rbp,%rdi
cmova  %rsi,%rdi
mov    %rsi,%rbx
cmova  %rbp,%rbx
mov    0x0(%r13,%rdi,8),%rdi
movsd  (%rdi,%rbx,8),%xmm1
mulsd  (%r12,%rsi,8),%xmm1
subsd  %xmm1,%xmm0
jmp    1240 <ldl_mprove_pm+0xf0>
nopw   0x0(%rax,%rax,1)
cmpq   $0x0,0x40(%rsp)
je     12e0 <ldl_mprove_pm+0x190>
mov    $0x1,%esi
jmp    12a2 <ldl_mprove_pm+0x152>
nop
lea    (%r10,%rsi,1),%rdi
add    $0x2,%rdi
add    $0x2,%rsi
cmp    $0x1,%rdi
je     12e5 <ldl_mprove_pm+0x195>
cmpl   $0x0,(%r14,%rsi,4)
je     12bd <ldl_mprove_pm+0x16d>
mov    0x0(%r13,%rbp,8),%rdi
movsd  (%rdi,%rsi,8),%xmm1
mulsd  (%r12,%rsi,8),%xmm1
subsd  %xmm1,%xmm0
cmpl   $0x0,0x4(%r14,%rsi,4)
je     1290 <ldl_mprove_pm+0x140>
mov    0x0(%r13,%rbp,8),%rdi
movsd  0x8(%rdi,%rsi,8),%xmm1
mulsd  0x8(%r12,%rsi,8),%xmm1
subsd  %xmm1,%xmm0
jmp    1290 <ldl_mprove_pm+0x140>
nopl   (%rax)
mov    $0x1,%esi
test   $0x1,%r8b
je     1210 <ldl_mprove_pm+0xc0>
cmpl   $0x0,(%r14,%rsi,4)
je     1210 <ldl_mprove_pm+0xc0>
mov    0x0(%r13,%rbp,8),%rdi
movsd  (%rdi,%rsi,8),%xmm1
mulsd  (%r12,%rsi,8),%xmm1
subsd  %xmm1,%xmm0
jmp    1210 <ldl_mprove_pm+0xc0>
mov    %r8,0x18(%rsp)
sub    $0x8,%rsp
lea    0x34(%rsp),%r10
mov    %r13,%rdi
mov    0x14(%rsp),%ebx
mov    %ebx,%esi
mov    %rcx,%r8
xor    %eax,%eax
push   %r10
push   $0x1
push   $0x0
push   %r14
push   %r15
call   1070 <ldl_dcmp_pm@plt>
mov    %ebx,%edx
add    $0x30,%rsp
test   %ebx,%ebx
jle    13f4 <ldl_mprove_pm+0x2a4>
cmpq   $0x0,0x40(%rsp)
je     13fa <ldl_mprove_pm+0x2aa>
mov    0x18(%rsp),%rdi
mov    %edi,%ecx
and    $0xfffffffe,%ecx
neg    %rcx
xorpd  %xmm0,%xmm0
mov    $0x1,%eax
mov    0x10(%rsp),%rbp
jmp    1392 <ldl_mprove_pm+0x242>
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%rcx,%rax,1),%rsi
add    $0x2,%rsi
add    $0x2,%rax
cmp    $0x1,%rsi
je     1408 <ldl_mprove_pm+0x2b8>
cmpl   $0x0,(%r15,%rax,4)
je     13a7 <ldl_mprove_pm+0x257>
movsd  0x0(%rbp,%rax,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
cmpl   $0x0,0x4(%r15,%rax,4)
je     1380 <ldl_mprove_pm+0x230>
movsd  0x8(%rbp,%rax,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
jmp    1380 <ldl_mprove_pm+0x230>
sub    $0x8,%rsp
lea    0x34(%rsp),%r10
mov    %r13,%rdi
mov    %ebx,%esi
mov    0x38(%rsp),%rdx
mov    %rbp,%rcx
mov    %rbp,%r8
mov    %rax,%r9
xor    %eax,%eax
push   %r10
push   $0x1
push   $0x0
push   %r14
push   %r15
call   1070 <ldl_dcmp_pm@plt>
mov    0x3c(%rsp),%edx
add    $0x30,%rsp
xorpd  %xmm0,%xmm0
jmp    1427 <ldl_mprove_pm+0x2d7>
xorpd  %xmm0,%xmm0
mov    $0x1,%eax
mov    0x18(%rsp),%rdi
test   $0x1,%dil
je     1427 <ldl_mprove_pm+0x2d7>
cmpl   $0x0,(%r15,%rax,4)
je     1427 <ldl_mprove_pm+0x2d7>
mov    0x10(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
mov    0x98(%rsp),%rbx
mov    0x90(%rsp),%r13
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1452 <ldl_mprove_pm+0x302>
sqrtsd %xmm0,%xmm0
jmp    145b <ldl_mprove_pm+0x30b>
call   1060 <sqrt@plt>
mov    0xc(%rsp),%edx
mov    0x38(%rsp),%rsi
mov    0x10(%rsp),%rdi
movl   $0x0,(%rbx)
movapd %xmm0,%xmm1
divsd  0x0(%r13),%xmm1
movsd  0xb83(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    14ed <ldl_mprove_pm+0x39d>
test   %edx,%edx
mov    0x20(%rsp),%rbp
jle    14e1 <ldl_mprove_pm+0x391>
mov    %edx,%eax
shl    $0x2,%rax
xor    %ecx,%ecx
jmp    14a9 <ldl_mprove_pm+0x359>
cs nopw 0x0(%rax,%rax,1)
add    $0x4,%rcx
cmp    %rcx,%rax
je     14e1 <ldl_mprove_pm+0x391>
cmpl   $0x0,0x4(%r15,%rcx,1)
je     14c5 <ldl_mprove_pm+0x375>
movsd  0x8(%rdi,%rcx,2),%xmm1
addsd  0x8(%r12,%rcx,2),%xmm1
movsd  %xmm1,0x8(%r12,%rcx,2)
cmpl   $0x0,0x4(%r14,%rcx,1)
je     14a0 <ldl_mprove_pm+0x350>
movsd  0x8(%rbp,%rcx,2),%xmm1
addsd  0x8(%rsi,%rcx,2),%xmm1
movsd  %xmm1,0x8(%rsi,%rcx,2)
jmp    14a0 <ldl_mprove_pm+0x350>
movsd  %xmm0,0x0(%r13)
movl   $0x1,(%rbx)
mov    $0x1,%esi
xor    %eax,%eax
mov    %edx,%ebx
call   1050 <free_dvector@plt>
mov    0x20(%rsp),%rdi
mov    $0x1,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <free_dvector@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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