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

```asm
<cholmod>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    %rdi,%r15
  mov    %rdi,0x50(%rsp)
  mov    %esi,%ebp
  mov    %rdx,0x38(%rsp)
  movsd  %xmm0,0x30(%rsp)
  movslq %esi,%rbx
  mov    %rbx,(%rsp)
  mov    %esi,%eax
  imul   %esi,%eax
  mov    %eax,%edi
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rax,0x78(%rsp)
  movsd  0x30(%rsp),%xmm7
  mulsd  D1(%rip),%xmm7
  movsd  %xmm7,0x40(%rsp)
  test   %ebp,%ebp
  jle    L78
  lea    0x8(,%rbx,8),%rsi
  mov    %r15,%rdx
  mov    %ebp,%ecx
  lea    (%rax,%rcx,8),%rcx
L91:
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  add    %rsi,%rdx
  add    $0x8,%rax
  cmp    %rcx,%rax
  jne    L91
  mov    %ebp,%edx
  imul   %ebp,%edx
L220:
  mov    $0x0,%eax
  mov    0x38(%rsp),%rcx
L206:
  movq   $0x0,(%rcx,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%edx
  jg     L206
  mov    %ebp,%esi
  mov    0x78(%rsp),%rdi
  call   <array_max_abs@plt>
  movsd  0x30(%rsp),%xmm7
  ucomisd D45(%rip),%xmm7
  jp     L237
  je     L128
L237:
  movsd  0x30(%rsp),%xmm6
  mulsd  D16(%rip),%xmm6
  movsd  %xmm6,0x70(%rsp)
  test   %ebp,%ebp
  jle    L174
  mov    (%rsp),%rax
  lea    0x8(,%rax,8),%rdi
  mov    %rdi,0x60(%rsp)
  lea    0x0(,%rax,8),%rbx
  mov    %rbx,0x8(%rsp)
  mov    0x38(%rsp),%rax
  lea    0x8(%rax),%r13
  mov    %r13,0x58(%rsp)
  add    %rbx,%r13
  mov    %ebp,%edi
  mov    %rdi,0x48(%rsp)
  mov    %rax,%rdi
  add    %rbx,%rdi
  mov    %rdi,0x68(%rsp)
  mov    %rax,0x18(%rsp)
  mov    0x50(%rsp),%rax
  mov    %rax,0x10(%rsp)
  mov    $0x0,%r15d
  mov    $0x1,%r14d
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x28(%rsp)
  movl   $0x0,0x20(%rsp)
  movapd %xmm7,%xmm1
  jmp    L201
L78:
  mov    %ebp,%edx
  imul   %ebp,%edx
  test   %edx,%edx
  jg     L220
  mov    %ebp,%esi
  mov    0x78(%rsp),%rdi
  call   <array_max_abs@plt>
  movsd  0x30(%rsp),%xmm6
  ucomisd D45(%rip),%xmm6
  jp     L278
  je     L128
L278:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x28(%rsp)
L82:
  mov    0x78(%rsp),%rdi
  call   <free@plt>
  movsd  0x28(%rsp),%xmm0
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L128:
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L48
  sqrtsd %xmm0,%xmm0
  movsd  %xmm0,0x30(%rsp)
  jmp    L237
L48:
  call   <sqrt@plt>
  movsd  %xmm0,0x30(%rsp)
  jmp    L237
L253:
  pxor   %xmm1,%xmm1
  jmp    L28
L238:
  pxor   %xmm2,%xmm2
  jmp    L119
L30:
  pxor   %xmm7,%xmm7
  ucomisd %xmm0,%xmm7
  ja     L130
  movapd %xmm0,%xmm2
  sqrtsd %xmm2,%xmm2
L242:
  movsd  %xmm2,(%r12)
  cmp    0x48(%rsp),%r14
  je     L82
  lea    -0x8(%r13),%rax
L248:
  movsd  (%rax),%xmm0
  divsd  (%r12),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x1,%ebx
  add    0x8(%rsp),%rax
  cmp    %ebx,%ebp
  jne    L248
  add    %ebx,0x20(%rsp)
  cmpl   $0x0,0x24(%rsp)
  jle    L286
  mov    0x68(%rsp),%rax
  lea    (%rax,%r15,8),%rax
  pxor   %xmm1,%xmm1
L136:
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  add    $0x8,%rax
  cmp    %r13,%rax
  jne    L136
L110:
  add    $0x1,%r14
  mov    0x60(%rsp),%rax
  add    %rax,0x10(%rsp)
  add    %rax,0x18(%rsp)
  add    (%rsp),%r15
  add    %rax,%r13
L201:
  lea    -0x1(%r14),%r8d
  mov    0x18(%rsp),%rax
  mov    %rax,%r12
  mov    0x10(%rsp),%rdi
  movsd  (%rdi),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    %r14d,%ebx
  mov    %r14d,0x24(%rsp)
  cmp    %r14d,%ebp
  jle    L238
  mov    0x20(%rsp),%eax
  lea    (%rax,%rbp,1),%edx
  movslq %edx,%rdx
  sub    %r15,%rdx
  lea    0x0(,%r15,8),%rdi
  mov    0x38(%rsp),%rax
  lea    (%rax,%rdi,1),%r9
  lea    -0x2(%r14),%eax
  add    %r15,%rax
  mov    0x58(%rsp),%rsi
  lea    (%rsi,%rax,8),%rcx
  add    0x50(%rsp),%rdi
  mov    %r14,%rsi
  pxor   %xmm2,%xmm2
L267:
  test   %r8d,%r8d
  jle    L253
  mov    %r9,%rax
  pxor   %xmm1,%xmm1
L288:
  movsd  (%rax),%xmm0
  mulsd  (%rax,%rdx,8),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x8,%rax
  cmp    %rcx,%rax
  jne    L288
L28:
  movsd  (%rdi,%rsi,8),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%r12,%rdx,8)
  andpd  D43(%rip),%xmm0
  maxsd  %xmm2,%xmm0
  movapd %xmm0,%xmm2
  add    $0x1,%rsi
  add    (%rsp),%rdx
  cmp    %esi,%ebp
  jg     L267
L119:
  divsd  0x30(%rsp),%xmm2
  maxsd  0x40(%rsp),%xmm2
  movsd  (%r12),%xmm0
  movapd %xmm2,%xmm1
  mulsd  %xmm2,%xmm1
  comisd %xmm1,%xmm0
  ja     L30
  movsd  0x70(%rsp),%xmm3
  maxsd  %xmm2,%xmm3
  movapd %xmm3,%xmm2
  movapd %xmm3,%xmm1
  mulsd  %xmm3,%xmm1
  subsd  %xmm0,%xmm1
  maxsd  0x28(%rsp),%xmm1
  movsd  %xmm1,0x28(%rsp)
  jmp    L242
L130:
  call   <sqrt@plt>
  movapd %xmm0,%xmm2
  jmp    L242
L174:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x28(%rsp)
  jmp    L82
L286:
  pxor   %xmm1,%xmm1
  jmp    L110
```

