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

```asm
<evaluateGTRGAMMAINVAR_VECTOR>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,%r15
  mov    %rsi,0x10(%rsp)
  mov    %rdx,0x30(%rsp)
  mov    %rcx,0x18(%rsp)
  mov    %r8,%r14
  mov    %r9,%r13
  mov    0xb0(%rsp),%rax
  mov    %rax,0x20(%rsp)
  mov    0xb8(%rsp),%rax
  movapd %xmm0,%xmm2
  mov    0xc0(%rsp),%rsi
  mov    %rsi,0x38(%rsp)
  mov    %fs:0x28,%rdx
  mov    %rdx,0x68(%rsp)
  xor    %edx,%edx
  movsd  D58(%rip),%xmm0
  subsd  %xmm2,%xmm0
  mulsd  D19(%rip),%xmm0
  movsd  %xmm0,0x8(%rsp)
  movapd %xmm2,%xmm0
  mulsd  (%rax),%xmm0
  movsd  %xmm0,0x40(%rsp)
  movapd %xmm2,%xmm0
  mulsd  0x8(%rax),%xmm0
  movsd  %xmm0,0x48(%rsp)
  movapd %xmm2,%xmm0
  mulsd  0x10(%rax),%xmm0
  movsd  %xmm0,0x50(%rsp)
  mulsd  0x18(%rax),%xmm2
  movsd  %xmm2,0x58(%rsp)
  movsd  D29(%rip),%xmm0
  comisd %xmm1,%xmm0
  jbe    L11
  movapd %xmm0,%xmm1
L11:
  movapd %xmm1,%xmm0
  call   <log@plt>
  pxor   %xmm6,%xmm6
  cvtsi2sd %eax,%xmm6
  movsd  %xmm6,(%rsp)
  mov    $0x80,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  lea    0x80(%rax),%rbx
  mov    %rax,0x28(%rsp)
L16:
  mov    0x0(%r13),%rbp
  mov    D58(%rip),%rax
  mov    %rax,(%r12)
  movq   %rbp,%xmm0
  mulsd  (%r14),%xmm0
  mulsd  (%rsp),%xmm0
  call   <exp@plt>
  movsd  %xmm0,0x8(%r12)
  movq   %rbp,%xmm0
  mulsd  0x8(%r14),%xmm0
  mulsd  (%rsp),%xmm0
  call   <exp@plt>
  movsd  %xmm0,0x10(%r12)
  movq   %rbp,%xmm0
  mulsd  0x10(%r14),%xmm0
  mulsd  (%rsp),%xmm0
  call   <exp@plt>
  movsd  %xmm0,0x18(%r12)
  add    $0x8,%r13
  add    $0x20,%r12
  cmp    %rbx,%r12
  jne    L16
  mov    0x28(%rsp),%rbp
  mov    0xd0(%rsp),%eax
  cmp    %eax,0xc8(%rsp)
  jge    L77
  movslq 0xc8(%rsp),%r12
  mov    %r12,%rbx
  shl    $0x7,%rbx
  add    0x30(%rsp),%rbx
  sub    $0x1,%eax
  sub    0xc8(%rsp),%eax
  lea    0x1(%r12,%rax,1),%rax
  mov    %rax,(%rsp)
  mov    0x38(%rsp),%r14
  jmp    L65
L6:
  mulsd  0x8(%rsp),%xmm0
  call   <log@plt>
  mov    %eax,0x28(%rsp)
  mov    (%r15,%r12,4),%r13d
  movsd  D39(%rip),%xmm0
  call   <log@plt>
  imul   %eax,%r13d
  add    0x28(%rsp),%r13d
  pxor   %xmm0,%xmm0
  cvtsi2sd %r13d,%xmm0
L13:
  mov    0x18(%rsp),%rax
  movsd  %xmm0,(%rax,%r12,8)
  add    $0x1,%r12
  sub    $0xffffffffffffff80,%rbx
  cmp    (%rsp),%r12
  je     L77
L65:
  movsbl (%r14,%r12,1),%eax
  shl    $0x2,%eax
  cltq
  mov    0x20(%rsp),%rcx
  lea    (%rcx,%rax,8),%rax
  movsd  (%rax),%xmm3
  movapd %xmm3,%xmm1
  mulsd  (%rbx),%xmm1
  mulsd  0x0(%rbp),%xmm1
  movsd  0x8(%rax),%xmm2
  movapd %xmm2,%xmm0
  mulsd  0x8(%rbx),%xmm0
  mulsd  0x8(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  0x10(%rax),%xmm1
  movapd %xmm1,%xmm5
  mulsd  0x10(%rbx),%xmm5
  mulsd  0x10(%rbp),%xmm5
  addsd  %xmm0,%xmm5
  movsd  0x18(%rax),%xmm0
  movapd %xmm0,%xmm4
  mulsd  0x18(%rbx),%xmm4
  mulsd  0x18(%rbp),%xmm4
  addsd  %xmm5,%xmm4
  movapd %xmm3,%xmm5
  mulsd  0x20(%rbx),%xmm5
  mulsd  0x20(%rbp),%xmm5
  addsd  %xmm4,%xmm5
  movapd %xmm2,%xmm4
  mulsd  0x28(%rbx),%xmm4
  mulsd  0x28(%rbp),%xmm4
  addsd  %xmm5,%xmm4
  movapd %xmm1,%xmm5
  mulsd  0x30(%rbx),%xmm5
  mulsd  0x30(%rbp),%xmm5
  addsd  %xmm4,%xmm5
  movapd %xmm0,%xmm4
  mulsd  0x38(%rbx),%xmm4
  mulsd  0x38(%rbp),%xmm4
  addsd  %xmm5,%xmm4
  movapd %xmm3,%xmm5
  mulsd  0x40(%rbx),%xmm5
  mulsd  0x40(%rbp),%xmm5
  addsd  %xmm4,%xmm5
  movapd %xmm2,%xmm4
  mulsd  0x48(%rbx),%xmm4
  mulsd  0x48(%rbp),%xmm4
  addsd  %xmm5,%xmm4
  movapd %xmm1,%xmm5
  mulsd  0x50(%rbx),%xmm5
  mulsd  0x50(%rbp),%xmm5
  addsd  %xmm4,%xmm5
  movapd %xmm0,%xmm4
  mulsd  0x58(%rbx),%xmm4
  mulsd  0x58(%rbp),%xmm4
  addsd  %xmm5,%xmm4
  mulsd  0x60(%rbx),%xmm3
  mulsd  0x60(%rbp),%xmm3
  addsd  %xmm4,%xmm3
  mulsd  0x68(%rbx),%xmm2
  mulsd  0x68(%rbp),%xmm2
  addsd  %xmm3,%xmm2
  mulsd  0x70(%rbx),%xmm1
  mulsd  0x70(%rbp),%xmm1
  addsd  %xmm2,%xmm1
  mulsd  0x78(%rbx),%xmm0
  mulsd  0x78(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  mov    0x10(%rsp),%rax
  mov    (%rax,%r12,4),%eax
  cmp    $0x3,%eax
  jg     L6
  mulsd  0x8(%rsp),%xmm0
  cltq
  addsd  0x40(%rsp,%rax,8),%xmm0
  movsd  %xmm0,0x28(%rsp)
  mov    (%r15,%r12,4),%edi
  movsd  D39(%rip),%xmm0
  call   <pow@plt>
  mulsd  0x28(%rsp),%xmm0
  call   <log@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  jmp    L13
L77:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L52
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L52:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D58
type_guessed: f64
name: parse_data
arguments: data_label: D19
type_guessed: f64
name: parse_data
arguments: data_label: D29
type_guessed: byte[8]
name: parse_data
arguments: data_label: D39
type_guessed: byte[8]

tool: D58: 1

tool: D19: 0.25

tool: {"D29": [0x16,0x56,0xe7,0x9e,0xaf,0x03,0xd2,0x3c]}

tool: {"D39": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x2f]}

assistant: ```c
void evaluateGTRGAMMAINVAR_VECTOR(int *ex2, int *iptr, double *x2_start, double *v, double *EIGN, double *gammaRates, double *tipVector, double *tFreqs, double invariants, double pz, char *tipX1, int lower, int n) {
  double z, lz, term, ki;
  int i;
  double *diagptable;
  double freqs[4];
  double *x1, *x2;
  double scaler = 0.25 * (1.0 - invariants);
  freqs[0] = tFreqs[0] * invariants;
  freqs[1] = tFreqs[1] * invariants;
  freqs[2] = tFreqs[2] * invariants;
  freqs[3] = tFreqs[3] * invariants;
  z = pz;
  if (z < 1.0E-15)
    z = 1.0E-15;
  lz = log(z);
  diagptable = (double *)malloc(sizeof(double) * 16);
  for (i = 0; i < 4; i++) {
    ki = gammaRates[i];
    diagptable[i * 4] = 1.0;
    diagptable[i * 4 + 1] = exp(EIGN[0] * ki * lz);
    diagptable[i * 4 + 2] = exp(EIGN[1] * ki * lz);
    diagptable[i * 4 + 3] = exp(EIGN[2] * ki * lz);
  }
  for (i = lower; i < n; i++) {
    x1 = &(tipVector[4 * tipX1[i]]);
    x2 = &x2_start[16 * i];
    term = x1[0] * x2[0] * diagptable[0];
    term += x1[1] * x2[1] * diagptable[1];
    term += x1[2] * x2[2] * diagptable[2];
    term += x1[3] * x2[3] * diagptable[3];
    term += x1[0] * x2[4] * diagptable[4];
    term += x1[1] * x2[5] * diagptable[5];
    term += x1[2] * x2[6] * diagptable[6];
    term += x1[3] * x2[7] * diagptable[7];
    term += x1[0] * x2[8] * diagptable[8];
    term += x1[1] * x2[9] * diagptable[9];
    term += x1[2] * x2[10] * diagptable[10];
    term += x1[3] * x2[11] * diagptable[11];
    term += x1[0] * x2[12] * diagptable[12];
    term += x1[1] * x2[13] * diagptable[13];
    term += x1[2] * x2[14] * diagptable[14];
    term += x1[3] * x2[15] * diagptable[15];
    if (iptr[i] < 4)
      term = log((scaler * term + freqs[iptr[i]]) * pow((1.0 / 115792089237316195423570985008687907853269984665640564039457584007913129639936.0), ex2[i]));
    else
      term = log(scaler * term) + ex2[i] * log((1.0 / 115792089237316195423570985008687907853269984665640564039457584007913129639936.0));
    v[i] = term;
  }
  free(diagptable);
}
```