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

```asm
<ess>:
  endbr64
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  lea    -0x1(%rsi),%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %r12,%rdi
  sub    $0x20,%rsp
  call   <dvector@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  mov    %rax,%r14
  call   <dmean@plt>
  test   %r12,%r12
  je     L147
  pxor   %xmm5,%xmm5
  mov    %r14,%rcx
  lea    (%rbx,%rbp,8),%rsi
  mov    %rbp,%rdi
  xor    %edx,%edx
  movapd %xmm5,%xmm4
L232:
  movsd  (%rcx),%xmm3
  mov    %rbx,%rax
  movapd %xmm5,%xmm1
  test   %rdi,%rdi
  je     L134
L308:
  movsd  (%rax),%xmm1
  movsd  (%rax,%rdx,8),%xmm2
  add    $0x8,%rax
  subsd  %xmm0,%xmm1
  subsd  %xmm0,%xmm2
  mulsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm3
  movsd  %xmm3,(%rcx)
  cmp    %rax,%rsi
  jne    L308
  pxor   %xmm1,%xmm1
  cvtsi2sd %rdi,%xmm1
L134:
  divsd  %xmm1,%xmm3
  movsd  %xmm3,(%rcx)
  test   %rdx,%rdx
  jne    L197
  movsd  (%r14),%xmm4
L108:
  add    $0x1,%rdx
  add    $0x8,%rcx
  sub    $0x1,%rdi
  sub    $0x8,%rsi
  cmp    %rdx,%r12
  jne    L232
  mov    %rbp,%rbx
  jmp    L148
  nopl   0x0(%rax,%rax,1)
L197:
  test   $0x1,%dl
  jne    L108
  addsd  -0x8(%rcx),%xmm3
  comisd %xmm5,%xmm3
  jbe    L225
  addsd  %xmm3,%xmm3
  addsd  %xmm3,%xmm4
  jmp    L108
  nopw   0x0(%rax,%rax,1)
L225:
  lea    0x1(%rdx),%rbx
L148:
  test   %rbp,%rbp
  js     L223
  pxor   %xmm3,%xmm3
  cvtsi2sd %rbp,%xmm3
L187:
  movapd %xmm4,%xmm0
  divsd  %xmm3,%xmm0
  ucomisd %xmm0,%xmm5
  ja     L36
  pxor   %xmm0,%xmm0
  cvtsi2sd %rbx,%xmm0
  addsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm0
L251:
  movsd  (%r14),%xmm6
  ucomisd %xmm5,%xmm6
  jp     L215
  movsd  D5(%rip),%xmm2
  jne    L215
L51:
  divsd  %xmm3,%xmm0
  ucomisd %xmm0,%xmm5
  ja     L4
L155:
  add    $0x20,%rsp
  movapd %xmm2,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L215:
  test   %r13,%r13
  js     L114
  pxor   %xmm1,%xmm1
  cvtsi2sd %r13,%xmm1
L239:
  mulsd  %xmm4,%xmm1
  divsd  %xmm6,%xmm1
  ucomisd %xmm5,%xmm1
  jp     L293
  je     L229
L293:
  imul   %r13,%rbp
  test   %rbp,%rbp
  js     L328
  pxor   %xmm2,%xmm2
  cvtsi2sd %rbp,%xmm2
L107:
  divsd  %xmm1,%xmm2
  jmp    L51
L223:
  mov    %rbp,%rax
  mov    %rbp,%rcx
  pxor   %xmm3,%xmm3
  shr    %rax
  and    $0x1,%ecx
  or     %rcx,%rax
  cvtsi2sd %rax,%xmm3
  addsd  %xmm3,%xmm3
  jmp    L187
L328:
  mov    %rbp,%rax
  and    $0x1,%ebp
  pxor   %xmm2,%xmm2
  shr    %rax
  or     %rbp,%rax
  cvtsi2sd %rax,%xmm2
  addsd  %xmm2,%xmm2
  jmp    L107
L114:
  mov    %r13,%rax
  mov    %r13,%rdx
  pxor   %xmm1,%xmm1
  shr    %rax
  and    $0x1,%edx
  or     %rdx,%rax
  cvtsi2sd %rax,%xmm1
  addsd  %xmm1,%xmm1
  jmp    L239
L147:
  movsd  (%r14),%xmm3
  pxor   %xmm5,%xmm5
  ucomisd %xmm5,%xmm3
  jp     L62
  movsd  D5(%rip),%xmm2
  je     L155
L62:
  test   %r13,%r13
  js     L198
  pxor   %xmm0,%xmm0
  cvtsi2sd %r13,%xmm0
L82:
  mulsd  %xmm5,%xmm0
  divsd  %xmm3,%xmm0
  ucomisd %xmm5,%xmm0
  movapd %xmm0,%xmm1
  jp     L159
  je     L144
L159:
  movsd  D15(%rip),%xmm0
  movsd  D5(%rip),%xmm3
  jmp    L293
L198:
  mov    %r13,%rax
  mov    %r13,%rdx
  pxor   %xmm0,%xmm0
  shr    %rax
  and    $0x1,%edx
  or     %rdx,%rax
  cvtsi2sd %rax,%xmm0
  addsd  %xmm0,%xmm0
  jmp    L82
L144:
  movsd  D5(%rip),%xmm2
  jmp    L155
L4:
  movsd  %xmm2,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x8(%rsp),%xmm2
  jmp    L155
L229:
  movsd  D5(%rip),%xmm2
  jmp    L51
L36:
  movsd  %xmm5,0x18(%rsp)
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm3,0x8(%rsp)
  call   <sqrt@plt>
  pxor   %xmm0,%xmm0
  movsd  0x18(%rsp),%xmm5
  movsd  0x10(%rsp),%xmm4
  cvtsi2sd %rbx,%xmm0
  movsd  0x8(%rsp),%xmm3
  addsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm0
  jmp    L251
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D5
data_type: f64
name: extract_symbolic_data
arguments: data_label: D15
data_type: f32[2]

tool: D5: 1

tool: {"D15": [0.0,2.25]}

assistant: ```c
double ess(double *values, size_t samples, size_t stepSize) {
  size_t maxLag = samples - 1;
  double *gammaStat = dvector(maxLag);
  double varStat = 0.0;
  double mean = dmean(values, samples);
  for (size_t lag = 0; lag < maxLag; lag++) {
    for (size_t j = 0; j < samples - lag; j++) {
      double del1 = values[j] - mean;
      double del2 = values[j + lag] - mean;
      gammaStat[lag] += (del1 * del2);
    }
    gammaStat[lag] /= ((double)(samples - lag));
    if (lag == 0) {
      varStat = gammaStat[0];
    } else if (lag % 2 == 0) {
      if (gammaStat[lag - 1] + gammaStat[lag] > 0) {
        varStat += 2.0 * (gammaStat[lag - 1] + gammaStat[lag]);
      } else
        maxLag = lag;
    }
  }
  double stdErrorOfMean = sqrt(varStat / samples);
  double ACT;
  double ESS;
  if (gammaStat[0] == 0)
    ACT = 0;
  else
    ACT = stepSize * varStat / gammaStat[0];
  if (ACT == 0)
    ESS = 1;
  else
    ESS = (stepSize * samples) / ACT;
  double stdErrOfACT = (2.0 * sqrt(2.0 * (2.0 * (double)(maxLag + 1)) / samples) * (varStat / gammaStat[0]) * stepSize);
  return ESS;
}
```