user: Please show me the C implementation that matches the assembly code listed below:

```asm
<modelhess2>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  movslq %esi,%rbx
  mov    %ebx,%edi
  mov    %rbx,%rbp
  imul   %ebx,%edi
  sub    $0x78,%rsp
  mov    %rdx,0x60(%rsp)
  shl    $0x3,%edi
  mov    %rbx,0x58(%rsp)
  call   <malloc@plt>
  mov    %rax,%r14
  test   %ebx,%ebx
  jle    L36
  mov    %ebx,%ecx
  lea    0x8(,%rbx,8),%rsi
  mov    %r12,%rdx
  lea    (%rax,%rcx,8),%rcx
  xchg   %ax,%ax
L38:
  movsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %rsi,%rdx
  movsd  %xmm0,-0x8(%rax)
  cmp    %rcx,%rax
  jne    L38
  mov    %ebp,%esi
  mov    %r14,%rdi
  call   <array_max@plt>
  mov    %ebp,%esi
  mov    %r14,%rdi
  movsd  %xmm0,(%rsp)
  call   <array_min@plt>
  movsd  (%rsp),%xmm3
  pxor   %xmm4,%xmm4
  movsd  %xmm4,0x8(%rsp)
  comisd %xmm4,%xmm3
  jbe    L261
  movsd  D44(%rip),%xmm2
  movq   %xmm3,%rbx
  mulsd  %xmm3,%xmm2
  movq   %xmm2,%r13
L229:
  mov    0x58(%rsp),%rax
  test   %ebp,%ebp
  mov    %r14,%rdi
  movsd  %xmm0,0x10(%rsp)
  movsd  %xmm3,(%rsp)
  lea    0x0(,%rax,8),%rdx
  mov    $0x8,%eax
  cmovle %rax,%rdx
  xor    %esi,%esi
  call   <memset@plt>
  movsd  0x10(%rsp),%xmm0
  movq   %r13,%xmm3
  pxor   %xmm2,%xmm2
  comisd %xmm0,%xmm3
  movsd  (%rsp),%xmm3
  jae    L132
L240:
  xor    %edi,%edi
  xor    %esi,%esi
  xor    %ecx,%ecx
  xchg   %ax,%ax
L212:
  mov    $0x1,%eax
  cmp    $0x1,%ebp
  je     L147
  nopw   0x0(%rax,%rax,1)
L280:
  cmp    %eax,%ecx
  jge    L21
  lea    (%rax,%rdi,1),%edx
  movslq %edx,%rdx
  movsd  (%r12,%rdx,8),%xmm0
  movslq %esi,%rdx
  add    $0x1,%esi
  movsd  %xmm0,(%r14,%rdx,8)
L21:
  add    $0x1,%eax
  cmp    %eax,%ebp
  jne    L280
L147:
  add    $0x1,%ecx
  add    %ebp,%edi
  cmp    %ecx,%ebp
  jg     L212
L26:
  mov    %r14,%rdi
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm3,(%rsp)
  call   <array_max_abs@plt>
  movsd  (%rsp),%xmm3
  movsd  D15(%rip),%xmm1
  movsd  0x10(%rsp),%xmm2
  mulsd  %xmm0,%xmm1
  comisd %xmm3,%xmm1
  jbe    L213
  movapd %xmm0,%xmm4
  subsd  %xmm3,%xmm4
  movsd  D89(%rip),%xmm3
  mulsd  %xmm0,%xmm3
  addsd  %xmm4,%xmm3
  addsd  %xmm3,%xmm2
  movapd %xmm1,%xmm3
L213:
  ucomisd 0x8(%rsp),%xmm3
  jp     L311
  jne    L311
  movsd  D62(%rip),%xmm2
  movapd %xmm2,%xmm3
L397:
  test   %ebp,%ebp
  jle    L384
  mov    0x58(%rsp),%rax
  xor    %edx,%edx
  lea    0x8(,%rax,8),%rcx
  mov    %r12,%rax
L214:
  movsd  (%rax),%xmm1
  add    $0x1,%edx
  addsd  %xmm2,%xmm1
  movsd  %xmm1,(%rax)
  add    %rcx,%rax
  cmp    %edx,%ebp
  jne    L214
L384:
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebp,%xmm1
  divsd  %xmm1,%xmm0
  comisd %xmm0,%xmm3
  jbe    L29
L383:
  movsd  0x8(%rsp),%xmm2
  ucomisd %xmm3,%xmm2
  ja     L150
  sqrtsd %xmm3,%xmm3
  movapd %xmm3,%xmm0
L329:
  mov    0x60(%rsp),%rdx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <cholmod@plt>
  comisd 0x8(%rsp),%xmm0
  movsd  %xmm0,0x50(%rsp)
  jbe    L410
  movsd  (%r12),%xmm3
  movsd  %xmm3,0x10(%rsp)
  test   %ebp,%ebp
  jle    L310
  mov    0x58(%rsp),%rax
  mov    %r12,0x30(%rsp)
  xor    %r15d,%r15d
  xor    %r13d,%r13d
  movsd  0x8(%rsp),%xmm2
  mov    %ebp,0x48(%rsp)
  add    $0x1,%rax
  mov    %r14,0x68(%rsp)
  lea    0x0(,%rax,8),%rdi
  mov    %rax,0x28(%rsp)
  lea    0x8(%r12),%rax
  mov    %rdi,0x40(%rsp)
  sub    $0x8,%rdi
  mov    %rax,%r14
  lea    (%r12,%rdi,1),%rbx
  mov    %rdi,0x38(%rsp)
  mov    %rbx,0x20(%rsp)
  mov    %rax,%rbx
  add    %rdi,%rbx
  lea    -0x1(%rbp),%edi
  movsd  %xmm3,0x18(%rsp)
  mov    %edi,0x4c(%rsp)
  movsd  %xmm2,(%rsp)
L60:
  add    $0x1,%r13d
  cmp    %r13d,0x48(%rsp)
  jle    L195
  mov    0x4c(%rsp),%eax
  mov    0x30(%rsp),%rdi
  mov    %r14,%rbp
  sub    %r13d,%eax
  add    %r15,%rax
  lea    0x10(%rdi,%rax,8),%r12
  nopw   0x0(%rax,%rax,1)
L392:
  movsd  0x0(%rbp),%xmm0
  add    $0x8,%rbp
  call   <fabs@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  cmp    %rbp,%r12
  jne    L392
L195:
  movsd  (%rsp),%xmm7
  movsd  -0x8(%r14),%xmm0
  movapd %xmm7,%xmm1
  addsd  %xmm0,%xmm1
  subsd  %xmm7,%xmm0
  maxsd  0x10(%rsp),%xmm1
  minsd  0x18(%rsp),%xmm0
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm0,0x18(%rsp)
  cmp    %r13d,0x48(%rsp)
  je     L290
  movsd  0x8(%rsp),%xmm2
  mov    0x20(%rsp),%r12
  movsd  %xmm2,(%rsp)
  nopl   0x0(%rax,%rax,1)
L181:
  movsd  (%r12),%xmm0
  add    $0x8,%r12
  call   <fabs@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  cmp    %r12,%rbx
  jne    L181
  mov    0x40(%rsp),%rdi
  mov    0x38(%rsp),%rsi
  add    0x28(%rsp),%r15
  add    %rsi,0x20(%rsp)
  add    %rdi,%r14
  add    %rdi,%rbx
  jmp    L60
L311:
  comisd 0x8(%rsp),%xmm2
  ja     L397
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebp,%xmm1
  divsd  %xmm1,%xmm0
  comisd %xmm0,%xmm3
  ja     L383
L29:
  movsd  0x8(%rsp),%xmm7
  ucomisd %xmm0,%xmm7
  ja     L269
  sqrtsd %xmm0,%xmm0
  jmp    L329
L132:
  movq   %rbx,%xmm2
  subsd  %xmm0,%xmm2
  addsd  %xmm2,%xmm2
  mulsd  D44(%rip),%xmm2
  subsd  %xmm0,%xmm2
  addsd  %xmm2,%xmm3
  jmp    L240
L290:
  movsd  0x18(%rsp),%xmm3
  movapd %xmm1,%xmm0
  movsd  0x8(%rsp),%xmm7
  mov    0x68(%rsp),%r14
  mov    0x30(%rsp),%r12
  subsd  %xmm3,%xmm0
  mulsd  D44(%rip),%xmm0
  mov    0x48(%rsp),%ebp
  subsd  %xmm3,%xmm0
  comisd %xmm0,%xmm7
  ja     L373
  movsd  0x50(%rsp),%xmm2
  comisd %xmm0,%xmm2
  ja     L277
L413:
  mov    0x28(%rsp),%rcx
  movsd  0x50(%rsp),%xmm1
  mov    %r12,%rax
  xor    %edx,%edx
  shl    $0x3,%rcx
  nop
L17:
  movsd  (%rax),%xmm0
  add    $0x1,%edx
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    %rcx,%rax
  cmp    %edx,%ebp
  jne    L17
L410:
  mov    0x60(%rsp),%rdx
  mov    %ebp,%esi
  mov    %r12,%rdi
  pxor   %xmm0,%xmm0
  call   <cholmod@plt>
  mov    %r14,%rdi
  movsd  %xmm0,(%rsp)
  call   <free@plt>
  movsd  (%rsp),%xmm0
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L261:
  movq   %xmm4,%r13
  movq   %xmm4,%rbx
  jmp    L229
L373:
  movsd  %xmm7,0x50(%rsp)
  jmp    L413
L36:
  mov    %rax,%rdi
  mov    %ebx,%esi
  call   <array_max@plt>
  mov    %ebx,%esi
  mov    %r14,%rdi
  movsd  %xmm0,(%rsp)
  call   <array_min@plt>
  movsd  (%rsp),%xmm3
  pxor   %xmm2,%xmm2
  movsd  %xmm2,0x8(%rsp)
  comisd %xmm2,%xmm3
  jbe    L98
  movsd  D44(%rip),%xmm2
  movapd %xmm3,%xmm1
  mulsd  %xmm3,%xmm2
L179:
  comisd %xmm0,%xmm2
  jae    L275
  pxor   %xmm2,%xmm2
  xor    %esi,%esi
  jmp    L26
L310:
  movapd %xmm3,%xmm0
  movsd  0x8(%rsp),%xmm7
  subsd  %xmm3,%xmm0
  mulsd  D44(%rip),%xmm0
  subsd  %xmm3,%xmm0
  comisd %xmm0,%xmm7
  ja     L410
  movsd  0x50(%rsp),%xmm4
  comisd %xmm0,%xmm4
  ja     L410
L254:
  mov    0x58(%rsp),%rax
  add    $0x1,%rax
  mov    %rax,0x28(%rsp)
  test   %ebp,%ebp
  jg     L413
  jmp    L410
L275:
  subsd  %xmm0,%xmm1
  movsd  D44(%rip),%xmm2
  xor    %esi,%esi
  addsd  %xmm1,%xmm1
  mulsd  %xmm1,%xmm2
  subsd  %xmm0,%xmm2
  addsd  %xmm2,%xmm3
  jmp    L26
L98:
  movapd %xmm2,%xmm1
  jmp    L179
L277:
  movsd  %xmm0,0x50(%rsp)
  jmp    L254
L269:
  call   <sqrt@plt>
  jmp    L329
L150:
  movapd %xmm3,%xmm0
  call   <sqrt@plt>
  jmp    L329
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D44
type_infered: byte[8]
name: extract_symbolic_data
arguments: data_tag: D15
type_infered: byte[8]
name: extract_symbolic_data
arguments: data_tag: D89
type_infered: byte[8]
name: extract_symbolic_data
arguments: data_tag: D62
type_infered: f32[2]

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

tool: {"D15": [0x8a,0x33,0xfa,0x10,0x00,0x00,0xf0,0x3f]}

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

tool: {"D62": [0.0,1.875]}

assistant: ```c
double modelhess2(double *A, int N, double *L) {
  double *U22;
  double sqrteps, maxdiag, mindiag, maxposdiag, u;
  double maxoffdiag, maxinp, maxadd;
  double maxev, minev, offrow, sdd;
  int step, i, j, k;
  sqrteps = sqrt((double)1e-15);
  U22 = (double *)malloc(sizeof(double) * N * N);
  for (i = 0; i < N; ++i) {
    U22[i] = A[i + i * N];
  }
  maxdiag = array_max(U22, N);
  mindiag = array_min(U22, N);
  maxposdiag = 0.0;
  if (maxdiag > maxposdiag) {
    maxposdiag = maxdiag;
  }
  for (i = 0; i < N; ++i) {
    U22[i] = 0.0;
  }
  u = 0.0;
  if (mindiag <= sqrteps * maxposdiag) {
    u = 2 * (maxposdiag - mindiag) * sqrteps - mindiag;
    maxdiag += u;
  }
  k = 0;
  for (i = 0; i < N; ++i) {
    for (j = 0; j < N; ++j) {
      if (j > i) {
        U22[k] = A[i * N + j];
        k++;
      }
    }
  }
  maxoffdiag = array_max_abs(U22, k);
  if (maxoffdiag * (1 + 2 * sqrteps) > maxdiag) {
    u += (maxoffdiag - maxdiag) + 2 * sqrteps * maxoffdiag;
    maxdiag = maxoffdiag * (1 + 2 * sqrteps);
  }
  if (maxdiag == 0) {
    u = 1;
    maxdiag = 1;
  }
  if (u > 0) {
    for (i = 0; i < N; ++i) {
      A[i * N + i] += u;
    }
  }
  if (maxdiag > maxoffdiag / N) {
    maxinp = sqrt(maxdiag);
  } else {
    maxinp = sqrt(maxoffdiag / N);
  }
  maxadd = cholmod(A, N, L, maxinp);
  if (maxadd > 0) {
    maxev = minev = A[0];
    for (i = 0; i < N; ++i) {
      offrow = 0.0;
      step = i * N;
      for (j = 0; j < i; ++j) {
        offrow += fabs(A[step + j]);
      }
      for (j = i + 1; j < N; ++j) {
        offrow += fabs(A[step + j]);
      }
      if (maxev < A[step + i] + offrow) {
        maxev = A[step + i] + offrow;
      }
      if (minev > A[step + i] - offrow) {
        minev = A[step + i] - offrow;
      }
    }
    sdd = (maxev - minev) * sqrteps - minev;
    if (sdd < 0) {
      sdd = 0;
    }
    if (maxadd > sdd) {
      u = sdd;
    } else {
      u = maxadd;
    }
    for (i = 0; i < N; ++i) {
      A[i * N + i] += u;
    }
  }
  maxadd = cholmod(A, N, L, 0.0);
  free(U22);
  return maxadd;
}
```