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

```asm
<cquat_from_matrix_t>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x30(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x30(%rbp),%rax
  add    $0x40,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x20(%rbp),%xmm1
  movsd  D32(%rip),%xmm0
  addsd  %xmm1,%xmm0
  addsd  -0x18(%rbp),%xmm0
  movsd  -0x10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  comisd D89(%rip),%xmm0
  jbe    L129
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  addsd  %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x18,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  D59(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  mov    -0x30(%rbp),%rax
  add    $0x38,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  divsd  -0x8(%rbp),%xmm0
  mov    -0x28(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  add    $0x30,%rax
  movsd  (%rax),%xmm0
  mov    -0x30(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x10,%rax
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L83
L129:
  movsd  -0x20(%rbp),%xmm0
  comisd -0x18(%rbp),%xmm0
  jbe    L127
  movsd  -0x20(%rbp),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L127
  movsd  -0x20(%rbp),%xmm1
  movsd  D32(%rip),%xmm0
  addsd  %xmm1,%xmm0
  subsd  -0x18(%rbp),%xmm0
  subsd  -0x10(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  addsd  %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  movsd  D59(%rip),%xmm1
  divsd  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm1
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  add    $0x30,%rax
  movsd  (%rax),%xmm1
  mov    -0x30(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x10,%rax
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  mov    -0x30(%rbp),%rax
  add    $0x38,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x18,%rax
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L83
L127:
  movsd  -0x18(%rbp),%xmm0
  comisd -0x20(%rbp),%xmm0
  jbe    L115
  movsd  -0x18(%rbp),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L115
  movsd  D32(%rip),%xmm0
  subsd  -0x20(%rbp),%xmm0
  addsd  -0x18(%rbp),%xmm0
  subsd  -0x10(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  addsd  %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  D59(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm1
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  divsd  -0x8(%rbp),%xmm0
  mov    -0x28(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  add    $0x38,%rax
  movsd  (%rax),%xmm1
  mov    -0x30(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x10,%rax
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  add    $0x30,%rax
  movsd  (%rax),%xmm0
  mov    -0x30(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x18,%rax
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L83
L115:
  movsd  -0x10(%rbp),%xmm0
  comisd -0x20(%rbp),%xmm0
  ja     L40
  jmp    L83
L40:
  movsd  -0x10(%rbp),%xmm0
  comisd -0x18(%rbp),%xmm0
  ja     L17
  jmp    L83
L17:
  movsd  D32(%rip),%xmm0
  subsd  -0x20(%rbp),%xmm0
  subsd  -0x18(%rbp),%xmm0
  addsd  -0x10(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  addsd  %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x10,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  D59(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  add    $0x30,%rax
  movsd  (%rax),%xmm1
  mov    -0x30(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x18,%rax
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  add    $0x38,%rax
  movsd  (%rax),%xmm1
  mov    -0x30(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  divsd  -0x8(%rbp),%xmm0
  mov    -0x28(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L83
L83:
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D32
type_infered: f64
name: disassemble_data
arguments: data_tag: D89
type_infered: f64[2]
name: disassemble_data
arguments: data_tag: D59
type_infered: f64

tool: D32: 1

tool: {"D89": [0.1,4.0]}

tool: D59: 4

assistant: ```c
void cquat_from_matrix_t(double *q, const double *m) {
  double m11 = m[((1) - 1) * (3) + ((1) - 1)];
  double m22 = m[((2) - 1) * (3) + ((2) - 1)];
  double m33 = m[((3) - 1) * (3) + ((3) - 1)];
  double s;
  s = 1.0 + m11 + m22 + m33;
  if (s > 0.1) {
    s = 2.0 * sqrt(s);
    q[3] = s / 4.0;
    q[0] = (m[((2) - 1) * (3) + ((3) - 1)] - m[((3) - 1) * (3) + ((2) - 1)]) / s;
    q[1] = (m[((3) - 1) * (3) + ((1) - 1)] - m[((1) - 1) * (3) + ((3) - 1)]) / s;
    q[2] = (m[((1) - 1) * (3) + ((2) - 1)] - m[((2) - 1) * (3) + ((1) - 1)]) / s;
  } else if ((m11 > m22) && (m11 > m33)) {
    s = 2.0 * sqrt(1.0 + m11 - m22 - m33);
    q[0] = s / 4.0;
    q[1] = (m[((2) - 1) * (3) + ((1) - 1)] + m[((1) - 1) * (3) + ((2) - 1)]) / s;
    q[2] = (m[((3) - 1) * (3) + ((1) - 1)] + m[((1) - 1) * (3) + ((3) - 1)]) / s;
    q[3] = (m[((2) - 1) * (3) + ((3) - 1)] - m[((3) - 1) * (3) + ((2) - 1)]) / s;
  } else if ((m22 > m11) && (m22 > m33)) {
    s = 2.0 * sqrt(1.0 - m11 + m22 - m33);
    q[1] = s / 4.0;
    q[0] = (m[((2) - 1) * (3) + ((1) - 1)] + m[((1) - 1) * (3) + ((2) - 1)]) / s;
    q[2] = (m[((3) - 1) * (3) + ((2) - 1)] + m[((2) - 1) * (3) + ((3) - 1)]) / s;
    q[3] = (m[((3) - 1) * (3) + ((1) - 1)] - m[((1) - 1) * (3) + ((3) - 1)]) / s;
  } else if ((m33 > m11) && (m33 > m22)) {
    s = 2.0 * sqrt(1.0 - m11 - m22 + m33);
    q[2] = s / 4.0;
    q[3] = (m[((3) - 1) * (3) + ((1) - 1)] + m[((1) - 1) * (3) + ((3) - 1)]) / s;
    q[0] = (m[((3) - 1) * (3) + ((2) - 1)] + m[((2) - 1) * (3) + ((3) - 1)]) / s;
    q[1] = (m[((1) - 1) * (3) + ((2) - 1)] - m[((2) - 1) * (3) + ((1) - 1)]) / s;
  }
}
```