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

```asm
<calc_dihedral_radians>:
  endbr64
  sub    $0x48,%rsp
  movapd %xmm4,%xmm10
  movapd %xmm5,%xmm9
  movsd  0x50(%rsp),%xmm8
  subsd  %xmm1,%xmm10
  subsd  %xmm2,%xmm9
  movapd %xmm3,%xmm11
  subsd  %xmm7,%xmm4
  subsd  0x60(%rsp),%xmm7
  subsd  %xmm8,%xmm5
  subsd  0x68(%rsp),%xmm8
  movapd %xmm10,%xmm1
  movapd %xmm9,%xmm2
  subsd  %xmm0,%xmm11
  mulsd  %xmm4,%xmm2
  subsd  %xmm6,%xmm3
  movapd %xmm9,%xmm14
  mulsd  %xmm5,%xmm1
  movapd %xmm5,%xmm0
  subsd  0x58(%rsp),%xmm6
  mulsd  %xmm7,%xmm0
  movapd %xmm11,%xmm13
  mulsd  %xmm3,%xmm14
  mulsd  %xmm4,%xmm13
  subsd  %xmm2,%xmm1
  movapd %xmm4,%xmm2
  mulsd  %xmm8,%xmm2
  mulsd  %xmm3,%xmm8
  mulsd  %xmm6,%xmm4
  subsd  %xmm0,%xmm2
  movapd %xmm11,%xmm0
  mulsd  %xmm5,%xmm0
  mulsd  %xmm6,%xmm5
  pxor   %xmm6,%xmm6
  subsd  %xmm0,%xmm14
  movapd %xmm10,%xmm0
  mulsd  %xmm3,%xmm0
  movapd %xmm5,%xmm12
  mulsd  %xmm7,%xmm3
  subsd  %xmm8,%xmm12
  subsd  %xmm0,%xmm13
  movapd %xmm1,%xmm0
  subsd  %xmm4,%xmm3
  mulsd  %xmm2,%xmm0
  movapd %xmm14,%xmm4
  mulsd  %xmm12,%xmm4
  mulsd  %xmm12,%xmm12
  mulsd  %xmm1,%xmm1
  mulsd  %xmm14,%xmm14
  addsd  %xmm4,%xmm0
  movapd %xmm13,%xmm4
  mulsd  %xmm3,%xmm4
  mulsd  %xmm13,%xmm13
  addsd  %xmm14,%xmm1
  addsd  %xmm0,%xmm4
  movapd %xmm2,%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm13,%xmm1
  addsd  %xmm0,%xmm12
  movapd %xmm3,%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm0,%xmm12
  mulsd  %xmm12,%xmm1
  ucomisd %xmm1,%xmm6
  ja     L17
  sqrtsd %xmm1,%xmm1
L40:
  divsd  %xmm1,%xmm4
  comisd D29(%rip),%xmm4
  jbe    L13
  mov    D29(%rip),%rax
  movq   %rax,%xmm0
L23:
  movsd  %xmm9,0x30(%rsp)
  movsd  %xmm10,0x28(%rsp)
  movsd  %xmm11,0x20(%rsp)
  movsd  %xmm3,0x18(%rsp)
  movsd  %xmm8,0x10(%rsp)
  movsd  %xmm5,0x8(%rsp)
  movsd  %xmm2,(%rsp)
  call   <acos@plt>
  movsd  0x8(%rsp),%xmm5
  pxor   %xmm7,%xmm7
  movsd  0x10(%rsp),%xmm8
  movsd  (%rsp),%xmm2
  movsd  0x20(%rsp),%xmm11
  subsd  %xmm5,%xmm8
  movsd  0x28(%rsp),%xmm10
  movsd  0x18(%rsp),%xmm3
  mulsd  %xmm11,%xmm2
  movsd  0x30(%rsp),%xmm9
  mulsd  %xmm10,%xmm8
  mulsd  %xmm9,%xmm3
  subsd  %xmm8,%xmm2
  addsd  %xmm3,%xmm2
  comisd %xmm7,%xmm2
  jbe    L64
L41:
  add    $0x48,%rsp
  ret
  nopl   0x0(%rax)
L13:
  movsd  D39(%rip),%xmm1
  maxsd  %xmm4,%xmm1
  movapd %xmm1,%xmm0
  jmp    L23
  nopl   (%rax)
L64:
  comisd %xmm2,%xmm7
  jbe    L41
  comisd %xmm7,%xmm0
  jbe    L41
  xorpd  D10(%rip),%xmm0
  jmp    L41
L17:
  movapd %xmm1,%xmm0
  movsd  %xmm4,0x38(%rsp)
  movsd  %xmm9,0x30(%rsp)
  movsd  %xmm10,0x28(%rsp)
  movsd  %xmm11,0x20(%rsp)
  movsd  %xmm3,0x18(%rsp)
  movsd  %xmm8,0x10(%rsp)
  movsd  %xmm5,0x8(%rsp)
  movsd  %xmm2,(%rsp)
  call   <sqrt@plt>
  movsd  0x38(%rsp),%xmm4
  movsd  0x30(%rsp),%xmm9
  movsd  0x18(%rsp),%xmm3
  movsd  0x28(%rsp),%xmm10
  movapd %xmm0,%xmm1
  movsd  0x20(%rsp),%xmm11
  movsd  0x10(%rsp),%xmm8
  movsd  0x8(%rsp),%xmm5
  movsd  (%rsp),%xmm2
  jmp    L40
```

