user: Please show me the C implementation that matches the assembly code listed below:

```asm
<chebyshev_coefs>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  D24(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x54(%rbp),%eax
  add    $0x1,%eax
  mov    $0x8,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,-0x40(%rbp)
  mov    -0x40(%rbp),%rax
  movsd  D18(%rip),%xmm0
  movsd  %xmm0,(%rax)
  cmpl   $0x0,-0x54(%rbp)
  jne    L49
  mov    -0x40(%rbp),%rax
  jmp    L46
L49:
  mov    -0x54(%rbp),%eax
  add    $0x1,%eax
  mov    $0x8,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  add    $0x8,%rax
  movsd  D18(%rip),%xmm0
  movsd  %xmm0,(%rax)
  cmpl   $0x1,-0x54(%rbp)
  jne    L24
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x38(%rbp),%rax
  jmp    L46
L24:
  mov    -0x54(%rbp),%eax
  add    $0x1,%eax
  mov    $0x8,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,-0x30(%rbp)
  movl   $0x2,-0x44(%rbp)
  jmp    L51
L68:
  mov    -0x54(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x44(%rbp),%eax
  lea    -0x1(%rax),%ecx
  mov    -0x54(%rbp),%edi
  mov    -0x30(%rbp),%rsi
  mov    -0x38(%rbp),%rdx
  lea    -0x20(%rbp),%rax
  mov    %edi,%r9d
  mov    %rsi,%r8
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <polynomial_multiplication@plt>
  mov    -0x44(%rbp),%eax
  lea    -0x2(%rax),%ecx
  mov    -0x30(%rbp),%rdi
  mov    -0x40(%rbp),%rdx
  mov    -0x54(%rbp),%esi
  mov    -0x30(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <polynomial_subtraction@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  addl   $0x1,-0x44(%rbp)
L51:
  mov    -0x44(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jle    L68
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x38(%rbp),%rax
L46:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L11
  call   <__stack_chk_fail@plt>
L11:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D24
data_type: f64
name: read_data
arguments: label: D18
data_type: f64

tool: D24: 2

tool: D18: 1

assistant: ```c
double *chebyshev_coefs(int degree) {
  int i;
  double *t0, *t1, *t2, *p;
  double m[2] = {0., 2.};
  t0 = calloc(degree + 1, sizeof(double));
  t0[0] = 1.;
  if (degree == 0)
    return t0;
  t1 = calloc(degree + 1, sizeof(double));
  t1[1] = 1.;
  if (degree == 1) {
    free(t0);
    return t1;
  }
  t2 = calloc(degree + 1, sizeof(double));
  for (i = 2; i <= degree; i++) {
    memset(t2, 0, (degree + 1) * sizeof(double));
    polynomial_multiplication(m, 1, t1, i - 1, t2, degree);
    polynomial_subtraction(t2, degree, t0, i - 2, t2);
    p = t0;
    t0 = t1;
    t1 = t2;
    t2 = p;
  }
  free(t0);
  free(t2);
  return t1;
}
```