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

```asm
<changeerror>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    %r8,-0x68(%rbp)
  mov    %r9,-0x70(%rbp)
  mov    -0x68(%rbp),%rax
  movsd  D4(%rip),%xmm0
  movsd  %xmm0,(%rax)
  cmpl   $0x0,-0x44(%rbp)
  jle    L10
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L60
L85:
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  ucomisd %xmm0,%xmm0
  jp     L33
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L33
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x30(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x28(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x20(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x10(%rbp),%xmm1
  movsd  D39(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
L33:
  addl   $0x1,-0x34(%rbp)
L60:
  mov    -0x34(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L85
  movsd  -0x10(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L88
  movsd  -0x30(%rbp),%xmm0
  divsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x68(%rbp),%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x10(%rbp),%xmm0
  cvttsd2si %xmm0,%edx
  mov    -0x70(%rbp),%rax
  mov    %edx,(%rax)
  movsd  -0x28(%rbp),%xmm0
  movapd %xmm0,%xmm1
  divsd  -0x10(%rbp),%xmm1
  movsd  -0x8(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  subsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L73
L63:
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x34(%rbp)
L73:
  mov    -0x34(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L63
  jmp    L53
L88:
  mov    -0x70(%rbp),%rax
  movl   $0x0,(%rax)
  movsd  D4(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  jmp    L53
L10:
  mov    -0x70(%rbp),%rax
  movl   $0x0,(%rax)
  movsd  D4(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
L53:
  movsd  -0x18(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D4
type_guessed: f32[2]
name: unpack_data
arguments: label: D39
type_guessed: f64

tool: {"D4": [0.0,-1.875]}

tool: D39: 1

assistant: ```c
double changeerror(int N, double *t, double *mag, double *sig, double *aveval, int *ngood) {
  double avesum1, avesum2, avesum3, ave, rmsval, n;
  int i;
  *aveval = -1.;
  if (N > 0) {
    avesum1 = 0.;
    avesum2 = 0.;
    avesum3 = 0.;
    n = 0;
    for (i = 0; i < N; i++) {
      if (!isnan(mag[i]) && sig[i] > 0.) {
        avesum1 += mag[i];
        avesum2 += mag[i] * mag[i];
        avesum3 += sig[i] * sig[i];
        n++;
      }
    }
    if (n > 0.) {
      ave = (avesum1 / (double)n);
      *aveval = ave;
      *ngood = n;
      rmsval = sqrt((avesum2 / (double)n) - (ave * ave));
      for (i = 0; i < N; i++) {
        sig[i] = rmsval;
      }
    } else {
      *ngood = 0;
      rmsval = -1.;
    }
  } else {
    *ngood = 0;
    rmsval = -1.;
  }
  return (rmsval);
}
```