user: Translate the below assembly code into C programming language:

```asm
<l2project2Tensor>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x68,%rsp
  mov    %edi,-0x60(%rbp)
  mov    %esi,-0x50(%rbp)
  mov    %edx,%r13d
  mov    %rcx,-0x88(%rbp)
  mov    %r8,%r15
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %edx,%eax
  imul   %edx,%eax
  mov    %eax,-0x4c(%rbp)
  cltq
  lea    0xf(,%rax,8),%rdx
  mov    %rdx,%rax
  and    $0xfffffffffffffff0,%rax
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rcx
  sub    %rdx,%rcx
L46:
  cmp    %rcx,%rsp
  je     L80
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L46
L80:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L6
  orq    $0x0,-0x8(%rsp,%rdx,1)
L6:
  mov    %rsp,%rbx
  mov    %rbx,-0x68(%rbp)
  cmpl   $0x0,-0x60(%rbp)
  jle    L65
  mov    -0x4c(%rbp),%eax
  mov    %eax,%edi
  imul   -0x50(%rbp),%edi
  mov    %edi,-0x7c(%rbp)
  lea    -0x1(%rax),%eax
  mov    %rbx,%rdi
  lea    0x8(%rbx,%rax,8),%rax
  mov    %rax,-0x78(%rbp)
  movslq %r13d,%r12
  shl    $0x3,%r12
  lea    -0x1(%r13),%ebx
  lea    0x8(%rdi,%rbx,8),%rax
  mov    %rax,-0x70(%rbp)
  movl   $0x0,-0x5c(%rbp)
  movl   $0x0,-0x58(%rbp)
  movl   $0x0,-0x54(%rbp)
  mov    %rbx,%r14
  not    %r14
  shl    $0x3,%r14
  jmp    L179
L165:
  mov    $0x0,%eax
L33:
  movsd  (%rcx,%rax,8),%xmm0
  divsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,(%rsi,%rax,8)
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    %rbx,%rdx
  jne    L33
  add    $0x1,%edi
  add    %r12,%rcx
  add    %r12,%rsi
  cmp    %edi,%r13d
  jne    L165
L169:
  add    $0x1,%r8d
  add    -0x4c(%rbp),%r9d
  cmp    %r8d,%r10d
  je     L73
L119:
  test   %r13d,%r13d
  jle    L169
  movslq %r9d,%rax
  lea    (%r15,%rax,8),%rsi
  mov    %r11,%rcx
  mov    $0x0,%edi
  jmp    L165
L102:
  mov    $0x0,%edi
  call   <assert@plt>
L73:
  addl   $0x1,-0x54(%rbp)
  mov    -0x54(%rbp),%eax
  mov    -0x7c(%rbp),%esi
  add    %esi,-0x58(%rbp)
  mov    -0x50(%rbp),%esi
  add    %esi,-0x5c(%rbp)
  cmp    %eax,-0x60(%rbp)
  je     L65
L179:
  mov    -0x68(%rbp),%rax
  mov    -0x78(%rbp),%rdx
  cmpl   $0x0,-0x4c(%rbp)
  jle    L88
L113:
  movq   $0x0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L113
L88:
  mov    -0x50(%rbp),%eax
  test   %eax,%eax
  jle    L102
  movslq -0x5c(%rbp),%rdx
  mov    -0x88(%rbp),%rdi
  lea    (%rdi,%rdx,8),%r8
  lea    -0x1(%rax),%eax
  add    %rdx,%rax
  lea    0x8(%rdi,%rax,8),%r10
  mov    -0x58(%rbp),%r9d
  pxor   %xmm4,%xmm4
  movsd  %xmm4,-0x48(%rbp)
  mov    -0x70(%rbp),%r11
L124:
  movsd  (%r8),%xmm1
  movsd  -0x48(%rbp),%xmm3
  addsd  %xmm1,%xmm3
  movsd  %xmm3,-0x48(%rbp)
  test   %r13d,%r13d
  jle    L31
  movslq %r9d,%rax
  lea    (%r15,%rax,8),%rdi
  mov    %r11,%rcx
  mov    $0x0,%esi
L147:
  lea    (%r14,%rcx,1),%rax
  mov    %rdi,%rdx
L68:
  movapd %xmm1,%xmm0
  mulsd  (%rdx),%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  add    $0x8,%rdx
  cmp    %rcx,%rax
  jne    L68
  add    $0x1,%esi
  add    %r12,%rdi
  add    %r12,%rcx
  cmp    %esi,%r13d
  jne    L147
L31:
  add    $0x8,%r8
  add    -0x4c(%rbp),%r9d
  cmp    %r10,%r8
  jne    L124
  movsd  -0x48(%rbp),%xmm5
  comisd D1(%rip),%xmm5
  seta   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    -0x58(%rbp),%r9d
  mov    $0x0,%r8d
  mov    -0x50(%rbp),%r10d
  mov    -0x68(%rbp),%r11
  jmp    L119
L65:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L40
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L40:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D1
type_guessed: f64

tool: D1: 0

assistant: ```c
void l2project2Tensor(const int nSimplices, const int nPointsPerSimplex, const int nSpace, double *dV, double *r) {
  int eN, k, I, J, nSpace2;
  double vol;
  double ravg[nSpace * nSpace];
  nSpace2 = nSpace * nSpace;
  for (eN = 0; eN < nSimplices; eN++) {
    vol = 0.0;
    for (I = 0; I < nSpace2; I++)
      ravg[I] = 0.0;
    for (k = 0; k < nPointsPerSimplex; k++) {
      vol += dV[eN * nPointsPerSimplex + k];
      for (I = 0; I < nSpace; I++)
        for (J = 0; J < nSpace; J++)
          ravg[I * nSpace + J] += r[eN * nPointsPerSimplex * nSpace2 + k * nSpace2 + I * nSpace + J] * dV[eN * nPointsPerSimplex + k];
    }
    assert(vol > 0.0);
    for (k = 0; k < nPointsPerSimplex; k++) {
      for (I = 0; I < nSpace; I++)
        for (J = 0; J < nSpace; J++)
          r[eN * nPointsPerSimplex * nSpace2 + k * nSpace2 + I * nSpace + J] = ravg[I * nSpace + J] / vol;
    }
  }
}
```