tool_calls: name: parse_data
arguments: data_tag: D29
type_guessed: f64[2]
name: parse_data
arguments: data_tag: D39
type_guessed: byte[8]
name: parse_data
arguments: data_tag: D10
type_guessed: byte[16]

tool: {"D29": [1.0,-0.0]}

tool: {"D39": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

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

assistant: ```c
double calc_dihedral_radians(double atom1x, double atom1y, double atom1z, double atom2x, double atom2y, double atom2z, double atom3x, double atom3y, double atom3z, double atom4x, double atom4y, double atom4z) {
  double vector1x, vector1y, vector1z;
  double vector2x, vector2y, vector2z;
  double vector3x, vector3y, vector3z;
  double v1Xv2xv2Xv3;
  double v1Xv2;
  double v2Xv3;
  double cosdihe;
  double dihedral;
  double sign;
  vector1x = atom2x - atom1x;
  vector1y = atom2y - atom1y;
  vector1z = atom2z - atom1z;
  vector2x = atom2x - atom3x;
  vector2y = atom2y - atom3y;
  vector2z = atom2z - atom3z;
  vector3x = atom3x - atom4x;
  vector3y = atom3y - atom4y;
  vector3z = atom3z - atom4z;
  v1Xv2xv2Xv3 = (vector1y * vector2z - vector1z * vector2y) * (vector2y * vector3z - vector2z * vector3y) + (vector2x * vector1z - vector1x * vector2z) * (vector3x * vector2z - vector2x * vector3z) + (vector1x * vector2y - vector2x * vector1y) * (vector2x * vector3y - vector3x * vector2y);
  v1Xv2 = (vector1y * vector2z - vector1z * vector2y) * (vector1y * vector2z - vector1z * vector2y) + (vector2x * vector1z - vector1x * vector2z) * (vector2x * vector1z - vector1x * vector2z) + (vector1x * vector2y - vector2x * vector1y) * (vector1x * vector2y - vector2x * vector1y);
  v2Xv3 = (vector2y * vector3z - vector2z * vector3y) * (vector2y * vector3z - vector2z * vector3y) + (vector3x * vector2z - vector2x * vector3z) * (vector3x * vector2z - vector2x * vector3z) + (vector2x * vector3y - vector3x * vector2y) * (vector2x * vector3y - vector3x * vector2y);
  cosdihe = v1Xv2xv2Xv3 / sqrt(v1Xv2 * v2Xv3);
  if (cosdihe > 1.0)
    cosdihe = 1.0;
  if (cosdihe < -1.0)
    cosdihe = -1.0;
  dihedral = acos(cosdihe);
  sign = vector1x * (vector2y * vector3z - vector3y * vector2z) - vector1y * (vector2x * vector3z - vector3x * vector2z) + vector1z * (vector2x * vector3y - vector3x * vector2y);
  if (sign > 0) {
    if (dihedral >= 0)
      return dihedral;
    if (dihedral < 0)
      return -dihedral;
  } else if (sign < 0) {
    if (dihedral > 0)
      return -dihedral;
    if (dihedral <= 0)
      return dihedral;
  }
  return dihedral;
}
```