user: Converte this assembly snippet into its equivalent C code:

```asm
<d2Sdiag2D>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x120,%rsp
  mov    %rdi,-0xf8(%rbp)
  mov    %rsi,-0x100(%rbp)
  mov    %rdx,-0x108(%rbp)
  mov    %rcx,-0x110(%rbp)
  mov    %r8,-0x118(%rbp)
  mov    %r9,-0x120(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x120(%rbp),%rax
  movsd  (%rax),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0xd8(%rbp)
  mov    -0x120(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0xd4(%rbp)
  mov    -0xd8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0xd4(%rbp),%eax
  add    $0x1,%eax
  imul   %edx,%eax
  mov    %eax,-0xd0(%rbp)
  mov    -0x118(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x118(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0xc0(%rbp)
  mov    -0x110(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  movsd  -0xc0(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0xb8(%rbp)
  movl   $0x1,-0xcc(%rbp)
  mov    -0xd8(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc8(%rbp)
  movl   $0x0,-0xe8(%rbp)
  jmp    L75
L1:
  movl   $0x0,-0xe4(%rbp)
  jmp    L76
L27:
  mov    -0xd8(%rbp),%eax
  add    $0x1,%eax
  imul   -0xe4(%rbp),%eax
  mov    %eax,%edx
  mov    -0xe8(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc4(%rbp)
  movl   $0x0,-0xdc(%rbp)
  movl   $0x0,-0xe0(%rbp)
  jmp    L72
L73:
  mov    -0xc4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0xdc(%rbp),%eax
  cltq
  add    %rdx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x100(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0xa8(%rbp)
  mov    -0xa8(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0xe0(%rbp),%eax
  cltq
  movsd  %xmm0,-0xa0(%rbp,%rax,8)
  mov    -0xcc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0xa8(%rbp)
  mov    -0xa8(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0xe0(%rbp),%eax
  cltq
  movsd  %xmm0,-0x90(%rbp,%rax,8)
  mov    -0xc8(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0xa8(%rbp)
  mov    -0xa8(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0xe0(%rbp),%eax
  cltq
  movsd  %xmm0,-0x70(%rbp,%rax,8)
  mov    -0xcc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  neg    %rax
  add    %rax,-0xa8(%rbp)
  mov    -0xa8(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0xe0(%rbp),%eax
  cltq
  movsd  %xmm0,-0x80(%rbp,%rax,8)
  mov    -0xe0(%rbp),%eax
  cltq
  movsd  -0xa0(%rbp,%rax,8),%xmm1
  mov    -0xe0(%rbp),%eax
  cltq
  movsd  -0x90(%rbp,%rax,8),%xmm0
  addsd  %xmm0,%xmm1
  mov    -0xe0(%rbp),%eax
  cltq
  movsd  -0x80(%rbp,%rax,8),%xmm0
  addsd  %xmm0,%xmm1
  mov    -0xe0(%rbp),%eax
  cltq
  movsd  -0x70(%rbp,%rax,8),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D4(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0xe0(%rbp),%eax
  cltq
  movsd  %xmm0,-0x60(%rbp,%rax,8)
  mov    -0xe0(%rbp),%eax
  cltq
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x50(%rbp,%rax,8)
  mov    -0xe0(%rbp),%eax
  cltq
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x40(%rbp,%rax,8)
  mov    -0xe0(%rbp),%eax
  cltq
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp,%rax,8)
  mov    -0xe0(%rbp),%eax
  cltq
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp,%rax,8)
  mov    -0xd0(%rbp),%eax
  add    %eax,-0xdc(%rbp)
  addl   $0x1,-0xe0(%rbp)
L72:
  cmpl   $0x1,-0xe0(%rbp)
  jle    L73
  mov    -0x108(%rbp),%rax
  mov    (%rax),%rdi
  movsd  -0xb8(%rbp),%xmm0
  lea    -0x20(%rbp),%r9
  lea    -0x40(%rbp),%r10
  lea    -0x50(%rbp),%rcx
  lea    -0x60(%rbp),%rdx
  lea    -0x90(%rbp),%rsi
  lea    -0xa0(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x30(%rbp),%r8
  push   %r8
  movapd %xmm0,%xmm1
  mov    %r10,%r8
  movq   %rdi,%xmm0
  mov    %rax,%rdi
  call   <d2SdiagTriangle@plt>
  add    $0x10,%rsp
  mov    -0x108(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rdi
  movsd  -0xb8(%rbp),%xmm0
  lea    -0x30(%rbp),%r9
  lea    -0x20(%rbp),%r10
  lea    -0x40(%rbp),%rcx
  lea    -0x60(%rbp),%rdx
  lea    -0x70(%rbp),%rsi
  lea    -0x90(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x50(%rbp),%r8
  push   %r8
  movapd %xmm0,%xmm1
  mov    %r10,%r8
  movq   %rdi,%xmm0
  mov    %rax,%rdi
  call   <d2SdiagTriangle@plt>
  add    $0x10,%rsp
  mov    -0x108(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rdi
  movsd  -0xb8(%rbp),%xmm0
  lea    -0x50(%rbp),%r9
  lea    -0x30(%rbp),%r10
  lea    -0x20(%rbp),%rcx
  lea    -0x60(%rbp),%rdx
  lea    -0x80(%rbp),%rsi
  lea    -0x70(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x40(%rbp),%r8
  push   %r8
  movapd %xmm0,%xmm1
  mov    %r10,%r8
  movq   %rdi,%xmm0
  mov    %rax,%rdi
  call   <d2SdiagTriangle@plt>
  add    $0x10,%rsp
  mov    -0x108(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rdi
  movsd  -0xb8(%rbp),%xmm0
  lea    -0x40(%rbp),%r9
  lea    -0x50(%rbp),%r10
  lea    -0x30(%rbp),%rcx
  lea    -0x60(%rbp),%rdx
  lea    -0xa0(%rbp),%rsi
  lea    -0x80(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x20(%rbp),%r8
  push   %r8
  movapd %xmm0,%xmm1
  mov    %r10,%r8
  movq   %rdi,%xmm0
  mov    %rax,%rdi
  call   <d2SdiagTriangle@plt>
  add    $0x10,%rsp
  movl   $0x0,-0xdc(%rbp)
  movl   $0x0,-0xe0(%rbp)
  jmp    L87
L56:
  mov    -0xc4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0xdc(%rbp),%eax
  cltq
  add    %rdx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0xf8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0xb0(%rbp)
  mov    -0xb0(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0xe0(%rbp),%eax
  cltq
  movsd  -0x50(%rbp,%rax,8),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0xb0(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0xcc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0xb0(%rbp)
  mov    -0xb0(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0xe0(%rbp),%eax
  cltq
  movsd  -0x40(%rbp,%rax,8),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0xb0(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0xc8(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0xb0(%rbp)
  mov    -0xb0(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0xe0(%rbp),%eax
  cltq
  movsd  -0x20(%rbp,%rax,8),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0xb0(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0xcc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  neg    %rax
  add    %rax,-0xb0(%rbp)
  mov    -0xb0(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0xe0(%rbp),%eax
  cltq
  movsd  -0x30(%rbp,%rax,8),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0xb0(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0xd0(%rbp),%eax
  add    %eax,-0xdc(%rbp)
  addl   $0x1,-0xe0(%rbp)
L87:
  cmpl   $0x1,-0xe0(%rbp)
  jle    L56
  addl   $0x1,-0xe4(%rbp)
L76:
  mov    -0xe4(%rbp),%eax
  cmp    -0xd4(%rbp),%eax
  jl     L27
  addl   $0x1,-0xe8(%rbp)
L75:
  mov    -0xe8(%rbp),%eax
  cmp    -0xd8(%rbp),%eax
  jl     L1
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L60
  call   <__stack_chk_fail@plt>
L60:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D4
type: f64

tool: D4: 0.25

assistant: ```c
void d2Sdiag2D(double *prod, const double *yc, const double *VRef, const double *alpha, const double *h, const double *m, const int n) {
  int idn, i1, i2, r, comp;
  double yA[2], yB[2], yC[2], yD[2], yM[2];
  double rA[2], rB[2], rC[2], rD[2];
  const int m1 = m[0], m2 = m[1];
  const int nn = (m1 + 1) * (m2 + 1);
  const double hd = h[0] * h[1];
  const double alphaVolume = alpha[2] * hd;
  const int inc_x = 1;
  const int inc_y = m1 + 1;
  const double *ptr;
  double *wptr;
#pragma omp parallel private(wptr, ptr, idn, i1, i2, r, comp, yA, yB, yC, yD, yM, rA, rB, rC, rD)
  {
#pragma omp for
    for (i1 = 0; i1 < m1; i1++) {
      for (i2 = 0; i2 < m2; i2++) {
        idn = i1 + i2 * (m1 + 1);
        comp = 0;
        for (r = 0; r < 2; r++) {
          ptr = yc + idn + comp;
          yA[r] = *ptr;
          ptr = ptr + inc_x;
          yB[r] = *ptr;
          ptr = ptr + inc_y;
          yD[r] = *ptr;
          ptr = ptr - inc_x;
          yC[r] = *ptr;
          yM[r] = 0.25 * (yA[r] + yB[r] + yC[r] + yD[r]);
          rA[r] = 0.0;
          rB[r] = 0.0;
          rC[r] = 0.0;
          rD[r] = 0.0;
          comp += nn;
        }
        d2SdiagTriangle(yA, yB, yM, VRef[0], rA, rB, rD, rC, alphaVolume);
        d2SdiagTriangle(yB, yD, yM, VRef[1], rB, rD, rC, rA, alphaVolume);
        d2SdiagTriangle(yD, yC, yM, VRef[2], rD, rC, rA, rB, alphaVolume);
        d2SdiagTriangle(yC, yA, yM, VRef[3], rC, rA, rB, rD, alphaVolume);
        comp = 0;
        for (r = 0; r < 2; r++) {
          wptr = prod + idn + comp;
#pragma omp atomic
          *wptr += rA[r];
          wptr += inc_x;
#pragma omp atomic
          *wptr += rB[r];
          wptr += inc_y;
#pragma omp atomic
          *wptr += rD[r];
          wptr -= inc_x;
#pragma omp atomic
          *wptr += rC[r];
          comp += nn;
        }
      }
    }
  }
}
```