user: Translate the below assembly code into C programming language:

```asm
<solve_matrix>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %edi,%r13d
  mov    %rsi,%rbx
  mov    %rdx,%r14
  lea    -0x1(%rdi),%eax
  mov    %eax,0x3c(%rsp)
  test   %eax,%eax
  jle    L127
  mov    %rsi,0x20(%rsp)
  mov    %eax,0x1c(%rsp)
  lea    -0x2(%rdi),%eax
  add    $0x2,%rax
  mov    %rax,0x30(%rsp)
  mov    $0x0,%r15d
  movq   $0x1,0x8(%rsp)
  movq   $0x0,0x10(%rsp)
  jmp    L3
L113:
  mov    0x18(%rsp),%r12d
L265:
  add    $0x1,%rbp
  cmp    %r14,%rbp
  je     L149
L162:
  mov    %ebp,0x18(%rsp)
  mov    (%rbx,%rbp,8),%rax
  mov    (%rax,%r15,1),%r13
  movslq %r12d,%rax
  mov    (%rbx,%rax,8),%rax
  cvttsd2si (%rax,%r15,1),%edi
  call   <fabs@plt>
  movq   %r13,%xmm6
  comisd %xmm0,%xmm6
  seta   %dil
  movzbl %dil,%edi
  call   <fabs@plt>
  ucomisd D34(%rip),%xmm0
  jp     L113
  je     L265
  jmp    L113
L149:
  mov    0x38(%rsp),%r13d
  mov    0x28(%rsp),%r14
  mov    0x20(%rsp),%r10
  mov    %r10,%rdi
  mov    (%r10),%rcx
  movslq %r12d,%rax
  shl    $0x3,%rax
  lea    (%rbx,%rax,1),%rdx
  mov    (%rdx),%rsi
  mov    %rsi,(%r10)
  mov    %rcx,(%rdx)
  movsd  (%r14,%r15,1),%xmm0
  add    %r14,%rax
  movsd  (%rax),%xmm1
  movsd  %xmm1,(%r14,%r15,1)
  movsd  %xmm0,(%rax)
L79:
  mov    0x1c(%rsp),%eax
  mov    0x10(%rsp),%r9
  lea    0x1(%r9,%rax,1),%r8
  shl    $0x3,%r8
  mov    0x8(%rsp),%rcx
  jmp    L125
L264:
  mov    0x20(%rsp),%r11
  mov    %r11,%rdi
  mov    (%r11),%rcx
  movslq 0x10(%rsp),%rax
  shl    $0x3,%rax
  lea    (%rbx,%rax,1),%rdx
  mov    (%rdx),%rsi
  mov    %rsi,(%r11)
  mov    %rcx,(%rdx)
  movsd  (%r14,%r15,1),%xmm0
  add    %r14,%rax
  movsd  (%rax),%xmm1
  movsd  %xmm1,(%r14,%r15,1)
  movsd  %xmm0,(%rax)
  cmp    0x8(%rsp),%r13d
  jg     L79
L36:
  addq   $0x1,0x10(%rsp)
  addq   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%rax
  addq   $0x8,0x20(%rsp)
  add    $0x8,%r15
  subl   $0x1,0x1c(%rsp)
  cmp    0x30(%rsp),%rax
  je     L153
L3:
  mov    0x10(%rsp),%rsi
  mov    %esi,%r12d
  mov    0x8(%rsp),%rbp
  cmp    %ebp,%r13d
  jle    L264
  mov    0x1c(%rsp),%eax
  lea    -0x1(%rax),%eax
  lea    0x2(%rsi,%rax,1),%rax
  mov    %r13d,0x38(%rsp)
  mov    %r14,0x28(%rsp)
  mov    %rax,%r14
  jmp    L162
L260:
  mulsd  (%r14,%r15,1),%xmm1
  movsd  (%r14,%rcx,8),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%r14,%rcx,8)
L208:
  add    $0x1,%rcx
  cmp    %ecx,%r13d
  jle    L36
L125:
  mov    (%rbx,%rcx,8),%rdx
  mov    (%rdi),%rax
  movsd  (%rdx,%r15,1),%xmm1
  divsd  (%rax,%r15,1),%xmm1
  ucomisd D34(%rip),%xmm1
  jp     L7
  je     L208
L7:
  cmp    %r9d,%r13d
  jle    L260
  mov    %r15,%rax
L37:
  mov    %rax,%rdx
  add    (%rbx,%rcx,8),%rdx
  mov    (%rdi),%rsi
  movapd %xmm1,%xmm2
  mulsd  (%rsi,%rax,1),%xmm2
  movsd  (%rdx),%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x8,%rax
  cmp    %r8,%rax
  jne    L37
  jmp    L260
L127:
  cmpl   $0x0,0x3c(%rsp)
  jne    L212
L153:
  movslq 0x3c(%rsp),%rdi
  lea    (%rbx,%rdi,8),%rcx
  mov    %r13d,%r8d
  lea    -0x2(%r13),%r9d
  pxor   %xmm4,%xmm4
  movapd %xmm4,%xmm3
  movsd  D46(%rip),%xmm5
  jmp    L150
L267:
  pxor   %xmm1,%xmm1
L271:
  lea    0x0(,%rdi,8),%rax
  mov    %rcx,%rsi
  mov    (%rcx),%rdx
  movsd  (%rdx,%rdi,8),%xmm2
  ucomisd %xmm4,%xmm2
  jp     L190
  ucomisd %xmm3,%xmm2
  je     L240
L190:
  movsd  (%r14,%rdi,8),%xmm0
  subsd  %xmm1,%xmm0
  divsd  %xmm2,%xmm0
  movsd  %xmm0,(%r14,%rdi,8)
  mov    (%rsi),%rdx
  movsd  %xmm5,(%rdx,%rax,1)
  sub    $0x1,%rdi
  sub    $0x1,%r8d
  sub    $0x8,%rcx
  test   %edi,%edi
  js     L212
L150:
  cmp    %r8d,%r13d
  jle    L267
  movslq %r8d,%rax
  shl    $0x3,%rax
  mov    %r9d,%edx
  sub    %edi,%edx
  lea    0x2(%rdi,%rdx,1),%rsi
  shl    $0x3,%rsi
  pxor   %xmm1,%xmm1
L73:
  mov    %rax,%rdx
  add    (%rcx),%rdx
  movsd  (%r14,%rax,1),%xmm0
  mulsd  (%rdx),%xmm0
  addsd  %xmm0,%xmm1
  movq   $0x0,(%rdx)
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L73
  jmp    L271
L240:
  pxor   %xmm0,%xmm0
  ucomisd (%r14,%rax,1),%xmm0
  jp     L214
  jne    L214
  lea    D31(%rip),%rdi
  call   <printf@plt>
L212:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L214:
  lea    D3(%rip),%rdi
  call   <printf@plt>
  jmp    L212
```

