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

```asm
<sinus>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  movsd  %xmm0,-0x58(%rbp)
  mov    %edi,-0x5c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movsd  -0x58(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  comisd -0x30(%rbp),%xmm0
  jbe    L28
  movsd  -0x30(%rbp),%xmm0
  movq   D118(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  addl   $0x2,-0x5c(%rbp)
L28:
  movsd  -0x30(%rbp),%xmm1
  movsd  D68(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x30(%rbp),%xmm0
  comisd D27(%rip),%xmm0
  jbe    L38
  lea    -0x40(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <modf@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x28(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x5c(%rbp),%xmm1
  movsd  -0x40(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  movsd  -0x40(%rbp),%xmm1
  movsd  D117(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  lea    -0x38(%rbp),%rdx
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <modf@plt>
  movsd  -0x40(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm2
  movsd  D42(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x5c(%rbp)
  jmp    L14
L38:
  movsd  -0x30(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x44(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x44(%rbp),%xmm1
  movsd  -0x30(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0x5c(%rbp),%edx
  mov    -0x44(%rbp),%eax
  add    %edx,%eax
  and    $0x3,%eax
  mov    %eax,-0x5c(%rbp)
L14:
  mov    -0x5c(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L45
  movsd  D80(%rip),%xmm0
  subsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
L45:
  cmpl   $0x1,-0x5c(%rbp)
  jle    L52
  movsd  -0x28(%rbp),%xmm0
  movq   D118(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
L52:
  movsd  -0x28(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x20(%rbp),%xmm1
  movsd  D145(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  D153(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x20(%rbp),%xmm1
  movsd  D62(%rip),%xmm0
  addsd  %xmm1,%xmm0
  mulsd  -0x20(%rbp),%xmm0
  movsd  D51(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x20(%rbp),%xmm1
  movsd  D87(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  -0x28(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x20(%rbp),%xmm1
  movsd  D112(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x20(%rbp),%xmm1
  movsd  D16(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x20(%rbp),%xmm1
  movsd  D58(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x20(%rbp),%xmm1
  movsd  D7(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x18(%rbp),%xmm0
  divsd  -0x10(%rbp),%xmm0
  movq   %xmm0,%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L26
  call   <__stack_chk_fail@plt>
L26:
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D118
type: byte[8]
name: retrieve_data
arguments: data_tag: D68
type: f64
name: retrieve_data
arguments: data_tag: D27
type: byte[16]
name: retrieve_data
arguments: data_tag: D117
type: f64
name: retrieve_data
arguments: data_tag: D42
type: byte[8]
name: retrieve_data
arguments: data_tag: D80
type: byte[8]
name: retrieve_data
arguments: data_tag: D145
type: f64
name: retrieve_data
arguments: data_tag: D153
type: f64
name: retrieve_data
arguments: data_tag: D62
type: f64
name: retrieve_data
arguments: data_tag: D51
type: f64
name: retrieve_data
arguments: data_tag: D87
type: f64
name: retrieve_data
arguments: data_tag: D112
type: f64
name: retrieve_data
arguments: data_tag: D16
type: f64
name: retrieve_data
arguments: data_tag: D58
type: f64
name: retrieve_data
arguments: data_tag: D7
type: f64

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

tool: D68: 0.636619772367581

tool: {"D27": [0x00,0x00,0x00,0x00,0x00,0xff,0xdf,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x3f]}

tool: D117: 0.25

tool: {"D42": [0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x40]}

tool: {"D80": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: D145: 145.968840666577

tool: D153: 13847.2724998245

tool: D62: 440103.053537527

tool: D51: 4942908.10090284

tool: D87: 13578840.9787738

tool: D112: 132.653490878614

tool: D16: 9463.09610153821

tool: D58: 408179.22523433

tool: D7: 8644558.65292253

assistant: ```c
double sinus(double arg, int quad) {
  double e, f;
  int k;
  double ysq;
  double x, y;
  double temp1, temp2;
  x = arg;
  if (x < 0) {
    x = -x;
    quad = quad + 2;
  }
  x = x * 0.636619772367581;
  if (x > 32764) {
    y = modf(x, &e);
    e = e + quad;
    modf(0.25 * e, &f);
    quad = e - 4 * f;
  } else {
    k = x;
    y = x - k;
    quad = (quad + k) & 03;
  }
  if (quad & 01)
    y = 1 - y;
  if (quad > 1)
    y = -y;
  ysq = y * y;
  temp1 = ((((0.145968840666577e3 * ysq + -0.138472724998245e5) * ysq + 0.440103053537527e6) * ysq + -0.494290810090284e7) * ysq + 0.135788409787738e8) * y;
  temp2 = ((((ysq + 0.132653490878614e3) * ysq + 0.946309610153821e4) * ysq + 0.408179225234330e6) * ysq + 0.864455865292253e7);
  return (temp1 / temp2);
}
```