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

```asm
<composite_waveform>:
  endbr64
  push   %r15
  mov    %rdx,%r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %r9d,0x2c(%rsp)
  movsd  %xmm0,0x20(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  lea    (%rdi,%rsi,8),%rax
  mov    %rax,0x38(%rsp)
  mov    (%rax),%rax
  mulsd  (%rax),%xmm0
  comisd D78(%rip),%xmm0
  jae    L27
  cvttsd2si %xmm0,%r13
L170:
  mov    $0x8,%esi
  mov    %r13,%rdi
  movsd  %xmm1,0x8(%rsp)
  call   <calloc@plt>
  movsd  0x8(%rsp),%xmm1
  test   %rax,%rax
  mov    %rax,%r11
  je     L134
  mov    0x38(%rsp),%rax
  mov    (%r12),%r10
  mov    (%rax),%r14
  movsd  0x8(%r14),%xmm0
  xorpd  D18(%rip),%xmm0
  comisd D78(%rip),%xmm0
  jae    L88
  cvttsd2si %xmm0,%rax
  mov    %rax,0x30(%rsp)
L56:
  cmpq   $0x0,0x30(%rsp)
  je     L228
  lea    -0x1(%r13,%r10,1),%rax
  mov    %r10,0x18(%rsp)
  xor    %r9d,%r9d
  mov    %r14,%rdi
  lea    (%r15,%rax,8),%rax
  lea    (%r15,%r10,8),%rbx
  mov    %r15,0x58(%rsp)
  mov    %r11,%r14
  mov    %rax,0x50(%rsp)
  lea    -0x8(%r11,%r13,8),%rax
  mov    %r13,%r15
  sub    %r11,%rbx
  mov    %rax,0x48(%rsp)
  lea    0x60(%rsp),%rax
  lea    (%r11,%r13,8),%rbp
  mov    %r9,%r13
  mov    %rax,0x40(%rsp)
  nop
L97:
  movsd  0x48(%rdi),%xmm0
  mov    0x2c(%rsp),%r8d
  mov    %r15,%rcx
  mov    %r14,%rsi
  mov    0x40(%rsp),%rdx
  mov    %rdi,0x8(%rsp)
  movsd  %xmm0,0x8(%rdi)
  movsd  0x20(%rsp),%xmm0
  movsd  %xmm1,0x10(%rsp)
  movq   $0x0,0x60(%rsp)
  call   <simple_waveform@plt>
  mov    0x8(%rsp),%rdi
  movsd  0x10(%rsp),%xmm1
  cmp    $0xffffffff,%eax
  je     L339
  mov    0x18(%rsp),%rax
  mov    %rax,(%r12)
  cvttsd2si 0x50(%rdi),%eax
  cmp    $0x3,%eax
  je     L259
  jg     L225
  cmp    $0x1,%eax
  je     L54
  cmp    $0x2,%eax
  jne    L49
  mov    %r14,%rax
  test   %r15,%r15
  je     L244
  nopl   0x0(%rax)
L194:
  movsd  (%rbx,%rax,1),%xmm0
  mulsd  (%rax),%xmm0
  movsd  %xmm0,(%rbx,%rax,1)
  add    $0x8,%rax
  movq   $0x0,-0x8(%rax)
  cmp    %rbp,%rax
  jne    L194
L14:
  mov    0x18(%rsp),%rax
  add    %r15,%rax
  mov    %rax,(%r12)
  mov    0x50(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    0x48(%rsp),%rax
  movq   $0x0,(%rax)
L244:
  add    $0x1,%r13
  cmp    %r13,0x30(%rsp)
  je     L83
  mov    0x38(%rsp),%rax
  mov    (%rax,%r13,8),%rdi
  jmp    L97
  nopl   (%rax)
L27:
  subsd  D78(%rip),%xmm0
  cvttsd2si %xmm0,%r13
  btc    $0x3f,%r13
  jmp    L170
  nop
L88:
  subsd  D78(%rip),%xmm0
  cvttsd2si %xmm0,%rax
  btc    $0x3f,%rax
  mov    %rax,0x30(%rsp)
  jmp    L56
  nopl   0x0(%rax)
L225:
  cmp    $0x4,%eax
  jne    L49
  mov    0x58(%rsp),%rdi
  mov    %r14,%rax
  xor    %edx,%edx
  test   %r15,%r15
  jne    L261
  jmp    L244
  nopw   0x0(%rax,%rax,1)
L296:
  mov    (%r12),%rcx
  add    $0x1,%rdx
  add    $0x8,%rax
  lea    0x1(%rcx),%rsi
  lea    (%rdi,%rcx,8),%rcx
  movsd  (%rcx),%xmm0
  mov    %rsi,(%r12)
  divsd  %xmm2,%xmm0
  movsd  %xmm0,(%rcx)
  movq   $0x0,-0x8(%rax)
  cmp    %rdx,%r15
  je     L244
L261:
  movsd  (%rax),%xmm2
  pxor   %xmm3,%xmm3
  ucomisd %xmm3,%xmm2
  jp     L296
  jne    L296
  mov    0x2c(%rsp),%esi
  lea    D13(%rip),%rdi
  call   <error@plt>
  mov    $0xffffffff,%r8d
L18:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L115
  add    $0x78,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L259:
  mov    %r14,%rax
  test   %r15,%r15
  je     L244
  nopl   0x0(%rax)
L30:
  movsd  (%rbx,%rax,1),%xmm0
  subsd  (%rax),%xmm0
  movsd  %xmm0,(%rbx,%rax,1)
  add    $0x8,%rax
  movq   $0x0,-0x8(%rax)
  cmp    %rbp,%rax
  jne    L30
  jmp    L14
  nopl   0x0(%rax)
L49:
  mov    %r14,%rax
  test   %r15,%r15
  je     L244
  nopl   0x0(%rax)
L144:
  movsd  (%rbx,%rax,1),%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rbx,%rax,1)
  add    $0x8,%rax
  movq   $0x0,-0x8(%rax)
  cmp    %rbp,%rax
  jne    L144
  jmp    L14
  nopl   0x0(%rax)
L54:
  mov    %r14,%rax
  test   %r15,%r15
  je     L244
  nopl   0x0(%rax)
L247:
  movsd  (%rbx,%rax,1),%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rbx,%rax,1)
  add    $0x8,%rax
  movq   $0x0,-0x8(%rax)
  cmp    %rbp,%rax
  jne    L247
  jmp    L14
  nopl   0x0(%rax)
L83:
  mov    %r14,%r11
L228:
  mov    %r11,%rdi
  call   <free@plt>
  mov    0x30(%rsp),%r8d
  jmp    L18
  nopl   (%rax)
L339:
  mov    0x2c(%rsp),%esi
  lea    D34(%rip),%rdi
  mov    %eax,0x8(%rsp)
  call   <error@plt>
  mov    0x8(%rsp),%r8d
  jmp    L18
L134:
  mov    0x2c(%rsp),%esi
  lea    D55(%rip),%rdi
  call   <error@plt>
  mov    $0xffffffff,%r8d
  jmp    L18
L115:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D78
data_type: f32[4]
name: extract_symbolic_data
arguments: tag: D18
data_type: f32[4]
name: extract_symbolic_data
arguments: tag: D13
data_type: string
name: extract_symbolic_data
arguments: tag: D34
data_type: string
name: extract_symbolic_data
arguments: tag: D55
data_type: string

tool: {"D78": [0.0,448.0,0.0,0.0]}

tool: {"D18": [0.0,-0.0,0.0,0.0]}

tool: D13: zero division!

tool: D34: simple_wav returned -1 inside composite_wav.

tool: D55: Unable to allocate memory for <out_temp> !

assistant: ```c
int composite_waveform(double **parsed_data, uint current_line, double *output, uint *index, uint N, double srate, double dt, int verbose) {
  uint i, Ni, line = 0, index_old, myindex, howmany;
  double *out_temp, *vector;
  int return_code;
  Ni = (uint)(parsed_data[current_line][0] * srate);
  out_temp = (double *)calloc(Ni, sizeof(double));
  if (out_temp == NULL) {
    error("Unable to allocate memory for <out_temp> !", verbose);
    return -1;
  }
  index_old = (*index);
  howmany = (uint)(-parsed_data[current_line][1]);
  for (line = 0; line < howmany; line++) {
    myindex = 0;
    vector = parsed_data[current_line + line];
    vector[1] = vector[9];
    return_code = simple_waveform(vector, out_temp, &myindex, Ni, srate, dt, verbose);
    if (return_code == -1) {
      error("simple_wav returned -1 inside composite_wav.", verbose);
      return -1;
    }
    (*index) = index_old;
    switch ((int)vector[10]) {
    case 1:
      for (i = 0; i < Ni; i++) {
        output[(*index)++] += out_temp[i];
        out_temp[i] = 0.;
      }
      break;
    case 2:
      for (i = 0; i < Ni; i++) {
        output[(*index)++] *= out_temp[i];
        out_temp[i] = 0.;
      }
      break;
    case 3:
      for (i = 0; i < Ni; i++) {
        output[(*index)++] -= out_temp[i];
        out_temp[i] = 0.;
      }
      break;
    case 4:
      for (i = 0; i < Ni; i++) {
        if (out_temp[i] == 0) {
          error("zero division!", verbose);
          return -1;
        }
        output[(*index)++] /= out_temp[i];
        out_temp[i] = 0.;
      }
      break;
    default:
      for (i = 0; i < Ni; i++) {
        output[(*index)++] += out_temp[i];
        out_temp[i] = 0.;
      }
      break;
    }
  }
  free(out_temp);
  return howmany;
}
```