user: Please show me the C implementation that matches the assembly code listed below:

```asm
<slfit>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r12
  mov    %rdx,%rbx
  mov    %ecx,%r14d
  mov    %r9d,%r13d
  mov    0x50(%rsp),%r15
  mov    0x58(%rsp),%rbp
  movl   $0x0,0x0(%rbp)
  test   %ecx,%ecx
  jle    L207
  mov    %ecx,%edx
  mov    $0x0,%eax
  movss  D32(%rip),%xmm2
  mov    $0x0,%ecx
  jmp    L23
L117:
  add    $0x1,%rax
  cmp    %rdx,%rax
  je     L34
L23:
  movss  (%rsi,%rax,4),%xmm0
  movss  %xmm0,(%rbx,%rax,4)
  movss  (%r8,%rax,4),%xmm1
  ucomiss D35(%rip),%xmm1
  jp     L117
  jne    L117
  mulss  %xmm2,%xmm0
  movss  %xmm0,(%rbx,%rax,4)
  mov    %ecx,%r13d
  jmp    L117
L214:
  mov    $0x0,%eax
  pxor   %xmm4,%xmm4
  movaps %xmm4,%xmm3
  movaps %xmm4,%xmm1
  movss  D17(%rip),%xmm5
L136:
  movss  (%r8,%rax,4),%xmm0
  movaps %xmm0,%xmm2
  mulss  %xmm0,%xmm2
  movaps %xmm5,%xmm0
  divss  %xmm2,%xmm0
  addss  %xmm0,%xmm4
  movaps %xmm0,%xmm2
  mulss  (%r12,%rax,4),%xmm2
  addss  %xmm2,%xmm1
  mulss  (%rbx,%rax,4),%xmm0
  addss  %xmm0,%xmm3
  add    $0x1,%rax
  cmp    %eax,%r14d
  jg     L136
L57:
  movaps %xmm1,%xmm6
  divss  %xmm4,%xmm6
  mov    %r14d,%edx
  mov    $0x0,%eax
  pxor   %xmm7,%xmm7
  movss  %xmm7,0x8(%rsp)
  test   %r14d,%r14d
  jle    L94
L174:
  movss  (%r8,%rax,4),%xmm5
  movss  (%r12,%rax,4),%xmm0
  subss  %xmm6,%xmm0
  divss  %xmm5,%xmm0
  movss  (%rbx,%rax,4),%xmm2
  divss  %xmm5,%xmm2
  mulss  %xmm0,%xmm2
  addss  0x0(%rbp),%xmm2
  movss  %xmm2,0x0(%rbp)
  mulss  %xmm0,%xmm0
  addss  0x8(%rsp),%xmm0
  movss  %xmm0,0x8(%rsp)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L174
L94:
  movss  0x0(%rbp),%xmm0
  movss  0x8(%rsp),%xmm7
  divss  %xmm7,%xmm0
  movss  %xmm0,0x0(%rbp)
  mulss  %xmm1,%xmm0
  subss  %xmm0,%xmm3
  divss  %xmm4,%xmm3
  movss  %xmm3,(%r15)
  mulss  %xmm1,%xmm1
  movaps %xmm7,%xmm0
  mulss  %xmm4,%xmm0
  divss  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtss2sd %xmm1,%xmm0
  addsd  D11(%rip),%xmm0
  cvtss2sd %xmm4,%xmm4
  divsd  %xmm4,%xmm0
  cvtsd2ss %xmm0,%xmm0
  call   <sqrt@plt>
  mov    0x60(%rsp),%rax
  movss  %xmm0,(%rax)
  movss  D17(%rip),%xmm0
  divss  0x8(%rsp),%xmm0
  call   <sqrt@plt>
  mov    0x68(%rsp),%rax
  movss  %xmm0,(%rax)
  test   %r13d,%r13d
  jne    L79
  test   %r14d,%r14d
  jle    L91
  mov    %r14d,%eax
  mov    %rax,0x8(%rsp)
  mov    $0x0,%r13d
  pxor   %xmm1,%xmm1
L62:
  movss  (%rbx,%r13,4),%xmm0
  subss  (%r15),%xmm0
  movss  0x0(%rbp),%xmm2
  mulss  (%r12,%r13,4),%xmm2
  subss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  mov    $0x2,%edi
  call   <pow@plt>
  movaps %xmm0,%xmm1
  add    $0x1,%r13
  cmp    %r13,0x8(%rsp)
  jne    L62
L1:
  pxor   %xmm0,%xmm0
  cmp    $0x2,%r14d
  jg     L107
L90:
  mov    0x60(%rsp),%rax
  movaps %xmm0,%xmm1
  mulss  (%rax),%xmm1
  movss  %xmm1,(%rax)
  mov    0x68(%rsp),%rax
  mulss  (%rax),%xmm0
  movss  %xmm0,(%rax)
L79:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L91:
  pxor   %xmm1,%xmm1
  jmp    L1
L107:
  sub    $0x2,%r14d
  pxor   %xmm0,%xmm0
  cvtsi2ss %r14d,%xmm0
  divss  %xmm0,%xmm1
  movaps %xmm1,%xmm0
  call   <sqrt@plt>
  jmp    L90
L35:
  pxor   %xmm4,%xmm4
  movaps %xmm4,%xmm3
  movaps %xmm4,%xmm1
  jmp    L57
L34:
  test   %r13d,%r13d
  jne    L214
  mov    $0x0,%eax
  pxor   %xmm3,%xmm3
  movaps %xmm3,%xmm1
L141:
  addss  (%r12,%rax,4),%xmm1
  addss  (%rbx,%rax,4),%xmm3
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L141
  pxor   %xmm4,%xmm4
  cvtsi2ss %r14d,%xmm4
  movaps %xmm1,%xmm5
  divss  %xmm4,%xmm5
  mov    %r14d,%edx
  mov    $0x0,%eax
  pxor   %xmm6,%xmm6
  movss  %xmm6,0x8(%rsp)
L130:
  movss  (%r12,%rax,4),%xmm0
  subss  %xmm5,%xmm0
  movaps %xmm0,%xmm2
  mulss  %xmm0,%xmm2
  addss  0x8(%rsp),%xmm2
  movss  %xmm2,0x8(%rsp)
  mulss  (%rbx,%rax,4),%xmm0
  addss  0x0(%rbp),%xmm0
  movss  %xmm0,0x0(%rbp)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L130
  jmp    L94
L207:
  test   %r9d,%r9d
  jne    L35
  pxor   %xmm4,%xmm4
  cvtsi2ss %ecx,%xmm4
  pxor   %xmm3,%xmm3
  movaps %xmm3,%xmm1
  movss  %xmm3,0x8(%rsp)
  jmp    L94
```

