user: Converte this assembly snippet into its equivalent C code:

```asm
<shanwavf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  movsd  %xmm0,-0x38(%rbp)
  movsd  %xmm1,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8d,-0x30(%rbp)
  movsd  %xmm2,-0x58(%rbp)
  mov    -0x38(%rbp),%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L11
L47:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jp     L7
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  je     L38
L7:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x38(%rbp),%xmm1
  movsd  D0(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <sin@plt>
  movq   %xmm0,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  movsd  (%rdx),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x38(%rbp),%xmm1
  movsd  D0(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movq   %rax,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  jmp    L39
L38:
  movsd  D20(%rip),%xmm0
  movsd  %xmm0,-0x10(%rbp)
L39:
  movsd  -0x40(%rbp),%xmm1
  movsd  D5(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <cos@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  mulsd  -0x10(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  divsd  -0x58(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x40(%rbp),%xmm1
  movsd  D5(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <sin@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  mulsd  -0x10(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  divsd  -0x58(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L11:
  mov    -0x14(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L47
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D0
datatype: f64
name: parse_data
arguments: data_label: D20
datatype: byte[8]
name: parse_data
arguments: data_label: D5
datatype: byte[8]

tool: D0: 3.141592653589793

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

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

assistant: ```c
void shanwavf(double *x, int sigInLength, double fb, double fc, double *psir, double *psii, int sigOutLength, double ys) {
  int count;
  double con, econ;
  con = sqrt(fb);
  for (count = 0; count < sigInLength; count++) {
    if (x[count] != 0)
      econ = sin(x[count] * fb * 3.1415926535897931159980) / (x[count] * fb * 3.1415926535897931159980);
    else
      econ = 1;
    psir[count] = cos(2 * 3.1415926535897931159980 * fc * x[count]) * econ * con / ys;
    psii[count] = sin(2 * 3.1415926535897931159980 * fc * x[count]) * econ * con / ys;
  }
  return;
}
```