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

```asm
<tide_pl>:
  endbr64
  push   %r14
  movq   %xmm0,%r14
  push   %r13
  mov    %rsi,%r13
  lea    D208(%rip),%rsi
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    $0x4,%edi
  add    $0xffffffffffffff80,%rsp
  movsd  D6(%rip),%xmm1
  movsd  (%rdx),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x78(%rsp)
  xor    %eax,%eax
  mov    $0x2,%eax
  mulsd  %xmm1,%xmm0
  mulsd  0x8(%rdx),%xmm1
  call   <trace@plt>
  mov    $0x3,%esi
  mov    %r13,%rdi
  call   <norm@plt>
  movapd %xmm0,%xmm2
  movapd %xmm0,%xmm3
  pxor   %xmm0,%xmm0
  comisd %xmm2,%xmm0
  jae    L14
  movupd 0x0(%r13),%xmm1
  unpcklpd %xmm3,%xmm3
  movsd  D11(%rip),%xmm4
  movsd  D149(%rip),%xmm8
  movsd  0x10(%r13),%xmm0
  divpd  %xmm3,%xmm1
  movq   %r14,%xmm3
  divsd  D101(%rip),%xmm3
  mulsd  %xmm4,%xmm3
  mulsd  %xmm4,%xmm3
  movapd %xmm2,%xmm4
  mulsd  %xmm2,%xmm4
  mulsd  %xmm2,%xmm4
  divsd  %xmm4,%xmm3
  movaps %xmm1,0x60(%rsp)
  movaps %xmm1,0x10(%rsp)
  divsd  %xmm2,%xmm0
  mulsd  %xmm3,%xmm8
  movsd  %xmm3,(%rsp)
  divsd  %xmm2,%xmm8
  movsd  %xmm0,0x70(%rsp)
  movsd  %xmm8,0x28(%rsp)
  call   <asin@plt>
  movapd 0x10(%rsp),%xmm1
  movsd  %xmm0,0x8(%rsp)
  movapd %xmm1,%xmm7
  unpckhpd %xmm7,%xmm7
  movapd %xmm7,%xmm0
  call   <atan2@plt>
  movsd  0x8(%rsp),%xmm6
  movsd  %xmm0,0x20(%rsp)
  movapd %xmm6,%xmm0
  movsd  %xmm6,0x48(%rsp)
  call   <cos@plt>
  lea    0x58(%rsp),%rdi
  lea    0x50(%rsp),%rsi
  movsd  %xmm0,0x40(%rsp)
  movsd  (%r12),%xmm0
  call   <sincos@plt>
  movsd  0x58(%rsp),%xmm0
  movsd  0x50(%rsp),%xmm5
  lea    0x60(%rsp),%rdi
  movsd  D126(%rip),%xmm2
  mov    %rbx,%rsi
  mov    $0x3,%edx
  movsd  %xmm5,0x38(%rsp)
  mulsd  %xmm0,%xmm2
  mulsd  %xmm0,%xmm2
  subsd  D134(%rip),%xmm2
  mulsd  D119(%rip),%xmm2
  movapd %xmm2,%xmm1
  movsd  %xmm2,0x10(%rsp)
  mulsd  D179(%rip),%xmm1
  addsd  D105(%rip),%xmm1
  movsd  %xmm1,0x8(%rsp)
  call   <dot@plt>
  movsd  (%rsp),%xmm5
  movsd  D126(%rip),%xmm10
  movsd  0x8(%rsp),%xmm1
  movapd %xmm0,%xmm9
  movsd  D88(%rip),%xmm11
  movapd %xmm0,%xmm3
  mulsd  %xmm5,%xmm10
  movsd  0x10(%rsp),%xmm2
  movsd  D13(%rip),%xmm6
  mulsd  %xmm11,%xmm9
  movsd  0x28(%rsp),%xmm8
  mulsd  D136(%rip),%xmm2
  mulsd  %xmm3,%xmm6
  mulsd  %xmm1,%xmm10
  mulsd  D126(%rip),%xmm1
  movapd %xmm9,%xmm4
  mulsd  %xmm0,%xmm4
  subsd  D119(%rip),%xmm4
  mulsd  %xmm0,%xmm10
  movsd  D129(%rip),%xmm0
  mulsd  %xmm3,%xmm1
  subsd  %xmm2,%xmm0
  movapd %xmm8,%xmm2
  mulsd  %xmm0,%xmm4
  movapd %xmm6,%xmm0
  movsd  0x48(%rsp),%xmm6
  mulsd  %xmm3,%xmm1
  mulsd  %xmm3,%xmm0
  addsd  %xmm6,%xmm6
  subsd  %xmm1,%xmm4
  movsd  D40(%rip),%xmm1
  subsd  %xmm11,%xmm0
  movsd  D95(%rip),%xmm11
  mulsd  %xmm3,%xmm1
  mulsd  %xmm11,%xmm2
  mulsd  %xmm5,%xmm4
  mulsd  %xmm3,%xmm1
  mulsd  %xmm0,%xmm2
  mulsd  %xmm11,%xmm0
  mulsd  %xmm3,%xmm1
  addsd  %xmm10,%xmm2
  mulsd  %xmm3,%xmm0
  movsd  %xmm2,0x30(%rsp)
  subsd  %xmm9,%xmm1
  mulsd  D41(%rip),%xmm1
  subsd  %xmm0,%xmm1
  movapd %xmm6,%xmm0
  mulsd  %xmm8,%xmm1
  addsd  %xmm4,%xmm1
  movsd  %xmm1,0x28(%rsp)
  call   <sin@plt>
  movsd  %xmm0,0x8(%rsp)
  movsd  (%r12),%xmm0
  addsd  %xmm0,%xmm0
  call   <sin@plt>
  movsd  0x8(%r12),%xmm1
  subsd  0x20(%rsp),%xmm1
  movsd  %xmm0,0x10(%rsp)
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x20(%rsp)
  call   <sin@plt>
  movsd  (%rsp),%xmm7
  movsd  0x20(%rsp),%xmm1
  mulsd  D25(%rip),%xmm7
  movapd %xmm0,%xmm3
  movsd  0x8(%rsp),%xmm0
  addsd  %xmm1,%xmm1
  mulsd  %xmm7,%xmm0
  mulsd  0x10(%rsp),%xmm0
  mulsd  %xmm3,%xmm0
  addsd  0x28(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  movapd %xmm1,%xmm0
  call   <sin@plt>
  movsd  (%rsp),%xmm3
  mulsd  D213(%rip),%xmm3
  lea    D139(%rip),%rsi
  movsd  0x40(%rsp),%xmm7
  movsd  0x38(%rsp),%xmm5
  mov    $0x5,%edi
  mov    $0x3,%eax
  mulsd  %xmm7,%xmm3
  mulsd  %xmm7,%xmm3
  mulsd  %xmm5,%xmm3
  mulsd  %xmm5,%xmm3
  mulsd  %xmm0,%xmm3
  addsd  0x8(%rsp),%xmm3
  movsd  (%rbx),%xmm1
  movsd  0x30(%rsp),%xmm2
  movsd  0x60(%rsp),%xmm0
  mulsd  %xmm3,%xmm1
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  0x68(%rsp),%xmm1
  mulsd  %xmm2,%xmm1
  movsd  %xmm0,0x0(%rbp)
  movsd  0x8(%rbx),%xmm4
  mulsd  0x70(%rsp),%xmm2
  mulsd  %xmm3,%xmm4
  addsd  %xmm4,%xmm1
  movsd  %xmm1,0x8(%rbp)
  mulsd  0x10(%rbx),%xmm3
  addsd  %xmm3,%xmm2
  movsd  %xmm2,0x10(%rbp)
  call   <trace@plt>
L14:
  mov    0x78(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L12
  sub    $0xffffffffffffff80,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L12:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D208
data_type: string
name: retrieve_data
arguments: data_tag: D6
data_type: byte[8]
name: retrieve_data
arguments: data_tag: D11
data_type: byte[8]
name: retrieve_data
arguments: data_tag: D149
data_type: f64
name: retrieve_data
arguments: data_tag: D101
data_type: byte[8]
name: retrieve_data
arguments: data_tag: D126
data_type: f64
name: retrieve_data
arguments: data_tag: D134
data_type: f64
name: retrieve_data
arguments: data_tag: D119
data_type: f64
name: retrieve_data
arguments: data_tag: D179
data_type: f64
name: retrieve_data
arguments: data_tag: D105
data_type: f64
name: retrieve_data
arguments: data_tag: D88
data_type: f64
name: retrieve_data
arguments: data_tag: D13
data_type: f64
name: retrieve_data
arguments: data_tag: D136
data_type: f64
name: retrieve_data
arguments: data_tag: D129
data_type: f64
name: retrieve_data
arguments: data_tag: D40
data_type: f64
name: retrieve_data
arguments: data_tag: D95
data_type: f64
name: retrieve_data
arguments: data_tag: D41
data_type: f64
name: retrieve_data
arguments: data_tag: D25
data_type: byte[8]
name: retrieve_data
arguments: data_tag: D213
data_type: byte[8]
name: retrieve_data
arguments: data_tag: D139
data_type: string

tool: D208: tide_pl : pos=%.3f %.3f


tool: {"D6": [0xf8,0xc1,0x63,0x1a,0xdc,0xa5,0x4c,0x40]}

tool: {"D11": [0x80,0xb8,0x2f,0x4c,0xd9,0x7f,0xc2,0x42]}

tool: D149: 6378137

tool: {"D101": [0x00,0x16,0x91,0x5b,0x66,0xa8,0xf6,0x42]}

tool: D126: 3

tool: D134: 1

tool: D119: 0.5

tool: D179: 0.0002

tool: D105: 0.0847

tool: D88: 1.5

tool: D13: 7.5

tool: D136: 0.0006

tool: D129: 0.6078

tool: D40: 2.5

tool: D95: 0.015

tool: D41: 0.292

tool: {"D25": [0xb8,0x1e,0x85,0xeb,0x51,0xb8,0x5e,0x3f]}

tool: {"D213": [0x46,0x25,0x75,0x02,0x9a,0x08,0x5b,0x3f]}

tool: D139: tide_pl : dr=%.3f %.3f %.3f


assistant: ```c
void tide_pl(const double *eu, const double *rp, double GMp, const double *pos, double *dr) {
  const double H3 = 0.292, L3 = 0.015;
  double r, ep[3], latp, lonp, p, K2, K3, a, H2, L2, dp, du, cosp, sinl, cosl;
  int i;
  trace(4, "tide_pl : pos=%.3f %.3f\n", pos[0] * (180.0 / 3.1415926535897932), pos[1] * (180.0 / 3.1415926535897932));
  if ((r = norm(rp, 3)) <= 0.0)
    return;
  for (i = 0; i < 3; i++)
    ep[i] = rp[i] / r;
  K2 = GMp / 3.986004415E+14 * ((6378137.0) * (6378137.0)) * ((6378137.0) * (6378137.0)) / (r * r * r);
  K3 = K2 * 6378137.0 / r;
  latp = asin(ep[2]);
  lonp = atan2(ep[1], ep[0]);
  cosp = cos(latp);
  sinl = sin(pos[0]);
  cosl = cos(pos[0]);
  p = (3.0 * sinl * sinl - 1.0) / 2.0;
  H2 = 0.6078 - 0.0006 * p;
  L2 = 0.0847 + 0.0002 * p;
  a = dot(ep, eu, 3);
  dp = K2 * 3.0 * L2 * a;
  du = K2 * (H2 * (1.5 * a * a - 0.5) - 3.0 * L2 * a * a);
  dp += K3 * L3 * (7.5 * a * a - 1.5);
  du += K3 * (H3 * (2.5 * a * a * a - 1.5 * a) - L3 * (7.5 * a * a - 1.5) * a);
  du += 3.0 / 4.0 * 0.0025 * K2 * sin(2.0 * latp) * sin(2.0 * pos[0]) * sin(pos[1] - lonp);
  du += 3.0 / 4.0 * 0.0022 * K2 * cosp * cosp * cosl * cosl * sin(2.0 * (pos[1] - lonp));
  dr[0] = dp * ep[0] + du * eu[0];
  dr[1] = dp * ep[1] + du * eu[1];
  dr[2] = dp * ep[2] + du * eu[2];
  trace(5, "tide_pl : dr=%.3f %.3f %.3f\n", dr[0], dr[1], dr[2]);
}
```