user: What is the c source code of the assembly code below:

```asm
<coreGAMMA_FLEX>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x88,%rsp
  xor    %r14d,%r14d
  mov    0x20c0(%rsp),%rax
  mov    0x20c8(%rsp),%ebx
  lea    0x0(,%rbx,4),%ebp
  mov    %edi,0x4c(%rsp)
  mov    %r9,%r13
  mov    %rsi,0x50(%rsp)
  mov    %rdx,0x58(%rsp)
  mov    %rcx,0x60(%rsp)
  mov    %r8,0x30(%rsp)
  mov    %rax,0x68(%rsp)
  movsd  %xmm0,0x20(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x2078(%rsp)
  xor    %eax,%eax
  lea    0x20(%r9),%rax
  mov    %rax,0x28(%rsp)
  lea    -0x2(%rbx),%eax
  shl    $0x3,%rax
  mov    %rax,0x40(%rsp)
  lea    0x10(%r8,%rax,1),%r12
  lea    0x70(%rsp),%rax
  mov    %rax,0x38(%rsp)
L87:
  movsd  0x0(%r13),%xmm6
  cmpl   $0x1,0x20c8(%rsp)
  movsd  %xmm6,0x10(%rsp)
  mulsd  %xmm6,%xmm6
  movsd  %xmm6,0x18(%rsp)
  jle    L80
  mov    0x30(%rsp),%rax
  mov    0x38(%rsp),%rdi
  lea    0x8(%rax),%rbx
  movslq %r14d,%rax
  lea    (%rdi,%rax,8),%r15
  nopl   0x0(%rax,%rax,1)
L18:
  movsd  (%rbx),%xmm1
  movsd  0x10(%rsp),%xmm2
  add    $0x8,%rbx
  add    $0x20,%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,(%r15)
  mulsd  %xmm1,%xmm1
  movsd  %xmm2,0x8(%r15)
  mulsd  0x18(%rsp),%xmm1
  movsd  %xmm1,0x10(%r15)
  cmp    %r12,%rbx
  jne    L18
L80:
  add    $0x8,%r13
  add    %ebp,%r14d
  cmp    0x28(%rsp),%r13
  jne    L87
  mov    0x4c(%rsp),%eax
  mov    0x20c8(%rsp),%ebx
  test   %eax,%eax
  jle    L81
  mov    0x68(%rsp),%r10
  sub    $0x1,%eax
  pxor   %xmm5,%xmm5
  movslq %ebp,%r13
  movslq %ebx,%r9
  mov    0x50(%rsp),%r11
  shl    $0x3,%r13
  movapd %xmm5,%xmm6
  lea    0x4(%r10,%rax,4),%r14
  mov    0x40(%rsp),%rax
  shl    $0x3,%r9
  movsd  D3(%rip),%xmm8
  movapd %xmm5,%xmm7
  lea    0x70(%rsp),%r12
  lea    0x8(%rax),%r15
  nopl   0x0(%rax,%rax,1)
L21:
  lea    (%r15,%r11,1),%rcx
  mov    %r11,%rsi
  xor    %r8d,%r8d
  mov    $0x4,%edi
  movapd %xmm5,%xmm3
  movapd %xmm5,%xmm2
  movapd %xmm5,%xmm1
L44:
  addsd  (%rsi),%xmm1
  cmp    $0x1,%ebx
  jle    L12
  movslq %r8d,%rax
  mov    %rsi,%rdx
  lea    0x20(%r12,%rax,8),%rax
  nopw   0x0(%rax,%rax,1)
L97:
  movsd  (%rax),%xmm0
  mulsd  0x8(%rdx),%xmm0
  add    $0x8,%rdx
  add    $0x20,%rax
  movsd  -0x18(%rax),%xmm4
  addsd  %xmm0,%xmm1
  mulsd  %xmm0,%xmm4
  mulsd  -0x10(%rax),%xmm0
  addsd  %xmm4,%xmm2
  addsd  %xmm0,%xmm3
  cmp    %rdx,%rcx
  jne    L97
L12:
  add    %r9,%rsi
  add    %ebp,%r8d
  add    %r9,%rcx
  sub    $0x1,%edi
  jne    L44
  movapd %xmm8,%xmm0
  add    $0x4,%r10
  add    %r13,%r11
  divsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x4(%r10),%xmm1
  movapd %xmm1,%xmm4
  mulsd  %xmm0,%xmm2
  mulsd  %xmm3,%xmm0
  mulsd  %xmm2,%xmm4
  mulsd  %xmm2,%xmm2
  addsd  %xmm4,%xmm7
  subsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm6
  cmp    %r10,%r14
  jne    L21
L67:
  mov    0x58(%rsp),%rax
  movsd  %xmm7,(%rax)
  mov    0x60(%rsp),%rax
  movsd  %xmm6,(%rax)
  mov    0x2078(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L94
  add    $0x2088,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L81:
  pxor   %xmm6,%xmm6
  movapd %xmm6,%xmm7
  jmp    L67
L94:
  call   <__stack_chk_fail@plt>
```

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

tool: D3: 1

assistant: ```c
void coreGAMMA_FLEX(int upper, double *sumtable, volatile double *ext_dlnLdlz, volatile double *ext_d2lnLdlz2, double *EIGN, double *gammaRates, double lz, int *wrptr, const int states) {
  double *sum, diagptable[1024], dlnLdlz = 0.0, d2lnLdlz2 = 0.0, ki, kisqr, tmp, inv_Li, dlnLidlz, d2lnLidlz2;
  int i, j, l;
  const int gammaStates = 4 * states;
  for (i = 0; i < 4; i++) {
    ki = gammaRates[i];
    kisqr = ki * ki;
    for (l = 1; l < states; l++) {
      diagptable[i * gammaStates + l * 4] = exp(EIGN[l] * ki * lz);
      diagptable[i * gammaStates + l * 4 + 1] = EIGN[l] * ki;
      diagptable[i * gammaStates + l * 4 + 2] = EIGN[l] * EIGN[l] * kisqr;
    }
  }
  for (i = 0; i < upper; i++) {
    sum = &sumtable[i * gammaStates];
    inv_Li = 0.0;
    dlnLidlz = 0.0;
    d2lnLidlz2 = 0.0;
    for (j = 0; j < 4; j++) {
      inv_Li += sum[j * states];
      for (l = 1; l < states; l++) {
        inv_Li += (tmp = diagptable[j * gammaStates + l * 4] * sum[j * states + l]);
        dlnLidlz += tmp * diagptable[j * gammaStates + l * 4 + 1];
        d2lnLidlz2 += tmp * diagptable[j * gammaStates + l * 4 + 2];
      }
    }
    inv_Li = 1.0 / inv_Li;
    dlnLidlz *= inv_Li;
    d2lnLidlz2 *= inv_Li;
    dlnLdlz += wrptr[i] * dlnLidlz;
    d2lnLdlz2 += wrptr[i] * (d2lnLidlz2 - dlnLidlz * dlnLidlz);
  }
  *ext_dlnLdlz = dlnLdlz;
  *ext_d2lnLdlz2 = d2lnLdlz2;
}
```