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

```asm
<network_corr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdx,0x60(%rsp)
  mov    0xc0(%rsp),%edx
  mov    %rdi,0x10(%rsp)
  mov    0xb0(%rsp),%r15d
  mov    %rsi,0x58(%rsp)
  mov    0xb8(%rsp),%r10d
  mov    %rcx,0x18(%rsp)
  mov    %r8,0x20(%rsp)
  mov    %r9,0x68(%rsp)
  test   %edx,%edx
  jle    L39
  movslq 0xc8(%rsp),%rax
  lea    0x1(%r10),%r14d
  movq   $0x0,0x38(%rsp)
  pxor   %xmm1,%xmm1
  movl   $0x0,0x48(%rsp)
  mov    %r15d,%ecx
  shl    $0x2,%rax
  movl   $0x0,0x34(%rsp)
  mov    %rax,0x40(%rsp)
  mov    0xc8(%rsp),%eax
  movl   $0x0,0x30(%rsp)
  sub    $0x1,%eax
  movl   $0x0,0x2c(%rsp)
  lea    0x4(%r9,%rax,4),%r9
  mov    0xc8(%rsp),%eax
  movss  %xmm1,0xc(%rsp)
  mov    %r9,(%rsp)
  imul   %r10d,%eax
  mov    %eax,0x4c(%rsp)
  mov    0xc8(%rsp),%eax
  imul   %r14d,%eax
  mov    %eax,0x50(%rsp)
  mov    0xc8(%rsp),%eax
  imul   %r15d,%eax
  mov    %eax,0x54(%rsp)
  nopw   0x0(%rax,%rax,1)
L18:
  mov    0xc8(%rsp),%eax
  test   %eax,%eax
  jle    L67
  mov    0x38(%rsp),%rdi
  mov    0x60(%rsp),%r8
  mov    %r14d,%r11d
  mov    0x58(%rsp),%rax
  mov    0x48(%rsp),%r13d
  mov    0x68(%rsp),%rbx
  add    %rdi,%r8
  mov    0x34(%rsp),%r12d
  add    %rdi,%rax
  mov    0x30(%rsp),%ebp
  mov    %r13d,%r15d
  mov    %r8,%r13
  add    %rdi,%rbx
  mov    %rax,%r14
  cs nopw 0x0(%rax,%rax,1)
L55:
  ucomiss (%rbx),%xmm1
  jp     L59
  je     L27
L59:
  mov    0x0(%r13),%esi
  mov    0x20(%rsp),%rax
  movslq %r15d,%rdi
  mov    %r11d,0x28(%rsp)
  movss  (%r14),%xmm0
  mov    %r10d,0xb8(%rsp)
  lea    (%r12,%rsi,1),%edx
  add    %ebp,%esi
  mov    %ecx,0xb0(%rsp)
  movslq %edx,%rdx
  movslq %esi,%rsi
  lea    (%rax,%rdx,8),%rdx
  mov    0x18(%rsp),%rax
  lea    (%rax,%rsi,4),%rsi
  mov    0x10(%rsp),%rax
  lea    (%rax,%rdi,4),%rdi
  call   <corrc@plt>
  mulss  (%rbx),%xmm0
  pxor   %xmm1,%xmm1
  mov    0xb8(%rsp),%r10d
  addss  0xc(%rsp),%xmm0
  mov    0x28(%rsp),%r11d
  mov    0xb0(%rsp),%ecx
  movss  %xmm0,0xc(%rsp)
L27:
  add    $0x4,%rbx
  add    $0x4,%r13
  add    %r10d,%ebp
  add    %r11d,%r12d
  add    $0x4,%r14
  add    %ecx,%r15d
  cmp    (%rsp),%rbx
  jne    L55
  mov    %r11d,%r14d
L67:
  mov    0x40(%rsp),%rdx
  addl   $0x1,0x2c(%rsp)
  mov    0x4c(%rsp),%ebx
  mov    0x50(%rsp),%edi
  mov    0x54(%rsp),%esi
  add    %rdx,(%rsp)
  add    %ebx,0x30(%rsp)
  mov    0x2c(%rsp),%eax
  add    %edi,0x34(%rsp)
  add    %esi,0x48(%rsp)
  add    %rdx,0x38(%rsp)
  cmp    %eax,0xc0(%rsp)
  jne    L18
L22:
  movss  0xc(%rsp),%xmm0
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L39:
  pxor   %xmm3,%xmm3
  movss  %xmm3,0xc(%rsp)
  jmp    L22
```

assistant: ```c
float network_corr(float *templates, float *sum_square_template, int *moveouts, float *data, double *csum_square_data, float *weights, int n_samples_template, int n_samples_data, int n_stations, int n_components) {
  int s, c, d, dd, t;
  int station_offset, component_offset;
  float cc, cc_sum = 0;
  for (s = 0; s < n_stations; s++) {
    station_offset = s * n_components;
    cc = 0;
    for (c = 0; c < n_components; c++) {
      component_offset = station_offset + c;
      if (weights[component_offset] == 0)
        continue;
      t = component_offset * n_samples_template;
      d = component_offset * n_samples_data + moveouts[component_offset];
      dd = component_offset * (n_samples_data + 1) + moveouts[component_offset];
      cc = corrc(templates + t, sum_square_template[component_offset], data + d, csum_square_data + dd, n_samples_template);
      cc_sum += cc * weights[component_offset];
    }
  }
  return cc_sum;
}
```