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

```asm
<llsfit>:
  endbr64
  push   %r15
  mov    %edx,%r15d
  push   %r14
  mov    %r15d,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  lea    0x1(%rbx),%eax
  sub    $0xd8,%rsp
  mov    %eax,0xc4(%rsp)
  imul   %edx,%eax
  mov    0x120(%rsp),%rbp
  mov    %rcx,0xb0(%rsp)
  mov    0x110(%rsp),%rdi
  mov    %rsi,0x18(%rsp)
  mov    0x118(%rsp),%rsi
  mov    %rbp,%r13
  movslq %eax,%rdx
  mov    %r8,0xb8(%rsp)
  lea    0x0(%rbp,%rdx,8),%rcx
  mov    %rdi,0x60(%rsp)
  mov    %rcx,0x98(%rsp)
  lea    (%r15,%rax,1),%ecx
  sub    %r15d,%eax
  cltq
  mov    %rsi,0x20(%rsp)
  lea    0x0(%rbp,%rax,8),%rax
  mov    %ecx,0x90(%rsp)
  mov    %rax,0x88(%rsp)
  movslq %ebx,%rax
  shl    $0x3,%rax
  movl   $0x0,0x5c(%rsp)
  mov    %rax,0x80(%rsp)
  movslq %ecx,%rax
  lea    0x0(%rbp,%rax,8),%rax
  mov    %r9,0xa0(%rsp)
  mov    %rax,0xc8(%rsp)
  lea    -0x1(%rbx),%eax
  mov    %eax,0xc0(%rsp)
  mov    %rax,0xa8(%rsp)
  lea    0x8(%rdi,%rax,8),%rax
  mov    %rax,0x78(%rsp)
  lea    -0x1(%r15),%eax
  mov    %eax,0x94(%rsp)
  lea    0x8(%rsi),%rax
  mov    %rax,0x68(%rsp)
L89:
  xor    %eax,%eax
  test   %ebx,%ebx
  jle    L33
  mov    0xa8(%rsp),%rcx
  mov    0x20(%rsp),%rsi
  nopw   0x0(%rax,%rax,1)
L55:
  mov    %rax,%rdx
  mov    %eax,(%rsi,%rax,4)
  add    $0x1,%rax
  cmp    %rcx,%rdx
  jne    L55
  mov    0x94(%rsp),%edi
  mov    0x20(%rsp),%rax
  mov    %r13,(%rsp)
  xor    %r12d,%r12d
  mov    0xb0(%rsp),%r15
  mov    %ebx,0x10(%rsp)
  mov    %rdi,0x8(%rsp)
  mov    %rax,%rbx
  cs nopw 0x0(%rax,%rax,1)
L173:
  xor    %ebp,%ebp
  mov    %rbp,%r13
  mov    %r15,%rbp
  test   %r14d,%r14d
  jle    L105
  nopl   (%rax)
L24:
  mov    (%rbx),%eax
  mov    (%rsp),%rdi
  movsd  0x0(%rbp,%r13,8),%xmm0
  imul   %r14d,%eax
  add    %r13d,%eax
  cltq
  lea    (%rdi,%rax,8),%r15
  mov    0x18(%rsp),%rax
  mov    %r12d,%edi
  call   *%rax
  mov    %r13,%rax
  add    $0x1,%r13
  movsd  %xmm0,(%r15)
  cmp    %rax,0x8(%rsp)
  jne    L24
  mov    %rbp,%r15
L105:
  add    $0x1,%r12d
  add    $0x4,%rbx
  cmp    %r12d,0x10(%rsp)
  jne    L173
  mov    0x10(%rsp),%ebx
  mov    (%rsp),%r13
L33:
  mov    0x94(%rsp),%ecx
  xor    %eax,%eax
  test   %r14d,%r14d
  jle    L257
  mov    0x98(%rsp),%rsi
  mov    0xb8(%rsp),%rdi
  nop
L252:
  movsd  (%rdi,%rax,8),%xmm0
  mov    %rax,%rdx
  movsd  %xmm0,(%rsi,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rcx
  jne    L252
L257:
  mov    0x5c(%rsp),%ecx
  test   %ecx,%ecx
  jne    L189
  test   %ebx,%ebx
  jle    L148
L30:
  mov    0x20(%rsp),%rax
  mov    %ebx,0x8(%rsp)
  mov    %r14d,%ebp
  mov    0x98(%rsp),%r15
  mov    0xa0(%rsp),%rbx
  movq   $0x0,0x40(%rsp)
  lea    0x4(%rax),%r12
  mov    0xc0(%rsp),%eax
  mov    %eax,0x58(%rsp)
  xchg   %ax,%ax
L125:
  mov    0x40(%rsp),%eax
  mov    0x5c(%rsp),%edx
  mov    %eax,0x4c(%rsp)
  mov    -0x4(%r12),%eax
  test   %edx,%edx
  je     L165
  imul   %ebp,%eax
  mov    %r15,%rcx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  cltq
  lea    0x0(%r13,%rax,8),%rdx
  xor    %eax,%eax
  call   <fdot@plt>
  pxor   %xmm7,%xmm7
  mov    %rbx,%rsi
  mov    %ebp,%edi
  cvtsi2sd %eax,%xmm7
  mov    -0x4(%r12),%eax
  imul   %ebp,%eax
  movsd  %xmm7,0x38(%rsp)
  cltq
  lea    0x0(%r13,%rax,8),%rdx
  xor    %eax,%eax
  mov    %rdx,%rcx
  call   <fdot@plt>
  pxor   %xmm7,%xmm7
  cvtsi2sd %eax,%xmm7
  movsd  %xmm7,(%rsp)
L4:
  movslq -0x4(%r12),%rdx
  mov    0x60(%rsp),%rsi
  mov    %ebp,%edi
  movsd  0x38(%rsp),%xmm0
  divsd  (%rsp),%xmm0
  mov    %rdx,%rax
  movsd  %xmm0,(%rsi,%rdx,8)
  mov    %r15,%rsi
  mov    %r15,%rdx
  imul   %ebp,%eax
  cltq
  lea    0x0(%r13,%rax,8),%rcx
  mov    $0x1,%eax
  call   <fortho@plt>
  mov    0x8(%rsp),%esi
  mov    0x58(%rsp),%edi
  mov    %esi,%eax
  sub    %edi,%eax
  cmp    %eax,%esi
  jle    L321
  lea    -0x1(%rdi),%eax
  mov    0x68(%rsp),%rsi
  mov    %r15,0x28(%rsp)
  mov    %r12,%r15
  mov    %eax,0x58(%rsp)
  add    0x40(%rsp),%rax
  lea    (%rsi,%rax,4),%rax
  mov    0x90(%rsp),%r14d
  mov    %rax,0x10(%rsp)
  mov    %r13,%rax
  mov    %rbx,%r13
  mov    %rax,%rbx
  nopl   0x0(%rax,%rax,1)
L327:
  mov    (%r15),%eax
  mov    %r13,%rsi
  mov    %ebp,%edi
  add    $0x4,%r15
  imul   %ebp,%eax
  cltq
  lea    (%rbx,%rax,8),%rcx
  mov    -0x4(%r12),%eax
  imul   %ebp,%eax
  cltq
  lea    (%rbx,%rax,8),%rdx
  xor    %eax,%eax
  call   <fdot@plt>
  pxor   %xmm0,%xmm0
  mov    -0x4(%r15),%ecx
  mov    %ebp,%edi
  cvtsi2sd %eax,%xmm0
  mov    0x8(%rsp),%eax
  mov    -0x4(%r12),%edx
  divsd  (%rsp),%xmm0
  imul   %ecx,%eax
  imul   %ebp,%ecx
  add    %r14d,%eax
  add    %edx,%eax
  imul   %ebp,%edx
  movslq %ecx,%rcx
  lea    (%rbx,%rcx,8),%rsi
  cltq
  movsd  %xmm0,(%rbx,%rax,8)
  mov    $0x1,%eax
  movslq %edx,%rdx
  lea    (%rbx,%rdx,8),%rcx
  mov    %rsi,%rdx
  call   <fortho@plt>
  cmp    %r15,0x10(%rsp)
  jne    L327
  mov    %rbx,%rax
  mov    0x28(%rsp),%r15
  mov    %r13,%rbx
  add    $0x4,%r12
  addq   $0x1,0x40(%rsp)
  mov    %rax,%r13
  jmp    L125
  nopw   0x0(%rax,%rax,1)
L165:
  mov    0x40(%rsp),%r14
  cmp    %r14d,0x8(%rsp)
  jle    L29
  mov    0x58(%rsp),%eax
  mov    %r12,0x70(%rsp)
  pxor   %xmm2,%xmm2
  movq   $0x0,(%rsp)
  mov    0x88(%rsp),%r12
  movq   $0x0,0x38(%rsp)
  lea    0x1(%r14,%rax,1),%rax
  mov    %rax,0x50(%rsp)
  mov    %ebp,%eax
  mov    %r14,%rbp
  mov    %eax,%r14d
  jmp    L214
  nopw   0x0(%rax,%rax,1)
L168:
  comisd %xmm0,%xmm2
  jbe    L285
  movsd  0x10(%rsp),%xmm6
  mov    %ebp,0x4c(%rsp)
  movapd %xmm0,%xmm2
  movsd  %xmm1,(%rsp)
  movsd  %xmm6,0x38(%rsp)
L285:
  add    $0x1,%rbp
  cmp    %rbp,0x50(%rsp)
  je     L201
L214:
  mov    0x20(%rsp),%rdi
  mov    %r15,%rcx
  mov    %rbx,%rsi
  mov    %ebp,0x10(%rsp)
  movsd  %xmm2,0x30(%rsp)
  mov    (%rdi,%rbp,4),%eax
  mov    %r14d,%edi
  imul   %r14d,%eax
  cltq
  lea    0x0(%r13,%rax,8),%rdx
  xor    %eax,%eax
  call   <fdot@plt>
  mov    0x20(%rsp),%rdi
  pxor   %xmm0,%xmm0
  mov    %rbx,%rsi
  cvtsi2sd %eax,%xmm0
  mov    (%rdi,%rbp,4),%eax
  mov    %r14d,%edi
  imul   %r14d,%eax
  movsd  %xmm0,0x10(%rsp)
  cltq
  lea    0x0(%r13,%rax,8),%rdx
  xor    %eax,%eax
  mov    %rdx,%rcx
  call   <fdot@plt>
  pxor   %xmm1,%xmm1
  mov    %r15,%rdx
  mov    %r12,%rsi
  cvtsi2sd %eax,%xmm1
  movsd  0x10(%rsp),%xmm0
  mov    0x20(%rsp),%rdi
  mov    (%rdi,%rbp,4),%eax
  mov    %r14d,%edi
  divsd  %xmm1,%xmm0
  imul   %r14d,%eax
  movsd  %xmm1,0x28(%rsp)
  cltq
  lea    0x0(%r13,%rax,8),%rcx
  mov    $0x1,%eax
  call   <fortho@plt>
  xor    %eax,%eax
  mov    %r12,%rcx
  mov    %r12,%rdx
  mov    %rbx,%rsi
  mov    %r14d,%edi
  call   <fdot@plt>
  movsd  0x30(%rsp),%xmm2
  pxor   %xmm4,%xmm4
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  0x28(%rsp),%xmm1
  ucomisd %xmm4,%xmm2
  jp     L168
  jne    L168
  movsd  0x10(%rsp),%xmm5
  mov    %ebp,0x4c(%rsp)
  movapd %xmm0,%xmm2
  add    $0x1,%rbp
  movsd  %xmm1,(%rsp)
  movsd  %xmm5,0x38(%rsp)
  cmp    %rbp,0x50(%rsp)
  jne    L214
L201:
  mov    0x70(%rsp),%r12
  mov    %r14d,%ebp
  mov    -0x4(%r12),%eax
L309:
  movslq 0x4c(%rsp),%rdx
  mov    0x20(%rsp),%rdi
  lea    (%rdi,%rdx,4),%rdx
  mov    (%rdx),%ecx
  mov    %ecx,-0x4(%r12)
  mov    %eax,(%rdx)
  jmp    L4
  cs nopw 0x0(%rax,%rax,1)
L321:
  mov    0x8(%rsp),%ebx
  mov    %ebp,%r14d
  mov    0x60(%rsp),%r8
  movslq 0xc0(%rsp),%r11
  mov    0x90(%rsp),%ebp
  mov    0x20(%rsp),%r9
  mov    %ebx,%r10d
  nopl   0x0(%rax,%rax,1)
L270:
  cmp    %r10d,%ebx
  jle    L315
  movslq (%r9,%r11,4),%rax
  movslq %r10d,%rcx
  lea    (%r8,%rax,8),%rsi
  mov    %rax,%rdi
  movsd  (%rsi),%xmm1
  nop
L94:
  movslq (%r9,%rcx,4),%rdx
  add    $0x1,%rcx
  mov    %edx,%eax
  imul   %ebx,%eax
  add    %ebp,%eax
  add    %edi,%eax
  cltq
  movsd  0x0(%r13,%rax,8),%xmm0
  mulsd  (%r8,%rdx,8),%xmm0
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rsi)
  cmp    %ecx,%ebx
  jg     L94
L315:
  sub    $0x1,%r11
  sub    $0x1,%r10d
  test   %r11d,%r11d
  jns    L270
L299:
  cmpl   $0x1,0x5c(%rsp)
  jne    L148
  mov    0xc4(%rsp),%eax
  mov    0xa0(%rsp),%r12
  mov    %r14d,%edi
  imul   %r14d,%eax
  mov    %r12,%rsi
  cltq
  lea    0x0(%r13,%rax,8),%rdx
  xor    %eax,%eax
  mov    %rdx,%rcx
  call   <fdot@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm7,%xmm7
  cltd
  idiv   %r14d
  cvtsi2sd %eax,%xmm0
  ucomisd %xmm0,%xmm7
  ja     L116
  add    $0xd8,%rsp
  sqrtsd %xmm0,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L148:
  movl   $0x1,0x5c(%rsp)
  jmp    L89
L189:
  test   %ebx,%ebx
  jle    L299
  mov    0x20(%rsp),%r15
  mov    %r14d,%eax
  mov    0x60(%rsp),%rbp
  mov    %ebx,0x8(%rsp)
  mov    0xc8(%rsp),%r12
  mov    0xa0(%rsp),%rbx
  mov    %r12,%r14
  mov    %r15,%r12
  mov    %eax,%r15d
  nopl   (%rax)
L153:
  mov    (%r12),%eax
  movsd  0x0(%rbp),%xmm0
  mov    %rbx,%rsi
  mov    %r15d,%edi
  add    $0x8,%rbp
  add    $0x4,%r12
  imul   %r15d,%eax
  mulsd  %xmm0,%xmm0
  cltq
  lea    0x0(%r13,%rax,8),%rdx
  xor    %eax,%eax
  mov    %rdx,%rcx
  movsd  %xmm0,(%rsp)
  call   <fdot@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  (%rsp),%xmm0
  movsd  %xmm0,(%r14)
  add    0x80(%rsp),%r14
  cmp    %rbp,0x78(%rsp)
  jne    L153
  mov    0x8(%rsp),%ebx
  mov    0x20(%rsp),%rdi
  mov    %r15d,%r14d
  xor    %esi,%esi
  mov    0x90(%rsp),%r8d
  mov    0xa8(%rsp),%r11
  nopl   0x0(%rax)
L16:
  mov    (%rdi,%rsi,4),%r9d
  mov    %esi,%ecx
  mov    %r9d,%eax
  imul   %ebx,%eax
  add    %r8d,%eax
  cltq
  movsd  0x0(%r13,%rax,8),%xmm0
  cmp    %rsi,%r11
  je     L30
  lea    0x1(%rsi),%r10
  mov    %r10,%rdx
  nopl   0x0(%rax,%rax,1)
L272:
  mov    (%rdi,%rdx,4),%eax
  imul   %ebx,%eax
  add    %r8d,%eax
  cltq
  movsd  0x0(%r13,%rax,8),%xmm1
  comisd %xmm0,%xmm1
  maxsd  %xmm0,%xmm1
  cmova  %edx,%ecx
  add    $0x1,%rdx
  movapd %xmm1,%xmm0
  cmp    %edx,%ebx
  jg     L272
  movslq %ecx,%rcx
  lea    (%rdi,%rcx,4),%rax
  mov    (%rax),%edx
  mov    %edx,(%rdi,%rsi,4)
  mov    %r10,%rsi
  mov    %r9d,(%rax)
  jmp    L16
L29:
  movq   $0x0,(%rsp)
  movq   $0x0,0x38(%rsp)
  jmp    L309
L116:
  add    $0xd8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <sqrt@plt>
```

