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

```asm
<doubles_quat_slerp>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdx,%rbp
  mov    $0x4,%edx
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x50,%rsp
  movsd  %xmm0,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  call   <doubles_dot@plt>
  lea    0x20(%rsp),%rdi
  mov    $0x20,%edx
  mov    %r12,%rsi
  movsd  %xmm0,0x10(%rsp)
  call   <memcpy@plt>
  movsd  0x10(%rsp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm0,%xmm1
  jbe    L23
  movapd D36(%rip),%xmm1
  movapd 0x20(%rsp),%xmm2
  xorpd  D12(%rip),%xmm0
  xorpd  %xmm1,%xmm2
  xorpd  0x30(%rsp),%xmm1
  movaps %xmm2,0x20(%rsp)
  movaps %xmm1,0x30(%rsp)
L23:
  comisd D17(%rip),%xmm0
  jbe    L26
  movsd  D3(%rip),%xmm0
  movsd  0x8(%rsp),%xmm4
  lea    0x8(%rbx),%rax
  subsd  %xmm4,%xmm0
  cmp    %rax,%rbp
  je     L70
  movupd (%rbx),%xmm2
  movapd 0x20(%rsp),%xmm3
  movapd %xmm4,%xmm1
  unpcklpd %xmm0,%xmm0
  unpcklpd %xmm1,%xmm1
  mulpd  %xmm0,%xmm2
  mulpd  %xmm1,%xmm3
  mulpd  0x30(%rsp),%xmm1
  addpd  %xmm3,%xmm2
  movups %xmm2,0x0(%rbp)
  movupd 0x10(%rbx),%xmm2
  mulpd  %xmm2,%xmm0
  addpd  %xmm0,%xmm1
  movups %xmm1,0x10(%rbp)
L69:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L62
  add    $0x50,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L26:
  call   <acos@plt>
  pxor   %xmm2,%xmm2
  movsd  D3(%rip),%xmm0
  subsd  0x8(%rsp),%xmm0
  cvtsi2sd %rax,%xmm2
  mulsd  %xmm2,%xmm0
  movsd  %xmm2,0x18(%rsp)
  call   <sin@plt>
  movsd  0x8(%rsp),%xmm0
  movsd  0x18(%rsp),%xmm2
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  mulsd  %xmm2,%xmm0
  movsd  %xmm1,0x10(%rsp)
  call   <sin@plt>
  pxor   %xmm0,%xmm0
  movsd  0x10(%rsp),%xmm1
  cvtsi2sd %rax,%xmm0
  lea    0x8(%rbx),%rax
  cmp    %rax,%rbp
  je     L71
  movupd (%rbx),%xmm2
  movapd 0x20(%rsp),%xmm3
  unpcklpd %xmm1,%xmm1
  unpcklpd %xmm0,%xmm0
  mulpd  %xmm1,%xmm2
  mulpd  %xmm0,%xmm3
  mulpd  0x30(%rsp),%xmm0
  addpd  %xmm3,%xmm2
  movups %xmm2,0x0(%rbp)
  movupd 0x10(%rbx),%xmm2
  mulpd  %xmm2,%xmm1
  addpd  %xmm1,%xmm0
  movups %xmm0,0x10(%rbp)
L15:
  mov    %rbp,%rdx
  mov    $0x4,%esi
  mov    %rbp,%rdi
  call   <doubles_normalize@plt>
  jmp    L69
  nopl   0x0(%rax)
L70:
  movsd  0x20(%rsp),%xmm2
  movsd  (%rbx),%xmm1
  movapd %xmm4,%xmm6
  mulsd  0x38(%rsp),%xmm6
  mulsd  %xmm0,%xmm1
  mulsd  %xmm4,%xmm2
  addsd  %xmm1,%xmm2
  movsd  0x28(%rsp),%xmm1
  mulsd  %xmm4,%xmm1
  movsd  %xmm2,0x8(%rbx)
  mulsd  %xmm0,%xmm2
  addsd  %xmm2,%xmm1
  movsd  0x30(%rsp),%xmm2
  mulsd  %xmm4,%xmm2
  movsd  %xmm1,0x10(%rbx)
  mulsd  %xmm0,%xmm1
  addsd  %xmm2,%xmm1
  movapd %xmm6,%xmm2
  mulsd  %xmm1,%xmm0
  movsd  %xmm1,0x18(%rbx)
  addsd  %xmm0,%xmm2
  movsd  %xmm2,0x20(%rbx)
  jmp    L69
  nopl   0x0(%rax)
L71:
  movsd  (%rbx),%xmm3
  movsd  0x20(%rsp),%xmm2
  mulsd  %xmm1,%xmm3
  mulsd  %xmm0,%xmm2
  addsd  %xmm2,%xmm3
  movsd  0x28(%rsp),%xmm2
  mulsd  %xmm0,%xmm2
  movsd  %xmm3,0x8(%rbx)
  mulsd  %xmm1,%xmm3
  addsd  %xmm3,%xmm2
  movsd  0x30(%rsp),%xmm3
  mulsd  %xmm0,%xmm3
  movsd  %xmm2,0x10(%rbx)
  mulsd  %xmm1,%xmm2
  mulsd  0x38(%rsp),%xmm0
  addsd  %xmm3,%xmm2
  mulsd  %xmm2,%xmm1
  movsd  %xmm2,0x18(%rbx)
  addsd  %xmm0,%xmm1
  movsd  %xmm1,0x20(%rbx)
  jmp    L15
L62:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D36
datatype: byte[16]
name: extract_symbolic_data
arguments: tag: D12
datatype: byte[16]
name: extract_symbolic_data
arguments: tag: D17
datatype: f64[2]
name: extract_symbolic_data
arguments: tag: D3
datatype: f64

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

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

tool: {"D17": [0.95,1.0]}

tool: D3: 1

assistant: ```c
void doubles_quat_slerp(const double q0[4], const double _q1[4], double r[4], double w) {
  double dot = doubles_dot(q0, _q1, 4);
  double q1[4];
  memcpy(q1, _q1, sizeof(double) * 4);
  if (dot < 0) {
    dot = -dot;
    for (int i = 0; i < 4; i++)
      q1[i] *= -1;
  }
  if (dot > 0.95) {
    for (int i = 0; i < 4; i++)
      r[i] = q0[i] * (1 - w) + q1[i] * w;
  } else {
    double angle = (double)acos(dot);
    double w0 = (double)sin(angle * (1 - w)), w1 = (double)sin(angle * w);
    for (int i = 0; i < 4; i++)
      r[i] = q0[i] * w0 + q1[i] * w1;
    doubles_normalize(r, 4, r);
  }
}
```