user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<find_cals>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  test   %esi,%esi
  jle    L62
  mov    %edx,%r9d
  mov    %r8,%r12
  lea    -0x1(%rbp),%eax
  mov    %rdi,%r8
  shr    $0x1f,%r9d
  mov    %edx,%esi
  mov    %ecx,%r10d
  mov    %rax,%r14
  add    %edx,%r9d
  lea    0x4(%r12,%rax,4),%r13
  mov    %r12,%rdi
  mov    %r12,%r15
  sar    %r9d
  pxor   %xmm1,%xmm1
  lea    (%rdx,%rcx,1),%r11d
  nopl   0x0(%rax)
L104:
  movl   $0x0,(%rdi)
  cmp    $0x1,%esi
  jle    L86
  mov    (%r8),%rbx
  movaps %xmm1,%xmm0
  xor    %ecx,%ecx
  nopw   0x0(%rax,%rax,1)
L138:
  lea    (%r10,%rcx,1),%eax
  add    $0x1,%ecx
  cltd
  idiv   %esi
  movslq %edx,%rdx
  addss  (%rbx,%rdx,4),%xmm0
  movss  %xmm0,(%rdi)
  cmp    %r9d,%ecx
  jl     L138
L65:
  cmp    %r9d,%esi
  jle    L77
  mov    (%r8),%rbx
  lea    (%r10,%r9,1),%ecx
  nopw   0x0(%rax,%rax,1)
L123:
  mov    %ecx,%eax
  add    $0x1,%ecx
  cltd
  idiv   %esi
  movslq %edx,%rdx
  subss  (%rbx,%rdx,4),%xmm0
  movss  %xmm0,(%rdi)
  cmp    %r11d,%ecx
  jne    L123
L77:
  add    $0x4,%rdi
  add    $0x8,%r8
  cmp    %r13,%rdi
  jne    L104
  mov    %r15,%rbx
  cmp    $0x2,%r14d
  jbe    L42
  mov    %ebp,%eax
  lea    0x10(%r12),%rcx
  movaps %xmm1,%xmm0
  shr    $0x2,%eax
  lea    -0x1(%rax),%edx
  mov    %r12,%rax
  shl    $0x4,%rdx
  add    %rcx,%rdx
  nopl   (%rax)
L163:
  movups (%rax),%xmm2
  add    $0x10,%rax
  addss  %xmm2,%xmm0
  movaps %xmm2,%xmm1
  shufps $0x55,%xmm2,%xmm1
  addss  %xmm0,%xmm1
  movaps %xmm2,%xmm0
  unpckhps %xmm2,%xmm0
  shufps $0xff,%xmm2,%xmm2
  addss  %xmm1,%xmm0
  addss  %xmm2,%xmm0
  cmp    %rdx,%rax
  jne    L163
  mov    %ebp,%eax
  and    $0xfffffffc,%eax
  cmp    %ebp,%eax
  je     L73
L134:
  movslq %eax,%rdx
  addss  (%r12,%rdx,4),%xmm0
  lea    0x0(,%rdx,4),%rcx
  lea    0x1(%rax),%edx
  cmp    %edx,%ebp
  jle    L52
  add    $0x2,%eax
  addss  0x4(%r12,%rcx,1),%xmm0
  cmp    %eax,%ebp
  jle    L52
  addss  0x8(%r12,%rcx,1),%xmm0
L52:
  pxor   %xmm1,%xmm1
  cvtsi2ss %ebp,%xmm1
  divss  %xmm1,%xmm0
  cmp    $0x2,%r14d
  jbe    L36
  lea    0x10(%r12),%rcx
L115:
  mov    %ebp,%eax
  movaps %xmm0,%xmm2
  shr    $0x2,%eax
  shufps $0x0,%xmm2,%xmm2
  sub    $0x1,%eax
  shl    $0x4,%rax
  add    %rcx,%rax
  nopl   0x0(%rax,%rax,1)
L71:
  movups (%rbx),%xmm1
  add    $0x10,%rbx
  divps  %xmm2,%xmm1
  movups %xmm1,-0x10(%rbx)
  cmp    %rax,%rbx
  jne    L71
  mov    %ebp,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%bpl
  je     L62
L116:
  movslq %eax,%rdx
  shl    $0x2,%rdx
  lea    (%r12,%rdx,1),%rcx
  movss  (%rcx),%xmm1
  divss  %xmm0,%xmm1
  movss  %xmm1,(%rcx)
  lea    0x1(%rax),%ecx
  cmp    %ecx,%ebp
  jle    L62
  lea    0x4(%r12,%rdx,1),%rcx
  add    $0x2,%eax
  movss  (%rcx),%xmm1
  divss  %xmm0,%xmm1
  movss  %xmm1,(%rcx)
  cmp    %ebp,%eax
  jge    L62
  lea    0x8(%r12,%rdx,1),%rax
  movss  (%rax),%xmm1
  divss  %xmm0,%xmm1
  movss  %xmm1,(%rax)
L62:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L86:
  movaps %xmm1,%xmm0
  jmp    L65
L73:
  pxor   %xmm1,%xmm1
  cvtsi2ss %ebp,%xmm1
  divss  %xmm1,%xmm0
  jmp    L115
L42:
  xor    %eax,%eax
  movaps %xmm1,%xmm0
  jmp    L134
L36:
  xor    %eax,%eax
  jmp    L116
```

assistant: ```c
void find_cals(float **tot, int nchan, int period, int phase, float *cal) {
  for (int i = 0; i < nchan; i++) {
    cal[i] = 0;
    for (int j = 0; j < period / 2; j++)
      cal[i] += tot[i][(j + phase) % period];
    for (int j = period / 2; j < period; j++)
      cal[i] -= tot[i][(j + phase) % period];
  }
  float norm = 0;
  for (int i = 0; i < nchan; i++)
    norm += cal[i];
  norm /= nchan;
  for (int i = 0; i < nchan; i++)
    cal[i] /= norm;
}
```