user: Please show me the C implementation that matches the assembly code listed below:

```asm
<makeP_FlexLG4>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  sub    $0x488,%rsp
  mov    %rdi,0x48(%rsp)
  mov    0x4c0(%rsp),%ebx
  xor    %edi,%edi
  mov    %rsi,0x50(%rsp)
  mov    %rdx,0x58(%rsp)
  mov    %r8,0x60(%rsp)
  mov    %r9,0x68(%rsp)
  movsd  %xmm0,0x10(%rsp)
  movsd  %xmm1,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x478(%rsp)
  xor    %eax,%eax
  lea    -0x1(%rbx),%eax
  mov    %eax,0x24(%rsp)
  mov    %ebx,%eax
  imul   %ebx,%eax
  cmp    $0x40,%ebx
  setle  %dil
  mov    %eax,0x3c(%rsp)
  call   <assert@plt>
  test   %ebp,%ebp
  jle    L72
  movslq %ebp,%rax
  xor    %r14d,%r14d
  movslq %ebx,%r10
  movl   $0x0,0x28(%rsp)
  mov    %rax,0x40(%rsp)
  lea    -0x2(%rbx),%eax
  lea    0x0(,%r10,8),%r15
  mov    %eax,0x2c(%rsp)
  mov    %r14,%rax
  mov    %r15,%r14
  mov    %rax,%r15
  nopw   0x0(%rax,%rax,1)
L29:
  mov    0x24(%rsp),%eax
  test   %eax,%eax
  jle    L23
  mov    0x48(%rsp),%rax
  mov    0x2c(%rsp),%ecx
  xor    %r13d,%r13d
  mov    %ebx,0x38(%rsp)
  lea    0x270(%rsp),%rbp
  mov    %r14,0x30(%rsp)
  mov    %r13,%rbx
  lea    0x70(%rsp),%r12
  movsd  (%rax,%r15,8),%xmm3
  mov    0x58(%rsp),%rax
  mov    %rbp,%r13
  mov    %rcx,%rbp
  mov    (%rax,%r15,8),%rax
  movsd  %xmm3,0x8(%rsp)
  mov    %rax,%r14
  nop
L62:
  movsd  0x8(%rsp),%xmm1
  mulsd  (%r14,%rbx,8),%xmm1
  movsd  0x10(%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm1,(%rsp)
  call   <exp@plt>
  movsd  (%rsp),%xmm1
  mulsd  0x18(%rsp),%xmm1
  movsd  %xmm0,(%r12,%rbx,8)
  movapd %xmm1,%xmm0
  call   <exp@plt>
  mov    %rbx,%rdx
  movsd  %xmm0,0x0(%r13,%rbx,8)
  add    $0x1,%rbx
  cmp    %rbp,%rdx
  jne    L62
  mov    0x30(%rsp),%r14
  mov    0x38(%rsp),%ebx
L23:
  test   %ebx,%ebx
  jle    L11
  movslq 0x28(%rsp),%rsi
  mov    0x60(%rsp),%rax
  xor    %r13d,%r13d
  xor    %r12d,%r12d
  mov    0x2c(%rsp),%ebp
  mov    0x24(%rsp),%r9d
  shl    $0x3,%rsi
  mov    0x50(%rsp),%r10
  lea    (%rax,%rsi,1),%rdi
  add    0x68(%rsp),%rsi
  nopl   0x0(%rax)
L4:
  mov    D6(%rip),%rax
  mov    %rax,(%rdi)
  mov    %rax,(%rsi)
  cmp    $0x1,%ebx
  je     L39
  mov    (%r10,%r15,8),%rdx
  movslq %r13d,%rax
  lea    0x70(%rsp),%r8
  lea    0x270(%rsp),%rcx
  lea    (%rdx,%rax,8),%rdx
  xor    %eax,%eax
  nopl   0x0(%rax)
L84:
  movsd  (%r8,%rax,8),%xmm0
  mulsd  (%rdx,%rax,8),%xmm0
  mov    %rax,%r11
  movsd  %xmm0,0x8(%rdi,%rax,8)
  movsd  (%rcx,%rax,8),%xmm0
  mulsd  (%rdx,%rax,8),%xmm0
  movsd  %xmm0,0x8(%rsi,%rax,8)
  add    $0x1,%rax
  cmp    %rbp,%r11
  jne    L84
L39:
  add    $0x1,%r12d
  add    %r14,%rdi
  add    %r14,%rsi
  add    %r9d,%r13d
  cmp    %r12d,%ebx
  jne    L4
L11:
  mov    0x3c(%rsp),%ecx
  add    $0x1,%r15
  add    %ecx,0x28(%rsp)
  cmp    0x40(%rsp),%r15
  jne    L29
L72:
  mov    0x478(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L32
  add    $0x488,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L32:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D6
type_infered: f64

tool: D6: 1

assistant: ```c
void makeP_FlexLG4(double z1, double z2, double *rptr, double *EI[4], double *EIGN[4], int numberOfCategories, double *left, double *right, const int numStates) {
  int i, j, k;
  const int rates = numStates - 1, statesSquare = numStates * numStates;
  double d1[64], d2[64];
  assert(numStates <= 64);
  for (i = 0; i < numberOfCategories; i++) {
    for (j = 0; j < rates; j++) {
      d1[j] = exp(rptr[i] * EIGN[i][j] * z1);
      d2[j] = exp(rptr[i] * EIGN[i][j] * z2);
    }
    for (j = 0; j < numStates; j++) {
      left[statesSquare * i + numStates * j] = 1.0;
      right[statesSquare * i + numStates * j] = 1.0;
      for (k = 1; k < numStates; k++) {
        left[statesSquare * i + numStates * j + k] = d1[k - 1] * EI[i][rates * j + (k - 1)];
        right[statesSquare * i + numStates * j + k] = d2[k - 1] * EI[i][rates * j + (k - 1)];
      }
    }
  }
}
```