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

```asm
<tw>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    %r8d,-0x74(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movl   $0x0,-0x48(%rbp)
  jmp    L23
L19:
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x40(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  addl   $0x1,-0x48(%rbp)
L23:
  mov    -0x48(%rbp),%eax
  cmp    -0x74(%rbp),%eax
  jl     L19
  movl   $0x0,-0x48(%rbp)
  jmp    L33
L5:
  mov    -0x74(%rbp),%eax
  sub    -0x48(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x44(%rbp),%eax
  add    $0x2,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x40(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x40(%rbp),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x44(%rbp),%xmm0
  movapd %xmm0,%xmm2
  mulsd  -0x38(%rbp),%xmm2
  movsd  -0x40(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  subsd  %xmm0,%xmm2
  divsd  %xmm2,%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x44(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  divsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x30(%rbp),%xmm0
  movsd  D24(%rip),%xmm1
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  movsd  %xmm0,-0x80(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  movapd %xmm0,%xmm3
  addsd  -0x80(%rbp),%xmm3
  movsd  %xmm3,-0x80(%rbp)
  movsd  -0x30(%rbp),%xmm0
  movsd  D24(%rip),%xmm1
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  movsd  %xmm0,-0x88(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  addsd  -0x88(%rbp),%xmm0
  mulsd  -0x80(%rbp),%xmm0
  divsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x30(%rbp),%xmm0
  movsd  D24(%rip),%xmm1
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  movsd  %xmm0,-0x80(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  addsd  -0x80(%rbp),%xmm0
  divsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x80(%rbp)
  movsd  -0x30(%rbp),%xmm0
  movsd  D24(%rip),%xmm1
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  movsd  D24(%rip),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,-0x88(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  movsd  D24(%rip),%xmm1
  divsd  %xmm0,%xmm1
  movapd %xmm1,%xmm6
  addsd  -0x88(%rbp),%xmm6
  movq   %xmm6,%rax
  movsd  D43(%rip),%xmm0
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <pow@plt>
  mulsd  -0x80(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x28(%rbp),%xmm0
  subsd  -0x20(%rbp),%xmm0
  divsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x28(%rbp),%rax
  movq   %rax,%xmm0
  call   <twtest@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x40(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x38(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  addl   $0x1,-0x48(%rbp)
L33:
  mov    -0x48(%rbp),%eax
  cmp    -0x74(%rbp),%eax
  jl     L5
  nop
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D24
type: f64
name: unpack_data
arguments: data_tag: D43
type: byte[8]

tool: D24: 1

tool: {"D43": [0x55,0x55,0x55,0x55,0x55,0x55,0xd5,0x3f]}

assistant: ```c
void tw(double *values, double *pvalues, double *twstat, double *effectn, int M) {
  int Mp, i;
  double nhat, lambda, mu, sigma, s, s2;
  s = 0;
  s2 = 0;
  for (i = 0; i < M; i++) {
    s += values[i];
    s2 += values[i] * values[i];
  }
  for (i = 0; i < M; i++) {
    Mp = M - i;
    nhat = (Mp + 2) * s * s / (Mp * s2 - s * s);
    lambda = values[i] * Mp / s;
    mu = (sqrt(nhat - 1) + sqrt(Mp)) * (sqrt(nhat - 1) + sqrt(Mp)) / nhat;
    sigma = (sqrt(nhat - 1) + sqrt(Mp)) / nhat * pow(1.0 / sqrt(nhat - 1) + 1.0 / sqrt(Mp), (double)(1.0 / 3.0));
    lambda = (lambda - mu) / sigma;
    pvalues[i] = twtest(lambda);
    twstat[i] = lambda;
    effectn[i] = nhat;
    s -= values[i];
    s2 -= values[i] * values[i];
  }
}
```