user: What would the C source look like for the assembly code provided here?

```asm
<fitLine>:
  endbr64
  push   %r15
  xor    %r15d,%r15d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xc8,%rsp
  mov    %rdx,0x68(%rsp)
  mov    %rcx,0x70(%rsp)
  mov    %r8d,0x60(%rsp)
  mov    %r9d,0x1c(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xb8(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  jle    L11
  mov    %rdi,%r12
  mov    %esi,%ebx
  cmp    $0x1,%esi
  je     L135
  pxor   %xmm6,%xmm6
  lea    -0x1(%rsi),%eax
  movsd  D30(%rip),%xmm1
  movslq %esi,%r15
  cvtsd2ss %xmm0,%xmm6
  pxor   %xmm0,%xmm0
  movss  %xmm6,0x8(%rsp)
  lea    0x0(,%r15,4),%rbp
  cvtsi2sd %eax,%xmm0
  mov    %rbp,%rdi
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x20(%rsp)
  call   <malloc@plt>
  mov    %rbp,%rdi
  mov    %rax,%r14
  call   <malloc@plt>
  mov    $0x1,%esi
  mov    %r15,%rdi
  mov    %rax,%rbp
  call   <calloc@plt>
  movsd  D45(%rip),%xmm1
  movss  0x8(%rsp),%xmm6
  mov    %rax,%r13
  xor    %eax,%eax
  nopl   0x0(%rax)
L93:
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  0x20(%rsp),%xmm0
  subsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,0x0(%rbp,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%r15
  jne    L93
  movq   $0x0,0xb0(%rsp)
  pxor   %xmm3,%xmm3
  xor    %eax,%eax
  movapd %xmm3,%xmm2
  movapd %xmm3,%xmm4
  nopw   0x0(%rax,%rax,1)
L35:
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd 0x0(%rbp,%rax,4),%xmm0
  movapd %xmm0,%xmm5
  cvtss2sd (%r12,%rax,4),%xmm1
  add    $0x1,%rax
  mulsd  %xmm0,%xmm5
  addsd  %xmm1,%xmm2
  mulsd  %xmm1,%xmm0
  addsd  %xmm5,%xmm4
  addsd  %xmm0,%xmm3
  cmp    %rax,%r15
  jne    L35
  movsd  %xmm3,0xa0(%rsp)
  divsd  %xmm4,%xmm3
  pxor   %xmm0,%xmm0
  mov    $0x5,%eax
  movsd  %xmm2,0xa8(%rsp)
  cvtsi2sd %ebx,%xmm0
  movsd  %xmm4,0x98(%rsp)
  divsd  %xmm0,%xmm2
  mulsd  D12(%rip),%xmm0
  cvttsd2si %xmm0,%edx
  movapd %xmm3,%xmm1
  movsd  %xmm3,0x78(%rsp)
  cmp    %eax,%edx
  cmovge %edx,%eax
  mov    %eax,0x64(%rsp)
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  jle    L90
  lea    0x90(%rsp),%rax
  xor    %r11d,%r11d
  cvtss2sd %xmm6,%xmm6
  mov    %ebx,%r9d
  mov    %rax,0x30(%rsp)
  lea    0x88(%rsp),%rax
  mov    %r11d,%r15d
  mov    %rax,0x58(%rsp)
  lea    0x98(%rsp),%rax
  mov    %rax,0x38(%rsp)
  lea    0xa8(%rsp),%rax
  mov    %rax,0x48(%rsp)
  lea    0xb0(%rsp),%rax
  mov    %rax,0x50(%rsp)
  lea    0xa0(%rsp),%rax
  mov    %rax,0x40(%rsp)
  movsd  %xmm6,0x28(%rsp)
  jmp    L123
  cs nopw 0x0(%rax,%rax,1)
L119:
  movsd  0xb0(%rsp),%xmm0
  movsd  0x98(%rsp),%xmm5
  movsd  0xa0(%rsp),%xmm1
  movsd  0xa8(%rsp),%xmm2
  movapd %xmm0,%xmm4
  divsd  %xmm5,%xmm4
  movapd %xmm1,%xmm3
  mulsd  %xmm4,%xmm3
  mulsd  %xmm0,%xmm4
  subsd  %xmm3,%xmm2
  pxor   %xmm3,%xmm3
  cvtsi2sd %eax,%xmm3
  subsd  %xmm4,%xmm3
  divsd  %xmm3,%xmm2
  mulsd  %xmm2,%xmm0
  subsd  %xmm0,%xmm1
  divsd  %xmm5,%xmm1
  cmp    %eax,0x18(%rsp)
  jle    L145
  cmp    %eax,0x64(%rsp)
  jg     L145
  add    $0x1,%r15d
  cmp    %r15d,0x1c(%rsp)
  je     L145
L123:
  movapd %xmm2,%xmm0
  mov    %ebx,%ecx
  mov    %rbp,%rdx
  mov    %r14,%rsi
  mov    %r12,%rdi
  mov    $0x2,%eax
  mov    %r9d,0x18(%rsp)
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  call   <flattenData@plt>
  mov    0x30(%rsp),%r8
  mov    %ebx,%edx
  mov    %r13,%rsi
  mov    0x58(%rsp),%rcx
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <computeSigma@plt>
  mov    0x60(%rsp),%eax
  mov    %ebx,%r8d
  mov    %r13,%rcx
  movsd  0x28(%rsp),%xmm0
  mov    %rbp,%rdx
  mov    %r14,%rsi
  mov    %r12,%rdi
  mulsd  0x90(%rsp),%xmm0
  push   %rax
  mov    $0x1,%eax
  push   0x50(%rsp)
  push   0x60(%rsp)
  push   0x58(%rsp)
  mov    0x58(%rsp),%r9
  call   <rejectPixels@plt>
  add    $0x20,%rsp
  movsd  0x8(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm1
  test   %eax,%eax
  mov    %eax,%r9d
  jg     L119
L145:
  mov    %r9d,%r15d
L152:
  subsd  %xmm1,%xmm2
  mulsd  0x20(%rsp),%xmm1
  mov    0x68(%rsp),%rax
  cvtsd2ss %xmm2,%xmm2
  movss  %xmm2,(%rax)
  cvtsd2ss %xmm1,%xmm1
  comiss D0(%rip),%xmm1
  movaps %xmm1,%xmm0
  jae    L48
  xorps  D43(%rip),%xmm0
L48:
  movsd  D20(%rip),%xmm2
  cvtss2sd %xmm0,%xmm0
  comisd %xmm0,%xmm2
  ja     L46
  mov    0x70(%rsp),%rax
  movss  %xmm1,(%rax)
L54:
  mov    %r14,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
L11:
  mov    0xb8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L37
  add    $0xc8,%rsp
  mov    %r15d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L135:
  movss  0x4(%rdi),%xmm0
  mov    $0x1,%r15d
  movss  %xmm0,(%rdx)
  movl   $0x0,(%rcx)
  jmp    L11
  nop
L46:
  movsd  0x20(%rsp),%xmm0
  mulsd  0x78(%rsp),%xmm0
  mov    0x70(%rsp),%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  jmp    L54
L90:
  movsd  0x78(%rsp),%xmm1
  mov    %ebx,%r15d
  jmp    L152
L37:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D30
datatype: f64
name: extract_symbolic_data
arguments: label: D45
datatype: f64
name: extract_symbolic_data
arguments: label: D12
datatype: f64
name: extract_symbolic_data
arguments: label: D0
datatype: f64
name: extract_symbolic_data
arguments: label: D43
datatype: byte[16]
name: extract_symbolic_data
arguments: label: D20
datatype: f64

tool: D30: 2

tool: D45: 1

tool: D12: 0.5

tool: D0: 0

tool: {"D43": [0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: D20: 0.001

assistant: ```c
int fitLine(data, npix, zstart, zslope, krej, ngrow, maxiter)
float *data;
int npix;
float *zstart;
float *zslope;
float krej;
int ngrow;
int maxiter;
{
  int i, ngoodpix, last_ngoodpix, minpix, niter;
  double xscale, z0, dz, o_dz, x, z, mean, sigma, threshold;
  double sumxsqr, sumxz, sumz, sumx, rowrat;
  float *flat, *normx;
  char *badpix;
  if (npix <= 0)
    return (0);
  else if (npix == 1) {
    *zstart = data[1];
    *zslope = 0.0;
    return (1);
  } else
    xscale = 2.0 / (npix - 1);
  flat = (float *)malloc(npix * sizeof(float));
  normx = (float *)malloc(npix * sizeof(float));
  badpix = (char *)calloc(npix, sizeof(char));
  for (i = 0; i < npix; i++)
    normx[i] = i * xscale - 1.0;
  sumxsqr = 0;
  sumxz = 0;
  sumx = 0;
  sumz = 0;
  for (i = 0; i < npix; i++) {
    x = normx[i];
    z = data[i];
    sumxsqr = sumxsqr + (x * x);
    sumxz = sumxz + z * x;
    sumz = sumz + z;
  }
  z0 = sumz / npix;
  dz = o_dz = sumxz / sumxsqr;
  ngoodpix = npix;
  minpix = ((5) > ((int)(npix * 0.5)) ? (5) : ((int)(npix * 0.5)));
  for (niter = 0; niter < maxiter; niter++) {
    last_ngoodpix = ngoodpix;
    flattenData(data, flat, normx, npix, z0, dz);
    ngoodpix = computeSigma(flat, badpix, npix, &mean, &sigma);
    threshold = sigma * krej;
    ngoodpix = rejectPixels(data, flat, normx, badpix, npix, &sumxsqr, &sumxz, &sumx, &sumz, threshold, ngrow);
    if (ngoodpix > 0) {
      rowrat = sumx / sumxsqr;
      z0 = (sumz - rowrat * sumxz) / (ngoodpix - rowrat * sumx);
      dz = (sumxz - z0 * sumx) / sumxsqr;
    }
    if (ngoodpix >= last_ngoodpix || ngoodpix < minpix)
      break;
  }
  *zstart = z0 - dz;
  *zslope = dz * xscale;
  if (((*zslope) >= 0 ? (*zslope) : -(*zslope)) < 0.001)
    *zslope = o_dz * xscale;
  free((float *)flat);
  free((float *)normx);
  free((char *)badpix);
  return (ngoodpix);
}
```