#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*/ checkroots(double *, int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
double lpa(double *x, int N, double *b, int M, int S) {
  int i, j;
  double s, at, a0, *rx, *rc;
  rx = (double *)malloc((M + 2) * sizeof(double));
  rc = (double *)malloc((M + 2) * sizeof(double));
  for (i = 0; i <= M + 1; i++)
    for (rx[i] = j = 0; j < N - i; j++)
      rx[i] += x[j] * x[i + j];
  b[0] = 1.;
  b[1] = rc[0] = rx[0] != 0. ? -rx[1] / rx[0] : 0.;
  for (i = 2; i <= M; i++)
    b[i] = 0;
  a0 = rx[0] + rx[1] * rc[0];
  for (i = 1; i < M; i++) {
    for (s = j = 0; j <= i; j++)
      s += rx[i - j + 1] * b[j];
    rc[i] = a0 != 0. ? -s / a0 : 0.;
    for (j = 1; j <= (i + 1) >> 1; j++) {
      at = b[j] + rc[i] * b[i - j + 1];
      b[i - j + 1] += rc[i] * b[j];
      b[j] = at;
    }
    b[i + 1] = rc[i];
    a0 += rc[i] * s;
    if (a0 < 0.)
      fprintf(stderr, "lpa: Singular matrix\n");
  }
  free(rx);
  free(rc);
  if (S > 0)
    checkroots(b, M, S);
  return (a0);
}


