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

```asm
<fit>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    %edx,%r14d
  mov    %rcx,%r15
  mov    %r8d,0x2c(%rsp)
  mov    %r9,%r12
  mov    0x70(%rsp),%rax
  movq   $0x0,(%rax)
  test   %r8d,%r8d
  jne    L194
  test   %edx,%edx
  jle    L66
  lea    0x1(%rdx),%edx
  mov    $0x1,%eax
  pxor   %xmm5,%xmm5
  movsd  %xmm5,0x10(%rsp)
  movsd  %xmm5,0x8(%rsp)
L148:
  movsd  0x8(%rsp),%xmm7
  addsd  (%rbx,%rax,8),%xmm7
  movsd  %xmm7,0x8(%rsp)
  movsd  0x10(%rsp),%xmm4
  addsd  0x0(%rbp,%rax,8),%xmm4
  movsd  %xmm4,0x10(%rsp)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L148
  pxor   %xmm7,%xmm7
  cvtsi2sd %r14d,%xmm7
  movsd  %xmm7,0x18(%rsp)
  movsd  0x8(%rsp),%xmm5
  divsd  %xmm7,%xmm5
  movsd  0x10(%rsp),%xmm4
  divsd  %xmm7,%xmm4
  lea    0x1(%r14),%edx
  mov    $0x1,%eax
  pxor   %xmm6,%xmm6
  movsd  %xmm6,0x20(%rsp)
  movsd  %xmm6,(%rsp)
L38:
  movsd  (%rbx,%rax,8),%xmm1
  subsd  %xmm5,%xmm1
  movsd  0x0(%rbp,%rax,8),%xmm0
  movapd %xmm0,%xmm2
  subsd  %xmm4,%xmm2
  movapd %xmm1,%xmm3
  mulsd  %xmm1,%xmm3
  addsd  (%rsp),%xmm3
  movsd  %xmm3,(%rsp)
  mulsd  %xmm2,%xmm2
  addsd  0x20(%rsp),%xmm2
  movsd  %xmm2,0x20(%rsp)
  mulsd  %xmm1,%xmm0
  addsd  (%r12),%xmm0
  movsd  %xmm0,(%r12)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L38
  jmp    L81
L194:
  test   %edx,%edx
  jle    L121
  mov    $0x1,%r13d
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x18(%rsp)
  movsd  %xmm7,0x10(%rsp)
  movsd  %xmm7,0x8(%rsp)
L147:
  cvttsd2si (%r15,%r13,8),%edi
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  movsd  D30(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  0x18(%rsp),%xmm6
  addsd  %xmm0,%xmm6
  movsd  %xmm6,0x18(%rsp)
  movapd %xmm0,%xmm1
  mulsd  (%rbx,%r13,8),%xmm1
  addsd  0x8(%rsp),%xmm1
  movsd  %xmm1,0x8(%rsp)
  mulsd  0x0(%rbp,%r13,8),%xmm0
  addsd  0x10(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  add    $0x1,%r13
  cmp    %r13d,%r14d
  jge    L147
  movsd  0x8(%rsp),%xmm3
  divsd  0x18(%rsp),%xmm3
  lea    0x1(%r14),%edx
  mov    $0x1,%eax
  pxor   %xmm7,%xmm7
  movsd  %xmm7,(%rsp)
L65:
  movsd  (%r15,%rax,8),%xmm1
  movsd  (%rbx,%rax,8),%xmm0
  subsd  %xmm3,%xmm0
  divsd  %xmm1,%xmm0
  movapd %xmm0,%xmm2
  mulsd  %xmm0,%xmm2
  addsd  (%rsp),%xmm2
  movsd  %xmm2,(%rsp)
  mulsd  0x0(%rbp,%rax,8),%xmm0
  divsd  %xmm1,%xmm0
  addsd  (%r12),%xmm0
  movsd  %xmm0,(%r12)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L65
  pxor   %xmm4,%xmm4
  movsd  %xmm4,0x20(%rsp)
L81:
  movsd  (%r12),%xmm0
  movsd  (%rsp),%xmm6
  divsd  %xmm6,%xmm0
  movsd  %xmm0,(%r12)
  movsd  0x8(%rsp),%xmm5
  mulsd  %xmm5,%xmm0
  movsd  0x10(%rsp),%xmm1
  subsd  %xmm0,%xmm1
  movsd  0x18(%rsp),%xmm4
  divsd  %xmm4,%xmm1
  mov    0x70(%rsp),%rax
  movsd  %xmm1,(%rax)
  movapd %xmm5,%xmm0
  mulsd  %xmm5,%xmm0
  movapd %xmm4,%xmm1
  mulsd  %xmm6,%xmm1
  divsd  %xmm1,%xmm0
  addsd  D30(%rip),%xmm0
  divsd  %xmm4,%xmm0
  cvttsd2si %xmm0,%edi
  call   <sqrt@plt>
  mov    0x80(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  D30(%rip),%xmm0
  divsd  (%rsp),%xmm0
  cvttsd2si %xmm0,%edi
  call   <sqrt@plt>
  mov    0x78(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    0x98(%rsp),%rax
  mov    D30(%rip),%rcx
  mov    %rcx,(%rax)
  mov    0x90(%rsp),%rax
  movq   $0x0,(%rax)
  cmpl   $0x0,0x2c(%rsp)
  jne    L15
  test   %r14d,%r14d
  jle    L130
  mov    0x70(%rsp),%rax
  movsd  (%rax),%xmm3
  movsd  (%r12),%xmm2
  lea    0x1(%r14),%edx
  mov    $0x1,%eax
  pxor   %xmm5,%xmm5
  movsd  %xmm5,(%rsp)
L124:
  movsd  0x0(%rbp,%rax,8),%xmm0
  subsd  %xmm3,%xmm0
  movapd %xmm2,%xmm1
  mulsd  (%rbx,%rax,8),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  %xmm0,%xmm0
  addsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L124
L196:
  lea    -0x2(%r14),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  (%rsp),%xmm0
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edi
  call   <sqrt@plt>
  mov    0x78(%rsp),%rax
  movapd %xmm0,%xmm5
  mulsd  (%rax),%xmm5
  movsd  %xmm5,(%rax)
  mov    0x80(%rsp),%rax
  mulsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  movsd  (%rsp),%xmm1
  divsd  0x20(%rsp),%xmm1
  movsd  D30(%rip),%xmm0
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edi
  call   <sqrt@plt>
  movq   %xmm0,%rbx
  mov    0x88(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    %r14d,%edi
  shr    $0x1f,%edi
  add    %r14d,%edi
  sar    %edi
  call   <sqrt@plt>
  movq   %rbx,%xmm5
  mulsd  %xmm0,%xmm5
  movapd %xmm5,%xmm0
  call   <erffc@plt>
  mov    0x90(%rsp),%rax
  movsd  %xmm0,(%rax)
L12:
  cmp    $0x2,%r14d
  jg     L132
L68:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L121:
  pxor   %xmm5,%xmm5
  movsd  %xmm5,0x18(%rsp)
  movsd  %xmm5,0x10(%rsp)
  movsd  %xmm5,0x8(%rsp)
  movsd  %xmm5,0x20(%rsp)
  movsd  %xmm5,(%rsp)
  jmp    L81
L130:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,(%rsp)
  jmp    L196
L15:
  test   %r14d,%r14d
  jle    L18
  mov    $0x1,%r13d
  pxor   %xmm4,%xmm4
  movsd  %xmm4,(%rsp)
L43:
  movsd  0x0(%rbp,%r13,8),%xmm0
  subsd  (%r12),%xmm0
  mov    0x70(%rsp),%rax
  movsd  (%rax),%xmm1
  mulsd  (%rbx,%r13,8),%xmm1
  subsd  %xmm1,%xmm0
  divsd  (%r15,%r13,8),%xmm0
  cvttsd2si %xmm0,%edi
  call   <sqrt@plt>
  addsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  add    $0x1,%r13
  cmp    %r13d,%r14d
  jge    L43
  jmp    L12
L18:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,(%rsp)
  jmp    L12
L132:
  movsd  D53(%rip),%xmm1
  sub    $0x2,%r14d
  pxor   %xmm0,%xmm0
  cvtsi2sd %r14d,%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  (%rsp),%xmm1
  call   <gammq@plt>
  mov    0x98(%rsp),%rax
  movsd  %xmm0,(%rax)
  jmp    L68
L66:
  pxor   %xmm7,%xmm7
  cvtsi2sd %edx,%xmm7
  movsd  %xmm7,0x18(%rsp)
  pxor   %xmm4,%xmm4
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm4,0x8(%rsp)
  movsd  %xmm4,0x20(%rsp)
  movsd  %xmm4,(%rsp)
  jmp    L81
```

