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

```asm
<quat_of_eulers>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  movsd  %xmm0,-0x40(%rbp)
  movsd  %xmm1,-0x48(%rbp)
  movsd  %xmm2,-0x50(%rbp)
  movsd  -0x40(%rbp),%xmm0
  movsd  D27(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x24(%rbp)
  movsd  -0x48(%rbp),%xmm0
  movsd  D27(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x20(%rbp)
  movsd  -0x50(%rbp),%xmm0
  movsd  D27(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x1c(%rbp)
  mov    -0x24(%rbp),%eax
  movd   %eax,%xmm0
  call   <sin@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x24(%rbp),%eax
  movd   %eax,%xmm0
  call   <cos@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x20(%rbp),%eax
  movd   %eax,%xmm0
  call   <sin@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x20(%rbp),%eax
  movd   %eax,%xmm0
  call   <cos@plt>
  movd   %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x1c(%rbp),%eax
  movd   %eax,%xmm0
  call   <sin@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x1c(%rbp),%eax
  movd   %eax,%xmm0
  call   <cos@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x4(%rbp)
  movss  -0x14(%rbp),%xmm0
  mulss  -0xc(%rbp),%xmm0
  movaps %xmm0,%xmm1
  mulss  -0x4(%rbp),%xmm1
  movss  -0x18(%rbp),%xmm0
  mulss  -0x10(%rbp),%xmm0
  mulss  -0x8(%rbp),%xmm0
  addss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  mov    -0x38(%rbp),%rax
  movsd  %xmm0,(%rax)
  movss  -0x14(%rbp),%xmm0
  movss  D8(%rip),%xmm1
  xorps  %xmm1,%xmm0
  mulss  -0x10(%rbp),%xmm0
  movaps %xmm0,%xmm1
  mulss  -0x8(%rbp),%xmm1
  movss  -0x18(%rbp),%xmm0
  mulss  -0xc(%rbp),%xmm0
  mulss  -0x4(%rbp),%xmm0
  addss  %xmm1,%xmm0
  mov    -0x38(%rbp),%rax
  add    $0x8,%rax
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  movss  -0x14(%rbp),%xmm0
  mulss  -0x10(%rbp),%xmm0
  movaps %xmm0,%xmm1
  mulss  -0x4(%rbp),%xmm1
  movss  -0x18(%rbp),%xmm0
  mulss  -0xc(%rbp),%xmm0
  mulss  -0x8(%rbp),%xmm0
  addss  %xmm1,%xmm0
  mov    -0x38(%rbp),%rax
  add    $0x10,%rax
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  movss  -0x14(%rbp),%xmm0
  mulss  -0xc(%rbp),%xmm0
  mulss  -0x8(%rbp),%xmm0
  movss  -0x18(%rbp),%xmm1
  mulss  -0x10(%rbp),%xmm1
  mulss  -0x4(%rbp),%xmm1
  subss  %xmm1,%xmm0
  mov    -0x38(%rbp),%rax
  add    $0x18,%rax
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D27
type_infered: f64
name: extract_symbolic_data
arguments: data_tag: D8
type_infered: byte[4]

tool: D27: 2

tool: {"D8": [0x00,0x00,0x00,0x80]}

assistant: ```c
void quat_of_eulers(double *quat, double phi, double theta, double psi) {
  const float phi2 = phi / 2.0;
  const float theta2 = theta / 2.0;
  const float psi2 = psi / 2.0;
  const float sinphi2 = sin(phi2);
  const float cosphi2 = cos(phi2);
  const float sintheta2 = sin(theta2);
  const float costheta2 = cos(theta2);
  const float sinpsi2 = sin(psi2);
  const float cospsi2 = cos(psi2);
  quat[0] = cosphi2 * costheta2 * cospsi2 + sinphi2 * sintheta2 * sinpsi2;
  quat[1] = -cosphi2 * sintheta2 * sinpsi2 + sinphi2 * costheta2 * cospsi2;
  quat[2] = cosphi2 * sintheta2 * cospsi2 + sinphi2 * costheta2 * sinpsi2;
  quat[3] = cosphi2 * costheta2 * sinpsi2 - sinphi2 * sintheta2 * cospsi2;
}
```