user: 请从给定的汇编指令推导出C源代码：

```asm
<doubles_rpy_to_quat>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x90,%rsp
  movsd  (%rdi),%xmm2
  movsd  0x8(%rdi),%xmm7
  movsd  D4(%rip),%xmm0
  mulsd  %xmm0,%xmm2
  mulsd  %xmm0,%xmm7
  mulsd  0x10(%rdi),%xmm0
  movsd  %xmm2,0x20(%rsp)
  movsd  %xmm7,0x40(%rsp)
  movsd  %xmm0,0x30(%rsp)
  movapd %xmm2,%xmm0
  call   <sin@plt>
  pxor   %xmm5,%xmm5
  movsd  0x40(%rsp),%xmm7
  cvtsi2sd %rax,%xmm5
  movsd  %xmm7,0x88(%rsp)
  movapd %xmm7,%xmm0
  movapd %xmm5,%xmm6
  movsd  %xmm5,0x10(%rsp)
  unpcklpd %xmm6,%xmm6
  movaps %xmm6,(%rsp)
  call   <sin@plt>
  pxor   %xmm3,%xmm3
  movsd  0x10(%rsp),%xmm5
  movsd  0x30(%rsp),%xmm1
  cvtsi2sd %rax,%xmm3
  movapd %xmm5,%xmm8
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x68(%rsp)
  movsd  %xmm5,0x80(%rsp)
  unpcklpd %xmm3,%xmm8
  movsd  %xmm3,0x10(%rsp)
  movaps %xmm8,0x70(%rsp)
  call   <sin@plt>
  pxor   %xmm4,%xmm4
  movsd  0x20(%rsp),%xmm2
  cvtsi2sd %rax,%xmm4
  movapd %xmm2,%xmm0
  movapd %xmm4,%xmm5
  movsd  %xmm4,0x60(%rsp)
  unpcklpd %xmm5,%xmm5
  movaps %xmm5,0x40(%rsp)
  call   <cos@plt>
  pxor   %xmm2,%xmm2
  movsd  0x10(%rsp),%xmm3
  movsd  0x80(%rsp),%xmm5
  movsd  0x88(%rsp),%xmm7
  cvtsi2sd %rax,%xmm2
  movsd  %xmm3,0x30(%rsp)
  movapd %xmm3,%xmm4
  movapd %xmm7,%xmm0
  movapd %xmm2,%xmm3
  unpcklpd %xmm2,%xmm4
  movsd  %xmm2,0x58(%rsp)
  unpcklpd %xmm5,%xmm3
  movaps %xmm4,0x20(%rsp)
  movaps %xmm3,0x10(%rsp)
  call   <cos@plt>
  pxor   %xmm0,%xmm0
  movsd  0x58(%rsp),%xmm2
  movapd 0x20(%rsp),%xmm6
  cvtsi2sd %rax,%xmm0
  movsd  0x30(%rsp),%xmm3
  movapd 0x70(%rsp),%xmm8
  mulpd  %xmm6,%xmm8
  movapd %xmm0,%xmm1
  movapd %xmm0,%xmm4
  unpcklpd %xmm0,%xmm2
  mulpd  %xmm6,%xmm2
  unpcklpd %xmm1,%xmm1
  unpcklpd %xmm3,%xmm4
  mulpd  0x10(%rsp),%xmm1
  mulpd  (%rsp),%xmm4
  movaps %xmm8,0x20(%rsp)
  movaps %xmm2,0x10(%rsp)
  movaps %xmm1,(%rsp)
  movsd  0x68(%rsp),%xmm1
  movaps %xmm4,0x30(%rsp)
  movapd %xmm1,%xmm0
  call   <cos@plt>
  pxor   %xmm0,%xmm0
  movapd 0x20(%rsp),%xmm3
  movsd  0x60(%rsp),%xmm4
  cvtsi2sd %rax,%xmm0
  mulpd  0x40(%rsp),%xmm3
  movapd %xmm4,%xmm2
  movapd %xmm0,%xmm1
  unpcklpd %xmm0,%xmm2
  unpcklpd %xmm4,%xmm0
  mulpd  0x10(%rsp),%xmm0
  unpcklpd %xmm1,%xmm1
  mulpd  (%rsp),%xmm1
  mulpd  0x30(%rsp),%xmm2
  movapd %xmm1,%xmm4
  subpd  %xmm3,%xmm1
  addpd  %xmm3,%xmm4
  movsd  %xmm4,%xmm1
  movups %xmm1,(%rbx)
  movapd %xmm0,%xmm1
  subpd  %xmm2,%xmm0
  addpd  %xmm2,%xmm1
  movsd  %xmm1,%xmm0
  movups %xmm0,0x10(%rbx)
  add    $0x90,%rsp
  pop    %rbx
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D4
datatype: f32[2]

tool: {"D4": [0.0,1.75]}

assistant: ```c
void doubles_rpy_to_quat(const double rpy[3], double quat[4]) {
  double roll = rpy[0], pitch = rpy[1], yaw = rpy[2];
  double halfroll = roll / 2;
  double halfpitch = pitch / 2;
  double halfyaw = yaw / 2;
  double sin_r2 = (double)sin(halfroll);
  double sin_p2 = (double)sin(halfpitch);
  double sin_y2 = (double)sin(halfyaw);
  double cos_r2 = (double)cos(halfroll);
  double cos_p2 = (double)cos(halfpitch);
  double cos_y2 = (double)cos(halfyaw);
  quat[0] = cos_r2 * cos_p2 * cos_y2 + sin_r2 * sin_p2 * sin_y2;
  quat[1] = sin_r2 * cos_p2 * cos_y2 - cos_r2 * sin_p2 * sin_y2;
  quat[2] = cos_r2 * sin_p2 * cos_y2 + sin_r2 * cos_p2 * sin_y2;
  quat[3] = cos_r2 * cos_p2 * sin_y2 - sin_r2 * sin_p2 * cos_y2;
}
```