user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<mycosA>:
  endbr64
  mov    %edi,%r8d
  movapd %xmm0,%xmm1
  mov    %rsi,%rdi
  mov    %rdx,%rsi
  mov    %ecx,%edx
  shr    $0x1f,%edx
  lea    (%rcx,%rdx,1),%eax
  and    $0x1,%eax
  sub    %edx,%eax
  add    %eax,%eax
  mov    $0x1,%edx
  sub    %eax,%edx
  pxor   %xmm5,%xmm5
  cvtsi2sd %edx,%xmm5
  pxor   %xmm2,%xmm2
  cvtsi2sd %ecx,%xmm2
  subsd  D88(%rip),%xmm2
  pxor   %xmm3,%xmm3
  cvtsi2sd %r8d,%xmm3
  addsd  D46(%rip),%xmm3
  pxor   %xmm4,%xmm4
  cvtsd2ss %xmm0,%xmm4
  cvtss2sd %xmm4,%xmm4
  movapd %xmm3,%xmm0
  mulsd  %xmm4,%xmm0
  movapd %xmm2,%xmm6
  mulsd  D18(%rip),%xmm6
  subsd  %xmm6,%xmm0
  subsd  %xmm4,%xmm1
  mulsd  %xmm3,%xmm1
  addsd  %xmm1,%xmm0
  mulsd  D59(%rip),%xmm2
  addsd  %xmm2,%xmm0
  movapd %xmm0,%xmm6
  mulsd  %xmm0,%xmm6
  mov    $0x3,%ecx
  movsd  D22(%rip),%xmm2
  movapd %xmm2,%xmm3
  pxor   %xmm4,%xmm4
  mov    $0x0,%eax
  movq   D12(%rip),%xmm7
L13:
  movapd %xmm0,%xmm1
  mulsd  %xmm3,%xmm1
  divsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm4
  xorpd  %xmm7,%xmm3
  add    $0x1,%eax
  mov    %ecx,%edx
  imul   %eax,%edx
  add    %edx,%edx
  pxor   %xmm1,%xmm1
  cvtsi2sd %edx,%xmm1
  mulsd  %xmm1,%xmm2
  mulsd  %xmm6,%xmm0
  add    $0x2,%ecx
  cmp    $0x6,%eax
  jne    L13
  mulsd  %xmm5,%xmm4
  movsd  %xmm4,(%rdi)
  mov    $0x1,%ecx
  movsd  D22(%rip),%xmm1
  movapd %xmm1,%xmm3
  movapd %xmm1,%xmm2
  pxor   %xmm4,%xmm4
  mov    $0x0,%eax
  movq   D12(%rip),%xmm7
L1:
  movapd %xmm2,%xmm0
  mulsd  %xmm3,%xmm0
  divsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm4
  xorpd  %xmm7,%xmm3
  add    $0x1,%eax
  mov    %ecx,%edx
  imul   %eax,%edx
  add    %edx,%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  mulsd  %xmm0,%xmm1
  mulsd  %xmm6,%xmm2
  add    $0x2,%ecx
  cmp    $0x6,%eax
  jne    L1
  xorpd  D12(%rip),%xmm4
  mulsd  %xmm5,%xmm4
  movsd  %xmm4,(%rsi)
  mov    $0x0,%eax
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D88
type_guessed: f32[2]
name: extract_symbolic_data
arguments: data_tag: D46
type_guessed: f32[2]
name: extract_symbolic_data
arguments: data_tag: D18
type_guessed: f64
name: extract_symbolic_data
arguments: data_tag: D59
type_guessed: f64
name: extract_symbolic_data
arguments: data_tag: D22
type_guessed: f64
name: extract_symbolic_data
arguments: data_tag: D12
type_guessed: f32[4]

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

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

tool: D18: 3.1415927410125732

tool: D59: 8.742278000372485e-08

tool: D22: 1

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

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