user: Converte this assembly snippet into its equivalent C code:

```asm
<syminv>:
  endbr64
  push   %r15
  mov    $0x1,%r15d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  test   %esi,%esi
  jle    L1
  mov    %rcx,%rbp
  mov    %r8,%rcx
  mov    %r9,%r8
  mov    %esi,%r12d
  mov    %rdx,%rbx
  call   <chol@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  jne    L1
  lea    0x1(%r12),%r14d
  lea    -0x1(%r12),%r11d
  pxor   %xmm3,%xmm3
  movsd  D1(%rip),%xmm4
  imul   %r12d,%r14d
  lea    -0x2(%r12),%r10d
  mov    %r11d,%r8d
  movslq %r10d,%r10
  sar    %r14d
  lea    -0x1(%r14),%r13d
  sub    %r12d,%r14d
  mov    %r13d,0xc(%rsp)
  nop
L86:
  movslq %r13d,%rax
  movsd  (%rbx,%rax,8),%xmm0
  ucomisd %xmm3,%xmm0
  jp     L166
  jne    L166
  mov    %r13d,%edx
  mov    %r8d,%eax
  cmp    %r8d,%r12d
  jle    L102
  nopl   0x0(%rax,%rax,1)
L49:
  movslq %edx,%rcx
  add    $0x1,%eax
  movq   $0x0,(%rbx,%rcx,8)
  add    %eax,%edx
  cmp    %eax,%r12d
  jne    L49
L102:
  sub    %r8d,%r13d
  sub    $0x1,%r8d
  sub    $0x1,%r10
  sub    $0x1,%r13d
  cmp    $0xffffffff,%r8d
  jne    L86
L1:
  add    $0x18,%rsp
  mov    %r15d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L166:
  cmp    %r8d,%r12d
  jle    L125
  lea    0x1(%r8),%eax
  mov    %r13d,%edx
  jmp    L24
  xchg   %ax,%ax
L115:
  movslq %edx,%rcx
  add    $0x1,%rax
  movsd  (%rbx,%rcx,8),%xmm0
L24:
  movsd  %xmm0,-0x8(%rbp,%rax,8)
  add    %eax,%edx
  cmp    %eax,%r12d
  jg     L115
L125:
  cmp    %r8d,%r11d
  jl     L102
  mov    0xc(%rsp),%edi
  mov    %r11d,%r9d
  nopl   (%rax)
L95:
  movsd  0x8(%rbp,%r10,8),%xmm2
  lea    (%r14,%r9,1),%eax
  movapd %xmm3,%xmm1
  cmp    %r8d,%r9d
  je     L141
L26:
  cmp    %r8d,%r11d
  jle    L19
  movslq %r11d,%rdx
  nopl   0x0(%rax)
L156:
  movslq %eax,%rcx
  lea    -0x1(%rax),%esi
  movsd  (%rbx,%rcx,8),%xmm0
  mulsd  0x0(%rbp,%rdx,8),%xmm0
  mov    %eax,%ecx
  sub    %edx,%ecx
  cmp    %edi,%eax
  mov    %ecx,%eax
  cmovle %esi,%eax
  sub    $0x1,%rdx
  subsd  %xmm0,%xmm1
  cmp    %edx,%r8d
  jl     L156
L19:
  divsd  %xmm2,%xmm1
  sub    %r9d,%edi
  cltq
  sub    $0x1,%r9d
  sub    $0x1,%edi
  movsd  %xmm1,(%rbx,%rax,8)
  cmp    %r10d,%r9d
  jne    L95
  jmp    L102
L141:
  movapd %xmm4,%xmm1
  divsd  %xmm2,%xmm1
  jmp    L26
```

tool_calls: name: extract_symbolic_data
arguments: label: D1
data_type: f64

tool: D1: 1

assistant: ```c
int syminv(double a[], int nrow, double c[], double w[], int *nullty, double *log_det) {
  double x;
  int i, j, k, l, irow, icol, jcol, mdiag, ndiag, last_cell, last_row;
  if (nrow <= 0)
    return (1);
  i = chol(a, nrow, c, nullty, log_det);
  if (i != 0)
    return (i);
  last_cell = ((nrow * (nrow + 1)) / 2) - 1;
  last_row = nrow - 1;
  for (ndiag = last_cell, irow = last_row; irow >= 0; ndiag -= irow, ndiag--, irow--) {
    if (c[ndiag] != 0.0) {
      for (l = ndiag, i = irow; i < nrow; i++, l += i)
        w[i] = c[l];
      for (icol = last_row, mdiag = jcol = last_cell; icol >= irow; mdiag -= icol, mdiag--, icol--, jcol--) {
        if (icol == irow)
          x = 1.0 / w[irow];
        else
          x = 0.0;
        for (k = last_row, l = jcol; k > irow; k--) {
          x -= (w[k] * c[l]);
          if (l > mdiag)
            l -= k;
          else
            l--;
        }
        c[l] = x / w[irow];
      }
    } else
      for (j = irow, l = ndiag; j < nrow; j++, l += j)
        c[l] = 0.0;
  }
  return (0);
}
```