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

```asm
<coreGTRCATPROT>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x238,%rsp
  mov    %rdi,%rbp
  movsd  %xmm0,(%rsp)
  mov    %esi,%ebx
  mov    %rdx,0x8(%rsp)
  mov    %rcx,0x18(%rsp)
  mov    %r8d,0x10(%rsp)
  mov    %r9,0x30(%rsp)
  mov    0x270(%rsp),%rax
  mov    %rax,0x38(%rsp)
  mov    0x278(%rsp),%rax
  mov    %rax,0x20(%rsp)
  mov    0x280(%rsp),%rax
  mov    %rax,0x28(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x228(%rsp)
  xor    %eax,%eax
  lea    (%rsi,%rsi,4),%edi
  shl    $0x5,%edi
  call   <rax_malloc@plt>
  mov    %rax,%r15
  mov    $0x8,%eax
L74:
  movsd  -0x8(%rbp,%rax,1),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,0x40(%rsp,%rax,1)
  movsd  %xmm0,0xe0(%rsp,%rax,1)
  mulsd  (%rsp),%xmm0
  movsd  %xmm0,0x180(%rsp,%rax,1)
  add    $0x8,%rax
  cmp    $0xa0,%rax
  jne    L74
  test   %ebx,%ebx
  jle    L54
  mov    0x8(%rsp),%r12
  lea    0x180(%rsp),%r13
  mov    %r15,%rbp
  sub    %r13,%rbp
  lea    (%rbx,%rbx,4),%eax
  shl    $0x2,%eax
  mov    $0x0,%r14d
  lea    0x220(%rsp),%r13
  mov    %r15,(%rsp)
  mov    %eax,%r15d
L42:
  lea    0x188(%rsp),%rbx
L0:
  movsd  (%rbx),%xmm0
  mulsd  (%r12),%xmm0
  call   <exp@plt>
  movsd  %xmm0,(%rbx,%rbp,1)
  add    $0x8,%rbx
  cmp    %r13,%rbx
  jne    L0
  add    $0x8,%r12
  add    $0x14,%r14d
  add    $0xa0,%rbp
  cmp    %r15d,%r14d
  jne    L42
  mov    (%rsp),%r15
L54:
  mov    0x10(%rsp),%eax
  test   %eax,%eax
  jle    L16
  mov    0x18(%rsp),%rcx
  mov    %rcx,%rbx
  mov    0x28(%rsp),%rbp
  mov    0x20(%rsp),%r12
  lea    -0x1(%rax),%eax
  lea    0x4(%rcx,%rax,4),%r13
  mov    D20(%rip),%r14
  mov    %r14,0x10(%rsp)
  mov    %r14,0x18(%rsp)
  mov    0x8(%rsp),%r14
L72:
  mov    (%rbx),%eax
  movslq %eax,%rdx
  movsd  (%r14,%rdx,8),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl 0x0(%rbp),%xmm1
  movapd %xmm1,%xmm6
  mulsd  %xmm0,%xmm6
  movsd  %xmm6,0x20(%rsp)
  mulsd  %xmm0,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,0x28(%rsp)
  lea    (%rax,%rax,4),%edx
  shl    $0x2,%edx
  movslq %edx,%rdx
  movsd  (%r12),%xmm1
  lea    0x8(%r15,%rdx,8),%rax
  lea    0xa0(%r15,%rdx,8),%rdi
  neg    %rdx
  shl    $0x3,%rdx
  sub    %r15,%rdx
  lea    (%r12,%rdx,1),%rsi
  lea    0xe0(%rsp,%rdx,1),%rcx
  lea    0x40(%rsp,%rdx,1),%rdx
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x8(%rsp)
  movsd  %xmm7,(%rsp)
L49:
  movsd  (%rax),%xmm0
  mulsd  (%rsi,%rax,1),%xmm0
  addsd  %xmm0,%xmm1
  movapd %xmm0,%xmm2
  mulsd  (%rcx,%rax,1),%xmm2
  addsd  (%rsp),%xmm2
  movsd  %xmm2,(%rsp)
  mulsd  (%rdx,%rax,1),%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  add    $0x8,%rax
  cmp    %rdi,%rax
  jne    L49
  movapd %xmm1,%xmm0
  call   <FABS@plt>
  movsd  D9(%rip),%xmm1
  divsd  %xmm0,%xmm1
  movsd  (%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  0x20(%rsp),%xmm2
  mulsd  %xmm0,%xmm2
  addsd  0x10(%rsp),%xmm2
  movsd  %xmm2,0x10(%rsp)
  mulsd  0x8(%rsp),%xmm1
  mulsd  %xmm0,%xmm0
  subsd  %xmm0,%xmm1
  mulsd  0x28(%rsp),%xmm1
  addsd  0x18(%rsp),%xmm1
  movsd  %xmm1,0x18(%rsp)
  add    $0x4,%rbx
  add    $0x4,%rbp
  add    $0xa0,%r12
  cmp    %r13,%rbx
  jne    L72
  movq   %xmm1,%r14
L83:
  mov    0x30(%rsp),%rax
  movsd  0x10(%rsp),%xmm6
  movsd  %xmm6,(%rax)
  mov    0x38(%rsp),%rax
  mov    %r14,(%rax)
  mov    %r15,%rdi
  call   <rax_free@plt>
  mov    0x228(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L79
  add    $0x238,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L16:
  mov    D20(%rip),%r14
  mov    %r14,0x10(%rsp)
  jmp    L83
L79:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D20
data_type: f64
name: unpack_data
arguments: tag: D9
data_type: f64

tool: D20: 0

tool: D9: 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);
}
```