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

```asm
<normalize>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  mov    %r9,-0x40(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jle    L87
  movl   $0x0,-0xc(%rbp)
  jmp    L46
L49:
  addl   $0x1,-0xc(%rbp)
L46:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movq   %rax,%xmm0
  call   <isnan@plt>
  test   %rax,%rax
  jne    L49
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x38(%rbp),%rax
  movsd  %xmm0,(%rax)
  movl   $0x1,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  addl   $0x1,-0xc(%rbp)
  jmp    L12
L19:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movq   %rax,%xmm0
  call   <isnan@plt>
  test   %rax,%rax
  jne    L71
  mov    -0x38(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x38(%rbp),%rax
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x8(%rbp)
L71:
  addl   $0x1,-0xc(%rbp)
L12:
  mov    -0xc(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L19
  mov    -0x38(%rbp),%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x8(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  mov    -0x38(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x38(%rbp),%rax
  movsd  (%rax),%xmm2
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x38(%rbp),%rax
  movsd  (%rax),%xmm2
  subsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x40(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L81
L80:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movq   %rax,%xmm0
  call   <isnan@plt>
  test   %rax,%rax
  jne    L30
  mov    -0x40(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x38(%rbp),%rax
  movsd  (%rax),%xmm3
  movapd %xmm0,%xmm2
  subsd  %xmm3,%xmm2
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x38(%rbp),%rax
  movsd  (%rax),%xmm3
  subsd  %xmm3,%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x40(%rbp),%rax
  movsd  %xmm0,(%rax)
L30:
  addl   $0x1,-0xc(%rbp)
L81:
  mov    -0xc(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L80
  mov    -0x40(%rbp),%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x8(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    -0x40(%rbp),%rdx
  mov    %rax,(%rdx)
  movl   $0x0,-0xc(%rbp)
  jmp    L85
L55:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x38(%rbp),%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x40(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x40(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0xc(%rbp)
L85:
  mov    -0xc(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L55
L87:
  nop
  leave
  ret
```

assistant: ```c
void normalize(int size, double *t, double *mag, double *sig, double *ave, double *stddev) {
  int i, i1, n;
  if (size > 0) {
    i = 0;
    while (isnan(mag[i]))
      i++;
    *ave = mag[i];
    n = 1;
    i1 = i;
    for (i = i + 1; i < size; i++)
      if (!isnan(mag[i])) {
        *ave += mag[i];
        n++;
      }
    *ave /= (double)n;
    *stddev = ((mag[i1] - *ave) * (mag[i1] - *ave));
    for (i = i1 + 1; i < size; i++)
      if (!isnan(mag[i]))
        *stddev += ((mag[i] - *ave) * (mag[i] - *ave));
    *stddev = sqrt((*stddev) / (double)n);
    for (i = 0; i < size; i++) {
      mag[i] = (mag[i] - *ave) / (*stddev);
      sig[i] = sig[i] / (*stddev);
    }
  }
}
```