user: 请将以下的汇编代码转换成C语言代码:

```asm
<cos>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  movsd  %xmm0,-0x28(%rbp)
  movl   $0x1,-0x14(%rbp)
  movsd  -0x28(%rbp),%xmm1
  movsd  D91(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  jmp    L38
L52:
  movsd  -0x28(%rbp),%xmm0
  movsd  D93(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
L38:
  movsd  -0x28(%rbp),%xmm0
  comisd D93(%rip),%xmm0
  ja     L52
  jmp    L23
L45:
  movsd  -0x28(%rbp),%xmm1
  movsd  D93(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
L23:
  movsd  D106(%rip),%xmm0
  comisd -0x28(%rbp),%xmm0
  ja     L45
  movsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x28(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movq   D52(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x8(%rbp),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x14(%rbp),%xmm0
  movapd %xmm0,%xmm2
  addsd  %xmm0,%xmm2
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x14(%rbp),%xmm0
  movapd %xmm0,%xmm3
  addsd  %xmm0,%xmm3
  movsd  D66(%rip),%xmm0
  addsd  %xmm3,%xmm0
  mulsd  %xmm0,%xmm2
  divsd  %xmm2,%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x10(%rbp),%xmm0
  addsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  addl   $0x1,-0x14(%rbp)
  jmp    L57
L3:
  movsd  -0x28(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movq   D52(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x8(%rbp),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x14(%rbp),%xmm0
  movapd %xmm0,%xmm2
  addsd  %xmm0,%xmm2
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x14(%rbp),%xmm0
  movapd %xmm0,%xmm3
  addsd  %xmm0,%xmm3
  movsd  D66(%rip),%xmm0
  addsd  %xmm3,%xmm0
  mulsd  %xmm0,%xmm2
  divsd  %xmm2,%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x10(%rbp),%xmm0
  addsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  addl   $0x1,-0x14(%rbp)
L57:
  movsd  -0x8(%rbp),%xmm0
  movq   D80(%rip),%xmm1
  andpd  %xmm1,%xmm0
  comisd D101(%rip),%xmm0
  jae    L3
  movsd  -0x10(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D91
datatype: byte[8]
name: unpack_data
arguments: data_tag: D93
datatype: byte[16]
name: unpack_data
arguments: data_tag: D106
datatype: byte[8]
name: unpack_data
arguments: data_tag: D52
datatype: byte[8]
name: unpack_data
arguments: data_tag: D66
datatype: f64
name: unpack_data
arguments: data_tag: D80
datatype: qword
name: unpack_data
arguments: data_tag: D101
datatype: f64

tool: {"D91": [0x18,0x2d,0x44,0x54,0xfb,0x21,0xf9,0x3f]}

tool: {"D93": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x19,0x40,0x18,0x2d,0x44,0x54,0xfb,0x21,0x19,0xc0]}

tool: {"D106": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x19,0xc0]}

tool: {"D52": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

tool: D66: 1

tool: D80: 9223372036854775807

tool: D101: 1e-05

assistant: ```c
double cos(double rad) {
  double app;
  double diff;
  int inc = 1;
  rad += 3.14159265358979323846 / 2.0;
  while (rad > 2 * 3.14159265358979323846)
    rad -= 2 * 3.14159265358979323846;
  while (rad < -2 * 3.14159265358979323846)
    rad += 2 * 3.14159265358979323846;
  app = diff = rad;
  diff = (diff * (-(rad * rad))) / ((2.0 * inc) * (2.0 * inc + 1.0));
  app = app + diff;
  inc++;
  while (fabs(diff) >= 0.00001) {
    diff = (diff * (-(rad * rad))) / ((2.0 * inc) * (2.0 * inc + 1.0));
    app = app + diff;
    inc++;
  }
  return app;
}
```