user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<cholesky>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x28,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %esi,%edi
  imul   %esi,%edi
  mov    %esi,0x1c(%rsp)
  mov    $0x8,%esi
  movslq %edi,%rdi
  call   <calloc@plt>
  mov    %rax,%r12
  test   %ebx,%ebx
  jle    L47
  lea    0x1(%rbx),%eax
  xor    %r14d,%r14d
  xor    %r15d,%r15d
  xor    %r13d,%r13d
  mov    %eax,0x18(%rsp)
  pxor   %xmm2,%xmm2
  xchg   %ax,%ax
L22:
  mov    %r13d,%r11d
  mov    %r13d,0x14(%rsp)
  add    $0x1,%r13d
  mov    %r13d,%r10d
  imul   %r11d,%r10d
  sar    %r10d
  lea    (%r11,%r10,1),%eax
  cltq
  lea    (%r12,%rax,8),%rbx
  test   %r11d,%r11d
  je     L58
  mov    0x8(%rsp),%rdi
  movslq %r14d,%rax
  movslq %r10d,%r10
  xor    %r8d,%r8d
  lea    (%rdi,%rax,8),%rbp
  lea    0x0(,%r10,8),%rax
  movsd  0x0(%rbp),%xmm1
  lea    (%r12,%rax,1),%r9
  lea    0x8(%r12,%rax,1),%rcx
  xor    %eax,%eax
  mov    %r9,%rdi
  movsd  %xmm1,(%r9)
  nopl   0x0(%rax,%rax,1)
L81:
  lea    0x1(%rax),%esi
  mov    %esi,%edx
  imul   %eax,%edx
  sar    %edx
  add    %eax,%edx
  movslq %edx,%rdx
  divsd  (%r12,%rdx,8),%xmm1
  movsd  %xmm1,(%r9,%r8,1)
  cmp    %r11d,%esi
  je     L39
  lea    0x2(%rax),%edx
  movsd  0x8(%rbp,%r8,1),%xmm1
  mov    %r9,%rax
  imul   %esi,%edx
  movsd  %xmm1,(%rcx)
  sar    %edx
  movslq %edx,%rdx
  sub    %r10,%rdx
  nopl   0x0(%rax)
L18:
  movsd  (%rax,%rdx,8),%xmm0
  mulsd  (%rax),%xmm0
  add    $0x8,%rax
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rcx)
  cmp    %rax,%rcx
  jne    L18
  add    $0x8,%rcx
  add    $0x8,%r8
  mov    %esi,%eax
  jmp    L81
  cs nopw 0x0(%rax,%rax,1)
L39:
  mov    0x8(%rsp),%rsi
  movslq %r15d,%rax
  movsd  (%rsi,%rax,8),%xmm1
  mov    0x14(%rsp),%eax
  sub    $0x1,%eax
  movsd  %xmm1,(%rbx)
  add    %r10,%rax
  lea    0x8(%r12,%rax,8),%rax
L98:
  movsd  (%rdi),%xmm0
  add    $0x8,%rdi
  mulsd  %xmm0,%xmm0
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rbx)
  cmp    %rdi,%rax
  jne    L98
L29:
  ucomisd %xmm1,%xmm2
  ja     L43
  sqrtsd %xmm1,%xmm1
L13:
  mov    0x1c(%rsp),%eax
  movsd  %xmm1,(%rbx)
  add    0x18(%rsp),%r15d
  add    %eax,%r14d
  cmp    %r13d,%eax
  jne    L22
L47:
  add    $0x28,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L58:
  mov    0x8(%rsp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%r12)
  movsd  (%rbx),%xmm1
  jmp    L29
L43:
  movapd %xmm1,%xmm0
  call   <sqrt@plt>
  pxor   %xmm2,%xmm2
  movapd %xmm0,%xmm1
  jmp    L13
```

assistant: ```c
double *cholesky(double *A, int n) {
  register int i, j, k;
  double *L = (double *)calloc(n * n, sizeof(double));
  for (i = 0; i < n; ++i) {
    for (j = 0; j < i; ++j) {
      L[((((i) * (i + 1)) / 2) + (j))] = A[((i * n) + j)];
      for (k = 0; k < j; ++k) {
        L[((((i) * (i + 1)) / 2) + (j))] -= L[((((i) * (i + 1)) / 2) + (k))] * L[((((j) * (j + 1)) / 2) + (k))];
      }
      L[((((i) * (i + 1)) / 2) + (j))] /= L[((((j) * (j + 1)) / 2) + (j))];
    }
    L[((((j) * (j + 1)) / 2) + (j))] = A[((j * n) + j)];
    for (k = 0; k < i; ++k) {
      L[((((i) * (i + 1)) / 2) + (i))] -= L[((((i) * (i + 1)) / 2) + (k))] * L[((((i) * (i + 1)) / 2) + (k))];
    }
    L[((((i) * (i + 1)) / 2) + (i))] = sqrt(L[((((i) * (i + 1)) / 2) + (i))]);
  }
  return L;
}
```