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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ MAT3_inv3_second_col(double **, double **, int);
int MAT3_invert3(double source[3][3], double inv[3][3]) {
  register int i, row0;
  double temp, a, b, c;
  inv[0][0] = inv[1][1] = inv[2][2] = 1.0;
  inv[0][1] = inv[0][2] = inv[1][0] = inv[1][2] = inv[2][0] = inv[2][1] = 0.0;
  a = source[0][0];
  if (a < 0)
    a = -a;
  b = source[1][0];
  if (b < 0)
    b = -b;
  c = source[2][0];
  if (c < 0)
    c = -c;
  if (a > b) {
    if (a > c)
      row0 = 0;
    else
      row0 = 2;
  } else {
    if (b > c)
      row0 = 1;
    else
      row0 = 2;
  }
  if ((source[row0][0] < 1e-20) && (source[row0][0] > -1e-20))
    return (0);
  temp = 1.0 / source[row0][0];
  source[row0][0] = 1.0;
  source[row0][1] *= temp;
  source[row0][2] *= temp;
  inv[row0][row0] = temp;
  for (i = 0; i < 3; i++)
    if (i != row0) {
      temp = -source[i][0];
      source[i][0] = 0.0;
      source[i][1] += temp * source[row0][1];
      source[i][2] += temp * source[row0][2];
      inv[i][row0] = temp * inv[row0][row0];
    }
  if (!MAT3_inv3_second_col(source, inv, row0))
    return (0);
  return 1;
}


