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

```asm
<coreGTRCAT>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    %edi,%r14d
  mov    %esi,%r15d
  mov    %rdx,0x20(%rsp)
  mov    %rcx,0x70(%rsp)
  mov    %r8,0x78(%rsp)
  mov    %r9,%r13
  mov    0xc0(%rsp),%rax
  movsd  %xmm0,0x8(%rsp)
  movsd  (%rax),%xmm7
  movsd  %xmm7,0x40(%rsp)
  mulsd  %xmm7,%xmm7
  movsd  %xmm7,0x58(%rsp)
  movsd  0x8(%rax),%xmm4
  movsd  %xmm4,0x48(%rsp)
  mulsd  %xmm4,%xmm4
  movsd  %xmm4,0x60(%rsp)
  movsd  0x10(%rax),%xmm5
  movsd  %xmm5,0x50(%rsp)
  mulsd  %xmm5,%xmm5
  movsd  %xmm5,0x68(%rsp)
  mov    %esi,%edi
  shl    $0x5,%edi
  call   <rax_malloc@plt>
  mov    %rax,%r12
  movsd  0x40(%rsp),%xmm7
  movsd  0x8(%rsp),%xmm6
  mulsd  %xmm6,%xmm7
  movsd  %xmm7,0x8(%rsp)
  movsd  0x48(%rsp),%xmm4
  mulsd  %xmm6,%xmm4
  movsd  %xmm4,0x10(%rsp)
  mulsd  0x50(%rsp),%xmm6
  movsd  %xmm6,0x18(%rsp)
  test   %r15d,%r15d
  jle    L11
  mov    %r13,%rbp
  mov    %rax,%rbx
  mov    %r15d,%r15d
  shl    $0x5,%r15
  add    %rax,%r15
L25:
  movsd  0x8(%rsp),%xmm0
  mulsd  0x0(%rbp),%xmm0
  call   <exp@plt>
  movsd  %xmm0,(%rbx)
  movsd  0x10(%rsp),%xmm0
  mulsd  0x0(%rbp),%xmm0
  call   <exp@plt>
  movsd  %xmm0,0x8(%rbx)
  movsd  0x18(%rsp),%xmm0
  mulsd  0x0(%rbp),%xmm0
  call   <exp@plt>
  movsd  %xmm0,0x10(%rbx)
  add    $0x8,%rbp
  add    $0x20,%rbx
  cmp    %r15,%rbx
  jne    L25
L11:
  test   %r14d,%r14d
  jle    L41
  mov    0xc8(%rsp),%rbp
  mov    0xd0(%rsp),%r15
  mov    0x20(%rsp),%rbx
  lea    -0x1(%r14),%eax
  lea    0x4(%rbp,%rax,4),%r14
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x10(%rsp)
  movsd  %xmm7,0x8(%rsp)
L3:
  mov    0x0(%rbp),%eax
  movslq %eax,%rdx
  movsd  0x0(%r13,%rdx,8),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl (%r15),%xmm1
  movapd %xmm1,%xmm7
  mulsd  %xmm0,%xmm7
  movsd  %xmm7,0x18(%rsp)
  mulsd  %xmm0,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,0x20(%rsp)
  shl    $0x2,%eax
  cltq
  lea    (%r12,%rax,8),%rax
  movsd  (%rax),%xmm0
  mulsd  0x8(%rbx),%xmm0
  movsd  %xmm0,0x28(%rsp)
  addsd  (%rbx),%xmm0
  movsd  0x8(%rax),%xmm1
  mulsd  0x10(%rbx),%xmm1
  movsd  %xmm1,0x30(%rsp)
  addsd  %xmm1,%xmm0
  movsd  0x10(%rax),%xmm1
  mulsd  0x18(%rbx),%xmm1
  movsd  %xmm1,0x38(%rsp)
  addsd  %xmm1,%xmm0
  call   <FABS@plt>
  movsd  D2(%rip),%xmm2
  divsd  %xmm0,%xmm2
  movapd %xmm2,%xmm1
  movsd  0x40(%rsp),%xmm2
  movsd  0x28(%rsp),%xmm4
  mulsd  %xmm4,%xmm2
  movapd %xmm2,%xmm3
  mulsd  0x58(%rsp),%xmm4
  movsd  0x48(%rsp),%xmm2
  movsd  0x30(%rsp),%xmm5
  mulsd  %xmm5,%xmm2
  addsd  %xmm3,%xmm2
  mulsd  0x60(%rsp),%xmm5
  movapd %xmm5,%xmm3
  addsd  %xmm4,%xmm3
  movsd  0x50(%rsp),%xmm4
  movsd  0x38(%rsp),%xmm6
  mulsd  %xmm6,%xmm4
  movapd %xmm4,%xmm0
  addsd  %xmm2,%xmm0
  mulsd  0x68(%rsp),%xmm6
  movapd %xmm6,%xmm2
  addsd  %xmm3,%xmm2
  mulsd  %xmm1,%xmm0
  movsd  0x18(%rsp),%xmm3
  mulsd  %xmm0,%xmm3
  addsd  0x8(%rsp),%xmm3
  movsd  %xmm3,0x8(%rsp)
  mulsd  %xmm2,%xmm1
  mulsd  %xmm0,%xmm0
  subsd  %xmm0,%xmm1
  mulsd  0x20(%rsp),%xmm1
  addsd  0x10(%rsp),%xmm1
  movsd  %xmm1,0x10(%rsp)
  add    $0x4,%rbp
  add    $0x4,%r15
  add    $0x20,%rbx
  cmp    %r14,%rbp
  jne    L3
L21:
  mov    0x70(%rsp),%rax
  movsd  0x8(%rsp),%xmm7
  movsd  %xmm7,(%rax)
  mov    0x78(%rsp),%rax
  movsd  0x10(%rsp),%xmm7
  movsd  %xmm7,(%rax)
  mov    %r12,%rdi
  call   <rax_free@plt>
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L41:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x10(%rsp)
  movsd  %xmm7,0x8(%rsp)
  jmp    L21
```

