user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<my_cos>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  movapd %xmm0,%xmm4
  movsd  %xmm0,0x18(%rsp)
  pxor   %xmm0,%xmm0
  comisd %xmm4,%xmm0
  ja     L70
  mov    $0x1,%edi
  call   <atan@plt>
  add    %eax,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  0x18(%rsp),%xmm5
  comisd %xmm0,%xmm5
  ja     L6
  movsd  0x18(%rsp),%xmm7
  movapd %xmm7,%xmm5
  mulsd  %xmm7,%xmm5
  movsd  %xmm5,(%rsp)
  movapd %xmm5,%xmm1
  mulsd  D19(%rip),%xmm1
  movsd  D12(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rbx
  ucomisd D42(%rip),%xmm0
  jp     L5
  je     L1
L5:
  mov    $0x4,%ebp
  movsd  D12(%rip),%xmm5
  movsd  %xmm5,0x8(%rsp)
  movsd  D119(%rip),%xmm6
  movsd  %xmm6,0x10(%rsp)
L36:
  mov    $0x2,%edi
  movsd  0x18(%rsp),%xmm0
  call   <pow@plt>
  mulsd  (%rsp),%xmm0
  movapd %xmm0,%xmm2
  mulsd  0x8(%rsp),%xmm2
  movsd  %xmm2,0x20(%rsp)
  mov    %ebp,%edi
  call   <my_fac@plt>
  mov    %rbx,0x28(%rsp)
  mulsd  0x10(%rsp),%xmm0
  movsd  0x20(%rsp),%xmm1
  divsd  %xmm0,%xmm1
  movq   %rbx,%xmm6
  addsd  %xmm1,%xmm6
  movq   %xmm6,%rbx
  add    $0x2,%ebp
  movsd  0x8(%rsp),%xmm3
  xorpd  D3(%rip),%xmm3
  movsd  %xmm3,0x8(%rsp)
  mov    %ebp,%edi
  call   <my_fac@plt>
  movapd %xmm0,%xmm7
  mulsd  0x10(%rsp),%xmm7
  movsd  %xmm7,0x10(%rsp)
  mov    $0x2,%edi
  movsd  0x18(%rsp),%xmm0
  call   <pow@plt>
  mulsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  movq   %rbx,%xmm6
  movsd  0x28(%rsp),%xmm2
  ucomisd %xmm2,%xmm6
  jp     L36
  jne    L36
  jmp    L1
L70:
  lea    D117(%rip),%rdi
  call   <printf@plt>
  lea    D88(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  mov    D12(%rip),%rbx
L1:
  movq   %rbx,%xmm0
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  ret
L6:
  lea    D117(%rip),%rdi
  call   <printf@plt>
  lea    D88(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  mov    D12(%rip),%rbx
  jmp    L1
```

tool_calls: name: parse_data
arguments: label: D19
data_type: f32[2]
name: parse_data
arguments: label: D12
data_type: f64
name: parse_data
arguments: label: D42
data_type: f32[2]
name: parse_data
arguments: label: D119
data_type: f32[2]
name: parse_data
arguments: label: D3
data_type: f32[4]
name: parse_data
arguments: label: D117
data_type: string
name: parse_data
arguments: label: D88
data_type: string

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

tool: D12: 1

tool: {"D42": [0.0,0.0]}

tool: {"D119": [0.0,2.0]}

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

tool: D117: Invalid x value: 0 <= x <= pi/2



tool: D88: usage: echo x value | ./p3

assistant: ```c
double my_cos(double x) {
  double val1 = 1, val2 = 0, fac, term, sign = -1;
  int expnt = 4;
  if (x < 0) {
    printf("Invalid x value: 0 <= x <= pi/2\n\n");
    printf("usage: echo x value | ./p3");
    exit(1);
  } else if (x > (4 * atan(1) / 2)) {
    printf("Invalid x value: 0 <= x <= pi/2\n\n");
    printf("usage: echo x value | ./p3");
    exit(1);
  } else {
    fac = 2;
    term = x * x;
    val1 = val1 + sign * (term / fac);
    sign = -1 * sign;
    while (val1 != val2) {
      val2 = val1;
      val1 = val1 + sign * (term * pow(x, 2)) / (fac * my_fac(expnt));
      expnt = expnt + 2;
      sign = -1 * sign;
      fac = fac * my_fac(expnt);
      term = term * pow(x, 2);
    }
  }
  return val1;
}
```