x86 assembly (clang, -O0):
<MAT3_invert3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,0x40(%rax)
mov    -0x18(%rbp),%rax
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,0x20(%rax)
mov    -0x18(%rbp),%rax
movsd  0xeb2(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x38(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x30(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x28(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    11d6 <MAT3_invert3+0xc6>
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    1213 <MAT3_invert3+0x103>
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    1250 <MAT3_invert3+0x140>
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    1288 <MAT3_invert3+0x178>
movsd  -0x30(%rbp),%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    127c <MAT3_invert3+0x16c>
movl   $0x0,-0x20(%rbp)
jmp    1283 <MAT3_invert3+0x173>
movl   $0x2,-0x20(%rbp)
jmp    12b0 <MAT3_invert3+0x1a0>
movsd  -0x38(%rbp),%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    12a4 <MAT3_invert3+0x194>
movl   $0x1,-0x20(%rbp)
jmp    12ab <MAT3_invert3+0x19b>
movl   $0x2,-0x20(%rbp)
jmp    12b0 <MAT3_invert3+0x1a0>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0xd41(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    1302 <MAT3_invert3+0x1f2>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
movsd  0xd24(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1302 <MAT3_invert3+0x1f2>
movl   $0x0,-0x4(%rbp)
jmp    14e0 <MAT3_invert3+0x3d0>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0xce7(%rip),%xmm0
divsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0xcc7(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    14b4 <MAT3_invert3+0x3a4>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
je     14a1 <MAT3_invert3+0x391>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x10(%rax),%xmm2
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    14a6 <MAT3_invert3+0x396>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    139d <MAT3_invert3+0x28d>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1030 <MAT3_inv3_second_col@plt>
cmp    $0x0,%eax
jne    14d9 <MAT3_invert3+0x3c9>
movl   $0x0,-0x4(%rbp)
jmp    14e0 <MAT3_invert3+0x3d0>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAT3_invert3>:
push   %rax
movabs $0x3ff0000000000000,%r8
mov    %r8,0x40(%rsi)
mov    %r8,0x20(%rsi)
mov    %r8,(%rsi)
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsi)
movq   $0x0,0x18(%rsi)
movups %xmm0,0x28(%rsi)
movq   $0x0,0x38(%rsi)
movsd  (%rdi),%xmm1
movapd 0xeb3(%rip),%xmm3
movapd %xmm1,%xmm2
xorpd  %xmm3,%xmm2
xorpd  %xmm4,%xmm4
movapd %xmm1,%xmm0
cmpltsd %xmm4,%xmm0
andpd  %xmm0,%xmm2
andnpd %xmm1,%xmm0
orpd   %xmm2,%xmm0
movsd  0x30(%rdi),%xmm2
movapd %xmm2,%xmm5
xorpd  %xmm3,%xmm5
movapd %xmm2,%xmm1
cmpltsd %xmm4,%xmm1
andpd  %xmm1,%xmm5
andnpd %xmm2,%xmm1
orpd   %xmm5,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setbe  %al
movsd  0x18(%rdi),%xmm5
xorpd  %xmm5,%xmm3
movapd %xmm5,%xmm2
cmpltsd %xmm4,%xmm2
andpd  %xmm2,%xmm3
andnpd %xmm5,%xmm2
orpd   %xmm3,%xmm2
add    %eax,%eax
xor    %ecx,%ecx
ucomisd %xmm1,%xmm2
seta   %cl
mov    $0x2,%edx
sub    %ecx,%edx
ucomisd %xmm2,%xmm0
cmova  %eax,%edx
lea    (%rdx,%rdx,2),%rcx
movsd  (%rdi,%rcx,8),%xmm3
movsd  0xe2f(%rip),%xmm4
ucomisd %xmm3,%xmm4
jbe    11f5 <MAT3_invert3+0xe5>
xor    %eax,%eax
ucomisd 0xe27(%rip),%xmm3
jbe    11f5 <MAT3_invert3+0xe5>
pop    %rcx
ret
lea    (%rdi,%rcx,8),%r9
lea    0x0(,%rdx,8),%rcx
lea    (%rcx,%rcx,2),%rcx
lea    (%rsi,%rcx,1),%rax
ucomisd %xmm2,%xmm0
movsd  0xe0b(%rip),%xmm2
divsd  %xmm3,%xmm2
mov    %r8,(%r9)
lea    0x8(%rdi,%rcx,1),%r8
movupd 0x8(%rdi,%rcx,1),%xmm3
movapd %xmm2,%xmm4
unpcklpd %xmm2,%xmm4
mulpd  %xmm3,%xmm4
movupd %xmm4,0x8(%rdi,%rcx,1)
lea    (%rax,%rdx,8),%rcx
movsd  %xmm2,(%rax,%rdx,8)
jbe    1254 <MAT3_invert3+0x144>
ucomisd %xmm1,%xmm0
jbe    1254 <MAT3_invert3+0x144>
cmp    $0x1,%edx
jne    1294 <MAT3_invert3+0x184>
jmp    12d7 <MAT3_invert3+0x1c7>
movsd  (%rdi),%xmm0
movapd 0xda0(%rip),%xmm1
xorpd  %xmm0,%xmm1
movq   $0x0,(%rdi)
movupd (%r8),%xmm2
movupd 0x8(%rdi),%xmm3
unpcklpd %xmm0,%xmm0
mulpd  %xmm2,%xmm0
subpd  %xmm0,%xmm3
movupd %xmm3,0x8(%rdi)
mulsd  (%rcx),%xmm1
movsd  %xmm1,(%rsi,%rdx,8)
cmp    $0x1,%edx
je     12d7 <MAT3_invert3+0x1c7>
movsd  0x18(%rdi),%xmm0
movapd 0xd5f(%rip),%xmm1
xorpd  %xmm0,%xmm1
movq   $0x0,0x18(%rdi)
movupd (%r8),%xmm2
movupd 0x20(%rdi),%xmm3
unpcklpd %xmm0,%xmm0
mulpd  %xmm2,%xmm0
subpd  %xmm0,%xmm3
movupd %xmm3,0x20(%rdi)
mulsd  (%rcx),%xmm1
movsd  %xmm1,0x18(%rsi,%rdx,8)
cmp    $0x2,%edx
je     1315 <MAT3_invert3+0x205>
movsd  0x30(%rdi),%xmm0
movapd 0xd1c(%rip),%xmm1
xorpd  %xmm0,%xmm1
movq   $0x0,0x30(%rdi)
movupd (%r8),%xmm2
movupd 0x38(%rdi),%xmm3
unpcklpd %xmm0,%xmm0
mulpd  %xmm2,%xmm0
subpd  %xmm0,%xmm3
movupd %xmm3,0x38(%rdi)
mulsd  (%rcx),%xmm1
movsd  %xmm1,0x30(%rsi,%rdx,8)
call   1030 <MAT3_inv3_second_col@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @MAT3_invert3([3 x double]* %0, [3 x double]* %1) {
%3 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 2
store double 1.000000e+00, double* %3
%4 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 1
store double 1.000000e+00, double* %4
%5 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
store double 1.000000e+00, double* %5
%6 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 2
%7 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
%8 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 0
%9 = bitcast double* %7 to i8*
%10 = bitcast double* %6 to i8*
%11 = load double, double* %8
%12 = fcmp olt double %11, 0.000000e+00
%13 = fneg double %11
%14 = select i1 %12, double %13, double %11
%15 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 0
%16 = load double, double* %15
%17 = fcmp olt double %16, 0.000000e+00
%18 = fneg double %16
%19 = select i1 %17, double %18, double %16
%20 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 0
%21 = load double, double* %20
%22 = fcmp olt double %21, 0.000000e+00
%23 = fneg double %21
%24 = select i1 %22, double %23, double %21
%25 = fcmp ogt double %14, %19
%26 = fcmp ogt double %14, %24
%27 = select i1 %26, i32 0, i32 2
%28 = fcmp ogt double %19, %24
%29 = select i1 %28, i32 1, i32 2
%30 = select i1 %25, i32 %27, i32 %29
%31 = zext i32 %30 to i64
%32 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 %31, i64 0
%33 = load double, double* %32
%34 = fcmp olt double %33, 0x3BC79CA10C924223
%35 = fcmp ogt double %33, 0xBBC79CA10C924223
%36 = and i1 %34, %35
br i1 %36, label %102, label %37
37: ; preds = %2
%38 = fdiv double 1.000000e+00, %33
store double 1.000000e+00, double* %32
%39 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 %31, i64 1
%40 = bitcast double* %39 to <2 x double>*
%41 = load <2 x double>, <2 x double>* %40
%42 = insertelement <2 x double> poison, double %38, i64 0
%43 = shufflevector <2 x double> %42, <2 x double> poison, <2 x i32> zeroinitializer
%44 = fmul <2 x double> %43, %41
%45 = bitcast double* %39 to <2 x double>*
store <2 x double> %44, <2 x double>* %45
%46 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 %31, i64 %31
store double %38, double* %46
%47 = select i1 %25, i1 %26, i1 false
br i1 %47, label %63, label %48
48: ; preds = %37
%49 = load double, double* %8
%50 = fneg double %49
store double 0.000000e+00, double* %8
%51 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 1
%52 = bitcast double* %39 to <2 x double>*
%53 = load <2 x double>, <2 x double>* %52
%54 = bitcast double* %51 to <2 x double>*
%55 = load <2 x double>, <2 x double>* %54
%56 = insertelement <2 x double> poison, double %50, i64 0
%57 = shufflevector <2 x double> %56, <2 x double> poison, <2 x i32> zeroinitializer
%58 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %57, <2 x double> %53, <2 x double> %55)
%59 = bitcast double* %51 to <2 x double>*
store <2 x double> %58, <2 x double>* %59
%60 = load double, double* %46
%61 = fmul double %60, %50
%62 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 %31
store double %61, double* %62
br label %63
63: ; preds = %37, %48
%64 = icmp eq i32 %30, 1
br i1 %64, label %81, label %65
65: ; preds = %63
%66 = load double, double* %15
%67 = fneg double %66
store double 0.000000e+00, double* %15
%68 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 1
%69 = bitcast double* %39 to <2 x double>*
%70 = load <2 x double>, <2 x double>* %69
%71 = bitcast double* %68 to <2 x double>*
%72 = load <2 x double>, <2 x double>* %71
%73 = insertelement <2 x double> poison, double %67, i64 0
%74 = shufflevector <2 x double> %73, <2 x double> poison, <2 x i32> zeroinitializer
%75 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %74, <2 x double> %70, <2 x double> %72)
%76 = bitcast double* %68 to <2 x double>*
store <2 x double> %75, <2 x double>* %76
%77 = load double, double* %46
%78 = fmul double %77, %67
%79 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 %31
store double %78, double* %79
%80 = icmp eq i32 %30, 2
br i1 %80, label %96, label %81
81: ; preds = %63, %65
%82 = load double, double* %20
%83 = fneg double %82
store double 0.000000e+00, double* %20
%84 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 1
%85 = bitcast double* %39 to <2 x double>*
%86 = load <2 x double>, <2 x double>* %85
%87 = bitcast double* %84 to <2 x double>*
%88 = load <2 x double>, <2 x double>* %87
%89 = insertelement <2 x double> poison, double %83, i64 0
%90 = shufflevector <2 x double> %89, <2 x double> poison, <2 x i32> zeroinitializer
%91 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %90, <2 x double> %86, <2 x double> %88)
%92 = bitcast double* %84 to <2 x double>*
store <2 x double> %91, <2 x double>* %92
%93 = load double, double* %46
%94 = fmul double %93, %83
%95 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 %31
store double %94, double* %95
br label %96
96: ; preds = %81, %65
%97 = bitcast [3 x double]* %0 to double**
%98 = bitcast [3 x double]* %1 to double**
%99 = tail call i32 @MAT3_inv3_second_col(double** %97, double** %98, i32 %30)
%100 = icmp ne i32 %99, 0
%101 = zext i1 %100 to i32
br label %102
102: ; preds = %96, %2
%103 = phi i32 [ 0, %2 ], [ %101, %96 ]
ret i32 %103
}