user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<l2project2Tensor>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  mov    %edx,%r15d
  push   %r14
  imul   %edx,%r15d
  push   %r13
  mov    %edx,%r13d
  push   %r12
  push   %rbx
  sub    $0x68,%rsp
  mov    %rcx,-0x78(%rbp)
  mov    %edi,-0x54(%rbp)
  mov    %rsp,%rcx
  mov    %esi,-0x44(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  movslq %r15d,%rax
  lea    0xf(,%rax,8),%rdx
  mov    %rdx,%rax
  and    $0xfffffffffffff000,%rdx
  sub    %rdx,%rcx
  and    $0xfffffffffffffff0,%rax
  cmp    %rcx,%rsp
  je     L149
L71:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L71
L149:
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  jne    L81
L82:
  mov    -0x54(%rbp),%eax
  mov    %rsp,%rdi
  mov    %rdi,-0x60(%rbp)
  test   %eax,%eax
  jle    L89
  mov    -0x44(%rbp),%eax
  lea    -0x1(%r13),%ebx
  movl   $0x0,-0x50(%rbp)
  movslq %r13d,%r12
  movl   $0x0,-0x4c(%rbp)
  mov    $0xfffffffffffffff8,%r14
  shl    $0x3,%r12
  imul   %r15d,%eax
  movl   $0x0,-0x48(%rbp)
  mov    %eax,-0x58(%rbp)
  lea    -0x1(%r15),%eax
  lea    0x8(,%rax,8),%rax
  mov    %rax,-0x68(%rbp)
  lea    0x0(,%rbx,8),%rax
  lea    0x8(%rdi,%rax,1),%rdi
  sub    %rax,%r14
  mov    %rdi,-0x70(%rbp)
L132:
  test   %r15d,%r15d
  je     L45
  mov    -0x68(%rbp),%rdx
  mov    -0x60(%rbp),%rdi
  xor    %esi,%esi
  mov    %r8,-0x80(%rbp)
  call   <memset@plt>
  mov    -0x80(%rbp),%r8
L45:
  mov    -0x44(%rbp),%eax
  test   %eax,%eax
  jle    L158
  movslq -0x50(%rbp),%rdx
  mov    -0x78(%rbp),%rdi
  sub    $0x1,%eax
  mov    %rbx,-0x80(%rbp)
  mov    -0x4c(%rbp),%r10d
  mov    -0x70(%rbp),%rbx
  pxor   %xmm1,%xmm1
  add    %rdx,%rax
  lea    (%rdi,%rdx,8),%r9
  lea    0x8(%rdi,%rax,8),%r11
  nopw   0x0(%rax,%rax,1)
L32:
  movsd  (%r9),%xmm2
  addsd  %xmm2,%xmm1
  test   %r13d,%r13d
  jle    L76
  movslq %r10d,%rax
  mov    %rbx,%rcx
  xor    %esi,%esi
  lea    (%r8,%rax,8),%rdi
  nopw   0x0(%rax,%rax,1)
L96:
  lea    (%r14,%rcx,1),%rax
  mov    %rdi,%rdx
  nopw   0x0(%rax,%rax,1)
L74:
  movsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    $0x8,%rdx
  mulsd  %xmm2,%xmm0
  addsd  -0x8(%rax),%xmm0
  movsd  %xmm0,-0x8(%rax)
  cmp    %rcx,%rax
  jne    L74
  add    $0x1,%esi
  add    %r12,%rdi
  add    %r12,%rcx
  cmp    %esi,%r13d
  jne    L96
L76:
  add    $0x8,%r9
  add    %r15d,%r10d
  cmp    %r11,%r9
  jne    L32
  pxor   %xmm3,%xmm3
  mov    -0x80(%rbp),%rbx
  movsd  %xmm1,-0x88(%rbp)
  comisd %xmm3,%xmm1
  mov    %r8,-0x80(%rbp)
  seta   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    -0x80(%rbp),%r8
  mov    -0x4c(%rbp),%r10d
  xor    %r9d,%r9d
  mov    -0x44(%rbp),%r11d
  movsd  -0x88(%rbp),%xmm1
  mov    %r14,-0x80(%rbp)
  mov    -0x60(%rbp),%r14
  nopl   (%rax)
L165:
  test   %r13d,%r13d
  jle    L13
  movslq %r10d,%rax
  mov    %r14,%rcx
  xor    %edi,%edi
  lea    (%r8,%rax,8),%rsi
  nopl   0x0(%rax)
L17:
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L127:
  movsd  (%rcx,%rax,8),%xmm0
  mov    %rax,%rdx
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rsi,%rax,8)
  add    $0x1,%rax
  cmp    %rbx,%rdx
  jne    L127
  add    $0x1,%edi
  add    %r12,%rcx
  add    %r12,%rsi
  cmp    %edi,%r13d
  jne    L17
L13:
  add    $0x1,%r9d
  add    %r15d,%r10d
  cmp    %r9d,%r11d
  jne    L165
  mov    -0x80(%rbp),%r14
L92:
  mov    -0x58(%rbp),%esi
  addl   $0x1,-0x48(%rbp)
  add    %esi,-0x4c(%rbp)
  mov    -0x48(%rbp),%eax
  mov    -0x44(%rbp),%esi
  add    %esi,-0x50(%rbp)
  cmp    %eax,-0x54(%rbp)
  jne    L132
L89:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L83
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L158:
  xor    %edi,%edi
  mov    %r8,-0x80(%rbp)
  call   <assert@plt>
  mov    -0x80(%rbp),%r8
  jmp    L92
L81:
  orq    $0x0,-0x8(%rsp,%rax,1)
  jmp    L82
L83:
  call   <__stack_chk_fail@plt>
```

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;
    }
  }
}
```