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

```asm
<matched_filter>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %r8,%r12
  push   %rbp
  push   %rbx
  mov    %r9d,%ebx
  sub    $0xa8,%rsp
  mov    0xe0(%rsp),%eax
  mov    0xe8(%rsp),%ebp
  mov    %rdx,0x90(%rsp)
  mov    0x100(%rsp),%edx
  mov    0x108(%rsp),%esi
  mov    %rcx,0x60(%rsp)
  mov    %eax,0x2c(%rsp)
  mov    0xf0(%rsp),%eax
  lea    0x1(%rbp),%r15d
  mov    %esi,0x6c(%rsp)
  mov    0x110(%rsp),%rsi
  mov    %eax,0x68(%rsp)
  mov    0xf8(%rsp),%eax
  mov    %rsi,0x30(%rsp)
  imul   %eax,%r15d
  mov    %edx,0x28(%rsp)
  mov    %ebp,0x48(%rsp)
  mov    %eax,0x24(%rsp)
  imul   %edx,%r15d
  shl    $0x3,%r15d
  mov    %r15d,%edi
  call   <malloc@plt>
  mov    %r15d,%edx
  xor    %esi,%esi
  mov    %rax,%rdi
  mov    %rax,%r15
  mov    %rax,0x58(%rsp)
  call   <memset@plt>
  mov    0x28(%rsp),%r8d
  mov    0x24(%rsp),%ecx
  mov    %ebp,%esi
  mov    0x60(%rsp),%rdi
  mov    %r12,%rdx
  mov    %r15,%r9
  call   <cumsum_square_data@plt>
  mov    0x68(%rsp),%edx
  test   %edx,%edx
  jle    L89
  mov    0x24(%rsp),%edi
  imul   0x28(%rsp),%edi
  pxor   %xmm5,%xmm5
  mov    %r14,0x8(%rsp)
  mov    0x2c(%rsp),%eax
  mov    0x48(%rsp),%edx
  cvtsi2ss %ebx,%xmm5
  mov    %r13,0x10(%rsp)
  mov    %r12,0x18(%rsp)
  mov    0x90(%rsp),%rbp
  sub    %eax,%edx
  imul   %edi,%eax
  mov    %edi,0x4c(%rsp)
  mov    %edx,0x80(%rsp)
  movslq %ebx,%rdx
  lea    0x0(,%rdx,4),%rcx
  shl    $0x3,%rdx
  movl   $0x0,0x54(%rsp)
  cltq
  mov    %rcx,0x38(%rsp)
  shl    $0x2,%rax
  mov    %rdx,0x40(%rsp)
  mov    %rax,0x70(%rsp)
  movslq %edi,%rax
  shl    $0x2,%rax
  movl   $0x0,0x4(%rsp)
  mov    %rax,0x78(%rsp)
  lea    -0x1(%rdi),%eax
  mov    %eax,0x88(%rsp)
  mov    %edi,%eax
  and    $0xfffffffc,%edi
  shr    $0x2,%eax
  mov    %edi,0x8c(%rsp)
  sub    $0x1,%eax
  movl   $0x0,0x50(%rsp)
  movss  %xmm5,0x84(%rsp)
  add    $0x1,%rax
  shl    $0x4,%rax
  mov    %rax,0x98(%rsp)
  xchg   %ax,%ax
L69:
  mov    0x4c(%rsp),%eax
  test   %eax,%eax
  jle    L40
  cmpl   $0x2,0x88(%rsp)
  jbe    L61
  mov    0x98(%rsp),%rax
  pxor   %xmm3,%xmm3
  movdqa %xmm3,%xmm1
  lea    (%rax,%rbp,1),%rdx
  mov    %rbp,%rax
  nopl   0x0(%rax)
L39:
  movdqu (%rax),%xmm0
  add    $0x10,%rax
  movdqa %xmm0,%xmm2
  pcmpgtd %xmm1,%xmm2
  pand   %xmm2,%xmm1
  pandn  %xmm0,%xmm2
  por    %xmm2,%xmm1
  movdqa %xmm0,%xmm2
  pcmpgtd %xmm3,%xmm2
  pand   %xmm2,%xmm0
  pandn  %xmm3,%xmm2
  movdqa %xmm2,%xmm3
  por    %xmm0,%xmm3
  cmp    %rdx,%rax
  jne    L39
  movdqa %xmm3,%xmm2
  mov    0x4c(%rsp),%ecx
  mov    0x8c(%rsp),%eax
  psrldq $0x8,%xmm2
  movdqa %xmm2,%xmm0
  mov    %ecx,%r10d
  pcmpgtd %xmm3,%xmm0
  pand   %xmm0,%xmm2
  pandn  %xmm3,%xmm0
  por    %xmm2,%xmm0
  movdqa %xmm0,%xmm3
  psrldq $0x4,%xmm3
  movdqa %xmm3,%xmm2
  pcmpgtd %xmm0,%xmm2
  pand   %xmm2,%xmm3
  pandn  %xmm0,%xmm2
  por    %xmm3,%xmm2
  movd   %xmm2,%r12d
  movdqa %xmm1,%xmm2
  psrldq $0x8,%xmm2
  movdqa %xmm2,%xmm0
  pcmpgtd %xmm1,%xmm0
  pand   %xmm0,%xmm1
  pandn  %xmm2,%xmm0
  por    %xmm1,%xmm0
  movdqa %xmm0,%xmm2
  psrldq $0x4,%xmm2
  movdqa %xmm2,%xmm1
  pcmpgtd %xmm0,%xmm1
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  por    %xmm0,%xmm1
  movd   %xmm1,%edi
  cmp    %ecx,%eax
  je     L29
L73:
  mov    0x54(%rsp),%edx
  mov    0x90(%rsp),%rsi
  lea    (%rdx,%rax,1),%ecx
  movslq %ecx,%rcx
  mov    (%rsi,%rcx,4),%ecx
  cmp    %ecx,%edi
  cmovg  %ecx,%edi
  cmp    %ecx,%r12d
  cmovl  %ecx,%r12d
  lea    0x1(%rax),%ecx
  cmp    %r10d,%ecx
  jge    L29
  add    %edx,%ecx
  movslq %ecx,%rcx
  mov    (%rsi,%rcx,4),%ecx
  cmp    %ecx,%edi
  cmovg  %ecx,%edi
  cmp    %ecx,%r12d
  cmovl  %ecx,%r12d
  add    $0x2,%eax
  cmp    %r10d,%eax
  jge    L29
  add    %edx,%eax
  cltq
  mov    (%rsi,%rax,4),%eax
  cmp    %eax,%edi
  cmovg  %eax,%edi
  cmp    %eax,%r12d
  cmovl  %eax,%r12d
L29:
  call   <abs@plt>
  divss  0x84(%rsp),%xmm0
  call   <ceilf@plt>
  mov    %eax,%r13d
  mov    0x80(%rsp),%eax
  imul   %ebx,%r13d
  sub    %r12d,%eax
  mov    %eax,0x20(%rsp)
  cmp    %r13d,%eax
  jl     L51
  mov    0x60(%rsp),%rcx
  mov    0x58(%rsp),%rdx
  movslq %r13d,%rax
  mov    %r13d,%r14d
  mov    %ebx,%r13d
  lea    (%rcx,%rax,4),%r12
  lea    0x8(%rdx,%rax,8),%r15
  mov    %r12,%rbx
  mov    %r15,%r12
  nopl   0x0(%rax,%rax,1)
L59:
  mov    %r14d,%eax
  mov    0x30(%rsp),%rsi
  mov    %r12,%r8
  mov    %rbx,%rcx
  cltd
  add    %r13d,%r14d
  idiv   %r13d
  mov    %rbp,%rdx
  add    0x4(%rsp),%eax
  cltq
  lea    (%rsi,%rax,4),%r15
  mov    0x28(%rsp),%eax
  push   %rax
  mov    0x2c(%rsp),%eax
  push   %rax
  mov    0x58(%rsp),%eax
  push   %rax
  mov    0x44(%rsp),%eax
  push   %rax
  mov    0x38(%rsp),%r9
  mov    0x30(%rsp),%rsi
  mov    0x28(%rsp),%rdi
  call   <network_corr@plt>
  add    0x58(%rsp),%rbx
  add    0x60(%rsp),%r12
  add    $0x20,%rsp
  movss  %xmm0,(%r15)
  cmp    %r14d,0x20(%rsp)
  jge    L59
  mov    %r13d,%ebx
L51:
  mov    0x6c(%rsp),%edi
  add    %edi,0x4(%rsp)
  mov    0x78(%rsp),%rdi
  mov    0x70(%rsp),%rcx
  addl   $0x1,0x50(%rsp)
  mov    0x50(%rsp),%eax
  add    %rcx,0x8(%rsp)
  add    %rdi,%rbp
  mov    0x4c(%rsp),%ecx
  add    %rdi,0x10(%rsp)
  add    %rdi,0x18(%rsp)
  add    %ecx,0x54(%rsp)
  cmp    %eax,0x68(%rsp)
  jne    L69
L89:
  mov    0x58(%rsp),%rdi
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10b0 <free@plt>
  nopl   0x0(%rax)
L40:
  xor    %r12d,%r12d
  xor    %edi,%edi
  jmp    L29
L61:
  mov    0x4c(%rsp),%r10d
  xor    %r12d,%r12d
  xor    %edi,%edi
  xor    %eax,%eax
  jmp    L73
```

