user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<Rmq>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  mov    %eax,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x10(%rbp),%eax
  imul   -0x14(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x14(%rbp),%eax
  imul   -0x4(%rbp),%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  mov    -0x30(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x8(%rbp),%xmm2
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  mov    -0x38(%rbp),%rax
  add    $0x8,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x10(%rbp),%eax
  imul   -0xc(%rbp),%eax
  imul   -0x8(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  imul   -0x4(%rbp),%eax
  sub    %eax,%edx
  pxor   %xmm1,%xmm1
  cvtsi2sd %edx,%xmm1
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x18(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x4(%rbp),%eax
  imul   -0x8(%rbp),%eax
  add    %edx,%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  mov    -0x30(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x14(%rbp),%eax
  imul   -0xc(%rbp),%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0x38(%rbp),%rax
  add    $0x10,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  imul   -0x4(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  imul   -0x10(%rbp),%eax
  imul   -0x8(%rbp),%eax
  add    %edx,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x18(%rbp),%eax
  imul   -0x4(%rbp),%eax
  imul   -0x8(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  imul   -0x8(%rbp),%eax
  sub    %eax,%edx
  pxor   %xmm2,%xmm2
  cvtsi2sd %edx,%xmm2
  mov    -0x30(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x18(%rbp),%eax
  imul   -0x14(%rbp),%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0x38(%rbp),%rax
  add    $0x18,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  nop
  leave
  ret
```

assistant: ```c
void Rmq(double theta[3], double Vin[3], double Vout[3]) {
  int cpsi, cphi, ctet;
  int spsi, sphi, stet;
  cphi = cos(theta[1]);
  ctet = cos(theta[2]);
  cpsi = cos(theta[3]);
  sphi = sin(theta[1]);
  stet = sin(theta[2]);
  spsi = sin(theta[3]);
  Vout[1] = cpsi * ctet * Vin[1] + ctet * spsi * Vin[2] - stet * Vin[3];
  Vout[2] = (cpsi * sphi * stet - cphi * spsi) * Vin[1] + (cphi * cpsi + sphi * spsi * stet) * Vin[2] + ctet * sphi * Vin[3];
  Vout[3] = (sphi * spsi + cphi * cpsi * stet) * Vin[1] + (cphi * spsi * stet - cpsi * stet) * Vin[2] + cphi * ctet * Vin[3];
}
```