user: Translate the below assembly code into C programming language:

```asm
<MatToQuat>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r12
  movss  (%rdi),%xmm1
  movss  0x10(%rdi),%xmm2
  movss  0x20(%rdi),%xmm3
  movaps %xmm1,%xmm0
  addss  %xmm2,%xmm0
  addss  %xmm3,%xmm0
  comiss D47(%rip),%xmm0
  ja     L16
  comiss %xmm1,%xmm2
  seta   %bpl
  movzbl %bpl,%ebp
  mov    $0xc,%eax
  mov    $0x0,%edx
  cmovbe %rdx,%rax
  movslq %ebp,%rdx
  lea    (%rdi,%rdx,4),%rdx
  ucomiss (%rdx,%rax,1),%xmm3
  mov    $0x2,%eax
  cmova  %eax,%ebp
  lea    D27(%rip),%rax
  movslq %ebp,%rbp
  movslq (%rax,%rbp,4),%r13
  lea    0x0(%rbp,%rbp,2),%rdx
  lea    (%rdi,%rdx,4),%rcx
  lea    0x0(%r13,%r13,2),%rdx
  lea    (%rdi,%rdx,4),%r15
  movslq (%rax,%r13,4),%r14
  lea    (%r14,%r14,2),%rax
  lea    (%rdi,%rax,4),%rbx
  movss  (%r15,%r13,4),%xmm1
  addss  (%rbx,%r14,4),%xmm1
  mov    %rcx,0x8(%rsp)
  movss  (%rcx,%rbp,4),%xmm0
  subss  %xmm1,%xmm0
  addss  D40(%rip),%xmm0
  call   <sqrt@plt>
  movsd  D47(%rip),%xmm1
  movapd %xmm0,%xmm2
  mulsd  %xmm1,%xmm2
  cvtsd2ss %xmm2,%xmm2
  movss  %xmm2,(%r12,%rbp,4)
  divsd  %xmm0,%xmm1
  movss  (%rbx,%r13,4),%xmm0
  subss  (%r15,%r14,4),%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,0xc(%r12)
  movss  (%r15,%rbp,4),%xmm0
  mov    0x8(%rsp),%rax
  addss  (%rax,%r13,4),%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%r12,%r13,4)
  movss  (%rbx,%rbp,4),%xmm0
  addss  (%rax,%r14,4),%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%r12,%r14,4)
L19:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L16:
  addss  D40(%rip),%xmm0
  call   <sqrt@plt>
  movsd  D47(%rip),%xmm1
  movapd %xmm0,%xmm2
  mulsd  %xmm1,%xmm2
  cvtsd2ss %xmm2,%xmm2
  movss  %xmm2,0xc(%r12)
  divsd  %xmm0,%xmm1
  movss  0x1c(%rbx),%xmm0
  subss  0x14(%rbx),%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%r12)
  movss  0x8(%rbx),%xmm0
  subss  0x18(%rbx),%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,0x4(%r12)
  movss  0xc(%rbx),%xmm0
  subss  0x4(%rbx),%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,0x8(%r12)
  jmp    L19
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D47
type_infered: f64
name: extract_symbolic_data
arguments: data_label: D27
type_infered: string
name: extract_symbolic_data
arguments: data_label: D40
type_infered: f32

tool: D47: 0.5

tool: D27: 

tool: D40: 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;
  }
}
```