user: Please show me the C implementation that matches the assembly code listed below:

```asm
<floats_mat_to_quat>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  movss  (%rax),%xmm1
  mov    -0x18(%rbp),%rax
  add    $0x14,%rax
  movss  (%rax),%xmm0
  addss  %xmm0,%xmm1
  mov    -0x18(%rbp),%rax
  add    $0x28,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movsd  D71(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  comisd D69(%rip),%xmm0
  jbe    L61
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  add    %eax,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm1
  movsd  D45(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  mov    -0x20(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x24,%rax
  movss  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  add    $0x18,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  divsd  -0x8(%rbp),%xmm0
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  add    $0x20,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  divsd  -0x8(%rbp),%xmm0
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x10,%rax
  movss  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  divsd  -0x8(%rbp),%xmm0
  mov    -0x20(%rbp),%rax
  add    $0xc,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  jmp    L33
L61:
  mov    -0x18(%rbp),%rax
  movss  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  add    $0x14,%rax
  movss  (%rax),%xmm1
  comiss %xmm1,%xmm0
  jbe    L53
  mov    -0x18(%rbp),%rax
  movss  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  add    $0x28,%rax
  movss  (%rax),%xmm1
  comiss %xmm1,%xmm0
  jbe    L53
  mov    -0x18(%rbp),%rax
  movss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movsd  D71(%rip),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x18(%rbp),%rax
  add    $0x14,%rax
  movss  (%rax),%xmm1
  cvtss2sd %xmm1,%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x18(%rbp),%rax
  add    $0x28,%rax
  movss  (%rax),%xmm1
  cvtss2sd %xmm1,%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  add    %eax,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x24,%rax
  movss  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  add    $0x18,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  divsd  -0x8(%rbp),%xmm0
  cvtsd2ss %xmm0,%xmm0
  mov    -0x20(%rbp),%rax
  movss  %xmm0,(%rax)
  movsd  -0x8(%rbp),%xmm1
  movsd  D45(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x10,%rax
  movss  (%rax),%xmm1
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  divsd  -0x8(%rbp),%xmm0
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm1
  mov    -0x18(%rbp),%rax
  add    $0x20,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  divsd  -0x8(%rbp),%xmm0
  mov    -0x20(%rbp),%rax
  add    $0xc,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  jmp    L33
L53:
  mov    -0x18(%rbp),%rax
  add    $0x14,%rax
  movss  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  add    $0x28,%rax
  movss  (%rax),%xmm1
  comiss %xmm1,%xmm0
  jbe    L58
  mov    -0x18(%rbp),%rax
  add    $0x14,%rax
  movss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movsd  D71(%rip),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x18(%rbp),%rax
  movss  (%rax),%xmm1
  cvtss2sd %xmm1,%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x18(%rbp),%rax
  add    $0x28,%rax
  movss  (%rax),%xmm1
  cvtss2sd %xmm1,%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  add    %eax,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  add    $0x20,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  divsd  -0x8(%rbp),%xmm0
  cvtsd2ss %xmm0,%xmm0
  mov    -0x20(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x10,%rax
  movss  (%rax),%xmm1
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  divsd  -0x8(%rbp),%xmm0
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  movsd  -0x8(%rbp),%xmm1
  movsd  D45(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x24,%rax
  movss  (%rax),%xmm1
  mov    -0x18(%rbp),%rax
  add    $0x18,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  divsd  -0x8(%rbp),%xmm0
  mov    -0x20(%rbp),%rax
  add    $0xc,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  jmp    L33
L58:
  mov    -0x18(%rbp),%rax
  add    $0x28,%rax
  movss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movsd  D71(%rip),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x18(%rbp),%rax
  movss  (%rax),%xmm1
  cvtss2sd %xmm1,%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x18(%rbp),%rax
  add    $0x14,%rax
  movss  (%rax),%xmm1
  cvtss2sd %xmm1,%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x10,%rax
  movss  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  divsd  -0x8(%rbp),%xmm0
  cvtsd2ss %xmm0,%xmm0
  mov    -0x20(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm1
  mov    -0x18(%rbp),%rax
  add    $0x20,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  divsd  -0x8(%rbp),%xmm0
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x24,%rax
  movss  (%rax),%xmm1
  mov    -0x18(%rbp),%rax
  add    $0x18,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  divsd  -0x8(%rbp),%xmm0
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  movsd  -0x8(%rbp),%xmm1
  movsd  D45(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x20(%rbp),%rax
  add    $0xc,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
L33:
  mov    -0x20(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <floats_normalize@plt>
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D71
type_guessed: f64
name: read_data
arguments: data_label: D69
type_guessed: f64[2]
name: read_data
arguments: data_label: D45
type_guessed: f64

tool: D71: 1

tool: {"D69": [1e-7,0.25]}

tool: D45: 0.25

assistant: ```c
void floats_mat_to_quat(const float M[16], float q[4]) {
  double T = M[0] + M[5] + M[10] + 1.0;
  double S;
  if (T > 0.0000001) {
    S = sqrt(T) * 2;
    q[0] = 0.25 * S;
    q[1] = (M[9] - M[6]) / S;
    q[2] = (M[2] - M[8]) / S;
    q[3] = (M[4] - M[1]) / S;
  } else if (M[0] > M[5] && M[0] > M[10]) {
    S = sqrt(1.0 + M[0] - M[5] - M[10]) * 2;
    q[0] = (M[9] - M[6]) / S;
    q[1] = 0.25 * S;
    q[2] = (M[4] + M[1]) / S;
    q[3] = (M[2] + M[8]) / S;
  } else if (M[5] > M[10]) {
    S = sqrt(1.0 + M[5] - M[0] - M[10]) * 2;
    q[0] = (M[2] - M[8]) / S;
    q[1] = (M[4] + M[1]) / S;
    q[2] = 0.25 * S;
    q[3] = (M[9] + M[6]) / S;
  } else {
    S = sqrt(1.0 + M[10] - M[0] - M[5]);
    q[0] = (M[4] - M[1]) / S;
    q[1] = (M[2] + M[8]) / S;
    q[2] = (M[9] + M[6]) / S;
    q[3] = 0.25 * S;
  }
  floats_normalize(q, 4, q);
}
```