user: Converte this assembly snippet into its equivalent C code:

```asm
<circlefit>:
  endbr64
  pxor   %xmm1,%xmm1
  push   %r14
  mov    %r8,%r14
  push   %r13
  cvtsi2sd %esi,%xmm1
  mov    %esi,%r13d
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x60,%rsp
  movsd  %xmm1,0x10(%rsp)
  test   %esi,%esi
  jle    L93
  lea    -0x1(%rsi),%eax
  pxor   %xmm0,%xmm0
  mov    %rdi,%rdx
  shl    $0x4,%rax
  lea    0x10(%rdi,%rax,1),%rcx
  mov    %rdi,%rax
  nopl   0x0(%rax,%rax,1)
L32:
  movupd (%rax),%xmm6
  add    $0x10,%rax
  addpd  %xmm6,%xmm0
  cmp    %rcx,%rax
  jne    L32
  movsd  0x10(%rsp),%xmm1
  movapd %xmm0,%xmm12
  unpckhpd %xmm0,%xmm0
  divsd  %xmm1,%xmm0
  divsd  %xmm1,%xmm12
  movsd  %xmm0,0x8(%rsp)
  cmp    $0x1,%r13d
  je     L199
  mov    %r13d,%eax
  pxor   %xmm13,%xmm13
  movapd %xmm12,%xmm15
  shr    %eax
  movapd %xmm0,%xmm14
  unpcklpd %xmm15,%xmm15
  sub    $0x1,%eax
  unpcklpd %xmm14,%xmm14
  movapd %xmm13,%xmm3
  shl    $0x5,%rax
  movapd %xmm13,%xmm1
  movapd %xmm13,%xmm2
  lea    0x20(%rbx,%rax,1),%rax
  movapd %xmm13,%xmm9
  movapd %xmm13,%xmm8
  movapd %xmm13,%xmm6
  nopl   0x0(%rax)
L167:
  movupd (%rdx),%xmm0
  movupd 0x10(%rdx),%xmm5
  add    $0x20,%rdx
  movlpd -0x18(%rdx),%xmm5
  movhpd -0x10(%rdx),%xmm0
  subpd  %xmm14,%xmm5
  subpd  %xmm15,%xmm0
  movapd %xmm5,%xmm7
  movapd %xmm0,%xmm10
  mulpd  %xmm5,%xmm7
  mulpd  %xmm0,%xmm10
  movapd %xmm7,%xmm4
  addsd  %xmm7,%xmm8
  unpckhpd %xmm7,%xmm7
  addpd  %xmm10,%xmm4
  addsd  %xmm10,%xmm6
  unpckhpd %xmm10,%xmm10
  addsd  %xmm7,%xmm8
  movapd %xmm4,%xmm7
  addsd  %xmm10,%xmm6
  mulpd  %xmm4,%xmm7
  addsd  %xmm7,%xmm9
  unpckhpd %xmm7,%xmm7
  addsd  %xmm7,%xmm9
  movapd %xmm5,%xmm7
  mulpd  %xmm0,%xmm7
  mulpd  %xmm4,%xmm0
  mulpd  %xmm5,%xmm4
  addsd  %xmm7,%xmm2
  unpckhpd %xmm7,%xmm7
  addsd  %xmm0,%xmm1
  unpckhpd %xmm0,%xmm0
  addsd  %xmm7,%xmm2
  addsd  %xmm0,%xmm1
  movapd %xmm4,%xmm0
  unpckhpd %xmm4,%xmm4
  addsd  %xmm3,%xmm0
  addsd  %xmm0,%xmm4
  movapd %xmm4,%xmm3
  cmp    %rax,%rdx
  jne    L167
  mov    %r13d,%eax
  and    $0xfffffffe,%eax
  test   $0x1,%r13b
  je     L38
L154:
  cltq
  shl    $0x4,%rax
  add    %rbx,%rax
  movsd  (%rax),%xmm0
  movsd  0x8(%rax),%xmm5
  subsd  0x8(%rsp),%xmm5
  subsd  %xmm12,%xmm0
  movapd %xmm5,%xmm7
  mulsd  %xmm5,%xmm7
  movapd %xmm0,%xmm10
  mulsd  %xmm0,%xmm10
  movapd %xmm7,%xmm4
  addsd  %xmm7,%xmm8
  addsd  %xmm10,%xmm4
  addsd  %xmm10,%xmm6
  movapd %xmm4,%xmm7
  mulsd  %xmm4,%xmm7
  addsd  %xmm7,%xmm9
  movapd %xmm5,%xmm7
  mulsd  %xmm0,%xmm7
  mulsd  %xmm4,%xmm0
  mulsd  %xmm5,%xmm4
  addsd  %xmm7,%xmm2
  addsd  %xmm0,%xmm1
  addsd  %xmm4,%xmm3
L38:
  movapd %xmm6,%xmm5
  movsd  0x10(%rsp),%xmm6
  movapd %xmm2,%xmm14
  movapd %xmm8,%xmm4
  movapd %xmm9,%xmm0
  mov    $0x14,%edx
  movsd  D16(%rip),%xmm9
  movsd  D95(%rip),%xmm8
  divsd  %xmm6,%xmm14
  movsd  D40(%rip),%xmm15
  divsd  %xmm6,%xmm5
  movapd %xmm14,%xmm2
  movsd  %xmm14,0x28(%rsp)
  mulsd  %xmm14,%xmm2
  divsd  %xmm6,%xmm3
  movapd %xmm5,%xmm10
  movsd  %xmm5,0x18(%rsp)
  divsd  %xmm6,%xmm4
  movapd %xmm3,%xmm11
  movsd  %xmm3,0x30(%rsp)
  movapd %xmm5,%xmm3
  divsd  %xmm6,%xmm1
  mulsd  %xmm4,%xmm3
  addsd  %xmm4,%xmm10
  movsd  %xmm4,0x20(%rsp)
  mulsd  %xmm10,%xmm8
  subsd  %xmm2,%xmm3
  movapd %xmm10,%xmm2
  mulsd  %xmm10,%xmm2
  movsd  %xmm3,0x38(%rsp)
  mulsd  %xmm10,%xmm8
  movapd %xmm3,%xmm7
  movapd %xmm11,%xmm3
  mulsd  %xmm11,%xmm3
  divsd  %xmm6,%xmm0
  movapd %xmm4,%xmm6
  mulsd  %xmm3,%xmm5
  movapd %xmm1,%xmm4
  mulsd  %xmm1,%xmm4
  mulsd  %xmm4,%xmm6
  addsd  %xmm5,%xmm6
  movapd %xmm7,%xmm5
  mulsd  %xmm0,%xmm5
  subsd  %xmm0,%xmm8
  subsd  %xmm5,%xmm6
  movapd %xmm1,%xmm5
  addsd  %xmm1,%xmm5
  mulsd  %xmm11,%xmm5
  movsd  D9(%rip),%xmm11
  mulsd  %xmm14,%xmm5
  movapd %xmm8,%xmm14
  addsd  %xmm8,%xmm14
  subsd  %xmm5,%xmm6
  movapd %xmm7,%xmm5
  mulsd  %xmm2,%xmm5
  mulsd  %xmm9,%xmm7
  mulsd  %xmm10,%xmm2
  mulsd  %xmm10,%xmm9
  addsd  %xmm5,%xmm6
  movapd %xmm7,%xmm5
  movapd %xmm0,%xmm7
  movsd  D26(%rip),%xmm0
  mulsd  %xmm10,%xmm5
  mulsd  %xmm10,%xmm7
  mulsd  %xmm9,%xmm11
  addsd  %xmm7,%xmm5
  subsd  %xmm4,%xmm5
  movq   D2(%rip),%xmm4
  subsd  %xmm3,%xmm5
  subsd  %xmm2,%xmm5
  movapd %xmm13,%xmm2
  jmp    L183
  cs nopw 0x0(%rax,%rax,1)
L109:
  movapd %xmm3,%xmm2
L183:
  movapd %xmm15,%xmm3
  movapd %xmm2,%xmm15
  mulsd  %xmm9,%xmm15
  andpd  %xmm4,%xmm3
  addsd  %xmm8,%xmm15
  mulsd  %xmm2,%xmm15
  addsd  %xmm5,%xmm15
  mulsd  %xmm2,%xmm15
  addsd  %xmm6,%xmm15
  movapd %xmm15,%xmm7
  andpd  %xmm4,%xmm7
  comisd %xmm3,%xmm7
  ja     L158
  movapd %xmm2,%xmm3
  movapd %xmm15,%xmm7
  mulsd  %xmm11,%xmm3
  addsd  %xmm14,%xmm3
  mulsd  %xmm2,%xmm3
  addsd  %xmm5,%xmm3
  divsd  %xmm3,%xmm7
  movapd %xmm2,%xmm3
  subsd  %xmm7,%xmm3
  movapd %xmm13,%xmm7
  maxsd  %xmm3,%xmm7
  movapd %xmm7,%xmm3
  subsd  %xmm2,%xmm7
  divsd  %xmm3,%xmm7
  movapd %xmm7,%xmm2
  andpd  %xmm4,%xmm2
  comisd %xmm0,%xmm2
  jbe    L16
  sub    $0x1,%edx
  jne    L109
  lea    D37(%rip),%rdi
  movsd  %xmm13,0x58(%rsp)
  movsd  %xmm10,0x50(%rsp)
  movsd  %xmm1,0x48(%rsp)
  movsd  %xmm12,0x40(%rsp)
  call   <printf@plt>
  movsd  0x58(%rsp),%xmm13
  movsd  0x40(%rsp),%xmm12
  movsd  0x48(%rsp),%xmm1
  movsd  0x50(%rsp),%xmm10
  movq   D2(%rip),%xmm4
  movapd %xmm13,%xmm3
  movapd %xmm13,%xmm2
L206:
  mulsd  %xmm10,%xmm3
  movsd  0x28(%rsp),%xmm6
  movsd  0x30(%rsp),%xmm5
  movsd  0x20(%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  subsd  %xmm3,%xmm2
  movapd %xmm6,%xmm3
  addsd  0x38(%rsp),%xmm2
  mulsd  %xmm5,%xmm3
  mulsd  0x18(%rsp),%xmm5
  mulsd  %xmm1,%xmm6
  addsd  %xmm2,%xmm2
  subsd  %xmm3,%xmm0
  movapd %xmm5,%xmm1
  subsd  %xmm6,%xmm1
  divsd  %xmm2,%xmm0
  divsd  %xmm2,%xmm1
  movsd  %xmm0,0x0(%rbp)
  mulsd  %xmm0,%xmm0
  movsd  %xmm1,0x8(%rbp)
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  addsd  %xmm10,%xmm0
  ucomisd %xmm0,%xmm13
  ja     L35
  sqrtsd %xmm0,%xmm0
L10:
  movsd  %xmm0,(%r12)
  movsd  0x8(%rsp),%xmm0
  addsd  0x0(%rbp),%xmm12
  addsd  0x8(%rbp),%xmm0
  movsd  %xmm12,0x0(%rbp)
  movsd  %xmm0,0x8(%rbp)
  movq   $0x0,(%r14)
  test   %r13d,%r13d
  jle    L113
  lea    -0x1(%r13),%eax
  movapd %xmm13,%xmm2
  shl    $0x4,%rax
  lea    0x10(%rbx,%rax,1),%r13
  nopl   0x0(%rax,%rax,1)
L105:
  movsd  (%rbx),%xmm0
  movsd  0x8(%rbx),%xmm1
  subsd  0x0(%rbp),%xmm0
  subsd  0x8(%rbp),%xmm1
  mulsd  %xmm0,%xmm0
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  ucomisd %xmm0,%xmm13
  ja     L60
  sqrtsd %xmm0,%xmm0
  subsd  (%r12),%xmm0
  add    $0x10,%rbx
  andpd  %xmm4,%xmm0
  addsd  %xmm0,%xmm2
  movsd  %xmm2,(%r14)
  cmp    %rbx,%r13
  jne    L105
L74:
  divsd  0x10(%rsp),%xmm2
  movsd  %xmm2,(%r14)
  add    $0x60,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L158:
  lea    D49(%rip),%rdi
  movsd  %xmm13,0x58(%rsp)
  movsd  %xmm12,0x50(%rsp)
  movsd  %xmm1,0x48(%rsp)
  movsd  %xmm10,0x40(%rsp)
  call   <printf@plt>
  movsd  0x58(%rsp),%xmm13
  movsd  0x40(%rsp),%xmm10
  movsd  0x48(%rsp),%xmm1
  movsd  0x50(%rsp),%xmm12
  movq   D2(%rip),%xmm4
  movapd %xmm13,%xmm2
  movapd %xmm13,%xmm3
  jmp    L206
  nopl   0x0(%rax)
L16:
  movsd  0x20(%rsp),%xmm6
  movapd %xmm3,%xmm2
  mulsd  %xmm3,%xmm2
  subsd  %xmm3,%xmm6
  movsd  %xmm6,0x20(%rsp)
  movsd  0x18(%rsp),%xmm6
  subsd  %xmm3,%xmm6
  movsd  %xmm6,0x18(%rsp)
  jmp    L206
  nopl   (%rax)
L113:
  movapd %xmm13,%xmm2
  jmp    L74
  nopw   0x0(%rax,%rax,1)
L93:
  pxor   %xmm1,%xmm1
  pxor   %xmm12,%xmm12
  pxor   %xmm13,%xmm13
  cvtsi2sd %esi,%xmm1
  movapd %xmm13,%xmm3
  movapd %xmm13,%xmm2
  movapd %xmm13,%xmm9
  movapd %xmm13,%xmm8
  movapd %xmm13,%xmm6
  divsd  %xmm1,%xmm12
  movapd %xmm13,%xmm1
  movsd  %xmm12,0x8(%rsp)
  jmp    L38
L199:
  pxor   %xmm13,%xmm13
  xor    %eax,%eax
  movapd %xmm13,%xmm3
  movapd %xmm13,%xmm1
  movapd %xmm13,%xmm2
  movapd %xmm13,%xmm9
  movapd %xmm13,%xmm8
  movapd %xmm13,%xmm6
  jmp    L154
L60:
  movsd  %xmm2,0x18(%rsp)
  add    $0x10,%rbx
  movsd  %xmm13,0x8(%rsp)
  call   <sqrt@plt>
  subsd  (%r12),%xmm0
  movq   D2(%rip),%xmm4
  cmp    %rbx,%r13
  movsd  0x18(%rsp),%xmm2
  movsd  0x8(%rsp),%xmm13
  andpd  %xmm4,%xmm0
  addsd  %xmm0,%xmm2
  movsd  %xmm2,(%r14)
  jne    L105
  jmp    L74
L35:
  movsd  %xmm13,0x20(%rsp)
  movsd  %xmm12,0x18(%rsp)
  call   <sqrt@plt>
  movq   D2(%rip),%xmm4
  movsd  0x20(%rsp),%xmm13
  movsd  0x18(%rsp),%xmm12
  jmp    L10
```

