user: Translate the below assembly code into C programming language:

```asm
<fitLine>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xe0,%rsp
  mov    %rdi,-0xb8(%rbp)
  mov    %esi,-0xbc(%rbp)
  mov    %rdx,-0xc8(%rbp)
  mov    %rcx,-0xd0(%rbp)
  mov    %r8d,-0xd4(%rbp)
  mov    %r9d,-0xd8(%rbp)
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0xc0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x0,-0xbc(%rbp)
  jg     L29
  mov    $0x0,%eax
  jmp    L106
L29:
  cmpl   $0x1,-0xbc(%rbp)
  jne    L153
  mov    -0xb8(%rbp),%rax
  movss  0x4(%rax),%xmm0
  mov    -0xc8(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0xd0(%rbp),%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    $0x1,%eax
  jmp    L106
L153:
  mov    -0xbc(%rbp),%eax
  sub    $0x1,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D38(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  mov    -0xbc(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x48(%rbp)
  mov    -0xbc(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x40(%rbp)
  mov    -0xbc(%rbp),%eax
  cltq
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <calloc@plt>
  mov    %rax,-0x38(%rbp)
  movl   $0x0,-0xa4(%rbp)
  jmp    L48
L117:
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0xa4(%rbp),%xmm0
  mulsd  -0x50(%rbp),%xmm0
  movsd  D13(%rip),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0xa4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0xa4(%rbp)
L48:
  mov    -0xa4(%rbp),%eax
  cmp    -0xbc(%rbp),%eax
  jl     L117
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x80(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x78(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x68(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x70(%rbp)
  movl   $0x0,-0xa4(%rbp)
  jmp    L112
L13:
  mov    -0xa4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0xa4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xb8(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  -0x80(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x80(%rbp)
  movsd  -0x10(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x18(%rbp),%xmm1
  movsd  -0x78(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x78(%rbp)
  movsd  -0x70(%rbp),%xmm0
  addsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x70(%rbp)
  addl   $0x1,-0xa4(%rbp)
L112:
  mov    -0xa4(%rbp),%eax
  cmp    -0xbc(%rbp),%eax
  jl     L13
  movsd  -0x70(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0xbc(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  -0x78(%rbp),%xmm0
  movsd  -0x80(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x58(%rbp)
  mov    -0xbc(%rbp),%eax
  mov    %eax,-0xa0(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0xbc(%rbp),%xmm1
  movsd  D20(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    $0x5,%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
  mov    %eax,-0x98(%rbp)
  movl   $0x0,-0x9c(%rbp)
  jmp    L46
L149:
  mov    -0xa0(%rbp),%eax
  mov    %eax,-0x94(%rbp)
  movsd  -0x58(%rbp),%xmm0
  mov    -0x60(%rbp),%rdi
  mov    -0xbc(%rbp),%ecx
  mov    -0x40(%rbp),%rdx
  mov    -0x48(%rbp),%rsi
  mov    -0xb8(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rdi,%xmm0
  mov    %rax,%rdi
  mov    $0x2,%eax
  call   <flattenData@plt>
  lea    -0x88(%rbp),%rdi
  lea    -0x90(%rbp),%rcx
  mov    -0xbc(%rbp),%edx
  mov    -0x38(%rbp),%rsi
  mov    -0x48(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <computeSigma@plt>
  mov    %eax,-0xa0(%rbp)
  pxor   %xmm1,%xmm1
  cvtss2sd -0xc0(%rbp),%xmm1
  movsd  -0x88(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0x28(%rbp),%rdi
  lea    -0x80(%rbp),%r9
  mov    -0xbc(%rbp),%r10d
  mov    -0x38(%rbp),%rcx
  mov    -0x40(%rbp),%rdx
  mov    -0x48(%rbp),%rsi
  mov    -0xb8(%rbp),%rax
  mov    -0xd4(%rbp),%r8d
  push   %r8
  lea    -0x70(%rbp),%r8
  push   %r8
  lea    -0x68(%rbp),%r8
  push   %r8
  lea    -0x78(%rbp),%r8
  push   %r8
  movq   %rdi,%xmm0
  mov    %r10d,%r8d
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <rejectPixels@plt>
  add    $0x20,%rsp
  mov    %eax,-0xa0(%rbp)
  cmpl   $0x0,-0xa0(%rbp)
  jle    L105
  movsd  -0x68(%rbp),%xmm0
  movsd  -0x80(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x70(%rbp),%xmm0
  movsd  -0x78(%rbp),%xmm1
  mulsd  -0x20(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0xa0(%rbp),%xmm1
  movsd  -0x68(%rbp),%xmm2
  mulsd  -0x20(%rbp),%xmm2
  subsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  -0x78(%rbp),%xmm0
  movsd  -0x68(%rbp),%xmm1
  mulsd  -0x60(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  movsd  -0x80(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x58(%rbp)
L105:
  mov    -0xa0(%rbp),%eax
  cmp    -0x94(%rbp),%eax
  jge    L66
  mov    -0xa0(%rbp),%eax
  cmp    -0x98(%rbp),%eax
  jl     L66
  addl   $0x1,-0x9c(%rbp)
L46:
  mov    -0x9c(%rbp),%eax
  cmp    -0xd8(%rbp),%eax
  jl     L149
L66:
  movsd  -0x60(%rbp),%xmm0
  subsd  -0x58(%rbp),%xmm0
  cvtsd2ss %xmm0,%xmm0
  mov    -0xc8(%rbp),%rax
  movss  %xmm0,(%rax)
  movsd  -0x58(%rbp),%xmm0
  mulsd  -0x50(%rbp),%xmm0
  cvtsd2ss %xmm0,%xmm0
  mov    -0xd0(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0xd0(%rbp),%rax
  movss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  comiss %xmm1,%xmm0
  jb     L33
  mov    -0xd0(%rbp),%rax
  movss  (%rax),%xmm0
  jmp    L58
L33:
  mov    -0xd0(%rbp),%rax
  movss  (%rax),%xmm0
  movss  D24(%rip),%xmm1
  xorps  %xmm1,%xmm0
L58:
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movsd  D33(%rip),%xmm0
  comisd %xmm1,%xmm0
  jbe    L124
  movsd  -0x30(%rbp),%xmm0
  mulsd  -0x50(%rbp),%xmm0
  cvtsd2ss %xmm0,%xmm0
  mov    -0xd0(%rbp),%rax
  movss  %xmm0,(%rax)
L124:
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0xa0(%rbp),%eax
L106:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L162
  call   <__stack_chk_fail@plt>
L162:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D38
type_infered: f64
name: disassemble_data
arguments: label: D13
type_infered: f64
name: disassemble_data
arguments: label: D20
type_infered: f64
name: disassemble_data
arguments: label: D24
type_infered: byte[4]
name: disassemble_data
arguments: label: D33
type_infered: f64

tool: D38: 2

tool: D13: 1

tool: D20: 0.5

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

tool: D33: 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);
}
```