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

```asm
<calc_dihedral_radians>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xc0,%rsp
  movsd  %xmm0,-0x88(%rbp)
  movsd  %xmm1,-0x90(%rbp)
  movsd  %xmm2,-0x98(%rbp)
  movsd  %xmm3,-0xa0(%rbp)
  movsd  %xmm4,-0xa8(%rbp)
  movsd  %xmm5,-0xb0(%rbp)
  movsd  %xmm6,-0xb8(%rbp)
  movsd  %xmm7,-0xc0(%rbp)
  movsd  -0xa0(%rbp),%xmm0
  subsd  -0x88(%rbp),%xmm0
  movsd  %xmm0,-0x70(%rbp)
  movsd  -0xa8(%rbp),%xmm0
  subsd  -0x90(%rbp),%xmm0
  movsd  %xmm0,-0x68(%rbp)
  movsd  -0xb0(%rbp),%xmm0
  subsd  -0x98(%rbp),%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  -0xa0(%rbp),%xmm0
  subsd  -0xb8(%rbp),%xmm0
  movsd  %xmm0,-0x58(%rbp)
  movsd  -0xa8(%rbp),%xmm0
  subsd  -0xc0(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0xb0(%rbp),%xmm0
  subsd  0x10(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0xb8(%rbp),%xmm0
  subsd  0x18(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  movsd  -0xc0(%rbp),%xmm0
  subsd  0x20(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  0x10(%rbp),%xmm0
  subsd  0x28(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x68(%rbp),%xmm0
  mulsd  -0x48(%rbp),%xmm0
  movsd  -0x60(%rbp),%xmm1
  mulsd  -0x50(%rbp),%xmm1
  movapd %xmm0,%xmm2
  subsd  %xmm1,%xmm2
  movsd  -0x50(%rbp),%xmm0
  mulsd  -0x30(%rbp),%xmm0
  movsd  -0x48(%rbp),%xmm1
  mulsd  -0x38(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x58(%rbp),%xmm0
  mulsd  -0x60(%rbp),%xmm0
  movsd  -0x70(%rbp),%xmm1
  mulsd  -0x48(%rbp),%xmm1
  movapd %xmm0,%xmm3
  subsd  %xmm1,%xmm3
  movsd  -0x40(%rbp),%xmm0
  mulsd  -0x48(%rbp),%xmm0
  movsd  -0x58(%rbp),%xmm1
  mulsd  -0x30(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm0,%xmm2
  movsd  -0x70(%rbp),%xmm0
  mulsd  -0x50(%rbp),%xmm0
  movsd  -0x58(%rbp),%xmm1
  mulsd  -0x68(%rbp),%xmm1
  movapd %xmm0,%xmm3
  subsd  %xmm1,%xmm3
  movsd  -0x58(%rbp),%xmm0
  mulsd  -0x38(%rbp),%xmm0
  movsd  -0x40(%rbp),%xmm1
  mulsd  -0x50(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x68(%rbp),%xmm0
  mulsd  -0x48(%rbp),%xmm0
  movsd  -0x60(%rbp),%xmm1
  mulsd  -0x50(%rbp),%xmm1
  movapd %xmm0,%xmm2
  subsd  %xmm1,%xmm2
  movsd  -0x68(%rbp),%xmm0
  mulsd  -0x48(%rbp),%xmm0
  movsd  -0x60(%rbp),%xmm1
  mulsd  -0x50(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x58(%rbp),%xmm0
  mulsd  -0x60(%rbp),%xmm0
  movsd  -0x70(%rbp),%xmm1
  mulsd  -0x48(%rbp),%xmm1
  movapd %xmm0,%xmm3
  subsd  %xmm1,%xmm3
  movsd  -0x58(%rbp),%xmm0
  mulsd  -0x60(%rbp),%xmm0
  movsd  -0x70(%rbp),%xmm1
  mulsd  -0x48(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm0,%xmm2
  movsd  -0x70(%rbp),%xmm0
  mulsd  -0x50(%rbp),%xmm0
  movsd  -0x58(%rbp),%xmm1
  mulsd  -0x68(%rbp),%xmm1
  movapd %xmm0,%xmm3
  subsd  %xmm1,%xmm3
  movsd  -0x70(%rbp),%xmm0
  mulsd  -0x50(%rbp),%xmm0
  movsd  -0x58(%rbp),%xmm1
  mulsd  -0x68(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x50(%rbp),%xmm0
  mulsd  -0x30(%rbp),%xmm0
  movsd  -0x48(%rbp),%xmm1
  mulsd  -0x38(%rbp),%xmm1
  movapd %xmm0,%xmm2
  subsd  %xmm1,%xmm2
  movsd  -0x50(%rbp),%xmm0
  mulsd  -0x30(%rbp),%xmm0
  movsd  -0x48(%rbp),%xmm1
  mulsd  -0x38(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x40(%rbp),%xmm0
  mulsd  -0x48(%rbp),%xmm0
  movsd  -0x58(%rbp),%xmm1
  mulsd  -0x30(%rbp),%xmm1
  movapd %xmm0,%xmm3
  subsd  %xmm1,%xmm3
  movsd  -0x40(%rbp),%xmm0
  mulsd  -0x48(%rbp),%xmm0
  movsd  -0x58(%rbp),%xmm1
  mulsd  -0x30(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm0,%xmm2
  movsd  -0x58(%rbp),%xmm0
  mulsd  -0x38(%rbp),%xmm0
  movsd  -0x40(%rbp),%xmm1
  mulsd  -0x50(%rbp),%xmm1
  movapd %xmm0,%xmm3
  subsd  %xmm1,%xmm3
  movsd  -0x58(%rbp),%xmm0
  mulsd  -0x38(%rbp),%xmm0
  movsd  -0x40(%rbp),%xmm1
  mulsd  -0x50(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x20(%rbp),%xmm0
  mulsd  -0x18(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  movsd  -0x28(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x78(%rbp)
  movsd  -0x78(%rbp),%xmm0
  movsd  D50(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L34
  movsd  D50(%rip),%xmm0
  movsd  %xmm0,-0x78(%rbp)
L34:
  movsd  D19(%rip),%xmm0
  comisd -0x78(%rbp),%xmm0
  jbe    L90
  movsd  D19(%rip),%xmm0
  movsd  %xmm0,-0x78(%rbp)
L90:
  mov    -0x78(%rbp),%rax
  movq   %rax,%xmm0
  call   <acos@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x10(%rbp)
  movsd  -0x50(%rbp),%xmm0
  mulsd  -0x30(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  mulsd  -0x48(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  -0x70(%rbp),%xmm0
  movsd  -0x58(%rbp),%xmm1
  mulsd  -0x30(%rbp),%xmm1
  movsd  -0x40(%rbp),%xmm2
  mulsd  -0x48(%rbp),%xmm2
  subsd  %xmm2,%xmm1
  mulsd  -0x68(%rbp),%xmm1
  movapd %xmm0,%xmm2
  subsd  %xmm1,%xmm2
  movsd  -0x58(%rbp),%xmm0
  mulsd  -0x38(%rbp),%xmm0
  movsd  -0x40(%rbp),%xmm1
  mulsd  -0x50(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  -0x60(%rbp),%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L8
  movsd  -0x10(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jb     L53
  movsd  -0x10(%rbp),%xmm0
  jmp    L1
L53:
  pxor   %xmm0,%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L103
  movsd  -0x10(%rbp),%xmm0
  movq   D44(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  jmp    L1
L8:
  pxor   %xmm0,%xmm0
  comisd -0x8(%rbp),%xmm0
  jbe    L103
  movsd  -0x10(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L11
  movsd  -0x10(%rbp),%xmm0
  movq   D44(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  jmp    L1
L11:
  pxor   %xmm0,%xmm0
  comisd -0x10(%rbp),%xmm0
  jb     L103
  movsd  -0x10(%rbp),%xmm0
  jmp    L1
L103:
  movsd  -0x10(%rbp),%xmm0
L1:
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D50
datatype: f64
name: retrieve_data
arguments: label: D19
datatype: byte[8]
name: retrieve_data
arguments: label: D44
datatype: byte[8]

tool: D50: 1

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

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

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;
}
```