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

```asm
<fit_quadratic>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  movsd  %xmm0,-0x48(%rbp)
  movsd  %xmm1,-0x50(%rbp)
  movsd  %xmm2,-0x58(%rbp)
  movsd  %xmm3,-0x60(%rbp)
  movsd  %xmm4,-0x68(%rbp)
  movsd  %xmm5,-0x70(%rbp)
  mov    %rdi,-0x78(%rbp)
  movsd  -0x60(%rbp),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x48(%rbp),%xmm1
  movsd  -0x68(%rbp),%xmm0
  subsd  -0x50(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <atan2@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x40(%rbp)
  movsd  -0x58(%rbp),%xmm0
  subsd  -0x40(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x38(%rbp)
  movsd  -0x58(%rbp),%xmm0
  subsd  -0x40(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x30(%rbp)
  movsd  -0x40(%rbp),%xmm0
  subsd  -0x70(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x28(%rbp)
  movsd  -0x40(%rbp),%xmm0
  subsd  -0x70(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x20(%rbp)
  movsd  -0x38(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x20(%rbp),%xmm1
  movsd  -0x28(%rbp),%xmm0
  mulsd  -0x30(%rbp),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D4(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x38(%rbp),%xmm0
  mulsd  -0x28(%rbp),%xmm0
  movsd  -0x18(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x30(%rbp),%xmm0
  mulsd  -0x28(%rbp),%xmm0
  movsd  -0x18(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x78(%rbp),%rax
  movsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x8,%rax
  movsd  -0x50(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x60(%rbp),%xmm0
  subsd  -0x48(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  addsd  -0x48(%rbp),%xmm0
  movsd  -0x68(%rbp),%xmm1
  subsd  -0x50(%rbp),%xmm1
  mulsd  -0x10(%rbp),%xmm1
  mov    -0x78(%rbp),%rax
  add    $0x10,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x68(%rbp),%xmm0
  subsd  -0x50(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0x50(%rbp),%xmm1
  movsd  -0x60(%rbp),%xmm0
  subsd  -0x48(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  mov    -0x78(%rbp),%rax
  add    $0x18,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x20,%rax
  movsd  -0x60(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x28,%rax
  movsd  -0x68(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D4
type: byte[8]

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

assistant: ```c
void fit_quadratic(double x0, double y0, double th0, double x1, double y1, double th1, double quad[6]) {
  double th;
  double s0, c0, s1, c1;
  double det, s, c;
  th = atan2(y1 - y0, x1 - x0);
  s0 = sin(th0 - th);
  c0 = cos(th0 - th);
  s1 = sin(th - th1);
  c1 = cos(th - th1);
  det = 1 / (s0 * c1 + s1 * c0);
  s = s0 * s1 * det;
  c = c0 * s1 * det;
  quad[0] = x0;
  quad[1] = y0;
  quad[2] = x0 + (x1 - x0) * c - (y1 - y0) * s;
  quad[3] = y0 + (y1 - y0) * c + (x1 - x0) * s;
  quad[4] = x1;
  quad[5] = y1;
}
```