user: Converte this assembly snippet into its equivalent C code:

```asm
<mid_point>:
  endbr64
  push   %r15
  movapd %xmm3,%xmm8
  movapd %xmm4,%xmm9
  movapd %xmm5,%xmm10
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0xc8,%rsp
  movsd  0x118(%rsp),%xmm5
  movsd  %xmm0,(%rsp)
  lea    0x78(%rsp),%rdi
  movsd  0x110(%rsp),%xmm4
  movsd  0x108(%rsp),%xmm3
  movapd %xmm8,%xmm0
  movsd  %xmm1,0x8(%rsp)
  lea    0x88(%rsp),%rdx
  movapd %xmm9,%xmm1
  movsd  %xmm2,0x10(%rsp)
  lea    0x80(%rsp),%rsi
  movapd %xmm10,%xmm2
  movsd  %xmm6,0x18(%rsp)
  lea    0xa8(%rsp),%r15
  lea    0xb0(%rsp),%r14
  movsd  %xmm7,0x20(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xb8(%rsp)
  xor    %eax,%eax
  movsd  %xmm10,0x68(%rsp)
  movsd  %xmm9,0x60(%rsp)
  movsd  %xmm8,0x58(%rsp)
  call   <cross@plt>
  movsd  0x20(%rsp),%xmm7
  movsd  0x100(%rsp),%xmm11
  lea    0x90(%rsp),%r8
  subsd  0x10(%rsp),%xmm11
  subsd  0x8(%rsp),%xmm7
  mov    %r8,%rdi
  mov    %r8,0x40(%rsp)
  movsd  0x18(%rsp),%xmm6
  subsd  (%rsp),%xmm6
  lea    0xa0(%rsp),%rdx
  movsd  0x118(%rsp),%xmm5
  lea    0x98(%rsp),%rsi
  movsd  0x110(%rsp),%xmm4
  mov    %rdx,0x50(%rsp)
  movapd %xmm11,%xmm2
  movapd %xmm7,%xmm1
  mov    %rsi,0x48(%rsp)
  movsd  0x108(%rsp),%xmm3
  movapd %xmm6,%xmm0
  movsd  %xmm11,0x38(%rsp)
  movsd  %xmm7,0x30(%rsp)
  movsd  %xmm6,0x28(%rsp)
  call   <cross@plt>
  movsd  0x78(%rsp),%xmm3
  mov    %r15,%rdi
  movsd  0x88(%rsp),%xmm5
  movsd  0x80(%rsp),%xmm4
  movsd  0xa0(%rsp),%xmm2
  movsd  0x98(%rsp),%xmm1
  movsd  0x90(%rsp),%xmm0
  call   <dotP@plt>
  movsd  0x78(%rsp),%xmm0
  mov    %r14,%rdi
  movsd  0x88(%rsp),%xmm2
  movsd  0x80(%rsp),%xmm1
  movapd %xmm2,%xmm5
  movapd %xmm0,%xmm3
  movapd %xmm1,%xmm4
  call   <dotP@plt>
  movsd  0x8(%rsp),%xmm7
  mov    0x50(%rsp),%rdx
  movsd  0x60(%rsp),%xmm9
  movsd  0x68(%rsp),%xmm10
  movsd  0xa8(%rsp),%xmm0
  movsd  0x10(%rsp),%xmm6
  divsd  0xb0(%rsp),%xmm0
  movapd %xmm0,%xmm1
  movapd %xmm0,%xmm13
  movsd  0x58(%rsp),%xmm8
  movsd  %xmm0,0xa8(%rsp)
  movsd  0x38(%rsp),%xmm11
  mulsd  %xmm10,%xmm0
  mov    0x48(%rsp),%rsi
  mov    0x40(%rsp),%rdi
  movapd %xmm10,%xmm5
  mulsd  %xmm9,%xmm13
  movapd %xmm9,%xmm4
  movapd %xmm8,%xmm3
  mulsd  %xmm8,%xmm1
  movapd %xmm11,%xmm2
  addsd  (%rsp),%xmm1
  addsd  %xmm0,%xmm6
  addsd  %xmm13,%xmm7
  movsd  %xmm1,(%rsp)
  movsd  %xmm6,0x10(%rsp)
  movsd  0x28(%rsp),%xmm6
  movsd  %xmm7,0x8(%rsp)
  movsd  0x30(%rsp),%xmm7
  movapd %xmm6,%xmm0
  movapd %xmm7,%xmm1
  call   <cross@plt>
  movsd  0x78(%rsp),%xmm3
  mov    %r15,%rdi
  movsd  0x88(%rsp),%xmm5
  movsd  0x80(%rsp),%xmm4
  movsd  0xa0(%rsp),%xmm2
  movsd  0x98(%rsp),%xmm1
  movsd  0x90(%rsp),%xmm0
  call   <dotP@plt>
  movsd  0x78(%rsp),%xmm0
  mov    %r14,%rdi
  movsd  0x88(%rsp),%xmm2
  movsd  0x80(%rsp),%xmm1
  movapd %xmm2,%xmm5
  movapd %xmm0,%xmm3
  movapd %xmm1,%xmm4
  call   <dotP@plt>
  movsd  D8(%rip),%xmm1
  movsd  0x108(%rsp),%xmm2
  movsd  0x110(%rsp),%xmm4
  movsd  0xa8(%rsp),%xmm0
  divsd  0xb0(%rsp),%xmm0
  movsd  0x100(%rsp),%xmm3
  mulsd  %xmm0,%xmm2
  mulsd  %xmm0,%xmm4
  addsd  0x18(%rsp),%xmm2
  mulsd  0x118(%rsp),%xmm0
  addsd  0x20(%rsp),%xmm4
  movapd %xmm2,%xmm5
  subsd  (%rsp),%xmm5
  movsd  %xmm2,0x28(%rsp)
  movapd %xmm4,%xmm6
  subsd  0x8(%rsp),%xmm6
  movsd  %xmm4,0x20(%rsp)
  addsd  %xmm0,%xmm3
  movapd %xmm5,%xmm0
  mulsd  %xmm6,%xmm6
  mulsd  %xmm0,%xmm0
  movapd %xmm3,%xmm5
  subsd  0x10(%rsp),%xmm5
  movsd  %xmm3,0x18(%rsp)
  mulsd  %xmm5,%xmm5
  addsd  %xmm6,%xmm0
  addsd  %xmm5,%xmm0
  call   <pow@plt>
  movsd  0x28(%rsp),%xmm2
  mov    D8(%rip),%rax
  movsd  %xmm0,0x0(%r13)
  movsd  (%rsp),%xmm0
  movsd  0x20(%rsp),%xmm4
  movq   %rax,%xmm1
  movsd  0x18(%rsp),%xmm3
  addsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%r12)
  movsd  0x8(%rsp),%xmm0
  addsd  %xmm4,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,0x0(%rbp)
  movsd  0x10(%rsp),%xmm0
  addsd  %xmm3,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rbx)
  mov    0xb8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0xc8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L3:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D8
type_guessed: f64

tool: D8: 0.5

assistant: ```c
void mid_point(double A1x, double A1y, double A1z, double Ux, double Uy, double Uz, double B1x, double B1y, double B1z, double Vx, double Vy, double Vz, double *dist, double *XX, double *YY, double *ZZ) {
  double Wx, Wy, Wz;
  double P1x, P1y, P1z, P2x, P2y, P2z;
  double cx, cy, cz, tmp1, tmp2;
  cross(Ux, Uy, Uz, Vx, Vy, Vz, &Wx, &Wy, &Wz);
  cross(B1x - A1x, B1y - A1y, B1z - A1z, Vx, Vy, Vz, &cx, &cy, &cz);
  dotP(cx, cy, cz, Wx, Wy, Wz, &tmp1);
  dotP(Wx, Wy, Wz, Wx, Wy, Wz, &tmp2);
  tmp1 = tmp1 / tmp2;
  P1x = A1x + tmp1 * Ux;
  P1y = A1y + tmp1 * Uy;
  P1z = A1z + tmp1 * Uz;
  cross(B1x - A1x, B1y - A1y, B1z - A1z, Ux, Uy, Uz, &cx, &cy, &cz);
  dotP(cx, cy, cz, Wx, Wy, Wz, &tmp1);
  dotP(Wx, Wy, Wz, Wx, Wy, Wz, &tmp2);
  tmp1 = tmp1 / tmp2;
  P2x = B1x + tmp1 * Vx;
  P2y = B1y + tmp1 * Vy;
  P2z = B1z + tmp1 * Vz;
  *dist = pow(pow(P2x - P1x, 2.) + pow(P2y - P1y, 2.) + pow(P2z - P1z, 2.), 0.5);
  *XX = 0.5 * (P1x + P2x);
  *YY = 0.5 * (P1y + P2y);
  *ZZ = 0.5 * (P1z + P2z);
}
```