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

```asm
<cholsol>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L117
L48:
  movl   $0x0,-0x20(%rbp)
  jmp    L81
L122:
  mov    -0x44(%rbp),%eax
  imul   -0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L5
L168:
  mov    -0x44(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x44(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x18(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  addl   $0x1,-0x1c(%rbp)
L5:
  mov    -0x1c(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L168
  mov    -0x44(%rbp),%eax
  imul   -0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x44(%rbp),%eax
  imul   -0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x18(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x20(%rbp)
L81:
  mov    -0x20(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L122
  mov    -0x44(%rbp),%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L141
L32:
  mov    -0x44(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x44(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x18(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  addl   $0x1,-0x1c(%rbp)
L141:
  mov    -0x1c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L32
  movsd  -0x18(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jb     L36
  mov    -0x44(%rbp),%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  jmp    L79
L36:
  mov    $0x1,%eax
  jmp    L127
L79:
  addl   $0x1,-0x24(%rbp)
L117:
  mov    -0x24(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L48
  mov    -0x40(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x38(%rbp),%rax
  movsd  (%rax),%xmm1
  divsd  %xmm1,%xmm0
  mov    -0x40(%rbp),%rax
  movsd  %xmm0,(%rax)
  movl   $0x1,-0x24(%rbp)
  jmp    L83
L119:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L132
L115:
  mov    -0x44(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x18(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  addl   $0x1,-0x1c(%rbp)
L132:
  mov    -0x1c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L115
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0x18(%rbp),%xmm0
  mov    -0x44(%rbp),%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x24(%rbp)
L83:
  mov    -0x24(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L119
  mov    -0x44(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x44(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x44(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x44(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x44(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x44(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,-0x24(%rbp)
  jmp    L8
L92:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x24(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L166
L84:
  mov    -0x44(%rbp),%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x18(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  addl   $0x1,-0x1c(%rbp)
L166:
  mov    -0x1c(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L84
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0x18(%rbp),%xmm0
  mov    -0x44(%rbp),%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  subl   $0x1,-0x24(%rbp)
L8:
  cmpl   $0x0,-0x24(%rbp)
  jns    L92
  mov    $0x0,%eax
L127:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

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;
}
```