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

```asm
<polyfit>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  movslq %edx,%rsi
  lea    0x0(,%rsi,8),%eax
  push   %rbp
  mov    %rsi,%r13
  mov    %rcx,%rbp
  push   %rbx
  mov    %eax,%edi
  lea    0x1(%r8),%ebx
  mov    %r13d,%r15d
  imul   %ebx,%edi
  sub    $0x48,%rsp
  mov    %edi,0x24(%rsp)
  mov    %r8d,0x8(%rsp)
  mov    %rsi,0x28(%rsp)
  mov    %eax,0x18(%rsp)
  call   <malloc@plt>
  cmp    %r13d,%ebx
  mov    0x24(%rsp),%edi
  cmovle %ebx,%r15d
  mov    %rax,0x10(%rsp)
  shl    $0x3,%r15d
  test   %r13d,%r13d
  jle    L11
  mov    0x8(%rsp),%esi
  mov    %rax,%rcx
  movslq %ebx,%r8
  movsd  D4(%rip),%xmm1
  shl    $0x3,%r8
  lea    -0x1(%rsi),%eax
  lea    0x10(%rcx,%rax,8),%rdx
  lea    -0x1(%r13),%eax
  mov    %eax,0x24(%rsp)
  shl    $0x3,%rax
  mov    %rax,0x38(%rsp)
  lea    0x8(%r14,%rax,1),%r9
  nopl   0x0(%rax)
L104:
  movsd  %xmm1,(%rcx)
  lea    0x8(%rcx),%rax
  movapd %xmm1,%xmm0
  cmp    $0x1,%ebx
  jle    L95
  nopl   0x0(%rax)
L14:
  mulsd  (%r14),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,-0x8(%rax)
  cmp    %rdx,%rax
  jne    L14
L95:
  add    $0x8,%r14
  add    %r8,%rcx
  add    %r8,%rdx
  cmp    %r9,%r14
  jne    L104
  mov    %r8,0x30(%rsp)
  call   <malloc@plt>
  mov    %r15d,%edi
  mov    %rax,%r14
  call   <malloc@plt>
  mov    %rax,%r15
  test   %ebx,%ebx
  jle    L30
  mov    0x8(%rsp),%eax
  mov    0x10(%rsp),%rsi
  mov    %r14,%r10
  xor    %r9d,%r9d
  mov    0x28(%rsp),%rdi
  mov    $0xfffffffffffffff8,%r11
  mov    0x30(%rsp),%r8
  shl    $0x3,%rax
  lea    0x8(%rsi,%rax,1),%rcx
  shl    $0x3,%rdi
  sub    %rax,%r11
  cs nopw 0x0(%rax,%rax,1)
L135:
  lea    (%r11,%rcx,1),%rax
  mov    %r10,%rdx
  nopw   0x0(%rax,%rax,1)
L102:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,(%rdx)
  add    %rdi,%rdx
  cmp    %rcx,%rax
  jne    L102
  add    $0x1,%r9d
  add    $0x8,%r10
  add    %r8,%rcx
  cmp    %r9d,%r13d
  jne    L135
L30:
  push   %r13
  xor    %ecx,%ecx
  mov    %r13d,%esi
  xor    %r9d,%r9d
  push   %rbx
  xor    %r8d,%r8d
  mov    %r15,%rdx
  mov    %r14,%rdi
  call   <qrdecomp_hh@plt>
  mov    0x28(%rsp),%edi
  call   <malloc@plt>
  pop    %rcx
  pop    %rsi
  mov    %rax,%r10
  lea    0x8(%r12),%rax
  cmp    %rax,%r10
  je     L71
  cmpl   $0x2,0x24(%rsp)
  jbe    L71
  mov    %r13d,%edx
  mov    %r12,%rcx
  mov    %r10,%rax
  shr    %edx
  sub    %r10,%rcx
  shl    $0x4,%rdx
  add    %r10,%rdx
  nopl   0x0(%rax)
L201:
  movupd (%rax,%rcx,1),%xmm2
  add    $0x10,%rax
  movups %xmm2,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L201
  mov    %r13d,%eax
  and    $0xfffffffe,%eax
  test   $0x1,%r13b
  je     L157
  movsd  (%r12,%rax,8),%xmm0
  movsd  %xmm0,(%r10,%rax,8)
L157:
  push   $0x1
  mov    %r13d,%r8d
  mov    %r10,%rcx
  mov    %r14,%rdi
  push   %r13
  mov    %ebx,%r9d
  mov    %r15,%rdx
  mov    %r13d,%esi
  mov    %r10,0x28(%rsp)
  call   <qrsolve_hh@plt>
  test   %ebx,%ebx
  pop    %rdi
  pop    %r8
  mov    0x18(%rsp),%r10
  jle    L185
  lea    0x8(%r10),%rax
  cmp    %rax,%rbp
  je     L68
  cmpl   $0x2,0x8(%rsp)
  jbe    L68
  mov    %ebx,%edx
  xor    %eax,%eax
  shr    %edx
  shl    $0x4,%rdx
  nopl   0x0(%rax,%rax,1)
L107:
  movupd (%r10,%rax,1),%xmm3
  movups %xmm3,0x0(%rbp,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L107
  mov    %ebx,%eax
  and    $0xfffffffe,%eax
  and    $0x1,%ebx
  je     L185
  cltq
  movsd  (%r10,%rax,8),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
L185:
  mov    %r14,%rdi
  mov    %r10,0x8(%rsp)
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <free@plt>
L71:
  mov    0x38(%rsp),%rax
  sub    %r10,%r12
  lea    0x8(%r10,%rax,1),%rdx
  mov    %r10,%rax
  nopl   0x0(%rax,%rax,1)
L203:
  movsd  (%r12,%rax,1),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rdx
  jne    L203
  jmp    L157
L68:
  mov    0x8(%rsp),%eax
  lea    0x8(,%rax,8),%rdx
  xor    %eax,%eax
  nop
L84:
  movsd  (%r10,%rax,1),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,1)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L84
  jmp    L185
L11:
  call   <malloc@plt>
  mov    %r15d,%edi
  mov    %rax,%r14
  call   <malloc@plt>
  push   %r13
  xor    %r9d,%r9d
  xor    %r8d,%r8d
  push   %rbx
  mov    %rax,%rdx
  xor    %ecx,%ecx
  mov    %r13d,%esi
  mov    %r14,%rdi
  mov    %rax,%r15
  call   <qrdecomp_hh@plt>
  mov    0x28(%rsp),%edi
  call   <malloc@plt>
  mov    %rax,%r10
  pop    %rax
  pop    %rdx
  jmp    L157
```

tool_calls: name: extract_symbolic_data
arguments: tag: D4
data_type: byte[8]

tool: {"D4": [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);
}
```