int inverse(double **a, double **b, int n) {
  int lu(double **, int *, double *);
  void mat_vec(double **, double *, double *, int, int);
  register int i, j, k;
  double **c, *e;
  c = (double **)malloc(n * sizeof(double *));
  e = (double *)malloc(n * sizeof(double));
  for (i = 0; i < n; i++)
    c[i] = (double *)malloc((n + 1) * sizeof(double));
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++)
      for (k = 0; k < n; k++)
        c[j][k] = a[j][k];
    for (j = 0; j < i; j++)
      c[j][n] = 0.0;
    c[i][n] = 1.0;
    for (j = i + 1; j < n; j++)
      c[j][n] = 0.0;
    if (lu(c, &n, e) == 1) {
      for (i = 0; i < n; i++)
        free(c[i]);
      free(c);
      free(e);
      return (1);
    };
    for (j = 0; j < n; j++)
      b[j][i] = e[j];
  };
  for (i = 0; i < n; i++)
    free(c[i]);
  free(c);
  free(e);
  return (0);
}


x86 assembly (clang, -O0):
<inverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movslq -0x1c(%rbp),%rdi
shl    $0x3,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x30(%rbp)
movslq -0x1c(%rbp),%rdi
shl    $0x3,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11a7 <inverse+0x77>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1050 <malloc@plt>
mov    %rax,%rdx
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    116c <inverse+0x3c>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    137c <inverse+0x24c>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    122b <inverse+0xfb>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1218 <inverse+0xe8>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11d4 <inverse+0xa4>
jmp    121d <inverse+0xed>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11c1 <inverse+0x91>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1264 <inverse+0x134>
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1232 <inverse+0x102>
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
movsd  0xd84(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12bc <inverse+0x18c>
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    128a <inverse+0x15a>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rdx
lea    -0x1c(%rbp),%rsi
call   1040 <lu@plt>
cmp    $0x1,%eax
jne    1326 <inverse+0x1f6>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1308 <inverse+0x1d8>
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12dd <inverse+0x1ad>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
jmp    13c7 <inverse+0x297>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1369 <inverse+0x239>
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    132d <inverse+0x1fd>
jmp    136e <inverse+0x23e>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11ae <inverse+0x7e>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13ae <inverse+0x27e>
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1383 <inverse+0x253>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverse>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %edx,%r12d
mov    %rsi,%r15
mov    %rdi,0x18(%rsp)
mov    %edx,0x4(%rsp)
movslq %edx,%rbp
lea    0x0(,%rbp,8),%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,0x8(%rsp)
test   %ebp,%ebp
jle    15c7 <inverse+0x497>
mov    %r12d,%ebx
lea    0x8(,%rbx,8),%r13
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r13,%rdi
call   1050 <malloc@plt>
mov    %rax,(%r14,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1190 <inverse+0x60>
test   %r12d,%r12d
jle    15c7 <inverse+0x497>
mov    $0x1,%eax
mov    %rax,0x10(%rsp)
xor    %ebp,%ebp
jmp    11d2 <inverse+0xa2>
nopl   0x0(%rax)
movslq %r12d,%rax
addq   $0x1,0x10(%rsp)
cmp    %rax,%rbp
jge    15a6 <inverse+0x476>
mov    %rbp,%r13
mov    %r12d,%eax
test   %r12d,%r12d
mov    0x18(%rsp),%rbx
jle    13c0 <inverse+0x290>
mov    %eax,%r9d
and    $0xfffffffc,%r9d
lea    -0x4(%r9),%rcx
mov    %rcx,0x30(%rsp)
shr    $0x2,%rcx
add    $0x1,%rcx
mov    %ecx,%edi
and    $0x3,%edi
and    $0xfffffffffffffffc,%rcx
mov    %rcx,0x20(%rsp)
mov    %eax,%r10d
and    $0x3,%r10d
mov    %rdi,0x28(%rsp)
shl    $0x5,%rdi
xor    %esi,%esi
jmp    122d <inverse+0xfd>
add    $0x1,%rsi
cmp    %rax,%rsi
je     13c0 <inverse+0x290>
mov    (%rbx,%rsi,8),%rcx
mov    (%r14,%rsi,8),%r8
cmp    $0x4,%r12d
jb     1255 <inverse+0x125>
lea    (%rcx,%rax,8),%rdx
cmp    %rdx,%r8
jae    12e0 <inverse+0x1b0>
lea    (%r8,%rax,8),%rdx
cmp    %rdx,%rcx
jae    12e0 <inverse+0x1b0>
xor    %r11d,%r11d
mov    %r11,%rdx
not    %rdx
add    %rax,%rdx
test   %r10,%r10
je     1286 <inverse+0x156>
mov    %r10,%rbp
nopl   0x0(%rax)
movsd  (%rcx,%r11,8),%xmm0
movsd  %xmm0,(%r8,%r11,8)
add    $0x1,%r11
add    $0xffffffffffffffff,%rbp
jne    1270 <inverse+0x140>
cmp    $0x3,%rdx
jb     1220 <inverse+0xf0>
nopl   0x0(%rax)
movsd  (%rcx,%r11,8),%xmm0
movsd  %xmm0,(%r8,%r11,8)
movsd  0x8(%rcx,%r11,8),%xmm0
movsd  %xmm0,0x8(%r8,%r11,8)
movsd  0x10(%rcx,%r11,8),%xmm0
movsd  %xmm0,0x10(%r8,%r11,8)
movsd  0x18(%rcx,%r11,8),%xmm0
movsd  %xmm0,0x18(%r8,%r11,8)
add    $0x4,%r11
cmp    %r11,%rax
jne    1290 <inverse+0x160>
jmp    1220 <inverse+0xf0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpq   $0xc,0x30(%rsp)
jae    12ec <inverse+0x1bc>
xor    %ebp,%ebp
jmp    1360 <inverse+0x230>
mov    0x20(%rsp),%rdx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movups (%rcx,%rbp,8),%xmm0
movups 0x10(%rcx,%rbp,8),%xmm1
movups %xmm0,(%r8,%rbp,8)
movups %xmm1,0x10(%r8,%rbp,8)
movups 0x20(%rcx,%rbp,8),%xmm0
movups 0x30(%rcx,%rbp,8),%xmm1
movups %xmm0,0x20(%r8,%rbp,8)
movups %xmm1,0x30(%r8,%rbp,8)
movups 0x40(%rcx,%rbp,8),%xmm0
movups 0x50(%rcx,%rbp,8),%xmm1
movups %xmm0,0x40(%r8,%rbp,8)
movups %xmm1,0x50(%r8,%rbp,8)
movups 0x60(%rcx,%rbp,8),%xmm0
movups 0x70(%rcx,%rbp,8),%xmm1
movups %xmm0,0x60(%r8,%rbp,8)
movups %xmm1,0x70(%r8,%rbp,8)
add    $0x10,%rbp
add    $0xfffffffffffffffc,%rdx
jne    1300 <inverse+0x1d0>
cmpq   $0x0,0x28(%rsp)
je     139c <inverse+0x26c>
lea    (%r8,%rbp,8),%rdx
add    $0x10,%rdx
lea    (%rcx,%rbp,8),%rbp
add    $0x10,%rbp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movups -0x10(%rbp,%rbx,1),%xmm0
movups 0x0(%rbp,%rbx,1),%xmm1
movups %xmm0,-0x10(%rdx,%rbx,1)
movups %xmm1,(%rdx,%rbx,1)
add    $0x20,%rbx
cmp    %rbx,%rdi
jne    1380 <inverse+0x250>
mov    %r9,%r11
cmp    %rax,%r9
mov    0x18(%rsp),%rbx
je     1220 <inverse+0xf0>
jmp    1258 <inverse+0x128>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %r12d,%rcx
test   %r13,%r13
je     1456 <inverse+0x326>
lea    -0x1(%r13),%rdx
cmp    $0x3,%rdx
jae    13e0 <inverse+0x2b0>
xor    %edx,%edx
jmp    142c <inverse+0x2fc>
nopw   0x0(%rax,%rax,1)
mov    %r13,%rsi
and    $0xfffffffffffffffc,%rsi
xor    %edx,%edx
nopl   0x0(%rax)
mov    (%r14,%rdx,8),%rdi
movq   $0x0,(%rdi,%rcx,8)
mov    0x8(%r14,%rdx,8),%rdi
movq   $0x0,(%rdi,%rcx,8)
mov    0x10(%r14,%rdx,8),%rdi
movq   $0x0,(%rdi,%rcx,8)
mov    0x18(%r14,%rdx,8),%rdi
movq   $0x0,(%rdi,%rcx,8)
add    $0x4,%rdx
cmp    %rdx,%rsi
jne    13f0 <inverse+0x2c0>
test   $0x3,%r13b
je     1456 <inverse+0x326>
mov    %r13d,%esi
and    $0x3,%esi
lea    (%r14,%rdx,8),%rdx
xor    %edi,%edi
xchg   %ax,%ax
mov    (%rdx,%rdi,8),%rbp
movq   $0x0,0x0(%rbp,%rcx,8)
add    $0x1,%rdi
cmp    %rdi,%rsi
jne    1440 <inverse+0x310>
mov    (%r14,%r13,8),%rdx
movabs $0x3ff0000000000000,%rsi
mov    %rsi,(%rdx,%rcx,8)
lea    0x1(%r13),%rbp
cmp    %rcx,%rbp
jge    1495 <inverse+0x365>
mov    0x10(%rsp),%rdx
cs nopw 0x0(%rax,%rax,1)
mov    (%r14,%rdx,8),%rsi
movq   $0x0,(%rsi,%rcx,8)
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1480 <inverse+0x350>
mov    %r14,%rdi
lea    0x4(%rsp),%rsi
mov    0x8(%rsp),%rbx
mov    %rbx,%rdx
call   1040 <lu@plt>
mov    0x4(%rsp),%r12d
cmp    $0x1,%eax
je     156d <inverse+0x43d>
test   %r12d,%r12d
jle    11c0 <inverse+0x90>
lea    -0x1(%r12),%rcx
mov    %r12d,%eax
and    $0x3,%eax
cmp    $0x3,%rcx
jae    14e0 <inverse+0x3b0>
xor    %ecx,%ecx
jmp    153b <inverse+0x40b>
cs nopw 0x0(%rax,%rax,1)
mov    %r12d,%edx
and    $0xfffffffc,%edx
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rcx,8),%xmm0
mov    (%r15,%rcx,8),%rsi
movsd  %xmm0,(%rsi,%r13,8)
movsd  0x8(%rbx,%rcx,8),%xmm0
mov    0x8(%r15,%rcx,8),%rsi
movsd  %xmm0,(%rsi,%r13,8)
movsd  0x10(%rbx,%rcx,8),%xmm0
mov    0x10(%r15,%rcx,8),%rsi
movsd  %xmm0,(%rsi,%r13,8)
movsd  0x18(%rbx,%rcx,8),%xmm0
mov    0x18(%r15,%rcx,8),%rsi
movsd  %xmm0,(%rsi,%r13,8)
add    $0x4,%rcx
cmp    %rcx,%rdx
jne    14f0 <inverse+0x3c0>
test   %rax,%rax
je     11c0 <inverse+0x90>
lea    (%r15,%rcx,8),%rdx
lea    (%rbx,%rcx,8),%rcx
xor    %esi,%esi
xchg   %ax,%ax
movsd  (%rcx,%rsi,8),%xmm0
mov    (%rdx,%rsi,8),%rdi
movsd  %xmm0,(%rdi,%r13,8)
add    $0x1,%rsi
cmp    %rsi,%rax
jne    1550 <inverse+0x420>
jmp    11c0 <inverse+0x90>
test   %r12d,%r12d
jle    1597 <inverse+0x467>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14,%rbp,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbp
movslq 0x4(%rsp),%rax
cmp    %rax,%rbp
jl     1580 <inverse+0x450>
mov    %r14,%rdi
call   1030 <free@plt>
mov    $0x1,%ebx
jmp    15d1 <inverse+0x4a1>
test   %r12d,%r12d
jle    15c7 <inverse+0x497>
xor    %ebp,%ebp
nopl   (%rax)
mov    (%r14,%rbp,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbp
movslq 0x4(%rsp),%rax
cmp    %rax,%rbp
jl     15b0 <inverse+0x480>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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