user: 请将以下的汇编代码转换成C语言代码：

```asm
<categorizeGTRGAMMAPROT>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  push   %r12
  mov    %r8,%r12
  push   %rbp
  mov    %r9,%rbp
  push   %rbx
  sub    $0x128,%rsp
  movsd  D29(%rip),%xmm0
  maxsd  (%rcx),%xmm0
  mov    0x160(%rsp),%rax
  mov    %rdi,0xc0(%rsp)
  mov    %rsi,0xc8(%rsp)
  mov    %rax,0xd0(%rsp)
  mov    0x168(%rsp),%rax
  mov    %rax,0xd8(%rsp)
  mov    0x170(%rsp),%eax
  mov    %eax,0x18(%rsp)
  mov    0x178(%rsp),%eax
  mov    %eax,0x20(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x118(%rsp)
  xor    %eax,%eax
  call   <log@plt>
  mov    $0x260,%edi
  movsd  %xmm0,0x10(%rsp)
  call   <malloc@plt>
  mov    %rax,0xb8(%rsp)
  mov    %rax,%rbx
  lea    0x260(%rax),%r15
L53:
  movsd  (%r12),%xmm7
  xor    %r13d,%r13d
  movsd  %xmm7,0x8(%rsp)
  nopl   0x0(%rax)
L3:
  movsd  0x8(%rsp),%xmm0
  mulsd  0x0(%rbp,%r13,1),%xmm0
  mulsd  0x10(%rsp),%xmm0
  call   <exp@plt>
  movsd  %xmm0,(%rbx,%r13,1)
  add    $0x8,%r13
  cmp    $0x98,%r13
  jne    L3
  add    $0x98,%rbx
  add    $0x8,%r12
  cmp    %r15,%rbx
  jne    L53
  mov    0x20(%rsp),%edi
  cmp    %edi,0x18(%rsp)
  jge    L91
  mov    0x20(%rsp),%r13d
  movslq 0x18(%rsp),%r15
  xor    %ebx,%ebx
  sub    $0x1,%r13d
  lea    0x1(%r15),%rax
  sub    %r15d,%r13d
  mov    %rax,0xb0(%rsp)
  add    %rax,%r13
  lea    0xf0(%rsp),%rax
  mov    %rax,0xe8(%rsp)
  lea    0x110(%rsp),%rax
  mov    %rax,0xa8(%rsp)
  mov    %r13,0xe0(%rsp)
  mov    %r15,%r13
  cs nopw 0x0(%rax,%rax,1)
L26:
  mov    0xc0(%rsp),%rax
  mov    0xd0(%rsp),%rdx
  movsbl (%rax,%r13,1),%eax
  lea    (%rax,%rax,4),%eax
  shl    $0x2,%eax
  cltq
  lea    (%rdx,%rax,8),%rax
  movsd  (%rax),%xmm3
  movsd  0x8(%rax),%xmm5
  movsd  0x10(%rax),%xmm7
  movsd  0x18(%rax),%xmm2
  movsd  %xmm3,0x8(%rsp)
  movsd  0x20(%rax),%xmm3
  movsd  0x40(%rax),%xmm4
  movsd  %xmm5,0x10(%rsp)
  movsd  0x28(%rax),%xmm5
  movsd  %xmm7,0x18(%rsp)
  movsd  0x30(%rax),%xmm7
  movsd  %xmm2,0x20(%rsp)
  movsd  0x38(%rax),%xmm2
  movsd  %xmm3,0x28(%rsp)
  movsd  0x48(%rax),%xmm3
  movsd  %xmm5,0x30(%rsp)
  movsd  0x50(%rax),%xmm5
  movsd  %xmm7,0x38(%rsp)
  movsd  0x58(%rax),%xmm7
  movsd  %xmm2,0x40(%rsp)
  movsd  0x60(%rax),%xmm2
  movsd  %xmm4,0x48(%rsp)
  movsd  0x68(%rax),%xmm4
  movsd  %xmm3,0x50(%rsp)
  movsd  0x70(%rax),%xmm3
  movsd  %xmm5,0x58(%rsp)
  movsd  %xmm7,0x60(%rsp)
  movsd  %xmm2,0x68(%rsp)
  movsd  %xmm4,0x70(%rsp)
  movsd  %xmm3,0x78(%rsp)
  movsd  0x78(%rax),%xmm5
  movsd  0x80(%rax),%xmm7
  movsd  0x88(%rax),%xmm2
  movsd  0x90(%rax),%xmm4
  movsd  0x98(%rax),%xmm3
  mov    0xc8(%rsp),%rcx
  lea    0x0(%r13,%r13,4),%rax
  movsd  %xmm5,0x80(%rsp)
  shl    $0x7,%rax
  mov    0xe8(%rsp),%rbp
  mov    0xb8(%rsp),%r15
  movsd  %xmm7,0x88(%rsp)
  movsd  %xmm2,0x90(%rsp)
  lea    (%rcx,%rax,1),%r12
  movsd  %xmm4,0x98(%rsp)
  movsd  %xmm3,0xa0(%rsp)
L52:
  movsd  0x8(%rsp),%xmm1
  pxor   %xmm7,%xmm7
  movsd  0x10(%rsp),%xmm0
  add    $0x98,%r15
  mulsd  (%r12),%xmm1
  add    $0x8,%rbp
  add    $0xa0,%r12
  mulsd  -0x98(%r12),%xmm0
  mulsd  -0x98(%r15),%xmm0
  addsd  %xmm7,%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x18(%rsp),%xmm1
  mulsd  -0x90(%r12),%xmm1
  mulsd  -0x90(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x20(%rsp),%xmm1
  mulsd  -0x88(%r12),%xmm1
  mulsd  -0x88(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x28(%rsp),%xmm1
  mulsd  -0x80(%r12),%xmm1
  mulsd  -0x80(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x30(%rsp),%xmm1
  mulsd  -0x78(%r12),%xmm1
  mulsd  -0x78(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x38(%rsp),%xmm1
  mulsd  -0x70(%r12),%xmm1
  mulsd  -0x70(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x40(%rsp),%xmm1
  mulsd  -0x68(%r12),%xmm1
  mulsd  -0x68(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x48(%rsp),%xmm1
  mulsd  -0x60(%r12),%xmm1
  mulsd  -0x60(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x50(%rsp),%xmm1
  mulsd  -0x58(%r12),%xmm1
  mulsd  -0x58(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x58(%rsp),%xmm1
  mulsd  -0x50(%r12),%xmm1
  mulsd  -0x50(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x60(%rsp),%xmm1
  mulsd  -0x48(%r12),%xmm1
  mulsd  -0x48(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x68(%rsp),%xmm1
  mulsd  -0x40(%r12),%xmm1
  mulsd  -0x40(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x70(%rsp),%xmm1
  mulsd  -0x38(%r12),%xmm1
  mulsd  -0x38(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x78(%rsp),%xmm1
  mulsd  -0x30(%r12),%xmm1
  mulsd  -0x30(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x80(%rsp),%xmm1
  mulsd  -0x28(%r12),%xmm1
  mulsd  -0x28(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x88(%rsp),%xmm1
  mulsd  -0x20(%r12),%xmm1
  mulsd  -0x20(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x90(%rsp),%xmm1
  mulsd  -0x18(%r12),%xmm1
  mulsd  -0x18(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x98(%rsp),%xmm1
  mulsd  -0x10(%r12),%xmm1
  mulsd  -0x10(%r15),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0xa0(%rsp),%xmm1
  mulsd  -0x8(%r12),%xmm1
  mulsd  -0x8(%r15),%xmm1
  addsd  %xmm1,%xmm0
  call   <log@plt>
  movapd %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl (%r14,%r13,4),%xmm0
  mulsd  D97(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  cmp    %rbp,0xa8(%rsp)
  jne    L52
  movsd  0xf0(%rsp),%xmm0
  movsd  0xf8(%rsp),%xmm2
  movsd  0x100(%rsp),%xmm1
  movsd  D0(%rip),%xmm5
  movsd  0x108(%rsp),%xmm3
  movapd %xmm0,%xmm4
  addsd  %xmm2,%xmm4
  mulsd  D41(%rip),%xmm0
  mulsd  D41(%rip),%xmm2
  addsd  %xmm1,%xmm4
  mulsd  D41(%rip),%xmm1
  addsd  %xmm3,%xmm4
  mulsd  D41(%rip),%xmm4
  mulsd  D41(%rip),%xmm3
  divsd  %xmm4,%xmm5
  mulsd  %xmm5,%xmm0
  mulsd  %xmm5,%xmm2
  mulsd  %xmm5,%xmm1
  mulsd  %xmm5,%xmm3
  movsd  D6(%rip),%xmm5
  movsd  %xmm0,0xf0(%rsp)
  comisd %xmm0,%xmm5
  movsd  %xmm2,0xf8(%rsp)
  movsd  %xmm1,0x100(%rsp)
  movsd  %xmm3,0x108(%rsp)
  jbe    L8
  xor    %ebx,%ebx
L92:
  comisd %xmm2,%xmm0
  jbe    L87
  movapd %xmm2,%xmm0
  mov    $0x1,%ebx
L87:
  comisd %xmm1,%xmm0
  jbe    L60
  movapd %xmm1,%xmm0
  mov    $0x2,%ebx
L60:
  ucomisd %xmm3,%xmm0
  mov    $0x3,%eax
  cmova  %eax,%ebx
  mov    0xd8(%rsp),%rax
  mov    %ebx,(%rax,%r13,4)
  mov    0xb0(%rsp),%rax
  mov    %rax,%r13
  cmp    %rax,0xe0(%rsp)
  je     L91
  add    $0x1,%rax
  mov    %rax,0xb0(%rsp)
  jmp    L26
  nopw   0x0(%rax,%rax,1)
L8:
  mov    D6(%rip),%rax
  movq   %rax,%xmm0
  jmp    L92
  cs nopw 0x0(%rax,%rax,1)
L91:
  mov    0x118(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L70
  mov    0xb8(%rsp),%rdi
  add    $0x128,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <free@plt>
L70:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D29
data_type: byte[8]
name: parse_data
arguments: data_label: D97
data_type: byte[8]
name: parse_data
arguments: data_label: D0
data_type: f64
name: parse_data
arguments: data_label: D41
data_type: f64
name: parse_data
arguments: data_label: D6
data_type: f64

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

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

tool: D0: 1

tool: D41: 0.25

tool: D6: 1e+300

assistant: ```c
void categorizeGTRGAMMAPROT(char *tipX1, double *x2, int *ex2, double *pz, double *gammaRates, double *EIGN, double *tipVector, int *rateCategory, int lower, int upper) {
  double z, lz, term[4], ki, min, allSum;
  int i, j, index = 0;
  double *diagptable, *diagptable_start;
  double *left, *right;
  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.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++;
      term[j] = log(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;
}
```