user: 请从给定的汇编指令推导出C源代码:

```asm
<gen_signal_double>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %rdi,%rbp
  movsd  %xmm0,0x18(%rsp)
  mov    %edx,%r13d
  cmp    $0x1,%esi
  je     L111
  test   %edx,%edx
  jle    L87
  pxor   %xmm6,%xmm6
  movsd  %xmm6,0x8(%rsp)
  mov    $0x0,%r12d
  lea    -0x3e8(%rdx),%r14d
  jmp    L122
L111:
  test   %edx,%edx
  jle    L87
  pxor   %xmm6,%xmm6
  movsd  %xmm6,0x8(%rsp)
  mov    $0x0,%r12d
  lea    -0x3e8(%rdx),%r14d
  jmp    L32
L17:
  pxor   %xmm0,%xmm0
  cvtsi2sd %r12d,%xmm0
  mulsd  0x18(%rsp),%xmm0
  divsd  D72(%rip),%xmm0
  movsd  %xmm0,0x8(%rsp)
L108:
  add    $0x1,%r12d
  pxor   %xmm5,%xmm5
  cvtsi2sd %r12d,%xmm5
  movsd  D179(%rip),%xmm0
  movsd  %xmm5,(%rsp)
  mulsd  %xmm5,%xmm0
  divsd  D60(%rip),%xmm0
  call   <sin@plt>
  movq   %xmm0,%rbx
  movsd  D174(%rip),%xmm0
  mulsd  (%rsp),%xmm0
  divsd  D60(%rip),%xmm0
  call   <cos@plt>
  movq   %rbx,%xmm1
  mulsd  D43(%rip),%xmm1
  mulsd  D65(%rip),%xmm0
  addsd  %xmm0,%xmm1
  mulsd  0x8(%rsp),%xmm1
  movsd  %xmm1,0x0(%rbp)
  add    $0x8,%rbp
  cmp    %r13d,%r12d
  je     L87
L32:
  cmp    $0x3e8,%r12d
  jle    L17
  cmp    %r12d,%r14d
  jge    L108
  mov    %r13d,%eax
  sub    %r12d,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  0x18(%rsp),%xmm0
  divsd  D72(%rip),%xmm0
  movsd  %xmm0,0x8(%rsp)
  jmp    L108
L48:
  pxor   %xmm0,%xmm0
  cvtsi2sd %r12d,%xmm0
  mulsd  0x18(%rsp),%xmm0
  divsd  D72(%rip),%xmm0
  movsd  %xmm0,0x8(%rsp)
L63:
  add    $0x1,%r12d
  pxor   %xmm2,%xmm2
  cvtsi2sd %r12d,%xmm2
  movsd  D179(%rip),%xmm0
  movsd  %xmm2,(%rsp)
  mulsd  %xmm2,%xmm0
  divsd  D60(%rip),%xmm0
  call   <sin@plt>
  movq   %xmm0,%rbx
  movsd  D174(%rip),%xmm0
  mulsd  (%rsp),%xmm0
  divsd  D60(%rip),%xmm0
  call   <cos@plt>
  movapd %xmm0,%xmm3
  mulsd  D65(%rip),%xmm3
  movq   %rbx,%xmm0
  mulsd  D43(%rip),%xmm0
  movsd  %xmm3,0x10(%rsp)
  addsd  %xmm3,%xmm0
  mulsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x0(%rbp)
  movsd  D40(%rip),%xmm0
  mulsd  (%rsp),%xmm0
  divsd  D60(%rip),%xmm0
  call   <sin@plt>
  mulsd  D43(%rip),%xmm0
  addsd  0x10(%rsp),%xmm0
  mulsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rbp)
  add    $0x10,%rbp
  cmp    %r13d,%r12d
  je     L87
L122:
  cmp    $0x3e8,%r12d
  jle    L48
  cmp    %r12d,%r14d
  jge    L63
  mov    %r13d,%eax
  sub    %r12d,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  0x18(%rsp),%xmm0
  divsd  D72(%rip),%xmm0
  movsd  %xmm0,0x8(%rsp)
  jmp    L63
L87:
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D72
type_guessed: f32[2]
name: disassemble_data
arguments: tag: D179
type_guessed: byte[8]
name: disassemble_data
arguments: tag: D60
type_guessed: f32[2]
name: disassemble_data
arguments: tag: D174
type_guessed: byte[8]
name: disassemble_data
arguments: tag: D43
type_guessed: f64
name: disassemble_data
arguments: tag: D65
type_guessed: f64
name: disassemble_data
arguments: tag: D40
type_guessed: byte[8]

tool: {"D72": [0.0,4.4765625]}

tool: {"D179": [0x53,0x25,0x4a,0xbd,0x5c,0x27,0x6a,0x40]}

tool: {"D60": [0.0,6.17291259765625]}

tool: {"D174": [0x06,0x5b,0x18,0xbb,0x31,0xbe,0x93,0x40]}

tool: D43: 0.4

tool: D65: 0.3

tool: {"D40": [0x1b,0x1f,0x13,0xf3,0x77,0xcb,0x75,0x40]}

assistant: ```c
void gen_signal_double(double *data, double scale, int channels, int datalen) {
  int k, ramplen;
  double amp = 0.0;
  ramplen = 1000;
  if (channels == 1) {
    for (k = 0; k < datalen; k++) {
      if (k <= ramplen)
        amp = scale * k / ((double)ramplen);
      else if (k > datalen - ramplen)
        amp = scale * (datalen - k) / ((double)ramplen);
      data[k] = amp * (0.4 * sin(33.3 * 2.0 * 3.14159265358979323846264338 * ((double)(k + 1)) / ((double)11025)) + 0.3 * cos(201.1 * 2.0 * 3.14159265358979323846264338 * ((double)(k + 1)) / ((double)11025)));
    };
  } else {
    for (k = 0; k < datalen; k++) {
      if (k <= ramplen)
        amp = scale * k / ((double)ramplen);
      else if (k > datalen - ramplen)
        amp = scale * (datalen - k) / ((double)ramplen);
      data[2 * k] = amp * (0.4 * sin(33.3 * 2.0 * 3.14159265358979323846264338 * ((double)(k + 1)) / ((double)11025)) + 0.3 * cos(201.1 * 2.0 * 3.14159265358979323846264338 * ((double)(k + 1)) / ((double)11025)));
      data[2 * k + 1] = amp * (0.4 * sin(55.5 * 2.0 * 3.14159265358979323846264338 * ((double)(k + 1)) / ((double)11025)) + 0.3 * cos(201.1 * 2.0 * 3.14159265358979323846264338 * ((double)(k + 1)) / ((double)11025)));
    };
  };
  return;
}
```