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

```asm
<MatToQuat>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  movss  (%rax),%xmm1
  mov    -0x28(%rbp),%rax
  add    $0xc,%rax
  movss  0x4(%rax),%xmm0
  addss  %xmm0,%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x18,%rax
  movss  0x8(%rax),%xmm0
  addss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L34
  movsd  -0x10(%rbp),%xmm1
  movsd  D70(%rip),%xmm0
  addsd  %xmm1,%xmm0
  pxor   %xmm3,%xmm3
  cvtsd2ss %xmm0,%xmm3
  movd   %xmm3,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm1
  movsd  D9(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x30(%rbp),%rax
  add    $0xc,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  movsd  D9(%rip),%xmm0
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x18,%rax
  movss  0x4(%rax),%xmm0
  mov    -0x28(%rbp),%rax
  add    $0xc,%rax
  movss  0x8(%rax),%xmm1
  subss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  -0x8(%rbp),%xmm0
  cvtsd2ss %xmm0,%xmm0
  mov    -0x30(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x28(%rbp),%rax
  movss  0x8(%rax),%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x18,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  -0x8(%rbp),%xmm0
  mov    -0x30(%rbp),%rax
  add    $0x4,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x28(%rbp),%rax
  add    $0xc,%rax
  movss  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  movss  0x4(%rax),%xmm1
  subss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  -0x8(%rbp),%xmm0
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  jmp    L25
L34:
  movl   $0x0,-0x1c(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0xc,%rax
  movss  0x4(%rax),%xmm0
  mov    -0x28(%rbp),%rax
  movss  (%rax),%xmm1
  comiss %xmm1,%xmm0
  jbe    L35
  movl   $0x1,-0x1c(%rbp)
L35:
  mov    -0x28(%rbp),%rax
  add    $0x18,%rax
  movss  0x8(%rax),%xmm0
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  movss  (%rdx,%rax,4),%xmm1
  comiss %xmm1,%xmm0
  jbe    L24
  movl   $0x2,-0x1c(%rbp)
L24:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    D47(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    D47(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  movss  (%rdx,%rax,4),%xmm0
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%eax
  cltq
  movss  (%rdx,%rax,4),%xmm2
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  movss  (%rdx,%rax,4),%xmm1
  addss  %xmm1,%xmm2
  movaps %xmm0,%xmm1
  subss  %xmm2,%xmm1
  movss  D13(%rip),%xmm0
  addss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm1
  movsd  D9(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  movsd  D9(%rip),%xmm0
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%eax
  cltq
  movss  (%rdx,%rax,4),%xmm0
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  movss  (%rdx,%rax,4),%xmm1
  subss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  -0x8(%rbp),%xmm0
  mov    -0x30(%rbp),%rax
  add    $0xc,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  movss  (%rdx,%rax,4),%xmm1
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%eax
  cltq
  movss  (%rdx,%rax,4),%xmm0
  addss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  -0x8(%rbp),%xmm0
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  movss  (%rdx,%rax,4),%xmm1
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  movss  (%rdx,%rax,4),%xmm0
  addss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  -0x8(%rbp),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
L25:
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D70
data_type: f64
name: unpack_data
arguments: label: D9
data_type: f64
name: unpack_data
arguments: label: D13
data_type: byte[4]

tool: D70: 1

tool: D9: 0.5

tool: {"D13": [0x00,0x00,0x80,0x3f]}

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