user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<calculateSubgridErrorShallowWater1D>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  movsd  %xmm0,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8,-0x48(%rbp)
  mov    %r9,-0x50(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L34
L19:
  movl   $0x0,-0x14(%rbp)
  jmp    L8
L38:
  mov    -0x18(%rbp),%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  movsd  %xmm2,-0x58(%rbp)
  mov    -0x18(%rbp),%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movsd  D1(%rip),%xmm0
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <fmax@plt>
  movapd %xmm0,%xmm1
  movsd  -0x58(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x18(%rbp),%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x30(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <fabs@plt>
  mov    %eax,%edi
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  -0x10(%rbp),%xmm0
  subsd  -0x8(%rbp),%xmm0
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x18(%rbp),%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x10(%rbp),%xmm0
  addsd  -0x8(%rbp),%xmm0
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x18(%rbp),%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L8:
  mov    -0x14(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L38
  addl   $0x1,-0x18(%rbp)
L34:
  mov    -0x18(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L19
  nop
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D1
type: byte[8]

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

assistant: ```c
void calculateSubgridErrorShallowWater1D(int nElements_global, int nQuadraturePoints_element, double g, double *elementDiameter, double *h, double *hu, double *cfl_1, double *cfl_2) {
  int eN, k;
  double u, c;
  for (eN = 0; eN < nElements_global; eN++) {
    for (k = 0; k < nQuadraturePoints_element; k++) {
      u = hu[eN * nQuadraturePoints_element + k] / fmax(h[eN * nQuadraturePoints_element + k], 1.0e-8);
      c = sqrt(fabs(g * h[eN * nQuadraturePoints_element + k]));
      cfl_1[eN * nQuadraturePoints_element + k] = (u - c) / elementDiameter[eN];
      cfl_2[eN * nQuadraturePoints_element + k] = (u + c) / elementDiameter[eN];
    }
  }
}
```