void invert(x, b, A, n) int n;
double *x;
double *b, **A;
{
  int i, j, k;
  double *dvector(), **dmatrix();
  double *xp, *W, **V, **A_inverse;
  void free_dvector(), free_dmatrix(), dsvdcmp();
  xp = dvector(1, n);
  W = dvector(1, n);
  V = dmatrix(1, n, 1, n);
  A_inverse = dmatrix(1, n, 1, n);
  dsvdcmp(A, n, n, W, V);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++)
      V[i][j] = (1.0 / W[i]) * A[j][i];
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      A_inverse[i][j] = 0.0;
      for (k = 1; k <= n; k++)
        A_inverse[i][j] += A[i][k] * V[k][j];
    }
  }
  free_dvector(W, 1, n);
  free_dmatrix(V, 1, n, 1, n);
  for (i = 1; i <= n; i++) {
    xp[i] = x[i];
    for (j = 1; j <= n; j++) {
      xp[i] -= A_inverse[i][j] * b[j];
    }
    x[i] = xp[i];
  }
  free_dvector(xp, 1, n);
  free_dmatrix(A_inverse, 1, n, 1, n);
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1050 <dvector@plt>
mov    %rax,-0x30(%rbp)
mov    -0x1c(%rbp),%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1050 <dvector@plt>
mov    %rax,-0x38(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x1c(%rbp),%ecx
mov    $0x1,%edx
mov    %edx,%edi
mov    $0x0,%al
call   1040 <dmatrix@plt>
mov    %rax,-0x40(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x1c(%rbp),%ecx
mov    $0x1,%edx
mov    %edx,%edi
mov    $0x0,%al
call   1040 <dmatrix@plt>
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    $0x0,%al
call   1030 <dsvdcmp@plt>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     125c <invert+0x10c>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1249 <invert+0xf9>
mov    -0x38(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  0xdf4(%rip),%xmm0
divsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11f0 <invert+0xa0>
jmp    124e <invert+0xfe>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11dd <invert+0x8d>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     132d <invert+0x1dd>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     131a <invert+0x1ca>
mov    -0x48(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1307 <invert+0x1b7>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x48(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12a1 <invert+0x151>
jmp    130c <invert+0x1bc>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1276 <invert+0x126>
jmp    131f <invert+0x1cf>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1263 <invert+0x113>
mov    -0x38(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    $0x1,%esi
mov    $0x0,%al
call   1060 <free_dvector@plt>
mov    -0x40(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%ecx
mov    %ecx,%esi
mov    $0x0,%al
call   1070 <free_dmatrix@plt>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1422 <invert+0x2d2>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     13fa <invert+0x2aa>
mov    -0x48(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x30(%rbp),%rax
movslq -0x20(%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    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    138d <invert+0x23d>
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1360 <invert+0x210>
mov    -0x30(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    $0x1,%esi
mov    $0x0,%al
call   1060 <free_dvector@plt>
mov    -0x48(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%ecx
mov    %ecx,%esi
mov    $0x0,%al
call   1070 <free_dmatrix@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %ecx,%r15d
mov    %rdx,%rbp
mov    %rsi,0x20(%rsp)
mov    %rdi,0x18(%rsp)
mov    $0x1,%edi
mov    %ecx,%esi
xor    %eax,%eax
call   1050 <dvector@plt>
mov    %rax,0x8(%rsp)
mov    $0x1,%edi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <dvector@plt>
mov    %rax,%r12
mov    $0x1,%edi
mov    %r15d,%esi
mov    $0x1,%edx
mov    %r15d,%ecx
xor    %eax,%eax
call   1040 <dmatrix@plt>
mov    %rax,%r14
mov    $0x1,%edi
mov    %r15d,%esi
mov    $0x1,%edx
mov    %r15d,%ecx
xor    %eax,%eax
call   1040 <dmatrix@plt>
mov    %rax,(%rsp)
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r15d,%edx
mov    %r12,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1030 <dsvdcmp@plt>
test   %r15d,%r15d
mov    %r15,0x10(%rsp)
jle    1364 <invert+0x214>
mov    %r15d,%r13d
lea    0x1(%r13),%rax
lea    -0x1(%r13),%r10
mov    %r13d,%ecx
and    $0xfffffffe,%ecx
neg    %rcx
mov    $0x1,%edx
movsd  0xdf3(%rip),%xmm0
jmp    121d <invert+0xcd>
nop
add    $0x1,%rdx
cmp    %rax,%rdx
je     1299 <invert+0x149>
mov    (%r14,%rdx,8),%rsi
mov    $0x1,%edi
test   %r10,%r10
je     1275 <invert+0x125>
mov    $0x1,%edi
movapd %xmm0,%xmm1
divsd  (%r12,%rdx,8),%xmm1
mov    0x0(%rbp,%rdi,8),%rbx
mulsd  (%rbx,%rdx,8),%xmm1
movsd  %xmm1,(%rsi,%rdi,8)
movapd %xmm0,%xmm1
divsd  (%r12,%rdx,8),%xmm1
mov    0x8(%rbp,%rdi,8),%rbx
mulsd  (%rbx,%rdx,8),%xmm1
movsd  %xmm1,0x8(%rsi,%rdi,8)
lea    (%rcx,%rdi,1),%rbx
add    $0x2,%rbx
add    $0x2,%rdi
cmp    $0x1,%rbx
jne    1230 <invert+0xe0>
test   $0x1,%r13b
je     1210 <invert+0xc0>
movapd %xmm0,%xmm1
divsd  (%r12,%rdx,8),%xmm1
mov    0x0(%rbp,%rdi,8),%rbx
mulsd  (%rbx,%rdx,8),%xmm1
movsd  %xmm1,(%rsi,%rdi,8)
jmp    1210 <invert+0xc0>
test   %r15d,%r15d
jle    1364 <invert+0x214>
add    $0x1,%r15d
mov    %r13d,%eax
and    $0xfffffffe,%eax
neg    %rax
mov    $0x1,%r8d
mov    (%rsp),%r9
jmp    12cd <invert+0x17d>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r8
cmp    %r15,%r8
je     139e <invert+0x24e>
mov    (%r9,%r8,8),%rdx
mov    0x0(%rbp,%r8,8),%rsi
mov    $0x1,%edi
jmp    12e9 <invert+0x199>
nopl   (%rax)
add    $0x1,%rdi
cmp    %r15,%rdi
je     12c0 <invert+0x170>
movq   $0x0,(%rdx,%rdi,8)
mov    $0x1,%ecx
xorpd  %xmm0,%xmm0
test   %r10,%r10
je     1342 <invert+0x1f2>
nop
movsd  (%rsi,%rcx,8),%xmm1
mov    (%r14,%rcx,8),%rbx
mulsd  (%rbx,%rdi,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rdx,%rdi,8)
movsd  0x8(%rsi,%rcx,8),%xmm0
mov    0x8(%r14,%rcx,8),%rbx
mulsd  (%rbx,%rdi,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rdx,%rdi,8)
lea    (%rax,%rcx,1),%rbx
add    $0x2,%rbx
add    $0x2,%rcx
cmp    $0x1,%rbx
jne    1300 <invert+0x1b0>
test   $0x1,%r13b
je     12e0 <invert+0x190>
movsd  (%rsi,%rcx,8),%xmm1
mov    (%r14,%rcx,8),%rcx
mulsd  (%rcx,%rdi,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rdx,%rdi,8)
jmp    12e0 <invert+0x190>
mov    %r12,%rdi
mov    $0x1,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1060 <free_dvector@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %r15d,%edx
mov    $0x1,%ecx
mov    %r15d,%r8d
xor    %eax,%eax
call   1070 <free_dmatrix@plt>
mov    0x8(%rsp),%rdi
mov    (%rsp),%r9
jmp    1488 <invert+0x338>
mov    %r12,%rdi
mov    $0x1,%esi
mov    0x10(%rsp),%rbx
mov    %ebx,%edx
xor    %eax,%eax
mov    %r10,%rbp
call   1060 <free_dvector@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %ebx,%edx
mov    $0x1,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   1070 <free_dmatrix@plt>
mov    (%rsp),%r9
test   %ebx,%ebx
mov    0x8(%rsp),%rdi
mov    0x20(%rsp),%rbx
mov    0x18(%rsp),%r8
jle    1488 <invert+0x338>
mov    %rbp,%r10
mov    %r13d,%eax
and    $0xfffffffe,%eax
neg    %rax
mov    $0x1,%ecx
jmp    140f <invert+0x2bf>
xchg   %ax,%ax
movsd  %xmm0,(%r8,%rcx,8)
add    $0x1,%rcx
cmp    %r15,%rcx
je     1488 <invert+0x338>
movsd  (%r8,%rcx,8),%xmm0
movsd  %xmm0,(%rdi,%rcx,8)
mov    (%r9,%rcx,8),%rdx
mov    $0x1,%esi
test   %r10,%r10
je     146a <invert+0x31a>
nopl   0x0(%rax,%rax,1)
movsd  (%rdx,%rsi,8),%xmm1
mulsd  (%rbx,%rsi,8),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rdi,%rcx,8)
movsd  0x8(%rdx,%rsi,8),%xmm1
mulsd  0x8(%rbx,%rsi,8),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rdi,%rcx,8)
lea    (%rax,%rsi,1),%rbp
add    $0x2,%rbp
add    $0x2,%rsi
cmp    $0x1,%rbp
jne    1430 <invert+0x2e0>
test   $0x1,%r13b
je     1400 <invert+0x2b0>
movsd  (%rdx,%rsi,8),%xmm1
mulsd  (%rbx,%rsi,8),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rdi,%rcx,8)
jmp    1400 <invert+0x2b0>
mov    $0x1,%esi
mov    0x10(%rsp),%rbx
mov    %ebx,%edx
xor    %eax,%eax
mov    %r9,%rbp
call   1060 <free_dvector@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %ebx,%edx
mov    $0x1,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <free_dmatrix@plt>

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

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