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

```asm
<matToAxisamount>:
  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    $0x10,%rax
  movss  (%rax),%xmm0
  addss  %xmm0,%xmm1
  mov    -0x18(%rbp),%rax
  add    $0x20,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  movss  D34(%rip),%xmm1
  subss  %xmm1,%xmm0
  movss  D52(%rip),%xmm1
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  movd   %eax,%xmm0
  call   <acos@plt>
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    $0xc,%rax
  pxor   %xmm0,%xmm0
  cvtsi2ss %rdx,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0xc,%rax
  mov    (%rax),%eax
  movd   %eax,%xmm0
  call   <sin@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %rax,%xmm0
  movss  %xmm0,-0x4(%rbp)
  pxor   %xmm0,%xmm0
  cvtss2sd -0x4(%rbp),%xmm0
  movsd  D55(%rip),%xmm1
  divsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd -0x4(%rbp),%xmm1
  movsd  D55(%rip),%xmm2
  divsd  %xmm2,%xmm1
  cvttsd2si %xmm1,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  subsd  %xmm1,%xmm0
  pxor   %xmm3,%xmm3
  cvtsd2ss %xmm0,%xmm3
  movd   %xmm3,%eax
  movd   %eax,%xmm0
  call   <fabs@plt>
  movsd  D31(%rip),%xmm1
  comisd %xmm0,%xmm1
  jbe    L6
  mov    -0x20(%rbp),%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  movss  D34(%rip),%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  jmp    L15
L6:
  mov    -0x18(%rbp),%rax
  add    $0x14,%rax
  movss  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  add    $0x1c,%rax
  movss  (%rax),%xmm2
  movaps %xmm0,%xmm1
  subss  %xmm2,%xmm1
  movss  -0x4(%rbp),%xmm0
  movaps %xmm0,%xmm2
  addss  %xmm0,%xmm2
  divss  %xmm2,%xmm1
  movaps %xmm1,%xmm0
  mov    -0x20(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x18,%rax
  movss  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm2
  movaps %xmm0,%xmm1
  subss  %xmm2,%xmm1
  movss  -0x4(%rbp),%xmm0
  movaps %xmm0,%xmm2
  addss  %xmm0,%xmm2
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  divss  %xmm2,%xmm1
  movaps %xmm1,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  add    $0xc,%rax
  movss  (%rax),%xmm2
  movaps %xmm0,%xmm1
  subss  %xmm2,%xmm1
  movss  -0x4(%rbp),%xmm0
  movaps %xmm0,%xmm2
  addss  %xmm0,%xmm2
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  divss  %xmm2,%xmm1
  movaps %xmm1,%xmm0
  movss  %xmm0,(%rax)
L15:
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D34
datatype: byte[4]
name: retrieve_data
arguments: tag: D52
datatype: byte[4]
name: retrieve_data
arguments: tag: D55
datatype: f64
name: retrieve_data
arguments: tag: D31
datatype: byte[8]

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

tool: {"D52": [0x00,0x00,0x00,0x40]}

tool: D55: 3.141592653589793

tool: {"D31": [0x48,0xaf,0xbc,0x9a,0xf2,0xd7,0x7a,0x3e]}

assistant: ```c
void matToAxisamount(float mat[], float aa[]) {
  float c;
  float s;
  c = (mat[0] + mat[4] + mat[8] - 1.0f) / 2.0f;
  aa[3] = (float)acos(c);
  s = (float)sin(aa[3]);
  if (fabs(s / 3.14159265358979323846 - (int)(s / 3.14159265358979323846)) < .0000001) {
    aa[0] = 0.0f;
    aa[1] = 1.0f;
    aa[2] = 0.0f;
  } else {
    aa[0] = (mat[5] - mat[7]) / (2.0f * s);
    aa[1] = (mat[6] - mat[2]) / (2.0f * s);
    aa[2] = (mat[1] - mat[3]) / (2.0f * s);
  }
}
```