#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*/ free(double *);
double *malloc(int);
int podimat_inversion(double *a, int n) {
  double *a0 = malloc(sizeof(double) * n);
  for (int k = 0; k < n; k++) {
    double a00 = a[0];
    if (a00 + 1.0 == 1.0) {
      free(a0);
      return -1;
    }
    for (int i = 1; i < n; i++) {
      double ai0 = a[i * (i + 1) / 2];
      if (i <= n - k - 1)
        a0[i] = -ai0 / a00;
      else
        a0[i] = ai0 / a00;
      for (int j = 1; j <= i; j++) {
        a[(i - 1) * i / 2 + j - 1] = a[i * (i + 1) / 2 + j] + ai0 * a0[j];
      }
    }
    for (int i = 1; i < n; i++) {
      a[(n - 1) * n / 2 + i - 1] = a0[i];
    }
    a[n * (n + 1) / 2 - 1] = 1.0 / a00;
  }
  free(a0);
  return 0;
}


x86 assembly (clang, -O0):
<podimat_inversion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1389 <podimat_inversion+0x269>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe96(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  0xe89(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    119c <podimat_inversion+0x7c>
jp     119c <podimat_inversion+0x7c>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1399 <podimat_inversion+0x279>
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12e5 <podimat_inversion+0x1c5>
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1225 <podimat_inversion+0x105>
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    123c <podimat_inversion+0x11c>
movsd  -0x40(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x34(%rbp),%eax
jg     12d2 <podimat_inversion+0x1b2>
mov    -0x10(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x60(%rbp),%rax
add    -0x44(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
imul   -0x34(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
add    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1243 <podimat_inversion+0x123>
jmp    12d7 <podimat_inversion+0x1b7>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11a3 <podimat_inversion+0x83>
movl   $0x1,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1341 <podimat_inversion+0x221>
mov    -0x20(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
imul   -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x68(%rbp),%rax
add    -0x48(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    12ec <podimat_inversion+0x1cc>
movsd  0xcb7(%rip),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x70(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1149 <podimat_inversion+0x29>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<podimat_inversion>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0x0(,%r14,8),%edi
call   1040 <malloc@plt>
test   %r14d,%r14d
jle    16d5 <podimat_inversion+0x5b5>
movabs $0x7ffffffffffffffc,%r10
ff ff 7f
mov    %rax,0x8(%rsp)
lea    -0x1(%r14),%ecx
imul   %r14d,%ecx
mov    %ecx,%r11d
shr    $0x1f,%r11d
add    %ecx,%r11d
sar    %r11d
lea    -0x1(%r11),%eax
mov    %eax,0x18(%rsp)
lea    0x1(%r14),%ecx
imul   %r14d,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
add    $0xffffffff,%edx
movslq %edx,%r8
mov    %r14d,%r9d
lea    -0x2(%r9),%rcx
lea    -0x1(%r9),%rdi
lea    0x8(%rbx),%rax
mov    %rax,0x88(%rsp)
lea    -0x5(%r9),%rax
mov    %rax,0x48(%rsp)
mov    %rax,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
lea    (%rcx,%r11,1),%edx
cmp    %r11d,%edx
setl   %dl
shr    $0x20,%rcx
mov    0x8(%rsp),%rax
setne  %cl
or     %dl,%cl
mov    %cl,0x7(%rsp)
mov    %rdi,0x20(%rsp)
and    $0xfffffffffffffffc,%rdi
mov    %rdi,0x38(%rsp)
lea    0x1(%rdi),%rcx
mov    %rcx,0x30(%rsp)
lea    0x2(%r10),%rdx
mov    %rsi,%rcx
mov    %rsi,0x40(%rsp)
and    %rsi,%rdx
mov    %rdx,0x28(%rsp)
mov    %rax,%r13
add    $0x8,%r13
movslq %r11d,%r10
add    $0xffffffffffffffff,%r10
movsd  0xde7(%rip),%xmm8
movapd 0xdef(%rip),%xmm1
xor    %ebp,%ebp
mov    %r14,0x68(%rsp)
mov    %r11,0x60(%rsp)
mov    %r8,0x58(%rsp)
mov    %r9,0x80(%rsp)
mov    %r13,0x78(%rsp)
mov    %r10,0x50(%rsp)
jmp    1271 <podimat_inversion+0x151>
cs nopw 0x0(%rax,%rax,1)
movapd %xmm8,%xmm3
divsd  %xmm2,%xmm3
movsd  %xmm3,(%rbx,%r8,8)
add    $0x1,%rbp
cmp    %r9,%rbp
mov    0x8(%rsp),%rax
je     16d5 <podimat_inversion+0x5b5>
movsd  (%rbx),%xmm2
movapd %xmm2,%xmm3
addsd  %xmm8,%xmm3
ucomisd %xmm8,%xmm3
jne    128b <podimat_inversion+0x16b>
jnp    16d9 <podimat_inversion+0x5b9>
cmp    $0x1,%r14d
je     1250 <podimat_inversion+0x130>
mov    %rbp,0x70(%rsp)
mov    %ebp,%ecx
not    %ecx
add    %r14d,%ecx
movslq %ecx,%rax
mov    %rax,0x98(%rsp)
mov    $0x2,%r11d
mov    $0x1,%r10d
mov    $0x4,%eax
mov    $0x2,%ecx
xor    %r12d,%r12d
jmp    12f6 <podimat_inversion+0x1d6>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r11
add    $0x1,%r12
mov    0x1c(%rsp),%eax
mov    0x14(%rsp),%ecx
add    %eax,%ecx
add    $0x2,%eax
mov    0xa0(%rsp),%r10
cmp    %r9,%r10
je     1540 <podimat_inversion+0x420>
mov    %eax,0x1c(%rsp)
lea    0x1(%r10),%rdi
mov    %edi,%edx
imul   %r10d,%edx
shr    %edx
movsd  (%rbx,%rdx,8),%xmm3
movapd %xmm3,%xmm4
cmp    0x98(%rsp),%r10
jg     1321 <podimat_inversion+0x201>
movapd %xmm3,%xmm4
xorpd  %xmm1,%xmm4
mov    %ecx,%r14d
shr    %r14d
divsd  %xmm2,%xmm4
mov    0x8(%rsp),%rax
movsd  %xmm4,(%rax,%r10,8)
lea    -0x1(%r10),%esi
imul   %r10d,%esi
mov    %esi,%r15d
shr    $0x1f,%r15d
add    %esi,%r15d
sar    %r15d
mov    $0x1,%r8d
cmp    $0x4,%r10
mov    %ecx,0x14(%rsp)
mov    %rdi,0xa0(%rsp)
jae    1420 <podimat_inversion+0x300>
mov    %r8,%rbp
test   $0x1,%r11b
jne    1399 <podimat_inversion+0x279>
lea    -0x1(%r15),%eax
add    %r8d,%edx
mov    0x8(%rsp),%rcx
movsd  (%rcx,%r8,8),%xmm0
mulsd  %xmm3,%xmm0
addsd  (%rbx,%rdx,8),%xmm0
add    %r8d,%eax
cltq
movsd  %xmm0,(%rbx,%rax,8)
lea    0x1(%r8),%rbp
cmp    %r8,%r10
je     12d0 <podimat_inversion+0x1b0>
mov    %r11,%rdx
sub    %rbp,%rdx
add    %ebp,%r14d
lea    0x0(,%rbp,8),%rsi
add    %r13,%rsi
lea    (%r15,%rbp,1),%edi
add    $0xffffffff,%edi
add    %ebp,%r15d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%r14,%rbp,1),%rax
mov    %eax,%ecx
movsd  -0x8(%rsi,%rbp,8),%xmm0
mulsd  %xmm3,%xmm0
addsd  (%rbx,%rcx,8),%xmm0
lea    (%rdi,%rbp,1),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rbx,%rcx,8)
add    $0x1,%eax
movsd  (%rsi,%rbp,8),%xmm0
mulsd  %xmm3,%xmm0
addsd  (%rbx,%rax,8),%xmm0
lea    (%r15,%rbp,1),%eax
cltq
movsd  %xmm0,(%rbx,%rax,8)
add    $0x2,%rbp
cmp    %rbp,%rdx
jne    13d0 <podimat_inversion+0x2b0>
jmp    12d0 <podimat_inversion+0x1b0>
nopw   0x0(%rax,%rax,1)
lea    (%r15,%r12,1),%esi
cmp    %r15d,%esi
jl     1367 <podimat_inversion+0x247>
mov    %r12,%rsi
shr    $0x20,%rsi
jne    1367 <podimat_inversion+0x247>
mov    $0xfffffffe,%edi
sub    %r14d,%edi
cmp    %r12d,%edi
jb     1367 <podimat_inversion+0x247>
test   %rsi,%rsi
jne    1367 <podimat_inversion+0x247>
lea    (%rbx,%r11,8),%rsi
lea    (%rsi,%r14,8),%rdi
movslq %r15d,%rsi
lea    (%rbx,%rsi,8),%rbp
cmp    %rdi,%rbp
jae    1485 <podimat_inversion+0x365>
lea    (%rbx,%r10,8),%rdi
mov    0x88(%rsp),%rax
lea    (%rax,%r14,8),%rbp
lea    (%rdi,%rsi,8),%rsi
cmp    %rsi,%rbp
jb     1367 <podimat_inversion+0x247>
mov    0x14(%rsp),%r13d
shr    %r13
add    $0x1,%r13
mov    %r10,%rsi
and    $0xfffffffffffffffc,%rsi
mov    %r10,%r8
movabs $0x7ffffffffffffffc,%rax
ff ff 7f
and    %rax,%r8
mov    %r8,0x90(%rsp)
or     $0x1,%r8
movapd %xmm3,%xmm4
unpcklpd %xmm3,%xmm4
mov    %r15d,%ebp
xor    %edi,%edi
mov    0x8(%rsp),%rcx
cs nopw 0x0(%rax,%rax,1)
lea    (%rdi,%r13,1),%r9d
movupd (%rbx,%r9,8),%xmm5
movupd 0x10(%rbx,%r9,8),%xmm6
movupd 0x8(%rcx,%rdi,8),%xmm7
movupd 0x18(%rcx,%rdi,8),%xmm0
mulpd  %xmm4,%xmm7
addpd  %xmm5,%xmm7
mulpd  %xmm4,%xmm0
addpd  %xmm6,%xmm0
lea    0x0(%rbp,%rdi,1),%eax
cltq
movupd %xmm7,(%rbx,%rax,8)
movupd %xmm0,0x10(%rbx,%rax,8)
add    $0x4,%rdi
cmp    %rdi,%rsi
jne    14d0 <podimat_inversion+0x3b0>
cmp    0x90(%rsp),%r10
mov    0x80(%rsp),%r9
mov    0x78(%rsp),%r13
je     12d0 <podimat_inversion+0x1b0>
jmp    1367 <podimat_inversion+0x247>
nopw   0x0(%rax,%rax,1)
mov    0x68(%rsp),%r14
cmp    $0x1,%r14d
mov    0x60(%rsp),%r11
mov    0x58(%rsp),%r8
mov    0x50(%rsp),%r10
mov    0x70(%rsp),%rbp
je     1250 <podimat_inversion+0x130>
cmpq   $0x4,0x20(%rsp)
setb   %cl
or     0x7(%rsp),%cl
mov    $0x1,%ecx
jne    162d <podimat_inversion+0x50d>
cmpq   $0x4,0x48(%rsp)
jae    1587 <podimat_inversion+0x467>
xor    %ecx,%ecx
jmp    15e0 <podimat_inversion+0x4c0>
mov    0x28(%rsp),%rdx
mov    %r11d,%esi
xor    %ecx,%ecx
mov    0x8(%rsp),%rax
cs nopw 0x0(%rax,%rax,1)
movups 0x8(%rax,%rcx,8),%xmm3
movups 0x18(%rax,%rcx,8),%xmm4
movslq %esi,%rsi
movups %xmm3,(%rbx,%rsi,8)
movups %xmm4,0x10(%rbx,%rsi,8)
movupd 0x28(%rax,%rcx,8),%xmm3
movupd 0x38(%rax,%rcx,8),%xmm4
lea    0x4(%rsi),%edi
movslq %edi,%rdi
movupd %xmm3,(%rbx,%rdi,8)
movupd %xmm4,0x10(%rbx,%rdi,8)
add    $0x8,%rcx
add    $0x8,%esi
add    $0xfffffffffffffffe,%rdx
jne    15a0 <podimat_inversion+0x480>
testb  $0x1,0x40(%rsp)
je     1618 <podimat_inversion+0x4f8>
lea    0x0(,%rcx,8),%rdx
or     $0x1,%ecx
add    0x18(%rsp),%ecx
or     $0x8,%rdx
mov    0x8(%rsp),%rax
movupd (%rax,%rdx,1),%xmm3
movupd 0x10(%rax,%rdx,1),%xmm4
movslq %ecx,%rcx
movupd %xmm3,(%rbx,%rcx,8)
movupd %xmm4,0x10(%rbx,%rcx,8)
mov    0x30(%rsp),%rcx
mov    0x38(%rsp),%rax
cmp    %rax,0x20(%rsp)
je     1250 <podimat_inversion+0x130>
mov    %r9d,%esi
sub    %ecx,%esi
mov    %rcx,%rdx
not    %rdx
add    %r9,%rdx
and    $0x3,%rsi
je     166b <podimat_inversion+0x54b>
mov    0x8(%rsp),%rax
cs nopw 0x0(%rax,%rax,1)
movsd  (%rax,%rcx,8),%xmm3
lea    (%r10,%rcx,1),%edi
movslq %edi,%rdi
movsd  %xmm3,(%rbx,%rdi,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    1650 <podimat_inversion+0x530>
cmp    $0x3,%rdx
jb     1250 <podimat_inversion+0x130>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x8(%rsp),%rsi
movsd  (%rsi,%rcx,8),%xmm0
lea    (%r10,%rcx,1),%eax
cltq
movsd  %xmm0,(%rbx,%rax,8)
movsd  0x8(%rsi,%rcx,8),%xmm0
lea    (%r11,%rcx,1),%rax
cltq
movsd  %xmm0,(%rbx,%rax,8)
movsd  0x10(%rsi,%rcx,8),%xmm0
lea    0x1(%rax),%edx
movslq %edx,%rdx
movsd  %xmm0,(%rbx,%rdx,8)
movsd  0x18(%rsi,%rcx,8),%xmm0
add    $0x2,%eax
cltq
movsd  %xmm0,(%rbx,%rax,8)
add    $0x4,%rcx
cmp    %rcx,%r9
jne    1680 <podimat_inversion+0x560>
jmp    1250 <podimat_inversion+0x130>
xor    %ebx,%ebx
jmp    16de <podimat_inversion+0x5be>
mov    $0xffffffff,%ebx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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