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

```asm
<coreGTRCATPROT>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  lea    (%rsi,%rsi,4),%edi
  shl    $0x5,%edi
  sub    $0x258,%rsp
  mov    0x290(%rsp),%rax
  mov    %rdx,0x30(%rsp)
  lea    0x60(%rsp),%r13
  lea    0x100(%rsp),%r14
  mov    %rcx,0x10(%rsp)
  mov    %rax,0x58(%rsp)
  mov    0x298(%rsp),%rax
  mov    %r8d,0x8(%rsp)
  mov    %rax,0x18(%rsp)
  mov    0x2a0(%rsp),%rax
  mov    %r9,0x50(%rsp)
  mov    %rax,0x20(%rsp)
  movsd  %xmm0,(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x248(%rsp)
  xor    %eax,%eax
  call   <rax_malloc@plt>
  movsd  (%rsp),%xmm0
  lea    0x1a0(%rsp),%rdx
  mov    %rax,0x48(%rsp)
  mov    $0x8,%eax
  nopl   (%rax)
L13:
  movsd  -0x8(%rbx,%rax,1),%xmm1
  movapd %xmm1,%xmm2
  movsd  %xmm1,(%r14,%rax,1)
  mulsd  %xmm1,%xmm2
  mulsd  %xmm0,%xmm1
  movsd  %xmm2,0x0(%r13,%rax,1)
  movsd  %xmm1,(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    $0xa0,%rax
  jne    L13
  test   %r12d,%r12d
  jle    L16
  lea    (%r12,%r12,4),%eax
  mov    0x48(%rsp),%rbx
  mov    %r14,0x38(%rsp)
  lea    0x1a8(%rsp),%r15
  shl    $0x2,%eax
  mov    0x30(%rsp),%rbp
  mov    %r13,0x28(%rsp)
  lea    0xa0(%rdx),%r12
  mov    %eax,(%rsp)
  xor    %eax,%eax
  sub    %rdx,%rbx
  mov    %eax,%r13d
  xchg   %ax,%ax
L42:
  mov    %r15,%r14
  nopl   0x0(%rax,%rax,1)
L60:
  movsd  (%r14),%xmm0
  mulsd  0x0(%rbp),%xmm0
  call   <exp@plt>
  movsd  %xmm0,(%rbx,%r14,1)
  add    $0x8,%r14
  cmp    %r14,%r12
  jne    L60
  add    $0x8,%rbp
  add    $0x14,%r13d
  add    $0xa0,%rbx
  cmp    %r13d,(%rsp)
  jne    L42
  mov    0x28(%rsp),%r13
  mov    0x38(%rsp),%r14
L16:
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jle    L73
  mov    0x10(%rsp),%r12
  sub    $0x1,%eax
  mov    0x20(%rsp),%rbp
  pxor   %xmm5,%xmm5
  mov    0x18(%rsp),%r15
  movapd %xmm5,%xmm6
  movapd %xmm5,%xmm7
  lea    0x4(%r12,%rax,4),%rax
  mov    %rax,0x38(%rsp)
  mov    0x48(%rsp),%rax
  lea    0xa0(%rax),%rbx
  mov    %rbx,0x40(%rsp)
  mov    %rax,%rbx
  mov    %r14,%rax
  mov    %r13,%r14
  mov    %r12,%r13
  mov    %rbp,%r12
  mov    %r15,%rbp
  mov    %rax,%r15
  nop
L63:
  pxor   %xmm1,%xmm1
  movslq 0x0(%r13),%rdx
  mov    0x30(%rsp),%rcx
  movapd %xmm5,%xmm2
  cvtsi2sdl (%r12),%xmm1
  mov    0x40(%rsp),%rsi
  movsd  0x0(%rbp),%xmm3
  movsd  (%rcx,%rdx,8),%xmm0
  lea    (%rdx,%rdx,4),%edx
  shl    $0x2,%edx
  movslq %edx,%rdx
  movapd %xmm1,%xmm8
  lea    0x8(%rbx,%rdx,8),%rax
  shl    $0x3,%rdx
  mulsd  %xmm0,%xmm8
  lea    (%rsi,%rdx,1),%rdi
  neg    %rdx
  mulsd  %xmm0,%xmm0
  sub    %rbx,%rdx
  lea    0x0(%rbp,%rdx,1),%rsi
  lea    (%r15,%rdx,1),%rcx
  add    %r14,%rdx
  mulsd  %xmm1,%xmm0
  movapd %xmm5,%xmm1
  movsd  %xmm0,(%rsp)
  nopl   0x0(%rax)
L11:
  movsd  (%rax),%xmm0
  mulsd  (%rsi,%rax,1),%xmm0
  movsd  (%rcx,%rax,1),%xmm4
  addsd  %xmm0,%xmm3
  mulsd  %xmm0,%xmm4
  mulsd  (%rdx,%rax,1),%xmm0
  add    $0x8,%rax
  addsd  %xmm4,%xmm1
  addsd  %xmm0,%xmm2
  cmp    %rax,%rdi
  jne    L11
  movapd %xmm3,%xmm0
  movsd  %xmm2,0x28(%rsp)
  add    $0x4,%r13
  add    $0x4,%r12
  movsd  %xmm1,0x20(%rsp)
  add    $0xa0,%rbp
  movsd  %xmm6,0x18(%rsp)
  movsd  %xmm7,0x10(%rsp)
  movsd  %xmm8,0x8(%rsp)
  call   <FABS@plt>
  movsd  0x20(%rsp),%xmm1
  cmp    %r13,0x38(%rsp)
  pxor   %xmm5,%xmm5
  movapd %xmm0,%xmm3
  movsd  D6(%rip),%xmm0
  movsd  0x8(%rsp),%xmm8
  movsd  0x28(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm7
  divsd  %xmm3,%xmm0
  movapd %xmm8,%xmm3
  movsd  0x18(%rsp),%xmm6
  mulsd  %xmm0,%xmm1
  mulsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm3
  mulsd  %xmm1,%xmm1
  addsd  %xmm3,%xmm7
  subsd  %xmm1,%xmm0
  mulsd  (%rsp),%xmm0
  addsd  %xmm0,%xmm6
  jne    L63
L31:
  mov    0x50(%rsp),%rax
  movsd  %xmm7,(%rax)
  mov    0x58(%rsp),%rax
  movsd  %xmm6,(%rax)
  mov    0x248(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L85
  mov    0x48(%rsp),%rdi
  add    $0x258,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10b0 <rax_free@plt>
L73:
  pxor   %xmm6,%xmm6
  movapd %xmm6,%xmm7
  jmp    L31
L85:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D6
data_type: f64

tool: D6: 1

assistant: ```c
void coreGTRCATPROT(double *EIGN, double lz, int numberOfCategories, double *rptr, int *cptr, int upper, volatile double *ext_dlnLdlz, volatile double *ext_d2lnLdlz2, double *sumtable, int *wgt) {
  int i, l;
  double *d1, *d_start, *sum;
  double e[20], s[20], dd[20];
  double tmp;
  double inv_Li, dlnLidlz, d2lnLidlz2;
  double dlnLdlz = 0.0;
  double d2lnLdlz2 = 0.0;
  d1 = d_start = (double *)rax_malloc(numberOfCategories * 20 * sizeof(double));
  for (l = 1; l < 20; l++) {
    e[l] = EIGN[l - 1] * EIGN[l - 1];
    s[l] = EIGN[l - 1];
    dd[l] = s[l] * lz;
  }
  for (i = 0; i < numberOfCategories; i++) {
    for (l = 1; l < 20; l++)
      d1[20 * i + l] = exp(dd[l] * rptr[i]);
  }
  for (i = 0; i < upper; i++) {
    double r = rptr[cptr[i]], wr1 = r * wgt[i], wr2 = r * r * wgt[i];
    d1 = &d_start[20 * cptr[i]];
    sum = &sumtable[20 * i];
    inv_Li = sum[0];
    dlnLidlz = 0.0;
    d2lnLidlz2 = 0.0;
    for (l = 1; l < 20; l++) {
      inv_Li += (tmp = d1[l] * sum[l]);
      dlnLidlz += tmp * s[l];
      d2lnLidlz2 += tmp * e[l];
    }
    inv_Li = 1.0 / FABS(inv_Li);
    dlnLidlz *= inv_Li;
    d2lnLidlz2 *= inv_Li;
    dlnLdlz += wr1 * dlnLidlz;
    d2lnLdlz2 += wr2 * (d2lnLidlz2 - dlnLidlz * dlnLidlz);
  }
  *ext_dlnLdlz = dlnLdlz;
  *ext_d2lnLdlz2 = d2lnLdlz2;
  rax_free(d_start);
}
```