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

```asm
<ess>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %rdx,-0x78(%rbp)
  mov    -0x70(%rbp),%rax
  sub    $0x1,%rax
  mov    %rax,-0x60(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <dvector@plt>
  mov    %rax,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x58(%rbp)
  mov    -0x70(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <dmean@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x28(%rbp)
  movq   $0x0,-0x50(%rbp)
  jmp    L227
L111:
  movq   $0x0,-0x48(%rbp)
  jmp    L262
L230:
  mov    -0x48(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x48(%rbp),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x50(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x10(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  mov    -0x50(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x48(%rbp)
L262:
  mov    -0x70(%rbp),%rax
  sub    -0x50(%rbp),%rax
  cmp    %rax,-0x48(%rbp)
  jb     L230
  mov    -0x50(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x70(%rbp),%rax
  sub    -0x50(%rbp),%rax
  test   %rax,%rax
  js     L21
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L31
L21:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L31:
  mov    -0x50(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax)
  cmpq   $0x0,-0x50(%rbp)
  jne    L200
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x58(%rbp)
  jmp    L71
L200:
  mov    -0x50(%rbp),%rax
  and    $0x1,%eax
  test   %rax,%rax
  jne    L71
  mov    -0x50(%rbp),%rax
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x50(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L48
  mov    -0x50(%rbp),%rax
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x50(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm0
  movsd  -0x58(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x58(%rbp)
  jmp    L71
L48:
  mov    -0x50(%rbp),%rax
  mov    %rax,-0x60(%rbp)
L71:
  addq   $0x1,-0x50(%rbp)
L227:
  mov    -0x50(%rbp),%rax
  cmp    -0x60(%rbp),%rax
  jb     L111
  mov    -0x70(%rbp),%rax
  test   %rax,%rax
  js     L186
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L100
L186:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L100:
  movsd  -0x58(%rbp),%xmm1
  divsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jp     L242
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jne    L242
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  jmp    L252
L242:
  mov    -0x78(%rbp),%rax
  test   %rax,%rax
  js     L220
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L11
L220:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L11:
  mulsd  -0x58(%rbp),%xmm0
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
L252:
  pxor   %xmm0,%xmm0
  ucomisd -0x40(%rbp),%xmm0
  jp     L17
  pxor   %xmm0,%xmm0
  ucomisd -0x40(%rbp),%xmm0
  jne    L17
  movsd  D6(%rip),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  jmp    L74
L17:
  mov    -0x78(%rbp),%rax
  imul   -0x70(%rbp),%rax
  test   %rax,%rax
  js     L63
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L251
L63:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L251:
  divsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
L74:
  mov    -0x60(%rbp),%rax
  add    $0x1,%rax
  test   %rax,%rax
  js     L107
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L246
L107:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L246:
  addsd  %xmm0,%xmm0
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm1
  mov    -0x70(%rbp),%rax
  test   %rax,%rax
  js     L237
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L142
L237:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L142:
  divsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm1
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm2
  movsd  -0x58(%rbp),%xmm0
  divsd  %xmm2,%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x78(%rbp),%rax
  test   %rax,%rax
  js     L286
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L259
L286:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L259:
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x38(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D6
type_infered: f64

tool: D6: 1

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;
}
```