tool_calls: name: parse_data
arguments: tag: D34
type_guessed: f64
name: parse_data
arguments: tag: D46
type_guessed: byte[8]
name: parse_data
arguments: tag: D31
type_guessed: string
name: parse_data
arguments: tag: D3
type_guessed: string

tool: D34: 0

tool: {"D46": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: D31: Equations are underconstrained.


tool: D3: Equations are inconsistent.


assistant: ```c
void solve_matrix(int n, double **a_s, double *b_s) {
  int DEBUG = 0;
  int i;
  if (DEBUG)
    print_matrix(n, a_s, b_s);
  for (i = 0; i < n - 1; i++) {
    int max = i;
    int i2;
    for (i2 = i + 1; i2 < n; i2++) {
      if (fabs(a_s[i2][i] > fabs(a_s[max][i])))
        max = i2;
    }
    {
      double *t, tt;
      t = a_s[i];
      a_s[i] = a_s[max];
      a_s[max] = t;
      tt = b_s[i];
      b_s[i] = b_s[max];
      b_s[max] = tt;
    }
    for (i2 = i + 1; i2 < n; i2++) {
      int j;
      double r = a_s[i2][i] / a_s[i][i];
      if (r == 0)
        continue;
      for (j = i; j < n; j++) {
        a_s[i2][j] -= a_s[i][j] * r;
      }
      b_s[i2] -= b_s[i] * r;
    }
  }
  if (DEBUG)
    print_matrix(n, a_s, b_s);
  for (i = n - 1; i >= 0; i--) {
    int j;
    double sum = 0;
    for (j = i + 1; j < n; j++) {
      sum += b_s[j] * a_s[i][j];
      a_s[i][j] = 0;
    }
    if (a_s[i][i] == 0) {
      if (b_s[i] == 0) {
        printf("Equations are underconstrained.\n");
        break;
      } else {
        printf("Equations are inconsistent.\n");
        break;
      }
    }
    b_s[i] = (b_s[i] - sum) / a_s[i][i];
    a_s[i][i] = 1;
  }
  if (DEBUG)
    print_matrix(n, a_s, b_s);
}
```