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

```asm
<mycosA>:
  endbr64
  pxor   %xmm5,%xmm5
  pxor   %xmm4,%xmm4
  pxor   %xmm6,%xmm6
  mov    %ecx,%r8d
  cvtsi2sd %edi,%xmm5
  movapd %xmm0,%xmm1
  cvtsd2ss %xmm0,%xmm6
  movsd  D35(%rip),%xmm3
  cvtsi2sd %ecx,%xmm4
  cvtss2sd %xmm6,%xmm6
  subsd  %xmm6,%xmm1
  shr    $0x1f,%r8d
  subsd  D75(%rip),%xmm4
  movsd  D145(%rip),%xmm7
  lea    (%rcx,%r8,1),%eax
  pxor   %xmm2,%xmm2
  and    $0x1,%eax
  addsd  %xmm3,%xmm5
  sub    %r8d,%eax
  mov    $0x1,%r8d
  mulsd  %xmm4,%xmm7
  add    %eax,%eax
  mulsd  D97(%rip),%xmm4
  sub    %eax,%r8d
  xor    %eax,%eax
  mulsd  %xmm5,%xmm1
  cvtsi2sd %r8d,%xmm2
  movapd %xmm5,%xmm0
  mulsd  %xmm6,%xmm0
  pxor   %xmm6,%xmm6
  subsd  %xmm7,%xmm0
  addsd  %xmm1,%xmm0
  addsd  %xmm4,%xmm0
  movq   D140(%rip),%xmm4
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm6
  mulsd  %xmm0,%xmm1
  mulsd  %xmm1,%xmm0
  mulsd  %xmm1,%xmm3
  movapd %xmm0,%xmm5
  mulsd  %xmm1,%xmm0
  xorpd  %xmm4,%xmm5
  divsd  D1(%rip),%xmm5
  addsd  %xmm6,%xmm5
  movapd %xmm0,%xmm6
  divsd  D142(%rip),%xmm6
  addsd  %xmm5,%xmm6
  mulsd  %xmm1,%xmm0
  movapd %xmm0,%xmm5
  mulsd  %xmm1,%xmm0
  xorpd  %xmm4,%xmm5
  divsd  D23(%rip),%xmm5
  addsd  %xmm6,%xmm5
  movapd %xmm0,%xmm6
  divsd  D57(%rip),%xmm6
  addsd  %xmm6,%xmm5
  movsd  D86(%rip),%xmm6
  mulsd  %xmm1,%xmm0
  subsd  %xmm3,%xmm6
  xorpd  %xmm4,%xmm0
  divsd  D31(%rip),%xmm0
  addsd  %xmm5,%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,(%rsi)
  movapd %xmm1,%xmm0
  mulsd  %xmm1,%xmm0
  movapd %xmm0,%xmm5
  divsd  D134(%rip),%xmm5
  addsd  %xmm6,%xmm5
  mulsd  %xmm1,%xmm0
  movapd %xmm0,%xmm3
  mulsd  %xmm1,%xmm0
  xorpd  %xmm4,%xmm3
  divsd  D114(%rip),%xmm3
  addsd  %xmm5,%xmm3
  movapd %xmm0,%xmm5
  divsd  D38(%rip),%xmm5
  addsd  %xmm5,%xmm3
  mulsd  %xmm1,%xmm0
  xorpd  %xmm4,%xmm0
  divsd  D63(%rip),%xmm0
  addsd  %xmm3,%xmm0
  xorpd  %xmm4,%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,(%rdx)
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D35
datatype: f32[2]
name: retrieve_data
arguments: tag: D75
datatype: f32[2]
name: retrieve_data
arguments: tag: D145
datatype: f64
name: retrieve_data
arguments: tag: D97
datatype: f64
name: retrieve_data
arguments: tag: D140
datatype: f32[2]
name: retrieve_data
arguments: tag: D1
datatype: f32[2]
name: retrieve_data
arguments: tag: D142
datatype: f32[2]
name: retrieve_data
arguments: tag: D23
datatype: f32[2]
name: retrieve_data
arguments: tag: D57
datatype: f32[2]
name: retrieve_data
arguments: tag: D86
datatype: f64
name: retrieve_data
arguments: tag: D31
datatype: f32[2]
name: retrieve_data
arguments: tag: D134
datatype: f32[2]
name: retrieve_data
arguments: tag: D114
datatype: f32[2]
name: retrieve_data
arguments: tag: D38
datatype: f32[2]
name: retrieve_data
arguments: tag: D63
datatype: f32[2]

tool: {"D35": [0.0,1.75]}

tool: {"D75": [0.0,1.625]}

tool: D145: 3.1415927410125732

tool: D97: 8.742278000372485e-08

tool: {"D140": [0.0,-0.0]}

tool: {"D1": [0.0,2.375]}

tool: {"D142": [0.0,3.46875]}

tool: {"D23": [0.0,5.615234375]}

tool: {"D57": [0.0,9.38427734375]}

tool: D86: 1

tool: {"D31": [0.0,16.379226684570312]}

tool: {"D134": [0.0,2.875]}

tool: {"D114": [0.0,4.203125]}

tool: {"D38": [0.0,7.115234375]}

tool: {"D63": [0.0,12.7303466796875]}

assistant: ```c
int mycosA(int n, double theta, double *cosA, double *sinA, int k) {
  int j;
  double dh, tmp = 0.0, DH, dh2, lo, hi = theta, fixsgn = (double)(1 - 2 * (k % 2));
  double k025 = (k - .25), rho = n + .5, sgn = 1.0, fact = 1.0, hi2;
  hi = (double)((float)hi);
  lo = theta - hi;
  dh = (hi * rho - k025 * 3.141592741012573242187) + lo * rho - k025 * -0.00000008742278000372485127293903;
  DH = dh;
  dh2 = dh * dh;
  for (j = 0; j <= 5; j++) {
    tmp += sgn * DH / fact;
    sgn = -sgn;
    fact = fact * (double)((2 * j + 3) * (2 * j + 2));
    DH *= dh2;
  }
  *cosA = tmp * fixsgn;
  tmp = 0.0;
  sgn = 1.0;
  fact = 1.0;
  DH = 1.0;
  for (j = 0; j <= 5; j++) {
    tmp += sgn * DH / fact;
    sgn = -sgn;
    fact = fact * (double)((2 * j + 2) * (2 * j + 1));
    DH *= dh2;
  }
  *sinA = -tmp * fixsgn;
  return 0;
}
```