tool_calls: name: parse_data
arguments: data_tag: D30
datatype: f64
name: parse_data
arguments: data_tag: D53
datatype: f64

tool: D30: 1

tool: D53: 0.5

assistant: ```c
void fit(double x[], double y[], int ndata, double sig[], int mwt, double *a, double *b, double *siga, double *sigb, double *r2, double *epsilon, double *q) {
  double gammq(double a, double x);
  double erfcc(double x);
  double erffc(double x);
  int i;
  double wt, t, sxoss, syoss, sx = 0.0, sy = 0.0, st2 = 0.0, ss, sigdat, chi2;
  double u, su2 = 0.0;
  *b = 0.0;
  if (mwt) {
    ss = 0.0;
    for (i = 1; i <= ndata; i++) {
      wt = 1.0 / sqrt(sig[i]);
      ss += wt;
      sx += x[i] * wt;
      sy += y[i] * wt;
    }
  } else {
    for (i = 1; i <= ndata; i++) {
      sx += x[i];
      sy += y[i];
    }
    ss = ndata;
  }
  sxoss = sx / ss;
  syoss = sy / ss;
  if (mwt) {
    for (i = 1; i <= ndata; i++) {
      t = (x[i] - sxoss) / sig[i];
      st2 += t * t;
      *a += t * y[i] / sig[i];
    }
  } else {
    for (i = 1; i <= ndata; i++) {
      t = x[i] - sxoss;
      u = y[i] - syoss;
      st2 += t * t;
      su2 += u * u;
      *a += t * y[i];
    }
  }
  *a /= st2;
  *b = (sy - sx * (*a)) / ss;
  *sigb = sqrt((1.0 + sx * sx / (ss * st2)) / ss);
  *siga = sqrt(1.0 / st2);
  chi2 = 0.0;
  *q = 1.0;
  *epsilon = 0.0;
  if (mwt) {
    for (i = 1; i <= ndata; i++)
      chi2 += sqrt((y[i] - (*a) - (*b) * x[i]) / sig[i]);
  } else {
    for (i = 1; i <= ndata; i++) {
      t = (y[i] - (*b) - (*a) * x[i]);
      chi2 += t * t;
    }
    sigdat = sqrt((chi2) / (ndata - 2));
    *siga *= sigdat;
    *sigb *= sigdat;
    *r2 = sqrt(1 - chi2 / su2);
    *epsilon = erffc((*r2) * sqrt(ndata / 2));
  }
  if (ndata > 2)
    *q = gammq(0.5 * (ndata - 2), 0.5 * (chi2));
}
```