user: What is the c source code of the assembly code below:

```asm
<cquat_from_matrix_t>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  movsd  (%rsi),%xmm1
  movsd  0x20(%rsi),%xmm2
  movsd  0x40(%rsi),%xmm3
  movapd %xmm1,%xmm4
  addsd  D78(%rip),%xmm4
  movapd %xmm4,%xmm0
  addsd  %xmm2,%xmm0
  addsd  %xmm3,%xmm0
  comisd D10(%rip),%xmm0
  ja     L160
  comisd %xmm2,%xmm1
  jbe    L120
  comisd %xmm3,%xmm1
  ja     L134
L120:
  comisd %xmm1,%xmm2
  jbe    L89
  comisd %xmm3,%xmm2
  ja     L17
L89:
  comisd %xmm1,%xmm3
  jbe    L55
  comisd %xmm2,%xmm3
  jbe    L55
  movsd  D78(%rip),%xmm0
  subsd  %xmm1,%xmm0
  subsd  %xmm2,%xmm0
  addsd  %xmm3,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L178
  sqrtsd %xmm0,%xmm0
L114:
  addsd  %xmm0,%xmm0
  movapd %xmm0,%xmm1
  mulsd  D28(%rip),%xmm1
  movsd  %xmm1,0x10(%rbp)
  movsd  0x30(%rbx),%xmm1
  addsd  0x10(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x18(%rbp)
  movsd  0x38(%rbx),%xmm1
  addsd  0x28(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x0(%rbp)
  movsd  0x8(%rbx),%xmm1
  subsd  0x18(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%rbp)
  jmp    L55
L160:
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L75
  sqrtsd %xmm0,%xmm0
L170:
  addsd  %xmm0,%xmm0
  movapd %xmm0,%xmm1
  mulsd  D28(%rip),%xmm1
  movsd  %xmm1,0x18(%rbp)
  movsd  0x28(%rbx),%xmm1
  subsd  0x38(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x0(%rbp)
  movsd  0x30(%rbx),%xmm1
  subsd  0x10(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%rbp)
  movsd  0x8(%rbx),%xmm1
  subsd  0x18(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x10(%rbp)
L55:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L75:
  call   <sqrt@plt>
  jmp    L170
L134:
  subsd  %xmm2,%xmm4
  movapd %xmm4,%xmm0
  subsd  %xmm3,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L91
  sqrtsd %xmm0,%xmm0
L110:
  addsd  %xmm0,%xmm0
  movapd %xmm0,%xmm1
  mulsd  D28(%rip),%xmm1
  movsd  %xmm1,0x0(%rbp)
  movsd  0x18(%rbx),%xmm1
  addsd  0x8(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%rbp)
  movsd  0x30(%rbx),%xmm1
  addsd  0x10(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x10(%rbp)
  movsd  0x28(%rbx),%xmm1
  subsd  0x38(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x18(%rbp)
  jmp    L55
L91:
  call   <sqrt@plt>
  jmp    L110
L17:
  movsd  D78(%rip),%xmm0
  subsd  %xmm1,%xmm0
  addsd  %xmm2,%xmm0
  subsd  %xmm3,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L86
  sqrtsd %xmm0,%xmm0
L56:
  addsd  %xmm0,%xmm0
  movapd %xmm0,%xmm1
  mulsd  D28(%rip),%xmm1
  movsd  %xmm1,0x8(%rbp)
  movsd  0x18(%rbx),%xmm1
  addsd  0x8(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x0(%rbp)
  movsd  0x38(%rbx),%xmm1
  addsd  0x28(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x10(%rbp)
  movsd  0x30(%rbx),%xmm1
  subsd  0x10(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x18(%rbp)
  jmp    L55
L86:
  call   <sqrt@plt>
  jmp    L56
L178:
  call   <sqrt@plt>
  jmp    L114
```

tool_calls: name: unpack_data
arguments: data_label: D78
data_type: f64
name: unpack_data
arguments: data_label: D10
data_type: f64[2]
name: unpack_data
arguments: data_label: D28
data_type: byte[8]

tool: D78: 1

tool: {"D10": [0.1,0.25]}

tool: {"D28": [0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x3f]}

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;
  }
}
```