#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 */
double fabs(double);
int solve_linear_system(int n, double A[n][n], double b[n]) {
  int i, j, pivot, k;
  double temp, scale, *p, *q, maxvalue, tmp;
  for (i = 0; i < n - 1; ++i) {
    pivot = i;
    maxvalue = fabs(A[i][i]);
    for (j = i + 1; j < n; ++j) {
      temp = fabs(A[j][i]);
      if (temp > maxvalue) {
        maxvalue = temp;
        pivot = j;
      }
    }
    if (maxvalue == 0.0)
      return 0;
    if (pivot != i) {
      for (k = 0; k < n; k++) {
        tmp = A[i][k];
        A[i][k] = A[pivot][k];
        A[pivot][k] = tmp;
      }
      tmp = b[i];
      b[i] = b[pivot];
      b[pivot] = tmp;
    }
    for (j = i + 1; j < n; ++j) {
      scale = -A[j][i] / A[i][i];
      for (p = A[j] + i + 1, q = A[i] + i + 1; p < A[j] + n;)
        (*p++) += scale * (*q++);
      b[j] += scale * b[i];
    }
  }
  if (fabs(A[n - 1][n - 1]) == 0.0)
    return 0;
  b[n - 1] /= A[n - 1][n - 1];
  for (i = n - 2; i >= 0; --i) {
    for (p = b + i + 1, q = A[i] + i + 1; p < b + n;)
      b[i] -= (*p++) * (*q++);
    b[i] /= A[i][i];
  }
  return 1;
}