assistant: ```c
void matched_filter(float *templates, float *sum_square_templates, int *moveouts, float *data, float *weights, int step, int n_samples_template, int n_samples_data, int n_templates, int n_stations, int n_components, int n_corr, float *cc_sum) {
  int t, ch, i;
  int start_i, stop_i, cc_i;
  int min_moveout, max_moveout;
  int network_offset, station_offset, cc_sum_offset;
  int *moveouts_t = NULL;
  float *templates_t = NULL, *sum_square_templates_t = NULL, *weights_t = NULL;
  double *csum_square_data = NULL;
  csum_square_data = malloc(((n_samples_data + 1) * n_stations * n_components) * sizeof(double));
  memset(csum_square_data, 0., ((n_samples_data + 1) * n_stations * n_components) * sizeof(double));
  cumsum_square_data(data, n_samples_data, weights, n_stations, n_components, csum_square_data);
  for (t = 0; t < n_templates; t++) {
    network_offset = t * n_stations * n_components;
    station_offset = t * n_stations;
    cc_sum_offset = t * n_corr;
    min_moveout = 0;
    max_moveout = 0;
    for (ch = 0; ch < (n_stations * n_components); ch++) {
      if (moveouts[network_offset + ch] < min_moveout)
        min_moveout = moveouts[network_offset + ch];
      if (moveouts[network_offset + ch] > max_moveout)
        max_moveout = moveouts[network_offset + ch];
    }
    templates_t = templates + network_offset * n_samples_template;
    moveouts_t = moveouts + network_offset;
    weights_t = weights + network_offset;
    sum_square_templates_t = sum_square_templates + network_offset;
    start_i = (int)(ceilf(abs(min_moveout) / (float)step)) * step;
    stop_i = 1 + (n_samples_data - n_samples_template - max_moveout);
#pragma omp parallel for private(i, cc_i)
    for (i = start_i; i < stop_i; i += step) {
      cc_i = i / step;
      cc_sum[cc_sum_offset + cc_i] = network_corr(templates_t, sum_square_templates_t, moveouts_t, data + i, csum_square_data + i + 1, weights_t, n_samples_template, n_samples_data, n_stations, n_components);
    }
  }
  free(csum_square_data);
}
```