user: Please show me the C implementation that matches the assembly code listed below:

```asm
<solve_linear_system>:
  endbr64
  push   %r15
  movslq %edi,%rax
  push   %r14
  mov    %rax,%r15
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  sub    $0x30,%rsp
  mov    %rax,0x8(%rsp)
  sub    $0x1,%eax
  mov    %rdx,(%rsp)
  mov    %eax,0x10(%rsp)
  test   %eax,%eax
  jle    L242
  movslq %r15d,%rsi
  lea    0x8(%r12),%rcx
  pxor   %xmm4,%xmm4
  mov    %r15d,%edi
  lea    0x8(,%rsi,8),%rax
  and    $0xfffffffe,%edi
  movq   $0x0,-0x48(%rsp)
  lea    -0x9(,%rsi,8),%r13
  lea    (%r12,%rax,1),%rbx
  mov    %rax,-0x20(%rsp)
  lea    -0x8(%rax),%r11
  movslq %edi,%r14
  lea    -0x2(%r15),%eax
  mov    %edi,0x14(%rsp)
  movq   D11(%rip),%xmm2
  add    $0x2,%rax
  mov    %rbx,-0x40(%rsp)
  movq   D9(%rip),%xmm3
  lea    0x8(%rdx),%rbx
  mov    %rax,-0x18(%rsp)
  mov    %r15d,%eax
  movq   $0x10,-0x38(%rsp)
  shr    %eax
  movq   $0x1,-0x58(%rsp)
  sub    $0x1,%eax
  movq   $0x0,-0x50(%rsp)
  add    $0x1,%rax
  shl    $0x4,%rax
  mov    %rax,0x18(%rsp)
  mov    %rsi,%rax
  shl    $0x4,%rax
  add    %r12,%rax
  mov    %rax,-0x10(%rsp)
  lea    0x10(%rdx),%rax
  mov    %rax,-0x8(%rsp)
  mov    0x10(%rsp),%eax
  mov    %rax,0x20(%rsp)
  mov    %r15d,%eax
  mov    %r13,%r15
  mov    %eax,%r13d
  nopw   0x0(%rax,%rax,1)
L255:
  movsd  -0x8(%rcx),%xmm0
  mov    -0x48(%rsp),%rax
  mov    -0x58(%rsp),%rsi
  mov    -0x50(%rsp),%edi
  movapd %xmm0,%xmm1
  lea    (%r12,%rax,1),%r8
  andpd  %xmm2,%xmm1
  mov    %esi,%r9d
  mov    %esi,%eax
  cmp    %esi,%r13d
  jle    L179
  mov    -0x40(%rsp),%rsi
  lea    -0x8(%rsi),%rdx
  xchg   %ax,%ax
L71:
  movsd  (%rdx),%xmm0
  andpd  %xmm2,%xmm0
  comisd %xmm1,%xmm0
  maxsd  %xmm1,%xmm0
  cmova  %eax,%edi
  add    $0x1,%eax
  movapd %xmm0,%xmm1
  add    %r11,%rdx
  mov    %edi,%esi
  cmp    %eax,%r13d
  jne    L71
  ucomisd %xmm4,%xmm0
  jp     L49
  je     L301
L49:
  cmp    -0x50(%rsp),%esi
  jne    L211
L156:
  mov    0x10(%rsp),%eax
  mov    -0x8(%rsp),%rsi
  mov    %r15,%rbp
  mov    %r14,-0x28(%rsp)
  shr    $0x3,%rbp
  mov    -0x38(%rsp),%r14
  mov    %r13d,-0x2c(%rsp)
  sub    %r9d,%eax
  add    -0x50(%rsp),%rax
  mov    -0x48(%rsp),%r8
  lea    (%rsi,%rax,8),%rdi
  lea    0x1(%rbp),%rax
  add    -0x10(%rsp),%r8
  mov    %rbx,%rsi
  mov    %rax,%r9
  mov    %rax,-0x60(%rsp)
  and    $0xfffffffffffffffe,%rax
  mov    %rdi,%r13
  shr    %r9
  lea    0x0(,%rax,8),%rbp
  mov    %rax,-0x68(%rsp)
  mov    -0x40(%rsp),%rax
  shl    $0x4,%r9
  lea    (%rcx,%rbp,1),%r10
  mov    %r9,-0x70(%rsp)
  nopw   0x0(%rax,%rax,1)
L147:
  movsd  -0x8(%rax),%xmm1
  mov    %rax,%rdx
  xorpd  %xmm3,%xmm1
  divsd  -0x8(%rcx),%xmm1
  cmp    %r8,%rax
  jae    L56
  mov    %rax,%rdi
  sub    %r12,%rdi
  cmp    %r14,%rdi
  je     L154
  cmp    $0x7,%r15
  jbe    L154
  movapd %xmm1,%xmm5
  mov    -0x70(%rsp),%r9
  xor    %edx,%edx
  unpcklpd %xmm5,%xmm5
  xchg   %ax,%ax
L274:
  movupd (%rcx,%rdx,1),%xmm0
  movupd (%rax,%rdx,1),%xmm6
  mulpd  %xmm5,%xmm0
  addpd  %xmm6,%xmm0
  movups %xmm0,(%rax,%rdx,1)
  add    $0x10,%rdx
  cmp    %rdx,%r9
  jne    L274
  mov    %r9,-0x70(%rsp)
  lea    (%rax,%rbp,1),%rdx
  mov    -0x60(%rsp),%r9
  cmp    %r9,-0x68(%rsp)
  je     L56
  movsd  (%r10),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  (%rdx),%xmm0
  movsd  %xmm0,(%rdx)
L56:
  mulsd  -0x8(%rbx),%xmm1
  add    $0x8,%rsi
  add    %r11,%rax
  add    %r11,%r8
  addsd  -0x8(%rsi),%xmm1
  movsd  %xmm1,-0x8(%rsi)
  cmp    %r13,%rsi
  jne    L147
  mov    -0x2c(%rsp),%r13d
  mov    -0x28(%rsp),%r14
L169:
  mov    -0x20(%rsp),%rsi
  addq   $0x1,-0x58(%rsp)
  add    $0x8,%rbx
  sub    $0x8,%r15
  addq   $0x1,-0x50(%rsp)
  mov    -0x58(%rsp),%rax
  add    %rsi,-0x40(%rsp)
  add    %rsi,%rcx
  add    %rsi,-0x38(%rsp)
  add    %r11,-0x48(%rsp)
  cmp    -0x18(%rsp),%rax
  jne    L255
  mov    %r13d,%r15d
L234:
  mov    0x8(%rsp),%rbx
  movslq 0x10(%rsp),%rax
  lea    0x0(,%rbx,8),%rsi
  lea    (%r12,%rax,8),%rcx
  mov    %rsi,%rdx
  imul   %rax,%rdx
  movsd  (%rcx,%rdx,1),%xmm1
  ucomisd %xmm4,%xmm1
  jp     L37
  je     L301
L37:
  mov    (%rsp),%rbx
  lea    -0x8(%rbx,%rsi,1),%rdx
  movsd  (%rdx),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx)
  mov    %r15d,%edx
  sub    $0x2,%edx
  js     L235
  mov    %rbx,%r15
  mov    0x8(%rsp),%rbx
  movslq %edx,%rdi
  shl    $0x3,%rax
  lea    0x1(%rdi),%r8
  lea    (%r15,%rax,1),%rcx
  add    %r15,%rsi
  imul   %rbx,%r8
  lea    0x1(%rbx),%r10
  mov    %rbx,%r9
  imul   %r10,%rdi
  lea    -0x8(%r15,%rax,1),%r10
  mov    %edx,%eax
  not    %r9
  shl    $0x3,%rax
  shl    $0x3,%r9
  lea    (%r12,%r8,8),%r8
  sub    %rax,%r10
  lea    0x8(%r12,%rdi,8),%rdi
L202:
  movsd  -0x8(%rcx),%xmm1
  mov    %rdi,%rdx
  cmp    %rsi,%rcx
  jae    L261
  mov    %rcx,%rax
  nopl   (%rax)
L187:
  add    $0x8,%rdx
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  mulsd  -0x8(%rdx),%xmm0
  subsd  %xmm0,%xmm1
  movsd  %xmm1,-0x8(%rcx)
  cmp    %rsi,%rax
  jb     L187
L261:
  divsd  -0x10(%r8),%xmm1
  sub    $0x8,%rcx
  movsd  %xmm1,(%rcx)
  add    %r9,%r8
  add    %r9,%rdi
  cmp    %r10,%rcx
  jne    L202
L235:
  add    $0x30,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L154:
  mov    -0x70(%rsp),%r9
  mov    %rcx,%rdi
L205:
  movsd  (%rdi),%xmm0
  add    $0x8,%rdx
  add    $0x8,%rdi
  mulsd  %xmm1,%xmm0
  addsd  -0x8(%rdx),%xmm0
  movsd  %xmm0,-0x8(%rdx)
  cmp    %r8,%rdx
  jb     L205
  mov    %r9,-0x70(%rsp)
  jmp    L56
L211:
  mov    0x8(%rsp),%rdx
  movslq %esi,%r10
  mov    -0x48(%rsp),%rdi
  imul   %r10,%rdx
  shl    $0x3,%rdx
  lea    0x10(%rdx),%rsi
  lea    (%r12,%rdx,1),%rax
  cmp    %rdi,%rsi
  setle  %sil
  add    $0x10,%rdi
  cmp    %rdi,%rdx
  setge  %dl
  or     %sil,%dl
  mov    $0x0,%edx
  je     L280
  cmpl   $0x1,0x10(%rsp)
  jbe    L280
  mov    0x18(%rsp),%rsi
  nopl   (%rax)
L33:
  movupd (%r8,%rdx,1),%xmm0
  movupd (%rax,%rdx,1),%xmm7
  movups %xmm7,(%r8,%rdx,1)
  movups %xmm0,(%rax,%rdx,1)
  add    $0x10,%rdx
  cmp    %rsi,%rdx
  jne    L33
  cmp    %r13d,0x14(%rsp)
  je     L103
  movsd  (%r8,%r14,8),%xmm0
  movsd  (%rax,%r14,8),%xmm1
  movsd  %xmm1,(%r8,%r14,8)
  movsd  %xmm0,(%rax,%r14,8)
L103:
  mov    (%rsp),%rax
  movsd  -0x8(%rbx),%xmm0
  lea    (%rax,%r10,8),%rax
  movsd  (%rax),%xmm1
  movsd  %xmm1,-0x8(%rbx)
  movsd  %xmm0,(%rax)
  jmp    L156
L179:
  ucomisd %xmm4,%xmm0
  jp     L169
  jne    L169
L301:
  add    $0x30,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L280:
  mov    0x20(%rsp),%rdi
L302:
  movsd  (%r8,%rdx,8),%xmm0
  movsd  (%rax,%rdx,8),%xmm1
  mov    %rdx,%rsi
  movsd  %xmm1,(%r8,%rdx,8)
  movsd  %xmm0,(%rax,%rdx,8)
  add    $0x1,%rdx
  cmp    %rdi,%rsi
  jne    L302
  jmp    L103
L242:
  pxor   %xmm4,%xmm4
  jmp    L234
```

tool_calls: name: extract_symbolic_data
arguments: label: D11
type_infered: qword
name: extract_symbolic_data
arguments: label: D9
type_infered: f32[2]

tool: D11: 9223372036854775807

tool: {"D9": [0.0,-0.0]}

assistant: ```c
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;
}
```