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

```asm
<bot_quat_to_roll_pitch_yaw>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    -0x48(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x48(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x48(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  mov    -0x48(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x48(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  mov    -0x48(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x48(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  mov    -0x48(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm1
  movsd  D11(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x30(%rbp),%xmm0
  mov    -0x38(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <atan2@plt>
  movq   %xmm0,%rax
  mov    -0x50(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x48(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x48(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x48(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm2
  mov    -0x48(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0x50(%rbp),%rax
  lea    0x8(%rax),%rbx
  mov    -0x28(%rbp),%rax
  movq   %rax,%xmm0
  call   <asin@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  mov    -0x48(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x48(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x48(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  mov    -0x48(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x48(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  mov    -0x48(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x48(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm2
  mov    -0x48(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm1
  movsd  D11(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x50(%rbp),%rax
  lea    0x10(%rax),%rbx
  movsd  -0x18(%rbp),%xmm0
  mov    -0x20(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <atan2@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D11
type_infered: f64

tool: D11: 1

assistant: ```c
void bot_quat_to_roll_pitch_yaw(const double q[4], double rpy[3]) {
  double roll_a = 2 * (q[0] * q[1] + q[2] * q[3]);
  double roll_b = 1 - 2 * (q[1] * q[1] + q[2] * q[2]);
  rpy[0] = atan2(roll_a, roll_b);
  double pitch_sin = 2 * (q[0] * q[2] - q[3] * q[1]);
  rpy[1] = asin(pitch_sin);
  double yaw_a = 2 * (q[0] * q[3] + q[1] * q[2]);
  double yaw_b = 1 - 2 * (q[2] * q[2] + q[3] * q[3]);
  rpy[2] = atan2(yaw_a, yaw_b);
}
```