user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<polyfit>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %rsi,0x28(%rsp)
  mov    %edx,%ebp
  mov    %rcx,%r14
  mov    %r8d,0x1c(%rsp)
  lea    0x1(%r8),%ebx
  movslq %edx,%rsi
  mov    %rsi,0x20(%rsp)
  lea    0x0(,%rdx,8),%r15d
  mov    %r15d,%eax
  imul   %ebx,%eax
  mov    %eax,0x8(%rsp)
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,%r13
  test   %ebp,%ebp
  jle    L69
  movslq %ebx,%r12
  shl    $0x3,%r12
  mov    0x10(%rsp),%rdi
  mov    %rdi,%rdx
  mov    0x1c(%rsp),%eax
  lea    -0x1(%rax),%eax
  lea    0x8(%r13,%rax,8),%rcx
  lea    -0x1(%rbp),%eax
  lea    0x8(%rdi,%rax,8),%rdi
  mov    %r13,%rsi
  movsd  D8(%rip),%xmm1
L17:
  movsd  %xmm1,(%rsi)
  cmp    $0x1,%ebx
  jle    L44
  mov    %rsi,%rax
L26:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  mulsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  cmp    %rcx,%rax
  jne    L26
L44:
  add    %r12,%rsi
  add    $0x8,%rdx
  add    %r12,%rcx
  cmp    %rdi,%rdx
  jne    L17
  mov    0x8(%rsp),%edi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %rax,0x8(%rsp)
  cmp    %ebp,%ebx
  mov    %ebp,%edi
  cmovle %ebx,%edi
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  mov    %r12,%r8
  mov    0x20(%rsp),%rsi
  shl    $0x3,%rsi
  mov    $0x0,%edi
  mov    $0x0,%r12d
  mov    0x1c(%rsp),%r10d
  lea    0x8(%r13),%r9
  jmp    L18
L7:
  movslq %edi,%rdx
  lea    0x0(%r13,%rdx,8),%rax
  add    %r10,%rdx
  lea    (%r9,%rdx,8),%rcx
  mov    %r8,%rdx
L21:
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x8,%rax
  add    %rsi,%rdx
  cmp    %rcx,%rax
  jne    L21
L41:
  lea    0x1(%r12),%eax
  add    $0x8,%r8
  add    %ebx,%edi
  cmp    %eax,%ebp
  je     L89
  mov    %eax,%r12d
L18:
  test   %ebx,%ebx
  jg     L7
  jmp    L41
L89:
  push   %rax
  push   %rbx
  mov    $0x0,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    0x20(%rsp),%rdx
  mov    %eax,%esi
  mov    0x18(%rsp),%rdi
  call   <qrdecomp_hh@plt>
  mov    %r15d,%edi
  call   <malloc@plt>
  mov    %rax,%r15
  mov    %r12d,%r12d
  lea    0x8(%rax,%r12,8),%rcx
  add    $0x10,%rsp
  mov    0x28(%rsp),%rdx
  sub    %rax,%rdx
L84:
  movsd  (%rdx,%rax,1),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rax,%rcx
  jne    L84
L81:
  push   $0x1
  push   %rbp
  mov    %ebx,%r9d
  mov    %ebp,%r8d
  mov    %r15,%rcx
  mov    0x20(%rsp),%rdx
  mov    %ebp,%esi
  mov    0x18(%rsp),%rdi
  call   <qrsolve_hh@plt>
  add    $0x10,%rsp
  test   %ebx,%ebx
  jle    L66
  mov    0x1c(%rsp),%eax
  lea    0x8(,%rax,8),%rdx
  mov    $0x0,%eax
L91:
  movsd  (%r15,%rax,1),%xmm0
  movsd  %xmm0,(%r14,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%rdx
  jne    L91
L66:
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L69:
  mov    0x8(%rsp),%edi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %rax,0x8(%rsp)
  cmp    %ebp,%ebx
  mov    %ebp,%edi
  cmovle %ebx,%edi
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    %rax,0x10(%rsp)
  push   %rbp
  push   %rbx
  mov    $0x0,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <qrdecomp_hh@plt>
  mov    %r15d,%edi
  call   <malloc@plt>
  mov    %rax,%r15
  add    $0x10,%rsp
  jmp    L81
```

tool_calls: name: retrieve_data
arguments: data_label: D8
datatype: byte[8]

tool: {"D8": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
void polyfit(const double *_x, const double *_y, int _n, double *_c, int _deg) {
  int m;
  double *x;
  int j;
  int i;
  m = _deg + 1;
  x = (double *)malloc(sizeof(*x) * _n * m);
  for (j = 0; j < _n; j++) {
    x[j * m + 0] = 1;
    for (i = 1; i < m; i++) {
      x[j * m + i] = x[j * m + i - 1] * _x[j];
    }
  }
  {
    double *qrt;
    double *d;
    double *b;
    qrt = (double *)malloc(sizeof(*qrt) * _n * m);
    d = (double *)malloc(sizeof(*d) * ((m) > (_n) ? (_n) : (m)));
    for (j = 0; j < _n; j++) {
      for (i = 0; i < m; i++) {
        qrt[i * _n + j] = x[j * m + i];
      }
    }
    qrdecomp_hh(qrt, _n, d, NULL, 0, NULL, m, _n);
    b = (double *)malloc(sizeof(*b) * _n);
    for (j = 0; j < _n; j++) {
      b[j] = _y[j];
    }
    qrsolve_hh(qrt, _n, d, b, _n, m, _n, 1);
    for (j = 0; j < m; j++) {
      _c[j] = b[j];
    }
    free(qrt);
    free(d);
    free(b);
  }
  free(x);
}
```