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

```asm
<GaussLegendreTet>:
  endbr64
  push   %r15
  mov    %edx,%r15d
  push   %r14
  mov    %esi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  movslq %edi,%rbx
  mov    %ebx,%edi
  sub    $0x88,%rsp
  mov    %esi,0x3c(%rsp)
  lea    0x40(%rsp),%rsi
  mov    %edx,0x14(%rsp)
  lea    0x58(%rsp),%rdx
  mov    %rcx,0x20(%rsp)
  mov    %r8,0x28(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x78(%rsp)
  xor    %eax,%eax
  call   <GaussLegendre1D@plt>
  lea    0x60(%rsp),%rdx
  lea    0x48(%rsp),%rsi
  mov    %r14d,%edi
  call   <GaussLegendre1D@plt>
  lea    0x68(%rsp),%rdx
  lea    0x50(%rsp),%rsi
  mov    %r15d,%edi
  call   <GaussLegendre1D@plt>
  test   %ebx,%ebx
  jle    L35
  lea    0x0(,%rbx,8),%rax
  movl   $0x0,0x38(%rsp)
  lea    0x70(%rsp),%rbp
  mov    %rax,0x30(%rsp)
  lea    -0x1(%r14),%eax
  lea    0x8(,%rax,8),%rax
  mov    %rax,0x18(%rsp)
  lea    -0x1(%r15),%eax
  xor    %r15d,%r15d
  lea    0x8(,%rax,8),%rax
  mov    %rax,0x8(%rsp)
  nopl   0x0(%rax)
L0:
  mov    0x3c(%rsp),%eax
  xor    %r14d,%r14d
  test   %eax,%eax
  jle    L39
  mov    %r15,%rax
  mov    %r14,%r15
  mov    %rax,%r14
  nopl   0x0(%rax,%rax,1)
L17:
  mov    0x14(%rsp),%edx
  test   %edx,%edx
  jle    L67
  movslq 0x38(%rsp),%rax
  mov    0x20(%rsp),%rcx
  xor    %r13d,%r13d
  mov    %rax,%rdi
  shl    $0x5,%rdi
  lea    (%rcx,%rdi,1),%r12
  mov    0x28(%rsp),%rcx
  lea    (%rcx,%rax,8),%rbx
  nopl   (%rax)
L44:
  mov    0x40(%rsp),%rax
  lea    0x10(%r12),%rdx
  mov    %r12,%rdi
  mov    %rbp,%rcx
  lea    0x8(%r12),%rsi
  add    $0x20,%r12
  movsd  (%rax,%r14,1),%xmm0
  mov    0x50(%rsp),%rax
  movsd  (%rax,%r13,1),%xmm2
  mov    0x48(%rsp),%rax
  movsd  (%rax,%r15,1),%xmm1
  call   <brickToTet@plt>
  movsd  D11(%rip),%xmm0
  mov    0x58(%rsp),%rax
  subsd  -0x20(%r12),%xmm0
  subsd  -0x18(%r12),%xmm0
  subsd  -0x10(%r12),%xmm0
  movsd  %xmm0,-0x8(%r12)
  movsd  (%rax,%r14,1),%xmm0
  mov    0x60(%rsp),%rax
  mulsd  0x70(%rsp),%xmm0
  mulsd  (%rax,%r15,1),%xmm0
  mov    0x68(%rsp),%rax
  mulsd  (%rax,%r13,1),%xmm0
  mulsd  D15(%rip),%xmm0
  movsd  %xmm0,(%rbx,%r13,1)
  add    $0x8,%r13
  cmp    0x8(%rsp),%r13
  jne    L44
  mov    0x14(%rsp),%ebx
  add    %ebx,0x38(%rsp)
L67:
  add    $0x8,%r15
  cmp    0x18(%rsp),%r15
  jne    L17
  mov    %r14,%r15
L39:
  add    $0x8,%r15
  cmp    0x30(%rsp),%r15
  jne    L0
L45:
  mov    0x78(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L32
  mov    0x38(%rsp),%eax
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L35:
  movl   $0x0,0x38(%rsp)
  jmp    L45
L32:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D11
datatype: f64
name: extract_symbolic_data
arguments: data_label: D15
datatype: f64

tool: D11: 1

tool: D15: 6

assistant: ```c
int GaussLegendreTet(int n1, int n2, int n3, double GLrstw[][4], double *GLwt) {
  int i, j, k, index = 0;
  double *pt1, *pt2, *pt3, *wt1, *wt2, *wt3, dJ;
  const double six = 6.000000000000000;
  GaussLegendre1D(n1, &pt1, &wt1);
  GaussLegendre1D(n2, &pt2, &wt2);
  GaussLegendre1D(n3, &pt3, &wt3);
  for (i = 0; i < n1; i++) {
    for (j = 0; j < n2; j++) {
      for (k = 0; k < n3; k++) {
        brickToTet(pt1[i], pt2[j], pt3[k], &GLrstw[index][0], &GLrstw[index][1], &GLrstw[index][2], &dJ);
        GLrstw[index][3] = 1.0e0 - GLrstw[index][0] - GLrstw[index][1] - GLrstw[index][2];
        GLwt[index++] = dJ * wt1[i] * wt2[j] * wt3[k] * six;
      }
    }
  }
  return index;
}
```