user: 请将以下的汇编代码转换成C语言代码：

```asm
<calculateNumericalDiffusionResGradQuad>:
  endbr64
  push   %r15
  mov    %edi,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %esi,0x20(%rsp)
  mov    %r8,0x18(%rsp)
  test   %edi,%edi
  jle    L45
  mov    %esi,%edi
  test   %esi,%esi
  jle    L45
  sub    $0x1,%eax
  movapd %xmm0,%xmm8
  mov    %r9,%rbx
  mov    %edx,%r15d
  lea    0x8(%rcx,%rax,8),%rax
  mov    %edx,%r13d
  mov    %rcx,%r10
  and    $0xfffffffe,%r15d
  mov    %rax,0x10(%rsp)
  mov    %edx,%eax
  imul   %edx,%esi
  xor    %r11d,%r11d
  shr    %eax
  movsd  D41(%rip),%xmm7
  pxor   %xmm4,%xmm4
  movq   D9(%rip),%xmm6
  mulsd  D35(%rip),%xmm8
  lea    -0x1(%rax),%r9d
  lea    -0x1(%rdi),%eax
  mov    %eax,0x24(%rsp)
  lea    0x8(%r8),%rax
  add    $0x1,%r9
  mov    %rax,0x28(%rsp)
  shl    $0x4,%r9
  mov    %esi,0xc(%rsp)
  xor    %esi,%esi
  nopw   0x0(%rax,%rax,1)
L12:
  movsd  (%r10),%xmm5
  mov    0x18(%rsp),%rax
  movslq %r11d,%rdx
  xor    %r12d,%r12d
  lea    0x0(,%rdx,8),%r14
  mov    0x28(%rsp),%rdi
  movslq %esi,%r8
  mulsd  %xmm8,%xmm5
  lea    (%rax,%r14,1),%rbp
  mov    0x24(%rsp),%eax
  add    0xb0(%rsp),%r14
  add    %rdx,%rax
  lea    (%rdi,%rax,8),%rdi
  nopl   0x0(%rax)
L72:
  movsd  0x0(%rbp),%xmm3
  movapd %xmm4,%xmm0
  andpd  %xmm6,%xmm3
  mulsd  %xmm5,%xmm3
  test   %r13d,%r13d
  jle    L105
  lea    (%rsi,%r12,1),%edx
  cmp    $0x1,%r13d
  je     L18
  movslq %r12d,%rax
  movapd %xmm4,%xmm0
  add    %r8,%rax
  lea    (%rbx,%rax,8),%rax
  lea    (%r9,%rax,1),%rcx
  cs nopw 0x0(%rax,%rax,1)
L47:
  movupd (%rax),%xmm2
  add    $0x10,%rax
  mulpd  %xmm2,%xmm2
  addsd  %xmm2,%xmm0
  unpckhpd %xmm2,%xmm2
  addsd  %xmm2,%xmm0
  cmp    %rax,%rcx
  jne    L47
  mov    %r15d,%eax
  cmp    %r15d,%r13d
  je     L92
L0:
  add    %edx,%eax
  cltq
  movsd  (%rbx,%rax,8),%xmm1
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
L92:
  ucomisd %xmm0,%xmm4
  ja     L61
L105:
  sqrtsd %xmm0,%xmm0
L20:
  addsd  %xmm7,%xmm0
  add    $0x8,%rbp
  add    $0x8,%r14
  add    %r13d,%r12d
  divsd  %xmm0,%xmm3
  movsd  %xmm3,-0x8(%r14)
  cmp    %rbp,%rdi
  jne    L72
  add    $0x8,%r10
  add    0x20(%rsp),%r11d
  add    0xc(%rsp),%esi
  cmp    0x10(%rsp),%r10
  jne    L12
L45:
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L18:
  movapd %xmm4,%xmm0
  xor    %eax,%eax
  jmp    L0
L61:
  mov    %r9,0x68(%rsp)
  mov    %r8,0x60(%rsp)
  mov    %rdi,0x50(%rsp)
  mov    %esi,0x4c(%rsp)
  mov    %r11d,0x48(%rsp)
  mov    %r10,0x40(%rsp)
  movsd  %xmm8,0x58(%rsp)
  movsd  %xmm3,0x38(%rsp)
  movsd  %xmm5,0x30(%rsp)
  call   <sqrt@plt>
  mov    D41(%rip),%rax
  mov    0x4c(%rsp),%esi
  pxor   %xmm4,%xmm4
  mov    0x68(%rsp),%r9
  mov    0x60(%rsp),%r8
  mov    0x50(%rsp),%rdi
  mov    0x48(%rsp),%r11d
  movq   %rax,%xmm7
  movsd  0x58(%rsp),%xmm8
  mov    0x40(%rsp),%r10
  movq   D9(%rip),%xmm6
  movsd  0x38(%rsp),%xmm3
  movsd  0x30(%rsp),%xmm5
  jmp    L20
```

tool_calls: name: unpack_data
arguments: label: D41
data_type: byte[8]
name: unpack_data
arguments: label: D9
data_type: qword
name: unpack_data
arguments: label: D35
data_type: f64

tool: {"D41": [0x3a,0x8c,0x30,0xe2,0x8e,0x79,0x45,0x3e]}

tool: D9: 9223372036854775807

tool: D35: 0.5

assistant: ```c
void calculateNumericalDiffusionResGradQuad(int nElements_global, int nQuadraturePoints_element, int nSpace, double shockCapturingDiffusion, double *elementDiameter, double *strong_residual, double *grad_u, double *numDiff) {
  int eN, k, I;
  double h, num, den, n_grad_u;
  for (eN = 0; eN < nElements_global; eN++) {
    h = elementDiameter[eN];
    for (k = 0; k < nQuadraturePoints_element; k++) {
      n_grad_u = 0.0;
      for (I = 0; I < nSpace; I++) {
        n_grad_u += grad_u[eN * nQuadraturePoints_element * nSpace + k * nSpace + I] * grad_u[eN * nQuadraturePoints_element * nSpace + k * nSpace + I];
      }
      num = shockCapturingDiffusion * 0.5 * h * fabs(strong_residual[eN * nQuadraturePoints_element + k]);
      den = sqrt(n_grad_u) + 1.0e-8;
      numDiff[eN * nQuadraturePoints_element + k] = num / den;
    }
  }
}
```