tool_calls: name: parse_data
arguments: data_tag: D16
data_type: f32[2]
name: parse_data
arguments: data_tag: D95
data_type: f32[2]
name: parse_data
arguments: data_tag: D40
data_type: byte[8]
name: parse_data
arguments: data_tag: D9
data_type: f64
name: parse_data
arguments: data_tag: D26
data_type: byte[8]
name: parse_data
arguments: data_tag: D2
data_type: qword
name: parse_data
arguments: data_tag: D37
data_type: string
name: parse_data
arguments: data_tag: D49
data_type: string

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

tool: {"D95": [0.0,-2.125]}

tool: {"D40": [0x40,0x8c,0xb5,0x78,0x1d,0xaf,0x15,0x44]}

tool: D9: 3

tool: {"D26": [0x11,0xea,0x2d,0x81,0x99,0x97,0x71,0x3d]}

tool: D2: 9223372036854775807

tool: D37: Newton-Taubin don't converge.


tool: D49: WARNING: Newton-Taubin goes in wrong direction.


assistant: ```c
void circlefit(double pts[][2], int npoints, double *radius, double *center, double *detcoeff) {
  int point, iter;
  double centroid[2];
  double Mxx, Myy, Mzz, Mxy, Mxz, Myz;
  double Mz, Cov_xy;
  double A0, A1, A2, A3, A22, A33;
  double norm_pt[3];
  double new_pt[2], old_pt[2], epsilon, maxIter, Dy;
  double Det;
  double diff[2];
  for (point = 0; point < npoints; point++) {
    centroid[0] += pts[point][0];
    centroid[1] += pts[point][1];
  }
  centroid[0] /= (double)npoints;
  centroid[1] /= (double)npoints;
  Mxx = 0.0;
  Myy = 0.0;
  Mzz = 0.0;
  Mxy = 0.0;
  Mxz = 0.0;
  Myz = 0.0;
  for (point = 0; point < npoints; point++) {
    norm_pt[0] = pts[point][0] - centroid[0];
    norm_pt[1] = pts[point][1] - centroid[1];
    norm_pt[2] = norm_pt[0] * norm_pt[0] + norm_pt[1] * norm_pt[1];
    Mxx += norm_pt[0] * norm_pt[0];
    Myy += norm_pt[1] * norm_pt[1];
    Mzz += norm_pt[2] * norm_pt[2];
    Mxy += norm_pt[0] * norm_pt[1];
    Mxz += norm_pt[0] * norm_pt[2];
    Myz += norm_pt[1] * norm_pt[2];
  }
  Mxx /= (double)npoints;
  Myy /= (double)npoints;
  Mzz /= (double)npoints;
  Mxy /= (double)npoints;
  Mxz /= (double)npoints;
  Myz /= (double)npoints;
  Mz = Mxx + Myy;
  Cov_xy = Mxx * Myy - Mxy * Mxy;
  A0 = Mxz * Mxz * Myy + Myz * Myz * Mxx - Mzz * Cov_xy - 2.0 * Mxz * Myz * Mxy + Mz * Mz * Cov_xy;
  A1 = Mzz * Mz + 4 * Cov_xy * Mz - Mxz * Mxz - Myz * Myz - Mz * Mz * Mz;
  A2 = -3 * Mz * Mz - Mzz;
  A3 = 4 * Mz;
  A22 = 2.0 * A2;
  A33 = 3.0 * A3;
  new_pt[0] = 0.0;
  new_pt[1] = 1e+20;
  epsilon = 1e-12;
  maxIter = 20;
  iter = 0;
  do {
    old_pt[1] = new_pt[1];
    new_pt[1] = A0 + new_pt[0] * (A1 + new_pt[0] * (A2 + new_pt[0] * A3));
    if (fabs(new_pt[1]) > fabs(old_pt[1])) {
      new_pt[0] = 0.0;
      printf("WARNING: Newton-Taubin goes in wrong direction.\n");
      break;
    }
    Dy = A1 + new_pt[0] * (A22 + new_pt[0] * A33);
    old_pt[0] = new_pt[0];
    new_pt[0] = old_pt[0] - new_pt[1] / Dy;
    if (new_pt[0] < 0.0) {
      new_pt[0] = 0.0;
    }
  } while ((fabs((new_pt[0] - old_pt[0]) / new_pt[0]) > epsilon) && (++iter < maxIter));
  if (iter == maxIter) {
    new_pt[0] = 0.0;
    printf("Newton-Taubin don't converge.\n");
  }
  Det = new_pt[0] * new_pt[0] - new_pt[0] * Mz + Cov_xy;
  center[0] = (Mxz * (Myy - new_pt[0]) - Myz * Mxy) / (2.0 * Det);
  center[1] = (Myz * (Mxx - new_pt[0]) - Mxz * Mxy) / (2.0 * Det);
  *radius = sqrt(((center[0] * center[0]) + (center[1] * center[1])) + Mz);
  center[0] += centroid[0];
  center[1] += centroid[1];
  *detcoeff = 0.0;
  for (point = 0; point < npoints; point++) {
    diff[0] = pts[point][0] - center[0];
    diff[1] = pts[point][1] - center[1];
    *detcoeff += fabs((sqrt(diff[0] * diff[0] + diff[1] * diff[1])) - *radius);
  }
  *detcoeff /= npoints;
}
```