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

```asm
<cholmod>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  movslq %esi,%r13
  push   %r12
  mov    %r13,%r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,0x20(%rsp)
  mov    %r13d,%edi
  imul   %r13d,%edi
  movsd  %xmm1,0x18(%rsp)
  mov    %rdx,0x10(%rsp)
  movsd  %xmm0,0x8(%rsp)
  shl    $0x3,%edi
  call   <malloc@plt>
  movsd  0x8(%rsp),%xmm6
  pxor   %xmm3,%xmm3
  movsd  0x18(%rsp),%xmm1
  mov    %rax,0x38(%rsp)
  ucomisd %xmm6,%xmm3
  ja     L56
  sqrtsd %xmm6,%xmm6
  movapd %xmm6,%xmm0
L198:
  ucomisd %xmm0,%xmm3
  ja     L21
  sqrtsd %xmm0,%xmm0
L6:
  movapd %xmm0,%xmm6
  mov    %r12d,%edi
  mulsd  %xmm1,%xmm6
  imul   %r12d,%edi
  test   %r12d,%r12d
  jle    L299
  mov    0x38(%rsp),%rbx
  mov    %r12d,%ecx
  mov    0x20(%rsp),%rdx
  lea    0x8(,%r13,8),%rsi
  mov    %rbx,%rax
  lea    (%rbx,%rcx,8),%rcx
  cs nopw 0x0(%rax,%rax,1)
L36:
  movsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %rsi,%rdx
  movsd  %xmm0,-0x8(%rax)
  cmp    %rcx,%rax
  jne    L36
L233:
  lea    -0x1(%rdi),%eax
  test   %edi,%edi
  mov    0x10(%rsp),%rdi
  movsd  %xmm1,0x28(%rsp)
  lea    0x8(,%rax,8),%rdx
  mov    $0x8,%eax
  movsd  %xmm6,0x18(%rsp)
  cmovle %rax,%rdx
  xor    %esi,%esi
  call   <memset@plt>
  movsd  0x18(%rsp),%xmm6
  movsd  0x28(%rsp),%xmm1
L214:
  mov    0x38(%rsp),%rdi
  mov    %r12d,%esi
  movsd  %xmm1,0x28(%rsp)
  movsd  %xmm6,0x18(%rsp)
  call   <array_max_abs@plt>
  movsd  0x28(%rsp),%xmm1
  pxor   %xmm3,%xmm3
  movsd  0x18(%rsp),%xmm6
  ucomisd %xmm3,%xmm1
  jp     L85
  je     L75
L85:
  movsd  0x8(%rsp),%xmm7
  ucomisd %xmm7,%xmm3
  ja     L249
  movapd %xmm7,%xmm5
  sqrtsd %xmm5,%xmm5
L62:
  mulsd  %xmm1,%xmm5
  test   %r12d,%r12d
  jle    L35
  mov    0x10(%rsp),%rbp
  lea    0x8(,%r13,8),%rax
  xor    %r11d,%r11d
  lea    0x0(,%r13,8),%r15
  mov    %rax,0x30(%rsp)
  mov    $0x1,%r10d
  movapd %xmm3,%xmm7
  movq   D19(%rip),%xmm4
  lea    0x8(%rbp),%rax
  mov    %r13,0x8(%rsp)
  movapd %xmm3,%xmm2
  mov    %rax,0x28(%rsp)
  lea    (%rax,%r15,1),%r14
  mov    0x20(%rsp),%rax
  mov    %rax,0x18(%rsp)
  nopl   0x0(%rax,%rax,1)
L98:
  mov    0x18(%rsp),%rax
  mov    %r10d,%r8d
  mov    %r10d,%ebx
  movsd  (%rax),%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,0x0(%rbp)
  cmp    %r10d,%r12d
  jle    L30
  mov    0x10(%rsp),%rax
  mov    0x28(%rsp),%rsi
  movapd %xmm3,%xmm8
  lea    0x0(,%r11,8),%rdi
  movslq 0x8(%rsp),%rdx
  lea    (%rax,%rdi,1),%r9
  lea    -0x2(%r10),%eax
  add    0x20(%rsp),%rdi
  add    %r11,%rax
  sub    %r11,%rdx
  lea    (%rsi,%rax,8),%rcx
  mov    %r10,%rsi
  nopw   0x0(%rax,%rax,1)
L210:
  cmp    $0x1,%r8d
  je     L143
  mov    %r9,%rax
  movapd %xmm3,%xmm2
  nopl   0x0(%rax)
L246:
  movsd  (%rax),%xmm0
  mulsd  (%rax,%rdx,8),%xmm0
  add    $0x8,%rax
  addsd  %xmm0,%xmm2
  cmp    %rax,%rcx
  jne    L246
L52:
  movsd  (%rdi,%rsi,8),%xmm0
  add    $0x1,%rsi
  subsd  %xmm2,%xmm0
  movsd  %xmm0,0x0(%rbp,%rdx,8)
  andpd  %xmm4,%xmm0
  add    %r13,%rdx
  maxsd  %xmm8,%xmm0
  movapd %xmm0,%xmm8
  cmp    %esi,%r12d
  jg     L210
  movsd  0x0(%rbp),%xmm0
L41:
  divsd  %xmm1,%xmm8
  maxsd  %xmm6,%xmm8
  movapd %xmm8,%xmm2
  mulsd  %xmm8,%xmm2
  comisd %xmm2,%xmm0
  ja     L13
  comisd %xmm8,%xmm5
  jbe    L28
  movapd %xmm5,%xmm2
  movapd %xmm5,%xmm8
  mulsd  %xmm5,%xmm2
L28:
  subsd  %xmm0,%xmm2
  maxsd  %xmm7,%xmm2
  movapd %xmm2,%xmm7
L140:
  movsd  %xmm8,0x0(%rbp)
  cmp    %r13,%r10
  je     L118
L97:
  lea    -0x8(%r14),%rax
  nopl   (%rax)
L174:
  add    $0x1,%ebx
  movsd  (%rax),%xmm0
  divsd  0x0(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  add    %r15,%rax
  cmp    %ebx,%r12d
  jne    L174
  mov    0x10(%rsp),%rax
  mov    0x8(%rsp),%rdi
  movapd %xmm3,%xmm2
  lea    (%rax,%rdi,8),%rax
  nopw   0x0(%rax,%rax,1)
L29:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm2
  cmp    %r14,%rax
  jne    L29
  mov    0x30(%rsp),%rax
  add    %r13,0x8(%rsp)
  add    %r13,%r11
  add    $0x1,%r10
  add    %rax,0x18(%rsp)
  add    %rax,%rbp
  add    %rax,%r14
  jmp    L98
  cs nopw 0x0(%rax,%rax,1)
L143:
  movapd %xmm3,%xmm2
  jmp    L52
L13:
  ucomisd %xmm0,%xmm3
  ja     L135
  sqrtsd %xmm0,%xmm0
  movapd %xmm0,%xmm8
  movsd  %xmm8,0x0(%rbp)
  cmp    %r13,%r10
  jne    L97
L118:
  mov    0x38(%rsp),%rdi
  movsd  %xmm7,0x8(%rsp)
  call   <free@plt>
  movsd  0x8(%rsp),%xmm7
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  movapd %xmm7,%xmm0
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L30:
  movapd %xmm3,%xmm8
  jmp    L41
L75:
  ucomisd %xmm0,%xmm3
  ja     L173
  movapd %xmm0,%xmm1
  sqrtsd %xmm1,%xmm1
  jmp    L85
L299:
  test   %edi,%edi
  je     L214
  jmp    L233
  nopw   0x0(%rax,%rax,1)
L35:
  movapd %xmm3,%xmm7
  jmp    L118
L21:
  movsd  %xmm1,0x18(%rsp)
  call   <sqrt@plt>
  movsd  0x18(%rsp),%xmm1
  jmp    L6
L249:
  movsd  0x8(%rsp),%xmm0
  movsd  %xmm1,0x28(%rsp)
  movsd  %xmm6,0x18(%rsp)
  call   <sqrt@plt>
  movsd  0x28(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm6
  pxor   %xmm3,%xmm3
  movapd %xmm0,%xmm5
  jmp    L62
L56:
  movsd  0x8(%rsp),%xmm0
  movsd  %xmm1,0x18(%rsp)
  call   <sqrt@plt>
  movsd  0x18(%rsp),%xmm1
  pxor   %xmm3,%xmm3
  jmp    L198
L135:
  mov    %r10,0x68(%rsp)
  mov    %r11,0x60(%rsp)
  movsd  %xmm1,0x58(%rsp)
  movsd  %xmm7,0x50(%rsp)
  movsd  %xmm5,0x48(%rsp)
  movsd  %xmm6,0x40(%rsp)
  call   <sqrt@plt>
  movsd  0x40(%rsp),%xmm6
  mov    0x60(%rsp),%r11
  pxor   %xmm3,%xmm3
  movsd  0x48(%rsp),%xmm5
  movsd  0x50(%rsp),%xmm7
  movapd %xmm0,%xmm8
  movsd  0x58(%rsp),%xmm1
  movq   D19(%rip),%xmm4
  mov    0x68(%rsp),%r10
  jmp    L140
L173:
  movsd  %xmm6,0x18(%rsp)
  call   <sqrt@plt>
  movsd  0x18(%rsp),%xmm6
  pxor   %xmm3,%xmm3
  movapd %xmm0,%xmm1
  jmp    L85
```

tool_calls: name: disassemble_data
arguments: data_label: D19
type_guessed: qword

tool: D19: 9223372036854775807

assistant: ```c
double cholmod(double *A, int N, double *L, double eps, double maxinp) {
  int i, j, k, step, step2;
  double ls;
  double *U22;
  double maxadd, maxdiag, minl, minl2, minljj;
  U22 = (double *)malloc(sizeof(double) * N * N);
  minl = sqrt(sqrt(eps)) * 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(eps) * 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;
}
```