user: Converte this assembly snippet into its equivalent C code:

```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    L37
  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)
L7:
  mov    0xc8(%rsp),%eax
  test   %eax,%eax
  jle    L44
  mov    0x38(%rsp),%rdi
  mov    0x60(%rsp),%r8
  mov    %r14d,%r11d
  mov    0x58(%rsp),%rax
  mov    0x48(%rsp),%r13d
  mov    0x34(%rsp),%r12d
  mov    0x30(%rsp),%ebp
  add    %rdi,%r8
  mov    0x68(%rsp),%rbx
  add    %rdi,%rax
  mov    %r13d,%r15d
  mov    %rax,%r14
  mov    %r12d,%r13d
  mov    %ebp,%r12d
  mov    %r8,%rbp
  add    %rdi,%rbx
  nopl   0x0(%rax)
L1:
  ucomiss (%rbx),%xmm1
  jp     L27
  je     L36
L27:
  mov    0x0(%rbp),%esi
  mov    0x20(%rsp),%rax
  movslq %r15d,%rdi
  mov    %r11d,0x28(%rsp)
  movss  (%r14),%xmm0
  mov    %r10d,0xb8(%rsp)
  lea    0x0(%r13,%rsi,1),%edx
  add    %r12d,%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)
L36:
  add    $0x4,%rbx
  add    $0x4,%rbp
  add    %r10d,%r12d
  add    %r11d,%r13d
  add    $0x4,%r14
  add    %ecx,%r15d
  cmp    (%rsp),%rbx
  jne    L1
  mov    %r11d,%r14d
L44:
  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    L7
L39:
  movss  0xc(%rsp),%xmm0
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L37:
  pxor   %xmm3,%xmm3
  movss  %xmm3,0xc(%rsp)
  jmp    L39
```

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;
}
```