tool_calls: name: parse_data
arguments: label: D32
datatype: f32
name: parse_data
arguments: label: D35
datatype: byte[4]
name: parse_data
arguments: label: D17
datatype: f32
name: parse_data
arguments: label: D11
datatype: f32[2]

tool: D32: 0.75

tool: {"D35": [0x00,0xc0,0x79,0xc4]}

tool: D17: 1

tool: {"D11": [0.0,1.875]}

assistant: ```c
void slfit(float *x, float *y, float *z, int ndata, float *sig, int weight, float *a, float *b, float *siga, float *sigb) {
  float sx = .0f;
  float sy = .0f;
  float st2 = .0f;
  float ss = .0f;
  *b = .0f;
  int q = 0;
  float sigdat = 0.0f;
  float t = 0.0f;
  float wt = 0.0f;
  float chi2 = 0.0f;
  float sxoss = 0.0f;
  int useweight = weight;
  int i = 0;
  for (i = 0; i < ndata; i++) {
    *(z + i) = *(y + i);
    if (*(sig + i) == -999.0) {
      useweight = 0;
      *(z + i) = 0.75 * (*(y + i));
    }
  }
  if (useweight) {
    for (i = 0; i < ndata; i++) {
      wt = 1.0 / (*(sig + i) * (*(sig + i)));
      ss = ss + wt;
      sx = sx + *(x + i) * wt;
      sy = sy + *(z + i) * wt;
    }
  } else {
    for (i = 0; i < ndata; i++) {
      sx = sx + *(x + i);
      sy = sy + *(z + i);
    }
    ss = (float)ndata;
  }
  sxoss = sx / ss;
  if (useweight) {
    for (i = 0; i < ndata; i++) {
      t = (*(x + i) - sxoss) / *(sig + i);
      *b = *b + t * (*(z + i) / *(sig + i));
      st2 = st2 + t * t;
    }
  } else {
    for (i = 0; i < ndata; i++) {
      t = (*(x + i) - sxoss);
      st2 = st2 + t * t;
      *b = *b + t * (*(z + i));
    }
  }
  *b = *b / st2;
  *a = (sy - sx * (*b)) / ss;
  *siga = sqrt((1.0 + sx * sx / (ss * st2)) / ss);
  *sigb = sqrt(1.0 / st2);
  chi2 = 0.0;
  if (!useweight) {
    for (i = 0; i < ndata; i++) {
      chi2 = pow((chi2 + ((*(z + i)) - *a - *b * (*(x + i)))), 2);
    }
    q = 1;
    sigdat = 0.0f;
    if (ndata > 2)
      sigdat = sqrt(chi2 / (ndata - 2));
    *siga = *siga * sigdat;
    *sigb = *sigb * sigdat;
  }
}
```