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

```asm
<MatrixLog3>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rsi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  movsd  (%rdi),%xmm5
  movsd  0x20(%rdi),%xmm3
  movsd  0x40(%rdi),%xmm2
  movapd %xmm5,%xmm0
  addsd  %xmm3,%xmm0
  addsd  %xmm2,%xmm0
  movsd  D197(%rip),%xmm4
  subsd  %xmm4,%xmm0
  mulsd  D222(%rip),%xmm0
  movapd %xmm0,%xmm1
  subsd  %xmm4,%xmm1
  andpd  D1(%rip),%xmm1
  movsd  D215(%rip),%xmm4
  comisd %xmm1,%xmm4
  ja     L87
  mov    %rdi,%rbx
  movsd  D25(%rip),%xmm1
  comisd %xmm0,%xmm1
  jb     L17
  addsd  D197(%rip),%xmm2
  comisd D215(%rip),%xmm2
  jae    L9
  addsd  D197(%rip),%xmm3
  comisd D215(%rip),%xmm3
  jb     L108
  addsd  %xmm3,%xmm3
  cvttsd2si %xmm3,%edi
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  movsd  D197(%rip),%xmm0
  divsd  %xmm1,%xmm0
  mulsd  0x8(%rbx),%xmm0
  movsd  %xmm0,0x10(%rsp)
  movsd  D197(%rip),%xmm0
  addsd  0x20(%rbx),%xmm0
  addsd  %xmm0,%xmm0
  cvttsd2si %xmm0,%edi
  call   <sqrt@plt>
  movapd %xmm0,%xmm2
  movsd  D197(%rip),%xmm0
  addsd  0x20(%rbx),%xmm0
  movsd  D197(%rip),%xmm1
  divsd  %xmm2,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,0x18(%rsp)
  addsd  %xmm0,%xmm0
  cvttsd2si %xmm0,%edi
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  movsd  D197(%rip),%xmm0
  divsd  %xmm1,%xmm0
  mulsd  0x38(%rbx),%xmm0
L3:
  movsd  D234(%rip),%xmm1
  movapd %xmm1,%xmm2
  mulsd  0x10(%rsp),%xmm2
  movsd  %xmm2,0x10(%rsp)
  movapd %xmm1,%xmm2
  mulsd  0x18(%rsp),%xmm2
  movsd  %xmm2,0x18(%rsp)
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,0x20(%rsp)
  lea    0x10(%rsp),%rdi
  mov    %rbp,%rsi
  call   <VecToso3@plt>
L56:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L30
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  ret
L87:
  mov    $0x48,%edx
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <memset@plt>
  jmp    L56
L9:
  addsd  %xmm2,%xmm2
  cvttsd2si %xmm2,%edi
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  movsd  D197(%rip),%xmm0
  divsd  %xmm1,%xmm0
  mulsd  0x10(%rbx),%xmm0
  movsd  %xmm0,0x10(%rsp)
  movsd  D197(%rip),%xmm0
  addsd  0x40(%rbx),%xmm0
  addsd  %xmm0,%xmm0
  cvttsd2si %xmm0,%edi
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  movsd  D197(%rip),%xmm0
  divsd  %xmm1,%xmm0
  mulsd  0x28(%rbx),%xmm0
  movsd  %xmm0,0x18(%rsp)
  movsd  D197(%rip),%xmm0
  addsd  0x40(%rbx),%xmm0
  addsd  %xmm0,%xmm0
  cvttsd2si %xmm0,%edi
  call   <sqrt@plt>
  movapd %xmm0,%xmm2
  movsd  D197(%rip),%xmm0
  addsd  0x40(%rbx),%xmm0
  movsd  D197(%rip),%xmm1
  divsd  %xmm2,%xmm1
  mulsd  %xmm1,%xmm0
  jmp    L3
L108:
  addsd  D197(%rip),%xmm5
  addsd  %xmm5,%xmm5
  cvttsd2si %xmm5,%edi
  call   <sqrt@plt>
  movapd %xmm0,%xmm2
  movsd  D197(%rip),%xmm0
  addsd  (%rbx),%xmm0
  movsd  D197(%rip),%xmm1
  divsd  %xmm2,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,0x10(%rsp)
  addsd  %xmm0,%xmm0
  cvttsd2si %xmm0,%edi
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  movsd  D197(%rip),%xmm0
  divsd  %xmm1,%xmm0
  mulsd  0x18(%rbx),%xmm0
  movsd  %xmm0,0x18(%rsp)
  movsd  D197(%rip),%xmm0
  addsd  (%rbx),%xmm0
  addsd  %xmm0,%xmm0
  cvttsd2si %xmm0,%edi
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  movsd  D197(%rip),%xmm0
  divsd  %xmm1,%xmm0
  mulsd  0x30(%rbx),%xmm0
  jmp    L3
L17:
  call   <acos@plt>
  movsd  %xmm0,0x8(%rsp)
  call   <sin@plt>
  addsd  %xmm0,%xmm0
  movsd  D197(%rip),%xmm1
  divsd  %xmm0,%xmm1
  mov    %rbx,%r8
  mov    $0x0,%ecx
L27:
  lea    (%rbx,%rcx,1),%rdi
  lea    0x0(%rbp,%rcx,1),%rsi
  mov    %r8,%rdx
  mov    $0x0,%eax
L91:
  movsd  (%rdi,%rax,1),%xmm0
  subsd  (%rdx),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  0x8(%rsp),%xmm0
  movsd  %xmm0,(%rsi,%rax,1)
  add    $0x18,%rdx
  add    $0x8,%rax
  cmp    $0x18,%rax
  jne    L91
  add    $0x8,%r8
  add    $0x18,%rcx
  cmp    $0x48,%rcx
  jne    L27
  jmp    L56
L30:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D197
data_type: f64
name: read_data
arguments: tag: D222
data_type: f32[2]
name: read_data
arguments: tag: D1
data_type: qword[2]
name: read_data
arguments: tag: D215
data_type: byte[16]
name: read_data
arguments: tag: D25
data_type: f32[2]
name: read_data
arguments: tag: D234
data_type: f64

tool: D197: 1

tool: {"D222": [0.0,1.75]}

tool: {"D1": [0x7fffffffffffffff,0x0000000000000000]}

tool: {"D215": [0x8d,0xed,0xb5,0xa0,0xf7,0xc6,0xb0,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: {"D25": [0.0,-1.875]}

tool: D234: 3.141592653589793

assistant: ```c
void MatrixLog3(double R[3][3], double so3Mat[3][3]) {
  double omg[3] = {0};
  double acosinput = (R[0][0] + R[1][1] + R[2][2] - 1.0) / 2.0;
  if (fabs(acosinput - 1.0) < 1.0E-6) {
    memset(so3Mat, 0, 9 * sizeof(double));
  } else if (acosinput <= -1.0) {
    if ((1.0 + R[2][2]) >= 1.0E-6) {
      omg[0] = 1.0 / sqrt(2 * (1.0 + R[2][2])) * R[0][2];
      omg[1] = 1.0 / sqrt(2 * (1.0 + R[2][2])) * R[1][2];
      omg[2] = 1.0 / sqrt(2 * (1.0 + R[2][2])) * (1.0 + R[2][2]);
    } else if ((1.0 + R[1][1] >= 1.0E-6)) {
      omg[0] = 1.0 / sqrt(2 * (1.0 + R[1][1])) * R[0][1];
      omg[1] = 1.0 / sqrt(2 * (1.0 + R[1][1])) * (1.0 + R[1][1]);
      omg[2] = 1.0 / sqrt(2 * (1.0 + R[1][1])) * R[2][1];
    } else {
      omg[0] = 1.0 / sqrt(2 * (1.0 + R[0][0])) * (1.0 + R[0][0]);
      omg[1] = 1.0 / sqrt(2 * (1.0 + R[0][0])) * R[1][0];
      omg[2] = 1.0 / sqrt(2 * (1.0 + R[0][0])) * R[2][0];
    }
    omg[0] = 3.14159265358979323846 * omg[0];
    omg[1] = 3.14159265358979323846 * omg[1];
    omg[2] = 3.14159265358979323846 * omg[2];
    VecToso3(omg, so3Mat);
  } else {
    int i;
    int j;
    double theta = acos(acosinput);
    for (i = 0; i < 3; i++) {
      for (j = 0; j < 3; j++) {
        so3Mat[i][j] = 1.0 / (2.0 * sin(theta)) * (R[i][j] - R[j][i]) * theta;
      }
    }
  }
  return;
}
```