tool_calls: name: disassemble_data
arguments: label: D1
datatype: byte[8]
name: disassemble_data
arguments: label: D45
datatype: f64
name: disassemble_data
arguments: label: D16
datatype: byte[8]
name: disassemble_data
arguments: label: D43
datatype: qword[2]

tool: {"D1": [0x23,0x26,0xc1,0x61,0xea,0x4e,0x27,0x3f]}

tool: D45: 0

tool: {"D16": [0x40,0xeb,0xd6,0x89,0x33,0xfa,0x60,0x3e]}

tool: {"D43": [0x7fffffffffffffff,0x0000000000000000]}

assistant: ```c
double cholmod(double *A, int N, double *L, double maxinp) {
  int i, j, k, step, step2;
  double beta, d1, ls;
  double *U22;
  double maxadd, maxdiag, minl, minl2, minljj;
  U22 = (double *)malloc(sizeof(double) * N * N);
  minl = sqrt(sqrt((double)1e-15)) * maxinp;
  maxadd = 0.0;
  for (i = 0; i < N; ++i) {
    U22[i] = A[i + i * N];
  }
  for (i = 0; i < N * N; ++i) {
    L[i] = 0.0;
  }
  maxdiag = array_max_abs(U22, N);
  if (maxinp == 0.0) {
    maxinp = sqrt(maxdiag);
  }
  minl2 = sqrt((double)1e-15) * maxinp;
  for (j = 0; j < N; ++j) {
    step = j * N;
    ls = 0.0;
    for (i = 0; i < j; ++i) {
      ls += L[step + i] * L[step + i];
    }
    L[step + j] = A[step + j] - ls;
    minljj = 0.0;
    for (i = j + 1; i < N; ++i) {
      ls = 0.0;
      step2 = i * N;
      for (k = 0; k < j; ++k) {
        ls += L[step + k] * L[step2 + k];
      }
      L[step2 + j] = A[step + i] - ls;
      if (fabs(L[step2 + j]) > minljj) {
        minljj = fabs(L[step2 + j]);
      }
    }
    if (minljj / maxinp > minl) {
      minljj = minljj / maxinp;
    } else {
      minljj = minl;
    }
    if (L[step + j] > minljj * minljj) {
      L[step + j] = sqrt(L[step + j]);
    } else {
      if (minljj < minl2) {
        minljj = minl2;
      }
      if (maxadd < (minljj * minljj - L[step + j])) {
        maxadd = minljj * minljj - L[step + j];
      }
      L[step + j] = minljj;
    }
    for (i = j + 1; i < N; ++i) {
      L[i * N + j] /= L[step + j];
    }
  }
  free(U22);
  return maxadd;
}
```