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

```asm
<regress_ch>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %ecx,-0x4c(%rbp)
  mov    %r8d,-0x50(%rbp)
  mov    -0x50(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  mov    %edx,%ecx
  mov    $0x1,%edx
  mov    %eax,%esi
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <matrix@plt>
  cltq
  mov    %rax,-0x18(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,%esi
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <vector@plt>
  cltq
  mov    %rax,-0x10(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,%esi
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <vector@plt>
  cltq
  mov    %rax,-0x8(%rbp)
  movl   $0x1,-0x28(%rbp)
  jmp    L49
L26:
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  jmp    L51
L69:
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x20(%rbp)
  movl   $0x1,-0x24(%rbp)
  jmp    L67
L38:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x20(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x20(%rbp)
  addl   $0x1,-0x24(%rbp)
L67:
  mov    -0x24(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jle    L38
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movss  -0x20(%rbp),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L51:
  mov    -0x2c(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L69
  addl   $0x1,-0x28(%rbp)
L49:
  mov    -0x28(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L26
  movl   $0x1,-0x28(%rbp)
  jmp    L76
L50:
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x20(%rbp)
  movl   $0x1,-0x24(%rbp)
  jmp    L39
L78:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x20(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x20(%rbp)
  addl   $0x1,-0x24(%rbp)
L39:
  mov    -0x24(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jle    L78
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movss  -0x20(%rbp),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x28(%rbp)
L76:
  mov    -0x28(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L50
  mov    -0x10(%rbp),%rdx
  mov    -0x1c(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <choldc_e@plt>
  mov    -0x48(%rbp),%rdi
  mov    -0x8(%rbp),%rcx
  mov    -0x10(%rbp),%rdx
  mov    -0x1c(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <cholsl@plt>
  mov    -0x1c(%rbp),%ecx
  mov    -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%r8d
  mov    $0x1,%ecx
  mov    $0x1,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <free_matrix@plt>
  mov    -0x1c(%rbp),%edx
  mov    -0x10(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <free_vector@plt>
  mov    -0x1c(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <free_vector@plt>
  nop
  leave
  ret
```

assistant: ```c
void regress_ch(data, b, a, ndata, ivar) float **data, *a, *b;
int ndata, ivar;
{
  int p = ivar + 1, j, i, k;
  float **d, sum, *diag, *atb;
  d = matrix(1, p, 1, p);
  diag = vector(1, p);
  atb = vector(1, p);
  for (i = 1; i <= p; i++)
    for (j = i; j <= p; j++) {
      sum = 0;
      for (k = 1; k <= ndata; k++)
        sum += data[k][j] * data[k][i];
      d[i][j] = sum;
    }
  for (i = 1; i <= p; i++) {
    sum = 0;
    for (k = 1; k <= ndata; k++)
      sum += data[k][i] * b[k];
    atb[i] = sum;
  }
  choldc_e(d, p, diag);
  cholsl(d, p, diag, atb, a);
  free_matrix(d, 1, p, 1, p);
  free_vector(diag, 1, p);
  free_vector(atb, 1, p);
}
```