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

```asm
<MatToQuat>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x28,%rsp
  movss  (%rdi),%xmm1
  movss  0x10(%rdi),%xmm2
  movss  0x20(%rdi),%xmm3
  movaps %xmm1,%xmm0
  addss  %xmm2,%xmm0
  addss  %xmm3,%xmm0
  comiss D9(%rip),%xmm0
  ja     L21
  comiss %xmm1,%xmm2
  mov    $0xc,%r15d
  mov    $0x0,%ecx
  seta   %r13b
  cmova  %r15,%rcx
  movzbl %r13b,%r13d
  lea    (%rdi,%r13,4),%rsi
  comiss (%rsi,%rcx,1),%xmm3
  ja     L9
  lea    D26(%rip),%rax
  mov    %rcx,%r15
  movslq (%rax,%r13,4),%rcx
  movslq (%rax,%rcx,4),%r12
  lea    0x0(,%r13,4),%rax
  lea    (%rcx,%rcx,2),%rsi
  mov    %rax,0x10(%rsp)
  lea    (%rdi,%rsi,4),%rsi
  lea    0x0(%rbp,%rcx,4),%r14
  lea    0x0(,%r12,4),%rax
  lea    (%r12,%r12,2),%rdi
  movss  (%rsi,%rcx,4),%xmm1
  mov    %rax,0x18(%rsp)
  shl    $0x2,%rdi
L4:
  add    %rbx,%r15
  add    %rdi,%rbx
  mov    %rcx,0x8(%rsp)
  addss  (%rbx,%r12,4),%xmm1
  movss  (%r15,%r13,4),%xmm0
  mov    %rsi,(%rsp)
  subss  %xmm1,%xmm0
  addss  D0(%rip),%xmm0
  call   <sqrt@plt>
  mov    0x10(%rsp),%rax
  mov    0x8(%rsp),%rcx
  movsd  D9(%rip),%xmm1
  movapd %xmm0,%xmm2
  mov    (%rsp),%rsi
  mulsd  %xmm1,%xmm2
  divsd  %xmm0,%xmm1
  cvtsd2ss %xmm2,%xmm2
  movss  %xmm2,0x0(%rbp,%rax,1)
  movss  (%rbx,%rcx,4),%xmm0
  subss  (%rsi,%r12,4),%xmm0
  mov    0x18(%rsp),%rax
  cvtss2sd %xmm0,%xmm0
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,0xc(%rbp)
  movss  (%rsi,%r13,4),%xmm0
  addss  (%r15,%rcx,4),%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%r14)
  movss  (%rbx,%r13,4),%xmm0
  addss  (%r15,%r12,4),%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,0x0(%rbp,%rax,1)
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L9:
  mov    %rdi,%rsi
  mov    %rbp,%r14
  mov    $0xc,%edi
  xor    %ecx,%ecx
  movq   $0x4,0x18(%rsp)
  mov    $0x18,%r15d
  mov    $0x2,%r13d
  mov    $0x1,%r12d
  movq   $0x8,0x10(%rsp)
  jmp    L4
  cs nopw 0x0(%rax,%rax,1)
L21:
  addss  D0(%rip),%xmm0
  call   <sqrt@plt>
  movsd  D9(%rip),%xmm2
  movapd %xmm0,%xmm1
  mulsd  %xmm2,%xmm1
  divsd  %xmm0,%xmm2
  cvtsd2ss %xmm1,%xmm1
  movss  %xmm1,0xc(%rbp)
  movss  0x1c(%rbx),%xmm0
  subss  0x14(%rbx),%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  %xmm2,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,0x0(%rbp)
  movss  0x8(%rbx),%xmm0
  subss  0x18(%rbx),%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  %xmm2,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,0x4(%rbp)
  movss  0xc(%rbx),%xmm1
  subss  0x4(%rbx),%xmm1
  pxor   %xmm0,%xmm0
  cvtss2sd %xmm1,%xmm0
  mulsd  %xmm2,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,0x8(%rbp)
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: label: D9
type: f64
name: retrieve_data
arguments: label: D26
type: string
name: retrieve_data
arguments: label: D0
type: f32

tool: D9: 0.5

tool: D26: 

tool: D0: 1

assistant: ```c
void MatToQuat(float srcMatrix[3][3], float destQuat[4]) {
  double trace, s;
  int i, j, k;
  static int next[3] = {1, 2, 0};
  trace = srcMatrix[0][0] + srcMatrix[1][1] + srcMatrix[2][2];
  if (trace > 0.0) {
    s = sqrt(trace + 1.0);
    destQuat[3] = s * 0.5;
    s = 0.5 / s;
    destQuat[0] = (srcMatrix[2][1] - srcMatrix[1][2]) * s;
    destQuat[1] = (srcMatrix[0][2] - srcMatrix[2][0]) * s;
    destQuat[2] = (srcMatrix[1][0] - srcMatrix[0][1]) * s;
  } else {
    i = 0;
    if (srcMatrix[1][1] > srcMatrix[0][0])
      i = 1;
    if (srcMatrix[2][2] > srcMatrix[i][i])
      i = 2;
    j = next[i];
    k = next[j];
    s = sqrt((srcMatrix[i][i] - (srcMatrix[j][j] + srcMatrix[k][k])) + 1.0);
    destQuat[i] = s * 0.5;
    s = 0.5 / s;
    destQuat[3] = (srcMatrix[k][j] - srcMatrix[j][k]) * s;
    destQuat[j] = (srcMatrix[j][i] + srcMatrix[i][j]) * s;
    destQuat[k] = (srcMatrix[k][i] + srcMatrix[i][k]) * s;
  }
}
```