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

```asm
<cholsol>:
  endbr64
  push   %r15
  movslq %edx,%rax
  mov    %rsi,%r10
  mov    %edx,%r11d
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rax,0x8(%rsp)
  test   %edx,%edx
  jle    L20
  mov    %rdi,%r15
  mov    %rdi,%rbp
  pxor   %xmm2,%xmm2
  xor    %r13d,%r13d
  lea    0x0(,%rax,8),%rbx
  lea    0x8(,%rax,8),%r12
  lea    (%rdi,%rbx,1),%rax
  mov    %rax,0x10(%rsp)
  nopl   0x0(%rax)
L122:
  mov    %r13d,%r9d
  test   %r13,%r13
  je     L15
  movsd  0x0(%rbp),%xmm0
  divsd  (%r14),%xmm0
  movsd  %xmm0,0x0(%rbp)
  cmp    $0x1,%r13d
  je     L245
  mov    $0x1,%esi
  mov    0x10(%rsp),%r8
  lea    0x0(%rbp,%rbx,1),%rdi
  mov    $0x1,%ecx
  sub    %r13,%rsi
L19:
  movsd  (%rdi),%xmm1
  mov    %rbp,%rax
  xor    %edx,%edx
  nopl   0x0(%rax)
L22:
  movsd  (%rax),%xmm0
  mulsd  (%rax,%rsi,8),%xmm0
  add    $0x1,%edx
  add    %rbx,%rax
  subsd  %xmm0,%xmm1
  cmp    %ecx,%edx
  jne    L22
  add    $0x1,%ecx
  divsd  0x8(%r8),%xmm1
  add    $0x1,%rsi
  add    %r12,%r8
  movsd  %xmm1,(%rdi)
  add    %rbx,%rdi
  cmp    %r9d,%ecx
  jne    L19
L245:
  movsd  (%r15),%xmm1
  mov    %rbp,%rdx
  xor    %eax,%eax
  nopl   (%rax)
L119:
  movsd  (%rdx),%xmm0
  add    $0x1,%eax
  add    %rbx,%rdx
  mulsd  %xmm0,%xmm0
  subsd  %xmm0,%xmm1
  cmp    %r9d,%eax
  jne    L119
  comisd %xmm2,%xmm1
  jb     L141
L241:
  ucomisd %xmm1,%xmm2
  ja     L205
  sqrtsd %xmm1,%xmm1
  add    $0x1,%r13
  add    $0x8,%rbp
  movsd  %xmm1,(%r15)
  add    %r12,%r15
  cmp    0x8(%rsp),%r13
  jne    L122
L20:
  lea    -0x1(%r11),%edi
  mov    %r11d,%eax
  mov    0x8(%rsp),%rsi
  lea    -0x2(%r11),%ebp
  imul   %edi,%eax
  movsd  (%r10),%xmm0
  divsd  (%r14),%xmm0
  movsd  %xmm0,(%r10)
  shl    $0x3,%rsi
  lea    -0x8(%r10,%rsi,1),%r13
  mov    %eax,0x8(%rsp)
  add    %edi,%eax
  cltq
  lea    (%r14,%rax,8),%r15
  cmp    $0x1,%r11d
  jle    L223
  lea    0x8(%rsi),%r12
  lea    0x8(%r10),%rcx
  mov    $0x1,%r8d
  lea    (%r14,%r12,1),%rbx
  lea    0x8(%r14),%r9
  pxor   %xmm2,%xmm2
L236:
  mov    %r10,%rax
  mov    %r9,%rdx
  movapd %xmm2,%xmm1
  nop
L192:
  movsd  (%rdx),%xmm0
  mulsd  (%rax),%xmm0
  add    $0x8,%rax
  add    %rsi,%rdx
  addsd  %xmm0,%xmm1
  cmp    %rax,%rcx
  jne    L192
  movsd  (%rcx),%xmm0
  add    $0x1,%r8d
  add    $0x8,%rcx
  add    $0x8,%r9
  subsd  %xmm1,%xmm0
  divsd  (%rbx),%xmm0
  add    %r12,%rbx
  movsd  %xmm0,-0x8(%rcx)
  cmp    %r8d,%r11d
  jne    L236
  movsd  0x0(%r13),%xmm0
  divsd  (%r15),%xmm0
  movsd  %xmm0,0x0(%r13)
L87:
  mov    0x8(%rsp),%ecx
  movslq %ebp,%rax
  mov    %r11d,%r9d
  mov    $0x1,%r8d
  not    %r9d
  sub    %r11d,%ecx
  movslq %r9d,%r9
  movslq %ecx,%rdx
  shl    $0x3,%r9
  lea    (%rdx,%rax,1),%rsi
  add    $0x1,%rax
  lea    (%r14,%rsi,8),%rbx
  mov    %r11d,%esi
  add    %rax,%rdx
  neg    %esi
  movslq %esi,%rsi
  lea    -0x8(,%rsi,8),%r12
  lea    (%r14,%rdx,8),%rsi
  lea    (%r10,%rax,8),%rdx
  mov    %edi,%eax
  cmp    %edi,%r11d
  jle    L194
L97:
  cmp    $0x1,%r8d
  je     L27
  mov    %r8d,%ebp
  xor    %eax,%eax
  movapd %xmm2,%xmm1
  shr    %ebp
  shl    $0x4,%rbp
  nopl   0x0(%rax)
L207:
  movupd (%rdx,%rax,1),%xmm0
  movupd (%rsi,%rax,1),%xmm4
  add    $0x10,%rax
  mulpd  %xmm4,%xmm0
  addsd  %xmm0,%xmm1
  unpckhpd %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rbp,%rax
  jne    L207
  mov    %r8d,%ebp
  and    $0xfffffffe,%ebp
  lea    (%rdi,%rbp,1),%eax
  cmp    %ebp,%r8d
  je     L139
L237:
  lea    (%rax,%rcx,1),%ebp
  cltq
  movslq %ebp,%rbp
  movsd  (%r14,%rbp,8),%xmm0
  mulsd  (%r10,%rax,8),%xmm0
  addsd  %xmm0,%xmm1
L139:
  movsd  -0x8(%rdx),%xmm0
  lea    -0x1(%rdi),%eax
  sub    %r11d,%ecx
  add    $0x1,%r8d
  add    %r12,%rsi
  sub    $0x8,%rdx
  subsd  %xmm1,%xmm0
  divsd  (%rbx),%xmm0
  add    %r9,%rbx
  movsd  %xmm0,(%rdx)
  sub    $0x2,%edi
  js     L8
  mov    %eax,%edi
  mov    %edi,%eax
  cmp    %edi,%r11d
  jg     L97
L194:
  movapd %xmm2,%xmm1
  jmp    L139
L15:
  movsd  (%r15),%xmm1
  comisd %xmm2,%xmm1
  jae    L241
L141:
  add    $0x38,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L223:
  movsd  0x0(%r13),%xmm0
  divsd  (%r15),%xmm0
  movsd  %xmm0,0x0(%r13)
  test   %ebp,%ebp
  jns    L159
L8:
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L27:
  movapd %xmm2,%xmm1
  jmp    L237
L159:
  pxor   %xmm2,%xmm2
  jmp    L87
  nopl   0x0(%rax)
L205:
  movapd %xmm1,%xmm0
  mov    %r11d,0x2c(%rsp)
  add    $0x1,%r13
  add    $0x8,%rbp
  mov    %r10,0x20(%rsp)
  movsd  %xmm2,0x18(%rsp)
  call   <sqrt@plt>
  movsd  0x18(%rsp),%xmm2
  mov    0x20(%rsp),%r10
  movsd  %xmm0,(%r15)
  add    %r12,%r15
  cmp    0x8(%rsp),%r13
  mov    0x2c(%rsp),%r11d
  jne    L122
  jmp    L20
```

assistant: ```c
int cholsol(double *A, double *b, int n) {
  int i, j, k;
  double sum;
  for (i = 0; i < n; ++i) {
    for (j = 0; j < i; ++j) {
      sum = A[i + n * j];
      for (k = 0; k < j; ++k)
        sum -= A[i + n * k] * A[j + n * k];
      A[i + n * j] = sum / A[j + n * j];
    }
    sum = A[i + n * i];
    for (k = 0; k < i; ++k)
      sum -= A[i + n * k] * A[i + n * k];
    if (sum >= 0.0)
      A[i + n * i] = sqrt(sum);
    else
      return 1;
  }
  b[0] = b[0] / A[0];
  for (i = 1; i < n; ++i) {
    sum = 0.;
    for (k = 0; k < i; ++k)
      sum += A[i + n * k] * b[k];
    b[i] = (b[i] - sum) / A[i + n * i];
  }
  b[n - 1] = b[n - 1] / A[n - 1 + n * (n - 1)];
  for (i = n - 2; i >= 0; --i) {
    sum = 0.;
    for (k = i + 1; k < n; ++k)
      sum += A[n * i + k] * b[k];
    b[i] = (b[i] - sum) / A[n * i + i];
  }
  return 0;
}
```