user: Please show me the C implementation that matches the assembly code listed below:

```asm
<cmorlet>:
  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)
  movsd  -0x38(%rbp),%xmm1
  movsd  D35(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  mov    %eax,%ecx
  mov    $0x1,%eax
  cltd
  idiv   %ecx
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L3
L9:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  movq   D30(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  divsd  -0x38(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <exp@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  -0x40(%rbp),%xmm1
  movsd  D13(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x1c(%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  -0x8(%rbp),%xmm0
  mulsd  -0x18(%rbp),%xmm0
  mov    -0x1c(%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  D13(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x1c(%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  -0x8(%rbp),%xmm0
  mulsd  -0x18(%rbp),%xmm0
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  divsd  -0x58(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x1c(%rbp)
L3:
  mov    -0x1c(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L9
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D35
datatype: f64
name: retrieve_data
arguments: label: D30
datatype: byte[8]
name: retrieve_data
arguments: label: D13
datatype: byte[8]

tool: D35: 3.141592653589793

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

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

assistant: ```c
void cmorlet(double *x, int sigInLength, double fb, double fc, double *psir, double *psii, int sigOutLength, double ys) {
  int count;
  double con, econ, x2;
  con = 1 / sqrt(3.1415926535897931159980 * fb);
  for (count = 0; count < sigInLength; count++) {
    x2 = x[count] * x[count];
    econ = exp(-x2 / fb);
    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;
}
```