x86 assembly (clang, -O0):
<lpa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     1222 <lpa+0xe2>
movl   $0x0,-0x28(%rbp)
mov    -0x48(%rbp),%rax
movslq -0x24(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x24(%rbp),%ecx
cmp    %ecx,%eax
jge    120f <lpa+0xcf>
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x48(%rbp),%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    11b7 <lpa+0x77>
jmp    1214 <lpa+0xd4>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    118f <lpa+0x4f>
mov    -0x18(%rbp),%rax
movsd  0xdd2(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x48(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1252 <lpa+0x112>
jp     1252 <lpa+0x112>
jmp    1284 <lpa+0x144>
mov    -0x48(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x48(%rbp),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    1291 <lpa+0x151>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    1291 <lpa+0x151>
movsd  -0x58(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movl   $0x2,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     12d8 <lpa+0x198>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12ae <lpa+0x16e>
mov    -0x48(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x48(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1501 <lpa+0x3c1>
movl   $0x0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     136e <lpa+0x22e>
mov    -0x48(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1320 <lpa+0x1e0>
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    138b <lpa+0x24b>
jp     138b <lpa+0x24b>
jmp    13b6 <lpa+0x276>
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    13c3 <lpa+0x283>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    13c3 <lpa+0x283>
movsd  -0x60(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
sar    $0x1,%ecx
cmp    %ecx,%eax
jg     1488 <lpa+0x348>
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x50(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x50(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    13dc <lpa+0x29c>
mov    -0x50(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    14ee <lpa+0x3ae>
mov    0x2b00(%rip),%rax
mov    (%rax),%edi
lea    0xb1f(%rip),%rsi
call   1040 <fprintf@plt>
jmp    14f3 <lpa+0x3b3>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1305 <lpa+0x1c5>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x20(%rbp)
jle    152c <lpa+0x3ec>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1060 <checkroots@plt>
movsd  -0x40(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lpa>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r8d,0x1c(%rsp)
mov    %ecx,%ebx
mov    %rdx,0x8(%rsp)
mov    %esi,%r13d
mov    %rdi,%r15
lea    0x10(,%rbx,8),%ebp
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,%rbp
mov    %rbx,0x10(%rsp)
cmp    $0xffffffff,%ebx
jge    1237 <lpa+0xe7>
movabs $0x3ff0000000000000,%rax
mov    0x8(%rsp),%rcx
mov    %rax,(%rcx)
movsd  (%r14),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    11bc <lpa+0x6c>
jnp    11ce <lpa+0x7e>
movsd  0x8(%r14),%xmm0
xorpd  0xe36(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x0(%rbp)
movsd  %xmm0,0x8(%rcx)
mov    0x10(%rsp),%rbx
cmp    $0x1,%ebx
jg     12e5 <lpa+0x195>
movsd  0x8(%r14),%xmm5
mulsd  0x0(%rbp),%xmm5
addsd  (%r14),%xmm5
movapd %xmm5,0x20(%rsp)
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    0x1c(%rsp),%edx
test   %edx,%edx
jle    1223 <lpa+0xd3>
mov    0x8(%rsp),%rdi
mov    0x10(%rsp),%rsi
call   1070 <checkroots@plt>
movaps 0x20(%rsp),%xmm0
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x10(%rsp),%rax
lea    0x2(%rax),%r8d
lea    0x8(%r15),%rcx
xor    %r9d,%r9d
xor    %esi,%esi
mov    %r13d,%eax
jmp    1264 <lpa+0x114>
xchg   %ax,%ax
add    $0x1,%rsi
add    $0xffffffff,%eax
add    $0x8,%r9
cmp    %r8,%rsi
je     1199 <lpa+0x49>
mov    %eax,%eax
movq   $0x0,(%r14,%rsi,8)
cmp    %r13d,%esi
jge    1250 <lpa+0x100>
cmp    $0x1,%eax
jne    1280 <lpa+0x130>
xorpd  %xmm0,%xmm0
xor    %ebx,%ebx
jmp    12c3 <lpa+0x173>
mov    %eax,%edi
and    $0xfffffffe,%edi
lea    (%rcx,%r9,1),%rdx
xorpd  %xmm0,%xmm0
xor    %ebx,%ebx
nop
movsd  -0x8(%rcx,%rbx,8),%xmm1
mulsd  -0x8(%rdx,%rbx,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rsi,8)
movsd  (%rcx,%rbx,8),%xmm0
mulsd  (%rdx,%rbx,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r14,%rsi,8)
add    $0x2,%rbx
cmp    %rbx,%rdi
jne    1290 <lpa+0x140>
test   $0x1,%al
je     1250 <lpa+0x100>
movsd  (%r15,%rbx,8),%xmm1
add    %rsi,%rbx
mulsd  (%r15,%rbx,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rsi,8)
jmp    1250 <lpa+0x100>
lea    0x10(%rcx),%rdi
lea    -0x1(%rbx),%edx
shl    $0x3,%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    0x8(%rsp),%r8
movsd  0x8(%r14),%xmm5
mulsd  0x0(%rbp),%xmm5
addsd  (%r14),%xmm5
mov    %ebx,%r9d
mov    %r14,%r15
add    $0x10,%r15
lea    0x18(%r8),%rax
mov    %rax,0x38(%rsp)
lea    0x8(%r8),%r13
mov    $0x2,%r10d
mov    $0x1,%eax
xorpd  %xmm6,%xmm6
mov    %r13,%r11
mov    %r9,0x30(%rsp)
jmp    1358 <lpa+0x208>
nopl   0x0(%rax)
add    $0x1,%r10
add    $0x8,%r15
add    $0x8,%r11
mov    %r12,%rax
cmp    %r9,%r12
je     11f6 <lpa+0xa6>
mov    %r10,%rcx
shr    $0x2,%rcx
cmp    $0x3,%rax
jae    1380 <lpa+0x230>
xor    %edx,%edx
xorpd  %xmm0,%xmm0
test   $0x3,%r10b
jne    13f4 <lpa+0x2a4>
jmp    142a <lpa+0x2da>
nopw   0x0(%rax,%rax,1)
lea    0x0(,%rcx,4),%rsi
neg    %rsi
xorpd  %xmm0,%xmm0
mov    0x38(%rsp),%rdi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
movsd  (%r15,%rdx,8),%xmm1
mulsd  -0x18(%rdi),%xmm1
addsd  %xmm0,%xmm1
movsd  -0x8(%r15,%rdx,8),%xmm2
mulsd  -0x10(%rdi),%xmm2
addsd  %xmm1,%xmm2
movsd  -0x10(%r15,%rdx,8),%xmm1
mulsd  -0x8(%rdi),%xmm1
movsd  -0x18(%r15,%rdx,8),%xmm0
addsd  %xmm2,%xmm1
mulsd  (%rdi),%xmm0
addsd  %xmm1,%xmm0
add    $0xfffffffffffffffc,%rdx
add    $0x20,%rdi
cmp    %rdx,%rsi
jne    13a0 <lpa+0x250>
neg    %rdx
test   $0x3,%r10b
je     142a <lpa+0x2da>
mov    %r10d,%esi
and    $0x3,%esi
lea    (%r8,%rdx,8),%rdi
shl    $0x3,%rdx
mov    %r15,%rbx
sub    %rdx,%rbx
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
movsd  (%rbx),%xmm1
mulsd  (%rdi,%rdx,8),%xmm1
addsd  %xmm1,%xmm0
add    $0x1,%rdx
add    $0xfffffffffffffff8,%rbx
cmp    %rdx,%rsi
jne    1410 <lpa+0x2c0>
mov    %r10,%rsi
shr    %rsi
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm5
jne    143c <lpa+0x2ec>
jnp    144c <lpa+0x2fc>
movapd %xmm0,%xmm1
xorpd  0xbb8(%rip),%xmm1
divsd  %xmm5,%xmm1
movsd  %xmm1,0x0(%rbp,%rax,8)
mov    $0x1,%edx
cmp    $0x1,%rsi
je     14e8 <lpa+0x398>
add    %rcx,%rcx
neg    %rcx
mov    $0x1,%edx
mov    %r11,%rsi
nop
movsd  -0x8(%r13,%rdx,8),%xmm2
movsd  (%rsi),%xmm3
movapd %xmm1,%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm2,%xmm4
mulsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
movsd  %xmm1,(%rsi)
movsd  %xmm4,-0x8(%r13,%rdx,8)
movsd  0x0(%rbp,%rax,8),%xmm1
movsd  0x0(%r13,%rdx,8),%xmm2
movsd  -0x8(%rsi),%xmm3
movapd %xmm1,%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm2,%xmm4
mulsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
movsd  %xmm1,-0x8(%rsi)
movsd  %xmm4,0x0(%r13,%rdx,8)
movsd  0x0(%rbp,%rax,8),%xmm1
add    $0xfffffffffffffff0,%rsi
lea    (%rcx,%rdx,1),%rdi
add    $0x2,%rdi
add    $0x2,%rdx
cmp    $0x1,%rdi
jne    1470 <lpa+0x320>
lea    0x1(%rax),%r12
test   $0x2,%r10b
je     152a <lpa+0x3da>
movsd  (%r8,%rdx,8),%xmm2
mov    %r12,%rcx
sub    %rdx,%rcx
movsd  (%r8,%rcx,8),%xmm3
movapd %xmm1,%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm2,%xmm4
mulsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
movsd  %xmm1,(%r8,%rcx,8)
movsd  %xmm4,(%r8,%rdx,8)
movsd  0x0(%rbp,%rax,8),%xmm1
movsd  %xmm1,(%r8,%r12,8)
mulsd  0x0(%rbp,%rax,8),%xmm0
addsd  %xmm0,%xmm5
ucomisd %xmm5,%xmm6
jbe    1340 <lpa+0x1f0>
mov    0x2a95(%rip),%rax
mov    (%rax),%edi
lea    0xabc(%rip),%rsi
movapd %xmm5,0x20(%rsp)
mov    %r10,%rbx
mov    %r11,0x40(%rsp)
call   1050 <fprintf@plt>
mov    0x40(%rsp),%r11
xorpd  %xmm6,%xmm6
mov    %rbx,%r10
mov    0x30(%rsp),%r9
movapd 0x20(%rsp),%xmm5
mov    0x8(%rsp),%r8
jmp    1340 <lpa+0x1f0>

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

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