user: 请将以下的汇编代码转换成C语言代码：

```asm
<gaussfit>:
  endbr64
  push   %r15
  mov    %rsi,%r8
  mov    %rdi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  sub    $0x518,%rsp
  mov    %ecx,0x4(%rsp)
  lea    0x40(%rsp),%r13
  lea    0x2a0(%rsp),%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x508(%rsp)
  xor    %eax,%eax
  test   %edx,%edx
  jle    L127
  movsd  D87(%rip),%xmm4
  movsd  D52(%rip),%xmm3
  lea    0x1(%rdx),%r14d
  mov    $0x1,%ebx
  movsd  D84(%rip),%xmm5
  lea    0x40(%rsp),%r13
  pxor   %xmm1,%xmm1
  lea    0x2a0(%rsp),%r12
  jmp    L131
  nopl   (%rax)
L144:
  movsd  %xmm2,(%r12,%rbx,8)
  add    $0x1,%rbx
  cmp    %r14,%rbx
  je     L127
L131:
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  movsd  %xmm0,0x0(%r13,%rbx,8)
  movsd  (%r15,%rbx,8),%xmm0
  mulsd  %xmm4,%xmm0
  ucomisd %xmm0,%xmm1
  ja     L143
  sqrtsd %xmm0,%xmm0
L120:
  comisd %xmm0,%xmm1
  movapd %xmm3,%xmm2
  jae    L144
  ucomisd %xmm0,%xmm1
  ja     L19
  sqrtsd %xmm0,%xmm0
L100:
  movapd %xmm5,%xmm2
  divsd  %xmm0,%xmm2
  movsd  %xmm2,(%r12,%rbx,8)
  add    $0x1,%rbx
  cmp    %r14,%rbx
  jne    L131
L127:
  mov    0x4(%rsp),%eax
  movl   $0x0,0x34(%rsp)
  cmp    $0x1,%eax
  jle    L2
  movl   $0x1,0x38(%rsp)
  cmp    $0x2,%eax
  je     L2
  movl   $0x1,0x3c(%rsp)
L2:
  lea    0x20(%rsp),%rax
  movl   $0x2,0x1c(%rsp)
  lea    0x30(%rsp),%r14
  mov    %rax,0x10(%rsp)
  lea    0x28(%rsp),%rax
  mov    %r14,%rbx
  mov    %r8,%r14
  mov    %rax,0x8(%rsp)
  mov    %ebp,%eax
  mov    %r15,%rbp
  mov    %eax,%r15d
L123:
  mov    D91(%rip),%rax
  mov    %rbx,%r9
  mov    %r13,%rdi
  mov    %r14,%r8
  mov    %r15d,%ecx
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %rax,0x20(%rsp)
  push   $0x1
  push   0x18(%rsp)
  push   0x18(%rsp)
  mov    0x1c(%rsp),%eax
  push   %rax
  call   <mrqmin@plt>
  mov    %r13,%rax
  add    $0x20,%rsp
  mov    %rbx,%r13
  movl   $0x4,0x18(%rsp)
  mov    %rax,%rbx
L90:
  push   $0x0
  mov    %r13,%r9
  mov    %r14,%r8
  mov    %r15d,%ecx
  push   0x18(%rsp)
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  push   0x18(%rsp)
  mov    0x1c(%rsp),%eax
  push   %rax
  call   <mrqmin@plt>
  add    $0x20,%rsp
  subl   $0x1,0x18(%rsp)
  jne    L90
  mov    %rbx,%rax
  mov    %r13,%rbx
  mov    %r14,%r8
  mov    %r15d,%ecx
  mov    %rax,%r13
  mov    %rbx,%r9
  mov    %r12,%rdx
  mov    %rbp,%rsi
  movq   $0x0,0x20(%rsp)
  mov    %r13,%rdi
  push   $0xffffffffffffffff
  push   0x18(%rsp)
  push   0x18(%rsp)
  mov    0x1c(%rsp),%eax
  push   %rax
  call   <mrqmin@plt>
  add    $0x20,%rsp
  cmpl   $0x1,0x1c(%rsp)
  jne    L16
  mov    0x508(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L18
  add    $0x518,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L16:
  movl   $0x1,0x1c(%rsp)
  jmp    L123
L143:
  mov    %r8,0x8(%rsp)
  call   <sqrt@plt>
  mov    D84(%rip),%rax
  mov    0x8(%rsp),%r8
  pxor   %xmm1,%xmm1
  movq   %rax,%xmm5
  mov    D52(%rip),%rax
  movq   %rax,%xmm3
  mov    D87(%rip),%rax
  movq   %rax,%xmm4
  jmp    L120
L19:
  mov    %r8,0x8(%rsp)
  call   <sqrt@plt>
  mov    D84(%rip),%rax
  mov    0x8(%rsp),%r8
  pxor   %xmm1,%xmm1
  movq   %rax,%xmm5
  mov    D52(%rip),%rax
  movq   %rax,%xmm3
  mov    D87(%rip),%rax
  movq   %rax,%xmm4
  jmp    L100
L18:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D87
type_infered: f64
name: parse_data
arguments: data_label: D52
type_infered: byte[8]
name: parse_data
arguments: data_label: D84
type_infered: f64
name: parse_data
arguments: data_label: D91
type_infered: f32[2]

tool: D87: 0.001

tool: {"D52": [0x33,0x33,0x33,0x33,0x33,0x33,0xd3,0x3f]}

tool: D84: 1

tool: {"D91": [0.0,-1.875]}

assistant: ```c
int gaussfit(double *y, double *a, int nPts, int MA) {
  int i, iter, itst, k, mfit = MA;
  int getmem;
  double alamda, chisq, ochisq;
  double x[76], sig[76];
  int ia[4];
  for (i = 1; i <= nPts; i++) {
    x[i] = (double)(i);
    sig[i] = (sqrt(y[i] * 0.001));
    if (sig[i] <= 0.00)
      sig[i] = .3;
    else {
      sig[i] = 1.0 / sqrt((double)(sig[i]));
    }
  }
  ia[1] = 0;
  for (i = 2; i <= mfit; i++)
    ia[i] = 1;
  for (iter = 1; iter <= 2; iter++) {
    alamda = -1;
    getmem = 1;
    mrqmin(x, y, sig, nPts, a, ia, MA, &chisq, &alamda, getmem);
    k = 1;
    itst = 0;
    for (;;) {
      getmem = 0;
      k++;
      ochisq = chisq;
      mrqmin(x, y, sig, nPts, a, ia, MA, &chisq, &alamda, getmem);
      itst++;
      if (itst < 4)
        continue;
      alamda = 0.0;
      getmem = -1;
      mrqmin(x, y, sig, nPts, a, ia, MA, &chisq, &alamda, getmem);
      break;
    }
  }
  return 0;
}
```