user: 请将以下的汇编代码转换成C语言代码:

```asm
<quat2rpy>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x70,%rsp
  mov    %rsi,%r12
  mov    %rdx,%rbp
  mov    %rcx,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  movsd  (%rdi),%xmm0
  movsd  %xmm0,0x40(%rsp)
  movsd  0x8(%rdi),%xmm0
  movsd  %xmm0,0x48(%rsp)
  movsd  0x10(%rdi),%xmm0
  movsd  %xmm0,0x50(%rsp)
  movsd  0x18(%rdi),%xmm0
  movsd  %xmm0,0x58(%rsp)
  mov    %rdi,%rax
  add    $0x20,%rdi
  movsd  D20(%rip),%xmm4
  movsd  %xmm4,(%rsp)
  pxor   %xmm0,%xmm0
  movq   D26(%rip),%xmm3
  movsd  D2(%rip),%xmm4
  jmp    L15
L11:
  divsd  (%rsp),%xmm1
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
L55:
  add    $0x8,%rax
  cmp    %rdi,%rax
  je     L60
L15:
  movsd  (%rax),%xmm1
  movapd %xmm1,%xmm2
  andpd  %xmm3,%xmm2
  movsd  (%rsp),%xmm7
  comisd %xmm7,%xmm2
  jbe    L11
  divsd  %xmm2,%xmm7
  mulsd  %xmm7,%xmm0
  mulsd  %xmm7,%xmm0
  addsd  %xmm4,%xmm0
  movsd  %xmm2,(%rsp)
  jmp    L55
L60:
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L46
  sqrtsd %xmm0,%xmm0
L19:
  mulsd  (%rsp),%xmm0
  lea    0x40(%rsp),%rax
  lea    0x60(%rsp),%rdx
L14:
  movsd  (%rax),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L14
  movsd  0x40(%rsp),%xmm6
  movapd %xmm6,%xmm5
  mulsd  %xmm6,%xmm6
  movsd  0x48(%rsp),%xmm3
  movapd %xmm3,%xmm4
  mulsd  %xmm3,%xmm3
  movsd  0x50(%rsp),%xmm2
  movapd %xmm2,%xmm7
  mulsd  %xmm2,%xmm2
  movsd  0x58(%rsp),%xmm8
  movapd %xmm8,%xmm9
  mulsd  %xmm8,%xmm8
  movsd  %xmm6,0x20(%rsp)
  movapd %xmm6,%xmm1
  movsd  %xmm3,0x28(%rsp)
  addsd  %xmm3,%xmm1
  movsd  %xmm2,0x30(%rsp)
  subsd  %xmm2,%xmm1
  movsd  %xmm4,0x8(%rsp)
  movapd %xmm4,%xmm0
  movsd  %xmm7,0x10(%rsp)
  mulsd  %xmm7,%xmm0
  movsd  %xmm5,(%rsp)
  movapd %xmm5,%xmm2
  movsd  %xmm9,0x18(%rsp)
  mulsd  %xmm9,%xmm2
  addsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm8,0x38(%rsp)
  subsd  %xmm8,%xmm1
  call   <rt_atan2d_snf@plt>
  movsd  %xmm0,(%r12)
  movsd  0x8(%rsp),%xmm0
  mulsd  0x18(%rsp),%xmm0
  movsd  (%rsp),%xmm7
  mulsd  0x10(%rsp),%xmm7
  subsd  %xmm7,%xmm0
  mulsd  D21(%rip),%xmm0
  call   <asin@plt>
  movsd  %xmm0,0x0(%rbp)
  movsd  0x20(%rsp),%xmm1
  subsd  0x28(%rsp),%xmm1
  subsd  0x30(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm5
  mulsd  0x18(%rsp),%xmm5
  movapd %xmm5,%xmm0
  movsd  (%rsp),%xmm2
  mulsd  0x8(%rsp),%xmm2
  addsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm0
  addsd  0x38(%rsp),%xmm1
  call   <rt_atan2d_snf@plt>
  movsd  %xmm0,(%rbx)
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L48
  add    $0x70,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L46:
  call   <sqrt@plt>
  jmp    L19
L48:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D20
data_type: f32[2]
name: read_data
arguments: data_label: D26
data_type: qword
name: read_data
arguments: data_label: D2
data_type: f64
name: read_data
arguments: data_label: D21
data_type: f32[2]

tool: {"D20": [0.0,1.4693679385278594e-39]}

tool: D26: 9223372036854775807

tool: D2: 1

tool: {"D21": [0.0,-2.0]}

assistant: ```c
void quat2rpy(const double q[4], double *yaw, double *pitch, double *roll) {
  int k;
  double qin[4];
  double qm;
  double scale;
  double absxk;
  double t;
  for (k = 0; k < 4; k++) {
    qin[k] = q[k];
  }
  qm = 0.0;
  scale = 2.2250738585072014E-308;
  for (k = 0; k < 4; k++) {
    absxk = fabs(q[k]);
    if (absxk > scale) {
      t = scale / absxk;
      qm = 1.0 + qm * t * t;
      scale = absxk;
    } else {
      t = absxk / scale;
      qm += t * t;
    }
  }
  qm = scale * sqrt(qm);
  for (k = 0; k < 4; k++) {
    qin[k] /= qm;
  }
  *yaw = rt_atan2d_snf(2.0 * (qin[1] * qin[2] + qin[0] * qin[3]), ((qin[0] * qin[0] + qin[1] * qin[1]) - qin[2] * qin[2]) - qin[3] * qin[3]);
  *pitch = asin(-2.0 * (qin[1] * qin[3] - qin[0] * qin[2]));
  *roll = rt_atan2d_snf(2.0 * (qin[2] * qin[3] + qin[0] * qin[1]), ((qin[0] * qin[0] - qin[1] * qin[1]) - qin[2] * qin[2]) + qin[3] * qin[3]);
}
```