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

```asm
<calculateSubgridErrorStokes_GLS_tau_sd>:
  endbr64
  push   %r15
  mov    %edi,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x40,%rsp
  mov    %esi,-0x30(%rsp)
  mov    0x80(%rsp),%r12
  mov    0x78(%rsp),%rsi
  test   %edi,%edi
  jle    L117
  test   %ebx,%ebx
  jle    L117
  mov    %edx,%edi
  cmp    $0x1,%edx
  jne    L160
  mov    %rcx,%r10
  sub    $0x1,%eax
  movslq %ebx,%r15
  mov    %ebx,%r11d
  lea    0x8(%r10,%rax,8),%rax
  shl    $0x3,%r15
  lea    0x8(%r9),%r13
  mov    %rsi,%rcx
  mov    %rax,-0x78(%rsp)
  mov    %ebx,%eax
  mov    %r12,%rdx
  lea    0x8(%r8),%r14
  shr    %eax
  movsd  D78(%rip),%xmm6
  and    $0xfffffffe,%r11d
  xor    %edi,%edi
  sub    $0x1,%eax
  movsd  D68(%rip),%xmm5
  movapd D78(%rip),%xmm8
  add    $0x1,%rax
  movapd D68(%rip),%xmm7
  shl    $0x4,%rax
  mov    %rax,-0x70(%rsp)
  lea    -0x1(%rbx),%eax
  shl    $0x3,%rax
  sub    %r9,%rax
  mov    %rax,-0x68(%rsp)
  mov    $0xfffffffffffffff8,%rax
  sub    %r9,%rax
  mov    %rax,-0x60(%rsp)
  nopl   0x0(%rax,%rax,1)
L95:
  cmp    %r13,%rcx
  movsd  (%r10),%xmm1
  setne  %bl
  cmp    %r13,%rdx
  mulsd  %xmm1,%xmm1
  setne  %al
  and    %ebx,%eax
  cmpl   $0x1,-0x30(%rsp)
  setne  %bl
  and    %eax,%ebx
  cmp    %r14,%rcx
  setne  %al
  and    %ebx,%eax
  cmp    %r14,%rdx
  setne  %bl
  test   %bl,%al
  je     L110
  lea    0x8(%rcx),%rax
  cmp    %rax,%rdx
  je     L110
  mov    %rsi,0x78(%rsp)
  movapd %xmm1,%xmm9
  lea    -0x8(%r13),%rbp
  xor    %eax,%eax
  mov    -0x70(%rsp),%rsi
  lea    -0x8(%r14),%rbx
  unpcklpd %xmm9,%xmm9
  nopw   0x0(%rax,%rax,1)
L73:
  movupd 0x0(%rbp,%rax,1),%xmm0
  movupd (%rbx,%rax,1),%xmm2
  movapd %xmm7,%xmm3
  mulpd  %xmm8,%xmm0
  movapd %xmm0,%xmm4
  divpd  %xmm9,%xmm4
  divpd  %xmm2,%xmm0
  divpd  %xmm4,%xmm3
  movups %xmm3,(%rcx,%rax,1)
  movups %xmm0,(%rdx,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rsi
  jne    L73
  mov    0x78(%rsp),%rsi
  cmp    %r11d,-0x30(%rsp)
  je     L151
  lea    (%rdi,%r11,1),%eax
  cltq
  movsd  (%r9,%rax,8),%xmm0
  movsd  (%r8,%rax,8),%xmm2
  mulsd  %xmm6,%xmm0
  movapd %xmm0,%xmm3
  divsd  %xmm1,%xmm3
  movapd %xmm5,%xmm1
  divsd  %xmm2,%xmm0
  divsd  %xmm3,%xmm1
  movsd  %xmm1,(%rsi,%rax,8)
  movsd  %xmm0,(%r12,%rax,8)
L151:
  add    $0x8,%r10
  add    %r15,%r13
  add    %r15,%rcx
  add    %r15,%rdx
  add    %r15,%r14
  add    -0x30(%rsp),%edi
  cmp    %r10,-0x78(%rsp)
  jne    L95
L117:
  add    $0x40,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L110:
  mov    -0x60(%rsp),%rax
  mov    -0x68(%rsp),%rbx
  add    %r13,%rax
  add    %r13,%rbx
  nopl   0x0(%rax,%rax,1)
L2:
  movsd  (%r9,%rax,1),%xmm0
  movsd  (%r8,%rax,1),%xmm2
  movapd %xmm5,%xmm3
  mulsd  %xmm6,%xmm0
  movapd %xmm0,%xmm4
  divsd  %xmm1,%xmm4
  divsd  %xmm2,%xmm0
  divsd  %xmm4,%xmm3
  movsd  %xmm3,(%rsi,%rax,1)
  movsd  %xmm0,(%r12,%rax,1)
  add    $0x8,%rax
  cmp    %rbx,%rax
  jne    L2
  jmp    L151
L160:
  mov    %ebx,%r14d
  mov    %rcx,%rbp
  mov    %rcx,-0x60(%rsp)
  movslq %ebx,%rcx
  imul   %edi,%r14d
  lea    0x0(,%rcx,8),%rdx
  sub    $0x1,%eax
  mov    %r9,-0x50(%rsp)
  lea    0x8(%rbp,%rax,8),%rax
  mov    %rdx,-0x28(%rsp)
  mov    %rsi,%rdx
  movsd  D78(%rip),%xmm5
  mov    %rax,-0x20(%rsp)
  movsd  D68(%rip),%xmm4
  mov    %r14d,%r15d
  mov    %r14d,(%rsp)
  movapd D78(%rip),%xmm7
  imul   %edi,%r15d
  mov    %r8,-0x58(%rsp)
  movapd D68(%rip),%xmm6
  mov    %r9,-0x68(%rsp)
  movslq %r15d,%r10
  mov    %r15d,0x4(%rsp)
  lea    0x0(,%r10,8),%r15
  lea    -0x1(%rcx),%r10
  mov    %edi,%ecx
  imul   %edi,%ecx
  mov    %r10,%rax
  mov    %r15,0x8(%rsp)
  movslq %ecx,%r11
  lea    0x0(,%r11,8),%r13
  mov    %r13,%rcx
  imul   %r10,%rcx
  xor    %r10d,%r10d
  add    %r9,%rcx
  mov    %rcx,-0x48(%rsp)
  movslq %r14d,%rcx
  mov    %r10,%r14
  shl    $0x3,%rcx
  mov    %rcx,-0x18(%rsp)
  movslq %edi,%rcx
  lea    0x0(,%rcx,8),%rbp
  imul   %rbp,%rax
  test   %edi,%edi
  cmovs  %rax,%r10
  cmovns %rax,%r14
  mov    %ebx,%eax
  shl    $0x4,%r11
  shr    %eax
  mov    %r11,0x20(%rsp)
  xor    %r15d,%r15d
  sub    $0x1,%eax
  shl    $0x4,%rcx
  mov    %r14,-0x10(%rsp)
  xor    %r14d,%r14d
  add    $0x1,%rax
  mov    %rcx,0x28(%rsp)
  xor    %ecx,%ecx
  shl    $0x4,%rax
  mov    %r10,-0x8(%rsp)
  mov    %ecx,%r10d
  mov    %rax,0x18(%rsp)
  mov    %ebx,%eax
  and    $0xfffffffe,%ebx
  mov    %ebx,%r11d
  imul   %edi,%ebx
  sub    $0x1,%eax
  shl    $0x3,%rax
  sub    %r12,%rax
  imul   %ebx,%edi
  mov    %ebx,-0x78(%rsp)
  mov    -0x28(%rsp),%rbx
  sub    $0x8,%rbx
  mov    %edi,-0x70(%rsp)
  mov    %rax,%rdi
  mov    %r12,%rax
  mov    %rbx,0x10(%rsp)
  lea    0x8(%rdi),%rbx
  mov    %rbx,0x30(%rsp)
  mov    %r8,%rbx
  nopw   0x0(%rax,%rax,1)
L27:
  mov    -0x60(%rsp),%rdi
  mov    -0x10(%rsp),%r9
  movsd  (%rdi),%xmm2
  mov    -0x58(%rsp),%rdi
  mulsd  %xmm2,%xmm2
  mov    %rdi,%rcx
  add    %rdi,%r9
  sub    %rbx,%rcx
  add    -0x8(%rsp),%rcx
  lea    0x8(%rdx),%rdi
  mov    %r9,-0x40(%rsp)
  add    %rbx,%rcx
  mov    %rcx,-0x38(%rsp)
  mov    0x10(%rsp),%rcx
  lea    (%rcx,%rdx,1),%r9
  add    %rax,%rcx
  cmp    %rdi,%rax
  setne  %dil
  cmpl   $0x1,-0x30(%rsp)
  setne  %r8b
  and    %r8d,%edi
  cmp    %rdx,-0x48(%rsp)
  setb   %r8b
  cmp    -0x50(%rsp),%r9
  setb   -0x29(%rsp)
  or     -0x29(%rsp),%r8b
  and    %edi,%r8d
  cmp    %rax,-0x48(%rsp)
  setb   %dil
  cmp    -0x50(%rsp),%rcx
  setb   -0x29(%rsp)
  or     -0x29(%rsp),%dil
  and    %r8d,%edi
  cmp    %rdx,-0x40(%rsp)
  setb   %r8b
  cmp    -0x38(%rsp),%r9
  setb   %r9b
  or     %r9d,%r8d
  test   %r8b,%dil
  je     L129
  cmp    -0x40(%rsp),%rax
  seta   %dil
  cmp    -0x38(%rsp),%rcx
  setb   %cl
  or     %dil,%cl
  je     L129
  mov    %r10d,-0x40(%rsp)
  movapd %xmm2,%xmm9
  mov    -0x58(%rsp),%r8
  xor    %ecx,%ecx
  mov    %rsi,0x78(%rsp)
  mov    -0x50(%rsp),%rdi
  unpcklpd %xmm9,%xmm9
  mov    0x20(%rsp),%r10
  mov    0x28(%rsp),%r9
  mov    0x18(%rsp),%rsi
  nopw   0x0(%rax,%rax,1)
L161:
  movsd  (%rdi),%xmm0
  movsd  (%r8),%xmm1
  movapd %xmm6,%xmm3
  movhpd (%rdi,%r13,1),%xmm0
  movhpd (%r8,%rbp,1),%xmm1
  add    %r10,%rdi
  add    %r9,%r8
  mulpd  %xmm7,%xmm0
  movapd %xmm0,%xmm8
  divpd  %xmm9,%xmm8
  divpd  %xmm1,%xmm0
  divpd  %xmm8,%xmm3
  movups %xmm3,(%rdx,%rcx,1)
  movups %xmm0,(%rax,%rcx,1)
  add    $0x10,%rcx
  cmp    %rsi,%rcx
  jne    L161
  mov    -0x40(%rsp),%r10d
  mov    0x78(%rsp),%rsi
  cmp    -0x30(%rsp),%r11d
  je     L49
  mov    -0x78(%rsp),%edi
  lea    (%r14,%rdi,1),%ecx
  mov    -0x70(%rsp),%edi
  movslq %ecx,%rcx
  movsd  (%rbx,%rcx,8),%xmm1
  lea    (%r15,%rdi,1),%ecx
  mov    -0x68(%rsp),%rdi
  movslq %ecx,%rcx
  movsd  (%rdi,%rcx,8),%xmm0
  lea    (%r10,%r11,1),%ecx
  movslq %ecx,%rcx
  mulsd  %xmm5,%xmm0
  movapd %xmm0,%xmm3
  divsd  %xmm2,%xmm3
  movapd %xmm4,%xmm2
  divsd  %xmm1,%xmm0
  divsd  %xmm3,%xmm2
  movsd  %xmm2,(%rsi,%rcx,8)
  movsd  %xmm0,(%r12,%rcx,8)
L49:
  mov    -0x28(%rsp),%rcx
  mov    0x8(%rsp),%r9
  addq   $0x8,-0x60(%rsp)
  add    0x4(%rsp),%r15d
  add    %r9,-0x48(%rsp)
  mov    -0x60(%rsp),%rdi
  add    %rcx,%rax
  add    %rcx,%rdx
  add    %r9,-0x50(%rsp)
  add    (%rsp),%r14d
  mov    -0x18(%rsp),%r9
  add    -0x30(%rsp),%r10d
  add    %r9,-0x58(%rsp)
  cmp    %rdi,-0x20(%rsp)
  jne    L27
  jmp    L117
L129:
  mov    0x30(%rsp),%rdi
  mov    %rax,%rcx
  mov    -0x58(%rsp),%r8
  sub    %r12,%rcx
  lea    (%rdi,%rax,1),%r9
  mov    -0x50(%rsp),%rdi
  nopl   (%rax)
L121:
  movsd  (%rdi),%xmm0
  movsd  (%r8),%xmm1
  movapd %xmm4,%xmm3
  add    %r13,%rdi
  add    %rbp,%r8
  mulsd  %xmm5,%xmm0
  movapd %xmm0,%xmm8
  divsd  %xmm2,%xmm8
  divsd  %xmm1,%xmm0
  divsd  %xmm8,%xmm3
  movsd  %xmm3,(%rsi,%rcx,1)
  movsd  %xmm0,(%r12,%rcx,1)
  add    $0x8,%rcx
  cmp    %r9,%rcx
  jne    L121
  jmp    L49
```

tool_calls: name: read_data
arguments: data_label: D78
data_type: f64[2]
name: read_data
arguments: data_label: D68
data_type: f64[2]

tool: {"D78": [4.0,4.0]}

tool: {"D68": [1.0,1.0]}

assistant: ```c
void calculateSubgridErrorStokes_GLS_tau_sd(int nElements_global, int nQuadraturePoints_element, int nSpace, double *elementDiameter, double *pfac, double *a, double *tau0, double *tau1) {
  int eN, k;
  double h, viscosity, density;
  for (eN = 0; eN < nElements_global; eN++) {
    h = elementDiameter[eN];
    for (k = 0; k < nQuadraturePoints_element; k++) {
      viscosity = a[eN * nQuadraturePoints_element * nSpace * nSpace + k * nSpace * nSpace];
      density = pfac[eN * nQuadraturePoints_element * nSpace + k * nSpace + 0];
      tau0[eN * nQuadraturePoints_element + k] = 1.0 / (4.0 * viscosity / (h * h));
      tau1[eN * nQuadraturePoints_element + k] = 4.0 * viscosity / density;
    }
  }
}
```