assistant: ```c
double llsfit(int N, double (*f)(double, int), int D, double x[], double y[], double w[], double A[], int order[], double WORK[]) {
  int d, n, m, mmax, RUN;
  double chi, nchi, inner, norm, isave, nsave;
  for (RUN = 0; RUN <= 1; RUN++) {
    for (n = 0; n < N; n++)
      order[n] = n;
    for (n = 0; n < N; n++) {
      for (d = 0; d < D; d++)
        WORK[D * order[n] + (d)] = (*f)(x[d], n);
    }
    for (d = 0; d < D; d++)
      WORK[D * (N + 1) + (d)] = y[d];
    if (RUN) {
      for (n = 0; n < N; n++)
        WORK[D * (N + 2) + N * (n) + (0)] = A[n] * A[n] * fdot(D, w, &WORK[D * order[n] + (0)], &WORK[D * order[n] + (0)]);
      for (n = 0; n < N; n++) {
        chi = WORK[D * (N + 2) + N * (order[n]) + (0)];
        mmax = n;
        for (m = n + 1; m < N; m++) {
          if (WORK[D * (N + 2) + N * (order[m]) + (0)] > chi) {
            mmax = m;
            chi = WORK[D * (N + 2) + N * (order[m]) + (0)];
          }
        }
        m = order[n];
        order[n] = order[mmax];
        order[mmax] = m;
      }
    }
    for (n = 0; n < N; n++) {
      if (!RUN) {
        mmax = n;
        chi = isave = nsave = 0.0;
        for (m = n; m < N; m++) {
          inner = fdot(D, w, &WORK[D * order[m] + (0)], &WORK[D * (N + 1) + (0)]);
          norm = fdot(D, w, &WORK[D * order[m] + (0)], &WORK[D * order[m] + (0)]);
          fortho(D, &WORK[D * (N) + (0)], &WORK[D * (N + 1) + (0)], &WORK[D * order[m] + (0)], inner / norm);
          nchi = fdot(D, w, &WORK[D * (N) + (0)], &WORK[D * (N) + (0)]);
          if (!chi || (nchi < chi)) {
            chi = nchi;
            mmax = m;
            isave = inner;
            nsave = norm;
          }
        }
        m = order[n];
        order[n] = order[mmax];
        order[mmax] = m;
        inner = isave;
        norm = nsave;
      } else {
        inner = fdot(D, w, &WORK[D * order[n] + (0)], &WORK[D * (N + 1) + (0)]);
        norm = fdot(D, w, &WORK[D * order[n] + (0)], &WORK[D * order[n] + (0)]);
      }
      A[order[n]] = inner / norm;
      fortho(D, &WORK[D * (N + 1) + (0)], &WORK[D * (N + 1) + (0)], &WORK[D * order[n] + (0)], inner / norm);
      for (m = n + 1; m < N; m++) {
        inner = fdot(D, w, &WORK[D * order[n] + (0)], &WORK[D * order[m] + (0)]);
        WORK[D * (N + 2) + N * (order[m]) + (order[n])] = inner / norm;
        fortho(D, &WORK[D * order[m] + (0)], &WORK[D * order[m] + (0)], &WORK[D * order[n] + (0)], inner / norm);
      }
    }
    for (n = N - 1; n >= 0; n--)
      for (m = n + 1; m < N; m++)
        A[order[n]] -= WORK[D * (N + 2) + N * (order[m]) + (order[n])] * A[order[m]];
  }
  return sqrt(fdot(D, w, &WORK[D * (N + 1) + (0)], &WORK[D * (N + 1) + (0)]) / D);
}
```