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

```asm
<choldc_sparse_neardiag>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L84
L36:
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  jmp    L23
L41:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jp     L67
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jne    L67
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  jmp    L119
L67:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x24(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L7
L68:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x24(%rbp)
  jg     L134
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x20(%rbp)
  jg     L134
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x18(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  subl   $0x1,-0x1c(%rbp)
L7:
  cmpl   $0x0,-0x1c(%rbp)
  jns    L68
L134:
  mov    -0x24(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jne    L6
  pxor   %xmm0,%xmm0
  comisd -0x18(%rbp),%xmm0
  jb     L21
  movsd  D1(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
L21:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  jmp    L95
L6:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  -0x18(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
L95:
  addl   $0x1,-0x20(%rbp)
L23:
  mov    -0x20(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L41
L119:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x20(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x20(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jge    L47
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
L47:
  addl   $0x1,-0x24(%rbp)
L84:
  mov    -0x24(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L36
  nop
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D1
data_type: byte[8]

tool: {"D1": [0x3e,0xc3,0xd8,0x4e,0x7d,0x7f,0x61,0x2b]}

assistant: ```c
void choldc_sparse_neardiag(double **a, int N, int *Nvec, double *p) {
  int i, j, k;
  double sum;
  for (i = 0; i < N; i++) {
    for (j = i; j < N; j++) {
      if (a[i][j] == 0.) {
        sum = 0;
        break;
      }
      for (sum = a[i][j], k = i - 1; k >= 0; k--) {
        if (Nvec[k] < i || Nvec[k] < j) {
          break;
        } else {
          sum -= a[i][k] * a[j][k];
        }
      }
      if (i == j) {
        if (sum <= 0.) {
          sum = 1.e-99;
        }
        p[i] = sqrt(sum);
      } else
        a[j][i] = sum / p[i];
    }
    Nvec[i] = j;
    if (j < N)
      a[j][i] = 0.0;
  }
}
```