x86 assembly (clang, -O0):
<solve_linear_system>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    145a <solve_linear_system+0x35a>
mov    -0x60(%rbp),%rdx
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xea5(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11dc <solve_linear_system+0xdc>
mov    -0x60(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xe60(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    11c9 <solve_linear_system+0xc9>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    11ce <solve_linear_system+0xce>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    116d <solve_linear_system+0x6d>
movsd  -0x50(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1200 <solve_linear_system+0x100>
jp     1200 <solve_linear_system+0x100>
movl   $0x0,-0x4(%rbp)
jmp    160a <solve_linear_system+0x50a>
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     12e9 <solve_linear_system+0x1e9>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12ab <solve_linear_system+0x1ab>
mov    -0x60(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x58(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1213 <solve_linear_system+0x113>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x58(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1447 <solve_linear_system+0x347>
mov    -0x60(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
mov    %rax,-0x48(%rbp)
mov    -0x60(%rbp),%rsi
mov    -0x40(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x20(%rbp),%rdx
imul   %rsi,%rdx
shl    $0x3,%rdx
add    %rdx,%rcx
movslq -0x8(%rbp),%rdx
shl    $0x3,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    140d <solve_linear_system+0x30d>
movsd  -0x38(%rbp),%xmm0
mov    -0x48(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x48(%rbp)
movsd  (%rax),%xmm2
mov    -0x40(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x40(%rbp)
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    13a2 <solve_linear_system+0x2a2>
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12f2 <solve_linear_system+0x1f2>
jmp    144c <solve_linear_system+0x34c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111d <solve_linear_system+0x1d>
mov    -0x60(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xb75(%rip),%xmm1
pand   %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    14ae <solve_linear_system+0x3ae>
jp     14ae <solve_linear_system+0x3ae>
movl   $0x0,-0x4(%rbp)
jmp    160a <solve_linear_system+0x50a>
mov    -0x60(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1603 <solve_linear_system+0x503>
mov    -0x60(%rbp),%rdx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq -0x8(%rbp),%rdx
shl    $0x3,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    15bf <solve_linear_system+0x4bf>
mov    -0x40(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x40(%rbp)
movsd  (%rax),%xmm0
mov    -0x48(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x48(%rbp)
movsd  (%rax),%xmm2
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1547 <solve_linear_system+0x447>
mov    -0x60(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    14fc <solve_linear_system+0x3fc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_linear_system>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe0,%rsp
mov    %rdx,-0x78(%rsp)
mov    %rsi,-0x80(%rsp)
mov    %edi,%ebx
lea    -0x1(%rdi),%eax
mov    %eax,-0x64(%rsp)
cmp    $0x2,%edi
jl     1904 <solve_linear_system+0x804>
mov    -0x64(%rsp),%eax
mov    %rax,0x70(%rsp)
lea    0x1(%rbx),%rax
mov    %rax,0x98(%rsp)
lea    0x0(,%rbx,8),%rsi
lea    0x8(,%rbx,8),%rax
mov    %rax,-0x10(%rsp)
mov    %rbx,%rax
shl    $0x4,%rax
mov    -0x80(%rsp),%rbp
add    %rbp,%rax
lea    0x0(,%rbx,8),%r14
add    %rbp,%r14
mov    $0xfffffffffffffff7,%r8
sub    %r14,%r8
mov    %rsi,%rdx
xor    $0xfffffffffffffff8,%rdx
mov    %rdx,-0x18(%rsp)
mov    %rsi,%rdx
neg    %rdx
mov    %rdx,0xb0(%rsp)
mov    %ebx,%edx
and    $0xfffffffc,%edx
mov    %rdx,0x40(%rsp)
add    $0xfffffffffffffffc,%rdx
mov    %rdx,0x38(%rsp)
mov    %rdx,%rcx
shr    $0x2,%rcx
add    $0x1,%rcx
mov    %rcx,%rdx
mov    %rcx,0x30(%rsp)
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0x28(%rsp)
mov    %rbx,%rcx
neg    %rcx
mov    %rcx,0x48(%rsp)
movapd 0xe29(%rip),%xmm0
xorpd  %xmm8,%xmm8
movapd 0xe2b(%rip),%xmm9
lea    0x2(%rbx),%rcx
mov    %rcx,0x88(%rsp)
lea    0x10(%rbp,%rbx,8),%rcx
lea    0x8(%rbp),%r9
lea    0x10(%rbp),%rdx
mov    %rdx,0x50(%rsp)
lea    0x30(%rbp),%r10
lea    0x38(%rbp,%rbx,8),%rdx
mov    %rdx,-0x20(%rsp)
add    $0x38,%rbp
mov    $0x1,%r13d
mov    %r8,0x60(%rsp)
mov    %r8,-0x50(%rsp)
xor    %edx,%edx
mov    %rax,0x68(%rsp)
mov    %rax,-0x28(%rsp)
mov    %rcx,0x58(%rsp)
mov    %rcx,-0x30(%rsp)
mov    %r9,-0x38(%rsp)
mov    %r10,0x20(%rsp)
mov    %rbx,-0x48(%rsp)
mov    %rdi,0x78(%rsp)
mov    %rsi,0xc8(%rsp)
jmp    12c3 <solve_linear_system+0x1c3>
nopl   0x0(%rax)
mov    0x8(%rsp),%r13
add    $0x1,%r13
mov    -0x10(%rsp),%rax
mov    0x80(%rsp),%r14
add    %rax,%r14
mov    -0x8(%rsp),%r10
add    %rsi,%r10
mov    -0x60(%rsp),%r9
add    %rsi,%r9
add    %rax,-0x20(%rsp)
mov    0x10(%rsp),%rbp
add    %rax,%rbp
add    %rax,-0x30(%rsp)
add    %rsi,-0x28(%rsp)
mov    -0x50(%rsp),%rax
add    -0x18(%rsp),%rax
mov    %rax,-0x50(%rsp)
mov    (%rsp),%rdx
cmp    0x70(%rsp),%rdx
mov    0x78(%rsp),%rdi
je     1904 <solve_linear_system+0x804>
mov    %r10,-0x8(%rsp)
mov    %r9,-0x60(%rsp)
mov    %rdx,%rax
mov    %rdx,%r11
imul   %rbx,%r11
mov    -0x80(%rsp),%rcx
lea    (%rcx,%r11,8),%r10
movsd  (%r10,%rdx,8),%xmm3
andpd  %xmm0,%xmm3
lea    0x1(%rdx),%r8
cmp    %rbx,%r8
mov    %rdx,-0x58(%rsp)
jae    1330 <solve_linear_system+0x230>
mov    %r14,%rcx
mov    %r13,%rdx
xchg   %ax,%ax
movsd  (%rcx),%xmm4
andpd  %xmm0,%xmm4
ucomisd %xmm3,%xmm4
cmova  %edx,%eax
maxsd  %xmm3,%xmm4
add    $0x1,%rdx
add    %rsi,%rcx
movapd %xmm4,%xmm3
cmp    %rdx,%rbx
jne    1300 <solve_linear_system+0x200>
jmp    1334 <solve_linear_system+0x234>
cs nopw 0x0(%rax,%rax,1)
nop
movapd %xmm3,%xmm4
ucomisd %xmm8,%xmm4
jne    1341 <solve_linear_system+0x241>
jnp    1a00 <solve_linear_system+0x900>
mov    %rbp,0x10(%rsp)
mov    %r14,0x80(%rsp)
mov    %eax,%ecx
mov    -0x58(%rsp),%r12
cmp    %rcx,%r12
mov    %r8,(%rsp)
je     1536 <solve_linear_system+0x436>
movslq %eax,%r9
mov    %r9,%r14
imul   %rbx,%r14
mov    -0x80(%rsp),%rax
lea    (%rax,%r14,8),%r8
cmp    $0x4,%edi
jb     13a9 <solve_linear_system+0x2a9>
lea    0x8(,%r9,8),%rax
imul   %rbx,%rax
add    -0x80(%rsp),%rax
cmp    %r10,%rax
jbe    142c <solve_linear_system+0x32c>
add    %rbx,%r11
mov    -0x80(%rsp),%rax
lea    (%rax,%r11,8),%rax
cmp    %rax,%r8
jae    142c <solve_linear_system+0x32c>
xor    %ecx,%ecx
mov    -0x60(%rsp),%rbp
mov    %rcx,%rax
test   $0x1,%bl
je     13d7 <solve_linear_system+0x2d7>
movsd  (%r10,%rcx,8),%xmm3
movsd  (%r8,%rcx,8),%xmm4
movsd  %xmm4,(%r10,%rcx,8)
movsd  %xmm3,(%r8,%rcx,8)
mov    %rcx,%rax
or     $0x1,%rax
not    %rcx
cmp    0x48(%rsp),%rcx
je     1510 <solve_linear_system+0x410>
mov    -0x38(%rsp),%rcx
lea    (%rcx,%r14,8),%rcx
xchg   %ax,%ax
movsd  -0x8(%rbp,%rax,8),%xmm3
movsd  -0x8(%rcx,%rax,8),%xmm4
movsd  %xmm4,-0x8(%rbp,%rax,8)
movsd  %xmm3,-0x8(%rcx,%rax,8)
movsd  0x0(%rbp,%rax,8),%xmm3
movsd  (%rcx,%rax,8),%xmm4
movsd  %xmm4,0x0(%rbp,%rax,8)
movsd  %xmm3,(%rcx,%rax,8)
add    $0x2,%rax
cmp    %rax,%rbx
jne    13f0 <solve_linear_system+0x2f0>
jmp    1510 <solve_linear_system+0x410>
cmpq   $0x0,0x38(%rsp)
je     14b0 <solve_linear_system+0x3b0>
mov    0x20(%rsp),%rax
lea    (%rax,%r14,8),%rcx
mov    0x28(%rsp),%rbp
xor    %eax,%eax
mov    -0x8(%rsp),%rdx
nopl   0x0(%rax)
movups -0x30(%rdx,%rax,8),%xmm3
movups -0x20(%rdx,%rax,8),%xmm4
movups -0x30(%rcx,%rax,8),%xmm5
movups -0x20(%rcx,%rax,8),%xmm6
movups %xmm5,-0x30(%rdx,%rax,8)
movups %xmm6,-0x20(%rdx,%rax,8)
movups %xmm3,-0x30(%rcx,%rax,8)
movups %xmm4,-0x20(%rcx,%rax,8)
movupd -0x10(%rdx,%rax,8),%xmm3
movupd (%rdx,%rax,8),%xmm4
movupd -0x10(%rcx,%rax,8),%xmm5
movupd (%rcx,%rax,8),%xmm6
movupd %xmm5,-0x10(%rdx,%rax,8)
movupd %xmm6,(%rdx,%rax,8)
movupd %xmm3,-0x10(%rcx,%rax,8)
movupd %xmm4,(%rcx,%rax,8)
add    $0x8,%rax
add    $0xfffffffffffffffe,%rbp
jne    1450 <solve_linear_system+0x350>
jmp    14b2 <solve_linear_system+0x3b2>
xor    %eax,%eax
testb  $0x1,0x30(%rsp)
mov    -0x60(%rsp),%rbp
je     14f2 <solve_linear_system+0x3f2>
movupd (%r10,%rax,8),%xmm3
movupd 0x10(%r10,%rax,8),%xmm4
movupd (%r8,%rax,8),%xmm5
movupd 0x10(%r8,%rax,8),%xmm6
movupd %xmm5,(%r10,%rax,8)
movupd %xmm6,0x10(%r10,%rax,8)
movupd %xmm3,(%r8,%rax,8)
movupd %xmm4,0x10(%r8,%rax,8)
mov    0x40(%rsp),%rax
mov    %rax,%rcx
cmp    %rbx,%rax
jne    13b0 <solve_linear_system+0x2b0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    -0x78(%rsp),%rax
movsd  (%rax,%r9,8),%xmm3
mov    -0x58(%rsp),%r12
movsd  (%rax,%r12,8),%xmm4
movsd  %xmm3,(%rax,%r12,8)
movsd  %xmm4,(%rax,%r9,8)
mov    (%rsp),%r8
mov    %r13,0x8(%rsp)
cmp    %rbx,%r8
jae    1260 <solve_linear_system+0x160>
mov    -0x10(%rsp),%rcx
imul   %r12,%rcx
mov    %rsi,%rdx
imul   %r12,%rdx
mov    -0x18(%rsp),%rdi
imul   %r12,%rdi
mov    0x58(%rsp),%rax
add    %rcx,%rax
mov    %rax,0xd0(%rsp)
add    0x68(%rsp),%rdx
mov    %rdx,0xd8(%rsp)
add    0x60(%rsp),%rdi
mov    %rdi,0xb8(%rsp)
mov    -0x38(%rsp),%rax
add    %rcx,%rax
mov    %rax,0x90(%rsp)
mov    0x50(%rsp),%rax
mov    %rcx,0xa8(%rsp)
add    %rcx,%rax
mov    %rax,0xa0(%rsp)
lea    (%r10,%r12,8),%rax
mov    %rax,-0x70(%rsp)
mov    -0x50(%rsp),%rax
mov    %rax,0x18(%rsp)
mov    -0x28(%rsp),%rdx
mov    -0x30(%rsp),%rdi
mov    -0x20(%rsp),%r13
xor    %ebp,%ebp
mov    0x8(%rsp),%r9
jmp    161e <solve_linear_system+0x51e>
nopw   0x0(%rax,%rax,1)
mov    -0x78(%rsp),%rax
mulsd  (%rax,%r12,8),%xmm3
addsd  (%rax,%r9,8),%xmm3
movsd  %xmm3,(%rax,%r9,8)
add    $0x1,%r9
add    $0x1,%rbp
mov    0xc8(%rsp),%rsi
add    %rsi,%r13
add    %rsi,%rdi
add    %rsi,%rdx
sub    %rsi,0x18(%rsp)
cmp    %rbx,%r9
je     1260 <solve_linear_system+0x160>
mov    %rbp,-0x40(%rsp)
cmp    %rdx,%rdi
mov    %rdx,%r8
cmova  %rdi,%r8
mov    %rsi,%rax
imul   %rbp,%rax
mov    0xd0(%rsp),%rcx
add    %rax,%rcx
add    0xd8(%rsp),%rax
cmp    %rax,%rcx
mov    %rax,%r14
cmova  %rcx,%r14
mov    %rbx,%rsi
mov    %rax,%r15
cmova  %rcx,%r15
cmova  %rcx,%rax
mov    %r9,%rcx
imul   %rbx,%rcx
mov    -0x80(%rsp),%rbp
lea    0x0(,%rcx,8),%rcx
add    %rbp,%rcx
movsd  (%rcx,%r12,8),%xmm3
xorpd  %xmm9,%xmm3
mov    -0x70(%rsp),%rbx
divsd  (%rbx),%xmm3
mov    -0x40(%rsp),%rbp
mov    %rsi,%rbx
lea    (%rcx,%rsi,8),%r10
lea    (%rcx,%r12,8),%r11
add    $0x8,%r11
cmp    %r10,%r11
jae    15e0 <solve_linear_system+0x4e0>
mov    0xb0(%rsp),%rcx
imul   %rbp,%rcx
add    0xb8(%rsp),%rcx
add    %rcx,%r15
mov    %r15,0xc0(%rsp)
cmp    $0x18,%r15
jae    16e0 <solve_linear_system+0x5e0>
mov    -0x70(%rsp),%rax
jmp    18d0 <solve_linear_system+0x7d0>
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%r15
imul   %rbx,%r15
mov    0x98(%rsp),%rbx
lea    (%rbx,%r15,1),%r12
mov    -0x80(%rsp),%rsi
lea    (%rsi,%r12,8),%rbp
mov    0xa8(%rsp),%r12
add    %r12,%rbp
add    %rcx,%rax
and    $0xfffffffffffffff8,%rax
mov    0xa0(%rsp),%rbx
add    %rax,%rbx
cmp    %rbx,%rbp
jae    1758 <solve_linear_system+0x658>
add    0x88(%rsp),%r15
mov    -0x80(%rsp),%rsi
lea    (%rsi,%r15,8),%rbx
add    %r12,%rbx
add    %rax,%rbx
cmp    %rbx,0x90(%rsp)
jae    1758 <solve_linear_system+0x658>
mov    -0x70(%rsp),%rax
mov    -0x48(%rsp),%rbx
mov    -0x58(%rsp),%r12
mov    -0x40(%rsp),%rbp
jmp    18d0 <solve_linear_system+0x7d0>
add    %rcx,%r14
shr    $0x3,%r14
add    $0x1,%r14
movabs $0x3ffffffffffffffc,%rax
ff ff 3f
and    %rax,%r14
add    $0xfffffffffffffffc,%r14
mov    %r14,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    0xc0(%rsp),%r12
shr    $0x3,%r12
add    $0x1,%r12
movapd %xmm3,%xmm4
unpcklpd %xmm3,%xmm4
test   %r14,%r14
je     184b <solve_linear_system+0x74b>
add    0x18(%rsp),%r8
shr    $0x3,%r8
add    $0x1,%r8
and    $0xfffffffffffffffc,%r8
add    $0xfffffffffffffffc,%r8
shr    $0x2,%r8
add    $0x1,%r8
and    $0xfffffffffffffffe,%r8
xor    %eax,%eax
mov    -0x48(%rsp),%rbx
mov    0x10(%rsp),%rcx
nopl   (%rax)
movupd -0x30(%rcx,%rax,8),%xmm5
movupd -0x20(%rcx,%rax,8),%xmm6
mulpd  %xmm4,%xmm5
movupd -0x30(%r13,%rax,8),%xmm7
addpd  %xmm5,%xmm7
movupd -0x20(%r13,%rax,8),%xmm5
movupd -0x10(%r13,%rax,8),%xmm1
movupd 0x0(%r13,%rax,8),%xmm2
mulpd  %xmm4,%xmm6
addpd  %xmm5,%xmm6
movupd %xmm7,-0x30(%r13,%rax,8)
movupd %xmm6,-0x20(%r13,%rax,8)
movupd -0x10(%rcx,%rax,8),%xmm5
movupd (%rcx,%rax,8),%xmm6
mulpd  %xmm4,%xmm5
addpd  %xmm1,%xmm5
mulpd  %xmm4,%xmm6
addpd  %xmm2,%xmm6
movupd %xmm5,-0x10(%r13,%rax,8)
movupd %xmm6,0x0(%r13,%rax,8)
add    $0x8,%rax
add    $0xfffffffffffffffe,%r8
jne    17d0 <solve_linear_system+0x6d0>
jmp    1852 <solve_linear_system+0x752>
xor    %eax,%eax
mov    -0x48(%rsp),%rbx
mov    %r12,%rcx
movabs $0x3ffffffffffffffc,%rbp
ff ff 3f
and    %rbp,%rcx
test   $0x1,%sil
je     18a3 <solve_linear_system+0x7a3>
mov    -0x70(%rsp),%rbp
movupd 0x8(%rbp,%rax,8),%xmm1
movupd 0x18(%rbp,%rax,8),%xmm2
movupd (%r11,%rax,8),%xmm5
movupd 0x10(%r11,%rax,8),%xmm6
mulpd  %xmm4,%xmm1
addpd  %xmm5,%xmm1
mulpd  %xmm4,%xmm2
addpd  %xmm6,%xmm2
movupd %xmm1,(%r11,%rax,8)
movupd %xmm2,0x10(%r11,%rax,8)
cmp    %rcx,%r12
mov    -0x58(%rsp),%r12
mov    -0x40(%rsp),%rbp
je     15e0 <solve_linear_system+0x4e0>
mov    -0x70(%rsp),%rax
lea    (%rax,%rcx,8),%rax
lea    (%r11,%rcx,8),%r11
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x8,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rax),%xmm1
mulsd  %xmm3,%xmm1
addsd  (%r11),%xmm1
movsd  %xmm1,(%r11)
add    $0x8,%r11
add    $0x8,%rax
cmp    %r10,%r11
jb     18e0 <solve_linear_system+0x7e0>
jmp    15e0 <solve_linear_system+0x4e0>
movslq -0x64(%rsp),%rcx
mov    %rcx,%rax
imul   %rbx,%rax
mov    -0x80(%rsp),%rdx
lea    (%rdx,%rax,8),%rax
movsd  (%rax,%rcx,8),%xmm0
xor    %eax,%eax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1930 <solve_linear_system+0x830>
jnp    1a02 <solve_linear_system+0x902>
mov    -0x78(%rsp),%rax
movsd  (%rax,%rcx,8),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rax,%rcx,8)
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1a02 <solve_linear_system+0x902>
add    $0xfffffffe,%edi
mov    -0x78(%rsp),%rcx
lea    (%rcx,%rbx,8),%r11
lea    0x0(,%rbx,8),%r8
lea    0x8(,%rbx,8),%rcx
imul   %rdi,%rcx
mov    -0x80(%rsp),%rdx
lea    (%rdx,%rcx,1),%r10
add    $0x8,%r10
xor    $0xfffffffffffffff8,%r8
jmp    19b2 <solve_linear_system+0x8b2>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    -0x80(%rsp),%rcx
lea    (%rcx,%r9,8),%rcx
divsd  (%rcx,%rdi,8),%xmm0
movsd  %xmm0,0x0(%rbp)
lea    -0x1(%rdi),%rcx
add    %r8,%r10
test   %rdi,%rdi
mov    %rcx,%rdi
jle    1a02 <solve_linear_system+0x902>
mov    -0x78(%rsp),%rdx
lea    (%rdx,%rdi,8),%rbp
mov    %rdi,%r9
imul   %rbx,%r9
lea    (%rdx,%rdi,8),%rcx
add    $0x8,%rcx
movsd  (%rdx,%rdi,8),%xmm0
cmp    %r11,%rcx
jae    1990 <solve_linear_system+0x890>
mov    %r10,%rdx
nopw   0x0(%rax,%rax,1)
movsd  (%rcx),%xmm1
mulsd  (%rdx),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x0(%rbp)
add    $0x8,%rcx
add    $0x8,%rdx
cmp    %r11,%rcx
jb     19e0 <solve_linear_system+0x8e0>
jmp    1990 <solve_linear_system+0x890>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @solve_linear_system(i32 %0, double* %1, double* %2) {
%4 = bitcast double* %1 to i8*
%5 = ptrtoint double* %1 to i64
%6 = zext i32 %0 to i64
%7 = add i32 %0, -1
%8 = icmp sgt i32 %0, 1
br i1 %8, label %9, label %388
9: ; preds = %3
%10 = zext i32 %0 to i64
%11 = zext i32 %7 to i64
%12 = add nuw nsw i64 %6, 1
%13 = shl nuw nsw i64 %6, 3
%14 = add nuw nsw i64 %13, 8
%15 = add nuw nsw i64 %6, 2
%16 = add i64 %13, %5
%17 = add i64 %16, 16
%18 = shl nuw nsw i64 %6, 3
%19 = shl nuw nsw i64 %6, 4
%20 = add i64 %19, %5
%21 = shl nuw nsw i64 %6, 3
%22 = add i64 %13, %5
%23 = sub i64 -9, %22
%24 = sub nuw nsw i64 -8, %13
%25 = mul nsw i64 %6, -8
%26 = getelementptr double, double* %1, i64 1
%27 = bitcast double* %26 to i8*
%28 = getelementptr double, double* %1, i64 2
%29 = bitcast double* %28 to i8*
%30 = shl nuw nsw i64 %6, 3
%31 = add i64 %30, %5
%32 = add i64 %31, 16
%33 = add nuw nsw i64 %30, 8
%34 = shl nuw nsw i64 %6, 3
%35 = shl nuw nsw i64 %6, 4
%36 = add i64 %35, %5
%37 = shl nuw nsw i64 %6, 3
%38 = add i64 %30, %5
%39 = sub i64 -9, %38
%40 = sub nuw nsw i64 -8, %30
%41 = mul nsw i64 %6, -8
%42 = and i64 %6, 4294967292
%43 = add nsw i64 %42, -4
%44 = lshr exact i64 %43, 2
%45 = add nuw nsw i64 %44, 1
%46 = add i64 %30, %5
%47 = add i64 %46, 16
%48 = shl nuw nsw i64 %6, 3
%49 = add i64 %35, %5
%50 = shl nuw nsw i64 %6, 3
%51 = add i64 %30, %5
%52 = sub i64 -9, %51
%53 = mul nsw i64 %6, -8
%54 = icmp ult i32 %0, 4
%55 = and i64 %6, 4294967292
%56 = and i64 %45, 1
%57 = icmp eq i64 %43, 0
%58 = and i64 %45, 9223372036854775806
%59 = icmp eq i64 %56, 0
%60 = icmp eq i64 %55, %6
%61 = and i64 %6, 1
%62 = icmp eq i64 %61, 0
%63 = sub nsw i64 0, %6
br label %67
64: ; preds = %380, %229
%65 = add nuw nsw i64 %69, 1
%66 = icmp eq i64 %100, %11
br i1 %66, label %388, label %67
67: ; preds = %9, %64
%68 = phi i64 [ 0, %9 ], [ %100, %64 ]
%69 = phi i64 [ 1, %9 ], [ %65, %64 ]
%70 = mul i64 %33, %68
%71 = add i64 %47, %70
%72 = mul i64 %50, %68
%73 = add i64 %49, %72
%74 = mul i64 %40, %68
%75 = add i64 %52, %74
%76 = mul i64 %68, %6
%77 = getelementptr double, double* %1, i64 %76
%78 = bitcast double* %77 to i8*
%79 = add i64 %76, %6
%80 = getelementptr double, double* %1, i64 %79
%81 = mul i64 %33, %68
%82 = add i64 %32, %81
%83 = mul i64 %37, %68
%84 = add i64 %36, %83
%85 = mul i64 %40, %68
%86 = add i64 %39, %85
%87 = mul i64 %14, %68
%88 = add i64 %17, %87
%89 = mul i64 %21, %68
%90 = add i64 %20, %89
%91 = mul i64 %24, %68
%92 = add i64 %23, %91
%93 = getelementptr i8, i8* %27, i64 %87
%94 = getelementptr i8, i8* %29, i64 %87
%95 = mul nuw nsw i64 %68, %6
%96 = getelementptr inbounds double, double* %1, i64 %95
%97 = getelementptr inbounds double, double* %96, i64 %68
%98 = load double, double* %97
%99 = tail call double @llvm.fabs.f64(double %98)
%100 = add nuw nsw i64 %68, 1
%101 = icmp ult i64 %100, %10
%102 = trunc i64 %68 to i32
br i1 %101, label %103, label %119
103: ; preds = %67
%104 = getelementptr inbounds double, double* %1, i64 %68
br label %105
105: ; preds = %103, %105
%106 = phi i64 [ %69, %103 ], [ %117, %105 ]
%107 = phi double [ %99, %103 ], [ %116, %105 ]
%108 = phi i32 [ %102, %103 ], [ %115, %105 ]
%109 = mul nuw nsw i64 %106, %6
%110 = getelementptr inbounds double, double* %104, i64 %109
%111 = load double, double* %110
%112 = tail call double @llvm.fabs.f64(double %111)
%113 = fcmp ogt double %112, %107
%114 = trunc i64 %106 to i32
%115 = select i1 %113, i32 %114, i32 %108
%116 = select i1 %113, double %112, double %107
%117 = add nuw nsw i64 %106, 1
%118 = icmp eq i64 %117, %6
br i1 %118, label %119, label %105
119: ; preds = %105, %67
%120 = phi i32 [ %102, %67 ], [ %115, %105 ]
%121 = phi double [ %99, %67 ], [ %116, %105 ]
%122 = fcmp oeq double %121, 0.000000e+00
br i1 %122, label %430, label %123
123: ; preds = %119
%124 = zext i32 %120 to i64
%125 = icmp eq i64 %68, %124
br i1 %125, label %229, label %126
126: ; preds = %123
%127 = sext i32 %120 to i64
%128 = mul nsw i64 %127, %6
%129 = getelementptr inbounds double, double* %1, i64 %128
br i1 %54, label %198, label %130
130: ; preds = %126
%131 = shl nsw i64 %127, 3
%132 = add nsw i64 %131, 8
%133 = mul i64 %132, %6
%134 = getelementptr i8, i8* %4, i64 %133
%135 = icmp ugt i8* %134, %78
%136 = icmp ult double* %129, %80
%137 = and i1 %135, %136
br i1 %137, label %198, label %138
138: ; preds = %130
br i1 %57, label %178, label %139
139: ; preds = %138, %139
%140 = phi i64 [ %175, %139 ], [ 0, %138 ]
%141 = phi i64 [ %176, %139 ], [ 0, %138 ]
%142 = getelementptr inbounds double, double* %96, i64 %140
%143 = bitcast double* %142 to <2 x double>*
%144 = load <2 x double>, <2 x double>* %143
%145 = getelementptr inbounds double, double* %142, i64 2
%146 = bitcast double* %145 to <2 x double>*
%147 = load <2 x double>, <2 x double>* %146
%148 = getelementptr inbounds double, double* %129, i64 %140
%149 = bitcast double* %148 to <2 x double>*
%150 = load <2 x double>, <2 x double>* %149
%151 = getelementptr inbounds double, double* %148, i64 2
%152 = bitcast double* %151 to <2 x double>*
%153 = load <2 x double>, <2 x double>* %152
%154 = bitcast double* %142 to <2 x double>*
store <2 x double> %150, <2 x double>* %154
%155 = bitcast double* %145 to <2 x double>*
store <2 x double> %153, <2 x double>* %155
%156 = bitcast double* %148 to <2 x double>*
store <2 x double> %144, <2 x double>* %156
%157 = bitcast double* %151 to <2 x double>*
store <2 x double> %147, <2 x double>* %157
%158 = or i64 %140, 4
%159 = getelementptr inbounds double, double* %96, i64 %158
%160 = bitcast double* %159 to <2 x double>*
%161 = load <2 x double>, <2 x double>* %160
%162 = getelementptr inbounds double, double* %159, i64 2
%163 = bitcast double* %162 to <2 x double>*
%164 = load <2 x double>, <2 x double>* %163
%165 = getelementptr inbounds double, double* %129, i64 %158
%166 = bitcast double* %165 to <2 x double>*
%167 = load <2 x double>, <2 x double>* %166
%168 = getelementptr inbounds double, double* %165, i64 2
%169 = bitcast double* %168 to <2 x double>*
%170 = load <2 x double>, <2 x double>* %169
%171 = bitcast double* %159 to <2 x double>*
store <2 x double> %167, <2 x double>* %171
%172 = bitcast double* %162 to <2 x double>*
store <2 x double> %170, <2 x double>* %172
%173 = bitcast double* %165 to <2 x double>*
store <2 x double> %161, <2 x double>* %173
%174 = bitcast double* %168 to <2 x double>*
store <2 x double> %164, <2 x double>* %174
%175 = add nuw i64 %140, 8
%176 = add i64 %141, 2
%177 = icmp eq i64 %176, %58
br i1 %177, label %178, label %139
178: ; preds = %139, %138
%179 = phi i64 [ 0, %138 ], [ %175, %139 ]
br i1 %59, label %197, label %180
180: ; preds = %178
%181 = getelementptr inbounds double, double* %96, i64 %179
%182 = bitcast double* %181 to <2 x double>*
%183 = load <2 x double>, <2 x double>* %182
%184 = getelementptr inbounds double, double* %181, i64 2
%185 = bitcast double* %184 to <2 x double>*
%186 = load <2 x double>, <2 x double>* %185
%187 = getelementptr inbounds double, double* %129, i64 %179
%188 = bitcast double* %187 to <2 x double>*
%189 = load <2 x double>, <2 x double>* %188
%190 = getelementptr inbounds double, double* %187, i64 2
%191 = bitcast double* %190 to <2 x double>*
%192 = load <2 x double>, <2 x double>* %191
%193 = bitcast double* %181 to <2 x double>*
store <2 x double> %189, <2 x double>* %193
%194 = bitcast double* %184 to <2 x double>*
store <2 x double> %192, <2 x double>* %194
%195 = bitcast double* %187 to <2 x double>*
store <2 x double> %183, <2 x double>* %195
%196 = bitcast double* %190 to <2 x double>*
store <2 x double> %186, <2 x double>* %196
br label %197
197: ; preds = %178, %180
br i1 %60, label %223, label %198
198: ; preds = %130, %126, %197
%199 = phi i64 [ 0, %130 ], [ 0, %126 ], [ %55, %197 ]
%200 = xor i64 %199, -1
br i1 %62, label %207, label %201
201: ; preds = %198
%202 = getelementptr inbounds double, double* %96, i64 %199
%203 = load double, double* %202
%204 = getelementptr inbounds double, double* %129, i64 %199
%205 = load double, double* %204
store double %205, double* %202
store double %203, double* %204
%206 = or i64 %199, 1
br label %207
207: ; preds = %201, %198
%208 = phi i64 [ %199, %198 ], [ %206, %201 ]
%209 = icmp eq i64 %200, %63
br i1 %209, label %223, label %210
210: ; preds = %207, %210
%211 = phi i64 [ %221, %210 ], [ %208, %207 ]
%212 = getelementptr inbounds double, double* %96, i64 %211
%213 = load double, double* %212
%214 = getelementptr inbounds double, double* %129, i64 %211
%215 = load double, double* %214
store double %215, double* %212
store double %213, double* %214
%216 = add nuw nsw i64 %211, 1
%217 = getelementptr inbounds double, double* %96, i64 %216
%218 = load double, double* %217
%219 = getelementptr inbounds double, double* %129, i64 %216
%220 = load double, double* %219
store double %220, double* %217
store double %218, double* %219
%221 = add nuw nsw i64 %211, 2
%222 = icmp eq i64 %221, %6
br i1 %222, label %223, label %210
223: ; preds = %207, %210, %197
%224 = getelementptr inbounds double, double* %2, i64 %127
%225 = load double, double* %224
%226 = getelementptr inbounds double, double* %2, i64 %68
%227 = load double, double* %226
%228 = getelementptr inbounds double, double* %2, i64 %127
store double %225, double* %226
store double %227, double* %228
br label %229
229: ; preds = %223, %123
br i1 %101, label %230, label %64
230: ; preds = %229
%231 = getelementptr inbounds double, double* %2, i64 %68
%232 = getelementptr double, double* %97, i64 1
%233 = getelementptr double, double* %97, i64 1
%234 = getelementptr double, double* %97, i64 1
br label %235
235: ; preds = %230, %380
%236 = phi i64 [ 0, %230 ], [ %387, %380 ]
%237 = phi i64 [ %69, %230 ], [ %385, %380 ]
%238 = mul i64 %48, %236
%239 = add i64 %71, %238
%240 = add i64 %73, %238
%241 = call i64 @llvm.umax.i64(i64 %239, i64 %240)
%242 = mul i64 %53, %236
%243 = add i64 %75, %242
%244 = add i64 %241, %243
%245 = lshr i64 %244, 3
%246 = add nuw nsw i64 %245, 1
%247 = and i64 %246, 4611686018427387900
%248 = add nsw i64 %247, -4
%249 = lshr exact i64 %248, 2
%250 = add nuw nsw i64 %249, 1
%251 = mul i64 %34, %236
%252 = add i64 %82, %251
%253 = add i64 %84, %251
%254 = call i64 @llvm.umax.i64(i64 %252, i64 %253)
%255 = mul i64 %41, %236
%256 = add i64 %86, %255
%257 = add i64 %254, %256
%258 = lshr i64 %257, 3
%259 = add nuw nsw i64 %258, 1
%260 = mul i64 %236, %6
%261 = add i64 %12, %260
%262 = getelementptr double, double* %1, i64 %261
%263 = bitcast double* %262 to i8*
%264 = getelementptr i8, i8* %263, i64 %87
%265 = add i64 %15, %260
%266 = getelementptr double, double* %1, i64 %265
%267 = bitcast double* %266 to i8*
%268 = getelementptr i8, i8* %267, i64 %87
%269 = mul i64 %18, %236
%270 = add i64 %88, %269
%271 = add i64 %90, %269
%272 = call i64 @llvm.umax.i64(i64 %270, i64 %271)
%273 = mul i64 %25, %236
%274 = add i64 %92, %273
%275 = add i64 %272, %274
%276 = and i64 %275, -8
%277 = getelementptr i8, i8* %268, i64 %276
%278 = getelementptr i8, i8* %94, i64 %276
%279 = mul nuw nsw i64 %237, %6
%280 = getelementptr inbounds double, double* %1, i64 %279
%281 = getelementptr inbounds double, double* %280, i64 %68
%282 = load double, double* %281
%283 = fneg double %282
%284 = load double, double* %97
%285 = fdiv double %283, %284
%286 = getelementptr inbounds double, double* %280, i64 %10
%287 = getelementptr inbounds double, double* %281, i64 1
%288 = icmp ult double* %287, %286
br i1 %288, label %289, label %380
289: ; preds = %235
%290 = icmp ult i64 %257, 24
br i1 %290, label %368, label %291
291: ; preds = %289
%292 = icmp ult i8* %264, %278
%293 = icmp ult i8* %93, %277
%294 = and i1 %292, %293
br i1 %294, label %368, label %295
295: ; preds = %291
%296 = and i64 %259, 4611686018427387900
%297 = getelementptr double, double* %97, i64 %296
%298 = getelementptr double, double* %287, i64 %296
%299 = insertelement <2 x double> poison, double %285, i64 0
%300 = shufflevector <2 x double> %299, <2 x double> poison, <2 x i32> zeroinitializer
%301 = insertelement <2 x double> poison, double %285, i64 0
%302 = shufflevector <2 x double> %301, <2 x double> poison, <2 x i32> zeroinitializer
%303 = and i64 %250, 1
%304 = icmp eq i64 %248, 0
br i1 %304, label %346, label %305
305: ; preds = %295
%306 = and i64 %250, 9223372036854775806
br label %307
307: ; preds = %307, %305
%308 = phi i64 [ 0, %305 ], [ %343, %307 ]
%309 = phi i64 [ 0, %305 ], [ %344, %307 ]
%310 = getelementptr double, double* %287, i64 %308
%311 = getelementptr inbounds double, double* %232, i64 %308
%312 = bitcast double* %311 to <2 x double>*
%313 = load <2 x double>, <2 x double>* %312
%314 = getelementptr inbounds double, double* %311, i64 2
%315 = bitcast double* %314 to <2 x double>*
%316 = load <2 x double>, <2 x double>* %315
%317 = bitcast double* %310 to <2 x double>*
%318 = load <2 x double>, <2 x double>* %317
%319 = getelementptr double, double* %310, i64 2
%320 = bitcast double* %319 to <2 x double>*
%321 = load <2 x double>, <2 x double>* %320
%322 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %300, <2 x double> %313, <2 x double> %318)
%323 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %302, <2 x double> %316, <2 x double> %321)
%324 = bitcast double* %310 to <2 x double>*
store <2 x double> %322, <2 x double>* %324
%325 = bitcast double* %319 to <2 x double>*
store <2 x double> %323, <2 x double>* %325
%326 = or i64 %308, 4
%327 = getelementptr double, double* %287, i64 %326
%328 = getelementptr inbounds double, double* %233, i64 %326
%329 = bitcast double* %328 to <2 x double>*
%330 = load <2 x double>, <2 x double>* %329
%331 = getelementptr inbounds double, double* %328, i64 2
%332 = bitcast double* %331 to <2 x double>*
%333 = load <2 x double>, <2 x double>* %332
%334 = bitcast double* %327 to <2 x double>*
%335 = load <2 x double>, <2 x double>* %334
%336 = getelementptr double, double* %327, i64 2
%337 = bitcast double* %336 to <2 x double>*
%338 = load <2 x double>, <2 x double>* %337
%339 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %300, <2 x double> %330, <2 x double> %335)
%340 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %302, <2 x double> %333, <2 x double> %338)
%341 = bitcast double* %327 to <2 x double>*
store <2 x double> %339, <2 x double>* %341
%342 = bitcast double* %336 to <2 x double>*
store <2 x double> %340, <2 x double>* %342
%343 = add nuw i64 %308, 8
%344 = add i64 %309, 2
%345 = icmp eq i64 %344, %306
br i1 %345, label %346, label %307
346: ; preds = %307, %295
%347 = phi i64 [ 0, %295 ], [ %343, %307 ]
%348 = icmp eq i64 %303, 0
br i1 %348, label %366, label %349
349: ; preds = %346
%350 = getelementptr double, double* %287, i64 %347
%351 = getelementptr inbounds double, double* %234, i64 %347
%352 = bitcast double* %351 to <2 x double>*
%353 = load <2 x double>, <2 x double>* %352
%354 = getelementptr inbounds double, double* %351, i64 2
%355 = bitcast double* %354 to <2 x double>*
%356 = load <2 x double>, <2 x double>* %355
%357 = bitcast double* %350 to <2 x double>*
%358 = load <2 x double>, <2 x double>* %357
%359 = getelementptr double, double* %350, i64 2
%360 = bitcast double* %359 to <2 x double>*
%361 = load <2 x double>, <2 x double>* %360
%362 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %300, <2 x double> %353, <2 x double> %358)
%363 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %302, <2 x double> %356, <2 x double> %361)
%364 = bitcast double* %350 to <2 x double>*
store <2 x double> %362, <2 x double>* %364
%365 = bitcast double* %359 to <2 x double>*
store <2 x double> %363, <2 x double>* %365
br label %366
366: ; preds = %346, %349
%367 = icmp eq i64 %259, %296
br i1 %367, label %380, label %368
368: ; preds = %291, %289, %366
%369 = phi double* [ %97, %291 ], [ %97, %289 ], [ %297, %366 ]
%370 = phi double* [ %287, %291 ], [ %287, %289 ], [ %298, %366 ]
br label %371
371: ; preds = %368, %371
%372 = phi double* [ %374, %371 ], [ %369, %368 ]
%373 = phi double* [ %378, %371 ], [ %370, %368 ]
%374 = getelementptr inbounds double, double* %372, i64 1
%375 = load double, double* %374
%376 = load double, double* %373
%377 = tail call double @llvm.fmuladd.f64(double %285, double %375, double %376)
store double %377, double* %373
%378 = getelementptr inbounds double, double* %373, i64 1
%379 = icmp ult double* %378, %286
br i1 %379, label %371, label %380
380: ; preds = %371, %366, %235
%381 = load double, double* %231
%382 = getelementptr inbounds double, double* %2, i64 %237
%383 = load double, double* %382
%384 = tail call double @llvm.fmuladd.f64(double %285, double %381, double %383)
store double %384, double* %382
%385 = add nuw nsw i64 %237, 1
%386 = icmp eq i64 %385, %6
%387 = add i64 %236, 1
br i1 %386, label %64, label %235
388: ; preds = %64, %3
%389 = sext i32 %7 to i64
%390 = mul nsw i64 %389, %6
%391 = getelementptr inbounds double, double* %1, i64 %390
%392 = getelementptr inbounds double, double* %391, i64 %389
%393 = load double, double* %392
%394 = fcmp oeq double %393, 0.000000e+00
br i1 %394, label %430, label %395
395: ; preds = %388
%396 = getelementptr inbounds double, double* %2, i64 %389
%397 = load double, double* %396
%398 = fdiv double %397, %393
store double %398, double* %396
br i1 %8, label %399, label %430
399: ; preds = %395
%400 = add nsw i32 %0, -2
%401 = zext i32 %0 to i64
%402 = getelementptr inbounds double, double* %2, i64 %401
%403 = zext i32 %400 to i64
br label %404
404: ; preds = %399, %424
%405 = phi i64 [ %403, %399 ], [ %428, %424 ]
%406 = getelementptr inbounds double, double* %2, i64 %405
%407 = mul nuw nsw i64 %405, %6
%408 = getelementptr inbounds double, double* %1, i64 %407
%409 = getelementptr inbounds double, double* %408, i64 %405
%410 = getelementptr inbounds double, double* %406, i64 1
%411 = icmp ult double* %410, %402
%412 = load double, double* %406
br i1 %411, label %413, label %424
413: ; preds = %404, %413
%414 = phi double [ %421, %413 ], [ %412, %404 ]
%415 = phi double* [ %422, %413 ], [ %410, %404 ]
%416 = phi double* [ %417, %413 ], [ %409, %404 ]
%417 = getelementptr inbounds double, double* %416, i64 1
%418 = load double, double* %415
%419 = load double, double* %417
%420 = fneg double %418
%421 = tail call double @llvm.fmuladd.f64(double %420, double %419, double %414)
store double %421, double* %406
%422 = getelementptr inbounds double, double* %415, i64 1
%423 = icmp ult double* %422, %402
br i1 %423, label %413, label %424
424: ; preds = %413, %404
%425 = phi double [ %412, %404 ], [ %421, %413 ]
%426 = load double, double* %409
%427 = fdiv double %425, %426
store double %427, double* %406
%428 = add nsw i64 %405, -1
%429 = icmp sgt i64 %405, 0
br i1 %429, label %404, label %430
430: ; preds = %119, %424, %395, %388
%431 = phi i32 [ 0, %388 ], [ 1, %395 ], [ 1, %424 ], [ 0, %119 ]
ret i32 %431
}