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

```asm
<R2Quaternion>:
  endbr64
  movss  (%rdi),%xmm0
  movss  D36(%rip),%xmm1
  push   %r12
  xor    %r12d,%r12d
  movss  0x10(%rdi),%xmm5
  movss  0x20(%rdi),%xmm4
  push   %rbp
  mov    %rsi,%rbp
  movaps %xmm0,%xmm2
  push   %rbx
  mov    %rdi,%rbx
  addss  %xmm1,%xmm2
  subss  %xmm0,%xmm1
  movaps %xmm5,%xmm0
  movaps %xmm2,%xmm3
  subss  %xmm5,%xmm2
  addss  %xmm1,%xmm0
  addss  %xmm5,%xmm3
  subss  %xmm5,%xmm1
  subss  %xmm4,%xmm2
  subss  %xmm4,%xmm0
  addss  %xmm4,%xmm3
  addss  %xmm4,%xmm1
  comiss %xmm3,%xmm2
  jbe    L76
  movaps %xmm2,%xmm3
  mov    $0x1,%r12d
L76:
  comiss %xmm3,%xmm0
  ja     L59
  comiss %xmm3,%xmm1
  ja     L38
  movaps %xmm3,%xmm0
  call   <sqrtf@plt>
  pxor   %xmm4,%xmm4
  add    %eax,%eax
  cvtsi2ss %eax,%xmm4
  test   %r12d,%r12d
  jne    L16
  movss  D11(%rip),%xmm2
  mulss  %xmm4,%xmm2
  movss  %xmm2,0x0(%rbp)
  movss  0x14(%rbx),%xmm1
  subss  0x1c(%rbx),%xmm1
  divss  %xmm4,%xmm1
  movss  %xmm1,0x4(%rbp)
  movss  0x18(%rbx),%xmm0
  subss  0x8(%rbx),%xmm0
  divss  %xmm4,%xmm0
  movss  %xmm0,0x8(%rbp)
  movss  0x4(%rbx),%xmm3
  subss  0xc(%rbx),%xmm3
  divss  %xmm4,%xmm3
  pxor   %xmm4,%xmm4
  comiss %xmm2,%xmm4
  movss  %xmm3,0xc(%rbp)
  ja     L29
L72:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L59:
  comiss %xmm0,%xmm1
  jbe    L7
L38:
  movaps %xmm1,%xmm0
  call   <sqrtf@plt>
  pxor   %xmm4,%xmm4
  movss  D11(%rip),%xmm3
  add    %eax,%eax
  cvtsi2ss %eax,%xmm4
  mulss  %xmm4,%xmm3
  movss  %xmm3,0xc(%rbp)
  movss  0x4(%rbx),%xmm2
  subss  0xc(%rbx),%xmm2
  divss  %xmm4,%xmm2
  movss  %xmm2,0x0(%rbp)
  movss  0x8(%rbx),%xmm1
  addss  0x18(%rbx),%xmm1
  divss  %xmm4,%xmm1
  movss  %xmm1,0x4(%rbp)
  movss  0x14(%rbx),%xmm0
  addss  0x1c(%rbx),%xmm0
  divss  %xmm4,%xmm0
  movss  %xmm0,0x8(%rbp)
L13:
  pxor   %xmm4,%xmm4
  comiss %xmm2,%xmm4
  jbe    L72
L29:
  movss  D58(%rip),%xmm4
  pop    %rbx
  xorps  %xmm4,%xmm2
  xorps  %xmm4,%xmm1
  xorps  %xmm4,%xmm0
  xorps  %xmm4,%xmm3
  movss  %xmm2,0x0(%rbp)
  movss  %xmm1,0x4(%rbp)
  movss  %xmm0,0x8(%rbp)
  movss  %xmm3,0xc(%rbp)
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L7:
  call   <sqrtf@plt>
  pxor   %xmm4,%xmm4
  movss  D11(%rip),%xmm0
  add    %eax,%eax
  cvtsi2ss %eax,%xmm4
  mulss  %xmm4,%xmm0
  movss  %xmm0,0x8(%rbp)
  movss  0x18(%rbx),%xmm2
  subss  0x8(%rbx),%xmm2
  divss  %xmm4,%xmm2
  movss  %xmm2,0x0(%rbp)
  movss  0x4(%rbx),%xmm1
  addss  0xc(%rbx),%xmm1
  divss  %xmm4,%xmm1
  movss  %xmm1,0x4(%rbp)
  movss  0x14(%rbx),%xmm3
  addss  0x1c(%rbx),%xmm3
  divss  %xmm4,%xmm3
  movss  %xmm3,0xc(%rbp)
  jmp    L13
L16:
  movss  D11(%rip),%xmm1
  mulss  %xmm4,%xmm1
  movss  %xmm1,0x4(%rbp)
  movss  0x14(%rbx),%xmm2
  subss  0x1c(%rbx),%xmm2
  divss  %xmm4,%xmm2
  movss  %xmm2,0x0(%rbp)
  movss  0x4(%rbx),%xmm0
  addss  0xc(%rbx),%xmm0
  divss  %xmm4,%xmm0
  movss  %xmm0,0x8(%rbp)
  movss  0x8(%rbx),%xmm3
  addss  0x18(%rbx),%xmm3
  divss  %xmm4,%xmm3
  movss  %xmm3,0xc(%rbp)
  jmp    L13
```

tool_calls: name: read_data
arguments: tag: D36
type_infered: byte[4]
name: read_data
arguments: tag: D11
type_infered: byte[4]
name: read_data
arguments: tag: D58
type_infered: byte[4]

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

tool: {"D11": [0x00,0x00,0x80,0x3e]}

tool: {"D58": [0x00,0x00,0x00,0x80]}

assistant: ```c
void R2Quaternion(float R[3][3], float q[4]) {
  float m[4], mag;
  uint8_t index, i;
  m[0] = 1 + R[0][0] + R[1][1] + R[2][2];
  m[1] = 1 + R[0][0] - R[1][1] - R[2][2];
  m[2] = 1 - R[0][0] + R[1][1] - R[2][2];
  m[3] = 1 - R[0][0] - R[1][1] + R[2][2];
  index = 0;
  mag = m[0];
  for (i = 1; i < 4; i++) {
    if (m[i] > mag) {
      mag = m[i];
      index = i;
    }
  }
  mag = 2 * sqrtf(mag);
  if (index == 0) {
    q[0] = mag / 4;
    q[1] = (R[1][2] - R[2][1]) / mag;
    q[2] = (R[2][0] - R[0][2]) / mag;
    q[3] = (R[0][1] - R[1][0]) / mag;
  } else if (index == 1) {
    q[1] = mag / 4;
    q[0] = (R[1][2] - R[2][1]) / mag;
    q[2] = (R[0][1] + R[1][0]) / mag;
    q[3] = (R[0][2] + R[2][0]) / mag;
  } else if (index == 2) {
    q[2] = mag / 4;
    q[0] = (R[2][0] - R[0][2]) / mag;
    q[1] = (R[0][1] + R[1][0]) / mag;
    q[3] = (R[1][2] + R[2][1]) / mag;
  } else {
    q[3] = mag / 4;
    q[0] = (R[0][1] - R[1][0]) / mag;
    q[1] = (R[0][2] + R[2][0]) / mag;
    q[2] = (R[1][2] + R[2][1]) / mag;
  }
  if (q[0] < 0) {
    q[0] = -q[0];
    q[1] = -q[1];
    q[2] = -q[2];
    q[3] = -q[3];
  }
}
```