user: Converte this assembly snippet into its equivalent C code:

```asm
<doubles_xytcov_mul>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  mov    %r8,%r14
  push   %r13
  mov    %r9,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x58,%rsp
  movsd  0x8(%rdi),%xmm2
  movsd  (%rdi),%xmm5
  movsd  0x10(%rdi),%xmm0
  movsd  0x8(%rdx),%xmm1
  movsd  %xmm2,0x18(%rsp)
  movsd  (%rdx),%xmm2
  movsd  %xmm1,0x28(%rsp)
  movsd  %xmm2,0x38(%rsp)
  movsd  %xmm5,0x10(%rsp)
  movsd  %xmm0,0x8(%rsp)
  call   <sin@plt>
  pxor   %xmm5,%xmm5
  movsd  0x8(%rsp),%xmm0
  cvtsi2sd %rax,%xmm5
  movsd  %xmm5,(%rsp)
  call   <cos@plt>
  movsd  (%rsp),%xmm5
  movsd  0x20(%r15),%xmm6
  pxor   %xmm0,%xmm0
  movsd  0x40(%rbx),%xmm1
  cvtsi2sd %rax,%xmm0
  movsd  (%rbx),%xmm3
  movsd  %xmm6,0x20(%rsp)
  movapd %xmm5,%xmm6
  xorpd  D6(%rip),%xmm6
  movsd  0x10(%rbx),%xmm13
  movsd  0x38(%rsp),%xmm2
  movsd  %xmm1,0x48(%rsp)
  movsd  0x28(%rsp),%xmm1
  movapd %xmm6,%xmm15
  movsd  %xmm13,0x30(%rsp)
  movsd  0x40(%r15),%xmm10
  movsd  0x10(%r15),%xmm7
  mulsd  %xmm2,%xmm15
  movapd %xmm1,%xmm13
  movsd  0x28(%r15),%xmm11
  movsd  0x20(%rbx),%xmm14
  mulsd  %xmm0,%xmm13
  movsd  0x28(%rbx),%xmm12
  movsd  0x8(%rbx),%xmm4
  movsd  %xmm3,0x28(%rsp)
  mulsd  %xmm5,%xmm1
  movsd  %xmm14,0x38(%rsp)
  mulsd  %xmm0,%xmm2
  movsd  %xmm12,0x40(%rsp)
  movapd %xmm14,%xmm12
  movapd %xmm11,%xmm14
  mulsd  %xmm6,%xmm12
  movapd %xmm15,%xmm8
  subsd  %xmm13,%xmm8
  movsd  %xmm13,(%rsp)
  subsd  %xmm1,%xmm2
  movapd %xmm10,%xmm1
  mulsd  %xmm8,%xmm1
  movapd %xmm8,%xmm13
  movapd %xmm3,%xmm8
  mulsd  %xmm13,%xmm14
  mulsd  %xmm0,%xmm8
  movapd %xmm1,%xmm9
  movapd %xmm4,%xmm1
  movapd %xmm9,%xmm3
  addsd  %xmm4,%xmm1
  addsd  %xmm7,%xmm3
  addsd  %xmm7,%xmm7
  mulsd  %xmm13,%xmm9
  movsd  %xmm3,0x8(%rsp)
  mulsd  %xmm2,%xmm3
  addsd  0x8(%r15),%xmm3
  mulsd  %xmm13,%xmm7
  movsd  0x30(%rsp),%xmm13
  addsd  %xmm3,%xmm14
  movapd %xmm6,%xmm3
  mulsd  %xmm4,%xmm3
  mulsd  %xmm0,%xmm4
  addsd  %xmm7,%xmm9
  addsd  %xmm8,%xmm3
  mulsd  %xmm0,%xmm8
  addsd  %xmm12,%xmm4
  mulsd  %xmm6,%xmm12
  mulsd  %xmm5,%xmm3
  mulsd  %xmm0,%xmm4
  addsd  %xmm9,%xmm8
  addsd  %xmm14,%xmm3
  addsd  %xmm4,%xmm3
  movapd %xmm1,%xmm4
  mulsd  %xmm0,%xmm4
  mulsd  %xmm5,%xmm1
  mulsd  %xmm6,%xmm4
  mulsd  %xmm0,%xmm1
  addsd  %xmm8,%xmm4
  addsd  %xmm12,%xmm4
  addsd  (%r15),%xmm4
  movsd  0x40(%rsp),%xmm12
  movsd  %xmm3,0x18(%r13)
  mulsd  %xmm12,%xmm6
  unpcklpd %xmm3,%xmm4
  movups %xmm4,0x0(%r13)
  movapd %xmm13,%xmm4
  mulsd  %xmm0,%xmm4
  addsd  0x8(%rsp),%xmm4
  addsd  %xmm6,%xmm4
  movapd %xmm10,%xmm6
  mulsd  %xmm2,%xmm6
  movsd  %xmm4,0x10(%r13)
  movapd %xmm6,%xmm3
  movapd %xmm11,%xmm6
  addsd  %xmm11,%xmm6
  movapd %xmm3,%xmm7
  addsd  %xmm11,%xmm3
  mulsd  %xmm2,%xmm7
  movapd %xmm6,%xmm8
  mulsd  %xmm2,%xmm8
  addsd  %xmm8,%xmm7
  movsd  0x28(%rsp),%xmm8
  mulsd  %xmm5,%xmm8
  mulsd  %xmm5,%xmm8
  mulsd  %xmm13,%xmm5
  addsd  %xmm8,%xmm7
  movsd  0x38(%rsp),%xmm8
  addsd  %xmm5,%xmm3
  mulsd  %xmm0,%xmm8
  addsd  %xmm7,%xmm1
  mulsd  %xmm0,%xmm8
  mulsd  %xmm12,%xmm0
  addsd  %xmm8,%xmm1
  addsd  0x20(%rsp),%xmm1
  movsd  %xmm4,0x30(%r13)
  addsd  %xmm0,%xmm3
  movsd  (%rsp),%xmm0
  addsd  0x48(%rsp),%xmm10
  addsd  0x10(%rsp),%xmm2
  subsd  %xmm15,%xmm0
  addsd  0x18(%rsp),%xmm0
  movsd  %xmm1,0x20(%r13)
  movsd  %xmm3,0x28(%r13)
  movsd  %xmm3,0x38(%r13)
  movsd  %xmm10,0x40(%r13)
  movsd  %xmm2,(%r14)
  movsd  %xmm0,0x8(%r14)
  movsd  0x10(%rbp),%xmm0
  addsd  0x10(%r12),%xmm0
  movsd  %xmm0,0x10(%r14)
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: tag: D6
datatype: f32[4]

tool: {"D6": [0.0,-0.0,0.0,0.0]}

assistant: ```c
void doubles_xytcov_mul(const double xyta[3], const double Ca[9], const double xytb[3], const double Cb[9], double xytr[3], double Cr[9]) {
  double xa = xyta[0], ya = xyta[1], ta = xyta[2];
  double xb = xytb[0], yb = xytb[1];
  double sa = (double)sin(ta), ca = (double)cos(ta);
  double P11 = Ca[0], P12 = Ca[1], P13 = Ca[2];
  double P22 = Ca[4], P23 = Ca[5];
  double P33 = Ca[8];
  double Q11 = Cb[0], Q12 = Cb[1], Q13 = Cb[2];
  double Q22 = Cb[4], Q23 = Cb[5];
  double Q33 = Cb[8];
  double JA13 = -sa * xb - ca * yb;
  double JA23 = ca * xb - sa * yb;
  double JB11 = ca;
  double JB12 = -sa;
  double JB21 = sa;
  double JB22 = ca;
  Cr[0] = P33 * JA13 * JA13 + 2 * P13 * JA13 + Q11 * JB11 * JB11 + 2 * Q12 * JB11 * JB12 + Q22 * JB12 * JB12 + P11;
  Cr[1] = P12 + JA23 * (P13 + JA13 * P33) + JA13 * P23 + JB21 * (JB11 * Q11 + JB12 * Q12) + JB22 * (JB11 * Q12 + JB12 * Q22);
  Cr[2] = P13 + JA13 * P33 + JB11 * Q13 + JB12 * Q23;
  Cr[3] = Cr[1];
  Cr[4] = P33 * JA23 * JA23 + 2 * P23 * JA23 + Q11 * JB21 * JB21 + 2 * Q12 * JB21 * JB22 + Q22 * JB22 * JB22 + P22;
  Cr[5] = P23 + JA23 * P33 + JB21 * Q13 + JB22 * Q23;
  Cr[6] = Cr[2];
  Cr[7] = Cr[5];
  Cr[8] = P33 + Q33;
  xytr[0] = ca * xb - sa * yb + xa;
  xytr[1] = sa * xb + ca * yb + ya;
  xytr[2] = xyta[2] + xytb[2];
}
```