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

```asm
<coreGTRGAMMAPROT_LG4>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x78,%rsp
  xor    %r12d,%r12d
  mov    0x10b0(%rsp),%rax
  mov    0x10b8(%rsp),%rbp
  mov    %rdi,0x28(%rsp)
  lea    0x2e0(%rsp),%r13
  mov    %rsi,0x30(%rsp)
  mov    %r13,%rbx
  mov    %rdx,0x38(%rsp)
  mov    %ecx,0x44(%rsp)
  mov    %r8,0x48(%rsp)
  mov    %r9,0x50(%rsp)
  mov    %rax,0x58(%rsp)
  movsd  %xmm0,0x20(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x1068(%rsp)
  xor    %eax,%eax
L29:
  mov    0x28(%rsp),%rax
  lea    -0x260(%rbx),%r14
  movsd  (%rax,%r12,1),%xmm5
  mov    0x30(%rsp),%rax
  movsd  %xmm5,0x10(%rsp)
  mulsd  %xmm5,%xmm5
  mov    (%rax,%r12,1),%r15
  movsd  %xmm5,0x18(%rsp)
  nopw   0x0(%rax,%rax,1)
L40:
  movsd  (%r15),%xmm1
  movsd  0x10(%rsp),%xmm2
  add    $0x20,%r14
  add    $0x8,%r15
  movsd  0x20(%rsp),%xmm0
  mulsd  %xmm1,%xmm2
  movsd  %xmm1,0x8(%rsp)
  mulsd  %xmm2,%xmm0
  movsd  %xmm2,(%rsp)
  call   <exp@plt>
  movsd  0x8(%rsp),%xmm1
  movsd  (%rsp),%xmm2
  movsd  %xmm0,-0x20(%r14)
  mulsd  %xmm1,%xmm1
  movsd  %xmm2,-0x18(%r14)
  mulsd  0x18(%rsp),%xmm1
  movsd  %xmm1,-0x10(%r14)
  cmp    %r14,%rbx
  jne    L40
  add    $0x8,%r12
  add    $0x400,%rbx
  cmp    $0x20,%r12
  jne    L29
  mov    0x44(%rsp),%eax
  test   %eax,%eax
  jle    L7
  mov    0x48(%rsp),%r12
  mov    0x38(%rsp),%r14
  pxor   %xmm6,%xmm6
  sub    $0x1,%eax
  movapd %xmm6,%xmm8
  movapd %xmm6,%xmm9
  add    $0x8,%r14
  lea    0x4(%r12,%rax,4),%rbx
  nopw   0x0(%rax,%rax,1)
L50:
  mov    %r13,%rcx
  mov    %r14,%rdi
  movapd %xmm6,%xmm7
  xor    %esi,%esi
  movapd %xmm6,%xmm5
  movapd %xmm6,%xmm10
L18:
  movsd  -0x8(%rdi),%xmm2
  mov    %rdi,%rdx
  movapd %xmm6,%xmm3
  movapd %xmm6,%xmm1
  lea    -0x260(%rcx),%rax
  addsd  %xmm6,%xmm2
L21:
  movsd  (%rax),%xmm0
  mulsd  (%rdx),%xmm0
  add    $0x20,%rax
  add    $0x8,%rdx
  movsd  -0x18(%rax),%xmm4
  addsd  %xmm0,%xmm2
  mulsd  %xmm0,%xmm4
  mulsd  -0x10(%rax),%xmm0
  addsd  %xmm4,%xmm1
  addsd  %xmm0,%xmm3
  cmp    %rax,%rcx
  jne    L21
  movsd  0x0(%rbp,%rsi,8),%xmm0
  add    $0x1,%rsi
  add    $0xa0,%rdi
  add    $0x400,%rcx
  mulsd  %xmm0,%xmm2
  mulsd  %xmm0,%xmm1
  mulsd  %xmm3,%xmm0
  addsd  %xmm2,%xmm10
  addsd  %xmm1,%xmm5
  addsd  %xmm0,%xmm7
  cmp    $0x4,%rsi
  jne    L18
  movapd %xmm10,%xmm0
  movsd  %xmm7,0x18(%rsp)
  add    $0x4,%r12
  add    $0x280,%r14
  movsd  %xmm5,0x10(%rsp)
  movsd  %xmm8,0x8(%rsp)
  movsd  %xmm9,(%rsp)
  call   <FABS@plt>
  movsd  0x10(%rsp),%xmm5
  pxor   %xmm6,%xmm6
  movsd  0x18(%rsp),%xmm7
  movapd %xmm0,%xmm1
  movsd  D3(%rip),%xmm0
  movsd  (%rsp),%xmm9
  movsd  0x8(%rsp),%xmm8
  divsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x4(%r12),%xmm1
  cmp    %r12,%rbx
  movapd %xmm1,%xmm2
  mulsd  %xmm0,%xmm5
  mulsd  %xmm7,%xmm0
  mulsd  %xmm5,%xmm2
  mulsd  %xmm5,%xmm5
  addsd  %xmm2,%xmm9
  subsd  %xmm5,%xmm0
  mulsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm8
  jne    L50
L25:
  mov    0x50(%rsp),%rax
  movsd  %xmm9,(%rax)
  mov    0x58(%rsp),%rax
  movsd  %xmm8,(%rax)
  mov    0x1068(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L62
  add    $0x1078,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L7:
  pxor   %xmm8,%xmm8
  movapd %xmm8,%xmm9
  jmp    L25
L62:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D3
type_infered: f64

tool: D3: 1

assistant: ```c
void coreGTRGAMMAPROT_LG4(double *gammaRates, double *EIGN[4], double *sumtable, int upper, int *wrptr, volatile double *ext_dlnLdlz, volatile double *ext_d2lnLdlz2, double lz, double *weights) {
  double *sum, diagptable[512];
  int i, j, l;
  double dlnLdlz = 0;
  double d2lnLdlz2 = 0;
  double ki, kisqr;
  double tmp;
  double inv_Li, dlnLidlz, d2lnLidlz2;
  for (i = 0; i < 4; i++) {
    ki = gammaRates[i];
    kisqr = ki * ki;
    for (l = 1; l < 20; l++) {
      diagptable[i * 128 + l * 4] = exp(EIGN[i][l - 1] * ki * lz);
      diagptable[i * 128 + l * 4 + 1] = EIGN[i][l - 1] * ki;
      diagptable[i * 128 + l * 4 + 2] = EIGN[i][l - 1] * EIGN[i][l - 1] * kisqr;
    }
  }
  for (i = 0; i < upper; i++) {
    sum = &sumtable[i * 80];
    inv_Li = 0.0;
    dlnLidlz = 0.0;
    d2lnLidlz2 = 0.0;
    for (j = 0; j < 4; j++) {
      double a1 = 0.0, a2 = 0.0, a3 = 0.0;
      a1 += sum[j * 20];
      for (l = 1; l < 20; l++) {
        a1 += (tmp = diagptable[j * 128 + l * 4] * sum[j * 20 + l]);
        a2 += tmp * diagptable[j * 128 + l * 4 + 1];
        a3 += tmp * diagptable[j * 128 + l * 4 + 2];
      }
      inv_Li += weights[j] * a1;
      dlnLidlz += weights[j] * a2;
      d2lnLidlz2 += weights[j] * a3;
    }
    inv_Li = 1.0 / FABS(inv_Li);
    dlnLidlz *= inv_Li;
    d2lnLidlz2 *= inv_Li;
    dlnLdlz += wrptr[i] * dlnLidlz;
    d2lnLdlz2 += wrptr[i] * (d2lnLidlz2 - dlnLidlz * dlnLidlz);
  }
  *ext_dlnLdlz = dlnLdlz;
  *ext_d2lnLdlz2 = d2lnLdlz2;
}
```