tool_calls: name: unpack_data
arguments: data_tag: D2
data_type: f64

tool: D2: 1

assistant: ```c
void coreGTRCAT(int upper, int numberOfCategories, double *sum, volatile double *d1, volatile double *d2, double *rptr, double *EIGN, int *cptr, double lz, int *wgt) {
  int i;
  double *d, *d_start, tmp_0, tmp_1, tmp_2, inv_Li, dlnLidlz, d2lnLidlz2, dlnLdlz = 0.0, d2lnLdlz2 = 0.0;
  double e[6];
  double dd1, dd2, dd3;
  e[0] = EIGN[0];
  e[1] = EIGN[0] * EIGN[0];
  e[2] = EIGN[1];
  e[3] = EIGN[1] * EIGN[1];
  e[4] = EIGN[2];
  e[5] = EIGN[2] * EIGN[2];
  d = d_start = (double *)rax_malloc(numberOfCategories * 4 * sizeof(double));
  dd1 = e[0] * lz;
  dd2 = e[2] * lz;
  dd3 = e[4] * lz;
  for (i = 0; i < numberOfCategories; i++) {
    d[i * 4] = exp(dd1 * rptr[i]);
    d[i * 4 + 1] = exp(dd2 * rptr[i]);
    d[i * 4 + 2] = exp(dd3 * rptr[i]);
  }
  for (i = 0; i < upper; i++) {
    double r = rptr[cptr[i]], wr1 = r * wgt[i], wr2 = r * r * wgt[i];
    d = &d_start[4 * cptr[i]];
    inv_Li = sum[4 * i];
    inv_Li += (tmp_0 = d[0] * sum[4 * i + 1]);
    inv_Li += (tmp_1 = d[1] * sum[4 * i + 2]);
    inv_Li += (tmp_2 = d[2] * sum[4 * i + 3]);
    inv_Li = 1.0 / FABS(inv_Li);
    dlnLidlz = tmp_0 * e[0];
    d2lnLidlz2 = tmp_0 * e[1];
    dlnLidlz += tmp_1 * e[2];
    d2lnLidlz2 += tmp_1 * e[3];
    dlnLidlz += tmp_2 * e[4];
    d2lnLidlz2 += tmp_2 * e[5];
    dlnLidlz *= inv_Li;
    d2lnLidlz2 *= inv_Li;
    dlnLdlz += wr1 * dlnLidlz;
    d2lnLdlz2 += wr2 * (d2lnLidlz2 - dlnLidlz * dlnLidlz);
  }
  *d1 = dlnLdlz;
  *d2 = d2lnLdlz2;
  rax_free(d_start);
}
```