user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<categorizeGTRGAMMAPROTINVAR>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x138,%rsp
  mov    %rdi,0x38(%rsp)
  mov    %rsi,0x40(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %r8,%r14
  mov    %r9,%r13
  mov    0x170(%rsp),%rax
  mov    %rax,0x48(%rsp)
  mov    0x178(%rsp),%rax
  mov    %rax,0x50(%rsp)
  mov    0x190(%rsp),%rax
  mov    %rax,0x18(%rsp)
  mov    0x1a0(%rsp),%rdx
  mov    %fs:0x28,%rax
  mov    %rax,0x128(%rsp)
  xor    %eax,%eax
  mov    0x198(%rsp),%rax
  movsd  (%rax),%xmm1
  movsd  D67(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%rsp)
  mov    $0x0,%eax
L105:
  movapd %xmm1,%xmm0
  mulsd  (%rdx,%rax,1),%xmm0
  movsd  %xmm0,0x80(%rsp,%rax,1)
  add    $0x8,%rax
  cmp    $0xa0,%rax
  jne    L105
  movsd  (%rcx),%xmm0
  movsd  D14(%rip),%xmm1
  comisd %xmm0,%xmm1
  jbe    L85
  movapd %xmm1,%xmm0
L85:
  call   <log@plt>
  movsd  %xmm0,(%rsp)
  mov    $0x260,%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    %rax,0x30(%rsp)
  lea    0x260(%rax),%r15
L27:
  mov    (%r14),%r12
  mov    $0x0,%ebx
L81:
  movq   %r12,%xmm0
  mulsd  0x0(%r13,%rbx,1),%xmm0
  mulsd  (%rsp),%xmm0
  call   <exp@plt>
  movsd  %xmm0,0x0(%rbp,%rbx,1)
  add    $0x8,%rbx
  cmp    $0x98,%rbx
  jne    L81
  add    $0x98,%rbp
  add    $0x8,%r14
  cmp    %r15,%rbp
  jne    L27
  mov    0x188(%rsp),%eax
  cmp    %eax,0x180(%rsp)
  jge    L63
  movslq 0x180(%rsp),%r15
  sub    $0x1,%eax
  sub    0x180(%rsp),%eax
  lea    0x1(%r15,%rax,1),%rax
  mov    %rax,0x58(%rsp)
  movl   $0x0,0x2c(%rsp)
  jmp    L140
L64:
  mulsd  0x8(%rsp),%xmm0
  call   <log@plt>
  movapd %xmm0,%xmm1
  mov    0x10(%rsp),%rax
  pxor   %xmm0,%xmm0
  cvtsi2sdl (%rax,%r15,4),%xmm0
  mulsd  D76(%rip),%xmm0
  addsd  %xmm1,%xmm0
L52:
  movsd  %xmm0,(%r14)
  add    $0xa0,%rbx
  add    $0x8,%r13
  cmp    (%rsp),%r13
  je     L11
L50:
  movsd  0x8(%r12),%xmm0
  mulsd  0x8(%rbx),%xmm0
  mulsd  0x0(%rbp),%xmm0
  movsd  (%r12),%xmm1
  mulsd  (%rbx),%xmm1
  pxor   %xmm6,%xmm6
  addsd  %xmm6,%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x10(%r12),%xmm1
  mulsd  0x10(%rbx),%xmm1
  mulsd  0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x18(%r12),%xmm1
  mulsd  0x18(%rbx),%xmm1
  mulsd  0x10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x20(%r12),%xmm1
  mulsd  0x20(%rbx),%xmm1
  mulsd  0x18(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x28(%r12),%xmm1
  mulsd  0x28(%rbx),%xmm1
  mulsd  0x20(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x30(%r12),%xmm1
  mulsd  0x30(%rbx),%xmm1
  mulsd  0x28(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x38(%r12),%xmm1
  mulsd  0x38(%rbx),%xmm1
  mulsd  0x30(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x40(%r12),%xmm1
  mulsd  0x40(%rbx),%xmm1
  mulsd  0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x48(%r12),%xmm1
  mulsd  0x48(%rbx),%xmm1
  mulsd  0x40(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x50(%r12),%xmm1
  mulsd  0x50(%rbx),%xmm1
  mulsd  0x48(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x58(%r12),%xmm1
  mulsd  0x58(%rbx),%xmm1
  mulsd  0x50(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x60(%r12),%xmm1
  mulsd  0x60(%rbx),%xmm1
  mulsd  0x58(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x68(%r12),%xmm1
  mulsd  0x68(%rbx),%xmm1
  mulsd  0x60(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x70(%r12),%xmm1
  mulsd  0x70(%rbx),%xmm1
  mulsd  0x68(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x78(%r12),%xmm1
  mulsd  0x78(%rbx),%xmm1
  mulsd  0x70(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x80(%r12),%xmm1
  mulsd  0x80(%rbx),%xmm1
  mulsd  0x78(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x88(%r12),%xmm1
  mulsd  0x88(%rbx),%xmm1
  mulsd  0x80(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x90(%r12),%xmm1
  mulsd  0x90(%rbx),%xmm1
  mulsd  0x88(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  add    $0x98,%rbp
  movsd  0x98(%r12),%xmm1
  mulsd  0x98(%rbx),%xmm1
  mulsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  mov    %r13,%r14
  movsd  %xmm0,0x0(%r13)
  mov    0x18(%rsp),%rax
  mov    (%rax,%r15,4),%eax
  cmp    $0x13,%eax
  jg     L64
  mulsd  0x8(%rsp),%xmm0
  cltq
  addsd  0x80(%rsp,%rax,8),%xmm0
  movsd  %xmm0,0x20(%rsp)
  mov    0x10(%rsp),%rax
  pxor   %xmm1,%xmm1
  cvtsi2sdl (%rax,%r15,4),%xmm1
  movsd  D69(%rip),%xmm0
  call   <pow@plt>
  mulsd  0x20(%rsp),%xmm0
  call   <log@plt>
  jmp    L52
L11:
  movsd  0x60(%rsp),%xmm0
  movsd  0x68(%rsp),%xmm2
  movsd  0x70(%rsp),%xmm1
  movsd  0x78(%rsp),%xmm3
  movapd %xmm0,%xmm4
  addsd  %xmm2,%xmm4
  addsd  %xmm1,%xmm4
  addsd  %xmm3,%xmm4
  movsd  D75(%rip),%xmm6
  mulsd  %xmm6,%xmm4
  movsd  D67(%rip),%xmm5
  divsd  %xmm4,%xmm5
  mulsd  %xmm6,%xmm0
  mulsd  %xmm5,%xmm0
  movsd  %xmm0,0x60(%rsp)
  mulsd  %xmm6,%xmm2
  mulsd  %xmm5,%xmm2
  movsd  %xmm2,0x68(%rsp)
  mulsd  %xmm6,%xmm1
  mulsd  %xmm5,%xmm1
  movsd  %xmm1,0x70(%rsp)
  mulsd  %xmm6,%xmm3
  mulsd  %xmm5,%xmm3
  movsd  %xmm3,0x78(%rsp)
  movsd  D41(%rip),%xmm4
  comisd %xmm0,%xmm4
  jbe    L94
  movl   $0x0,0x2c(%rsp)
L137:
  comisd %xmm2,%xmm0
  jbe    L4
  movapd %xmm2,%xmm0
  movl   $0x1,0x2c(%rsp)
L4:
  comisd %xmm1,%xmm0
  jbe    L93
  movapd %xmm1,%xmm0
  movl   $0x2,0x2c(%rsp)
L93:
  ucomisd %xmm3,%xmm0
  mov    $0x3,%eax
  cmovbe 0x2c(%rsp),%eax
  mov    %eax,0x2c(%rsp)
  mov    0x50(%rsp),%rcx
  mov    %eax,(%rcx,%r15,4)
  add    $0x1,%r15
  cmp    0x58(%rsp),%r15
  je     L63
L140:
  mov    0x38(%rsp),%rax
  movsbl (%rax,%r15,1),%eax
  lea    (%rax,%rax,4),%eax
  shl    $0x2,%eax
  cltq
  mov    0x48(%rsp),%rsi
  lea    (%rsi,%rax,8),%r12
  lea    (%r15,%r15,4),%rbx
  shl    $0x7,%rbx
  add    0x40(%rsp),%rbx
  lea    0x60(%rsp),%r13
  lea    0x80(%rsp),%rax
  mov    %rax,(%rsp)
  mov    0x30(%rsp),%rbp
  jmp    L50
L94:
  movsd  D41(%rip),%xmm0
  jmp    L137
L63:
  mov    0x30(%rsp),%rdi
  call   <free@plt>
  mov    0x128(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L131
  add    $0x138,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L131:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D67
datatype: f64
name: read_data
arguments: data_label: D14
datatype: byte[8]
name: read_data
arguments: data_label: D76
datatype: byte[8]
name: read_data
arguments: data_label: D69
datatype: f32[2]
name: read_data
arguments: data_label: D75
datatype: f64
name: read_data
arguments: data_label: D41
datatype: f64

tool: D67: 1

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

tool: {"D76": [0xef,0x39,0xfa,0xfe,0x42,0x2e,0x66,0xc0]}

tool: {"D69": [0.0,4.3655745685100555e-10]}

tool: D75: 0.25

tool: D41: 1e+300

assistant: ```c
void categorizeGTRGAMMAPROTINVAR(char *tipX1, double *x2, int *ex2, double *pz, double *gammaRates, double *EIGN, double *tipVector, int *rateCategory, int lower, int upper, int *iptr, double *invariants, double *frequencies) {
  double z, lz, term[4], ki, min, allSum;
  int i, j, index = 0;
  double *diagptable, *diagptable_start;
  double *left, *right;
  double scaler = (1.0 - invariants[0]);
  double freqs[20];
  for (i = 0; i < 20; i++)
    freqs[i] = frequencies[i] * invariants[0];
  z = pz[0];
  if (z < 1.0E-15)
    z = 1.0E-15;
  lz = log(z);
  diagptable = diagptable_start = (double *)malloc(sizeof(double) * 4 * 19);
  for (i = 0; i < 4; i++) {
    ki = gammaRates[i];
    for (j = 0; j < 19; j++)
      *diagptable++ = exp(EIGN[j] * ki * lz);
  }
  for (i = lower; i < upper; i++) {
    left = &(tipVector[20 * tipX1[i]]);
    diagptable = diagptable_start;
    for (j = 0; j < 4; j++) {
      right = &(x2[80 * i + 20 * j]);
      term[j] = 0;
      term[j] += left[0] * right[0];
      term[j] += left[1] * right[1] * *diagptable++;
      term[j] += left[2] * right[2] * *diagptable++;
      term[j] += left[3] * right[3] * *diagptable++;
      term[j] += left[4] * right[4] * *diagptable++;
      term[j] += left[5] * right[5] * *diagptable++;
      term[j] += left[6] * right[6] * *diagptable++;
      term[j] += left[7] * right[7] * *diagptable++;
      term[j] += left[8] * right[8] * *diagptable++;
      term[j] += left[9] * right[9] * *diagptable++;
      term[j] += left[10] * right[10] * *diagptable++;
      term[j] += left[11] * right[11] * *diagptable++;
      term[j] += left[12] * right[12] * *diagptable++;
      term[j] += left[13] * right[13] * *diagptable++;
      term[j] += left[14] * right[14] * *diagptable++;
      term[j] += left[15] * right[15] * *diagptable++;
      term[j] += left[16] * right[16] * *diagptable++;
      term[j] += left[17] * right[17] * *diagptable++;
      term[j] += left[18] * right[18] * *diagptable++;
      term[j] += left[19] * right[19] * *diagptable++;
      if (iptr[i] < 20)
        term[j] = log((scaler * term[j] + freqs[iptr[i]]) * pow((1.0 / 115792089237316195423570985008687907853269984665640564039457584007913129639936.0), ex2[i]));
      else
        term[j] = log(scaler * term[j]) + ex2[i] * log((1.0 / 115792089237316195423570985008687907853269984665640564039457584007913129639936.0));
    }
    allSum = 0.25 * (term[0] + term[1] + term[2] + term[3]);
    allSum = 1.0 / allSum;
    term[0] = 0.25 * term[0] * allSum;
    term[1] = 0.25 * term[1] * allSum;
    term[2] = 0.25 * term[2] * allSum;
    term[3] = 0.25 * term[3] * allSum;
    min = 1.0E300;
    if (term[0] < min) {
      min = term[0];
      index = 0;
    }
    if (term[1] < min) {
      min = term[1];
      index = 1;
    }
    if (term[2] < min) {
      min = term[2];
      index = 2;
    }
    if (term[3] < min) {
      min = term[3];
      index = 3;
    }
    rateCategory[i] = index;
  }
  free(diagptable_start);
  return;
}
```