user: What is the c source code of the assembly code below?

```asm
<linetrend>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  mov    %rcx,-0x50(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x2c(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x24(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x20(%rbp)
  movl   $0x1,-0x14(%rbp)
  jmp    L48
L51:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  movss  -0x2c(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x2c(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x24(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x24(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  movss  -0x28(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x28(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x20(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x20(%rbp)
  addl   $0x1,-0x14(%rbp)
L48:
  mov    -0x14(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jle    L51
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x44(%rbp),%xmm1
  movss  -0x2c(%rbp),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x10(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x44(%rbp),%xmm1
  movss  -0x28(%rbp),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,-0xc(%rbp)
  pxor   %xmm2,%xmm2
  cvtsi2ssl -0x44(%rbp),%xmm2
  movss  -0x24(%rbp),%xmm0
  movaps %xmm0,%xmm1
  divss  %xmm2,%xmm1
  movss  -0x10(%rbp),%xmm0
  movaps %xmm0,%xmm2
  mulss  %xmm0,%xmm2
  subss  %xmm2,%xmm1
  movaps %xmm1,%xmm0
  movss  %xmm0,-0x8(%rbp)
  pxor   %xmm2,%xmm2
  cvtsi2ssl -0x44(%rbp),%xmm2
  movss  -0x20(%rbp),%xmm0
  movaps %xmm0,%xmm1
  divss  %xmm2,%xmm1
  movss  -0xc(%rbp),%xmm0
  movaps %xmm0,%xmm2
  mulss  %xmm0,%xmm2
  subss  %xmm2,%xmm1
  movaps %xmm1,%xmm0
  movss  %xmm0,-0x4(%rbp)
  pxor   %xmm0,%xmm0
  comiss -0x8(%rbp),%xmm0
  setae  %dl
  pxor   %xmm0,%xmm0
  comiss -0x4(%rbp),%xmm0
  setae  %al
  or     %edx,%eax
  test   %al,%al
  je     L17
  mov    -0x50(%rbp),%rax
  add    $0x4,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x50(%rbp),%rax
  add    $0x8,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x50(%rbp),%rax
  add    $0xc,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  jmp    L10
L17:
  pxor   %xmm4,%xmm4
  cvtss2sd -0x8(%rbp),%xmm4
  movq   %xmm4,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x8(%rbp)
  pxor   %xmm5,%xmm5
  cvtss2sd -0x4(%rbp),%xmm5
  movq   %xmm5,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x4(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x1c(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x18(%rbp)
  movl   $0x1,-0x14(%rbp)
  jmp    L29
L25:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  movaps %xmm0,%xmm1
  subss  -0x10(%rbp),%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  subss  -0xc(%rbp),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x1c(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x1c(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x18(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x18(%rbp)
  addl   $0x1,-0x14(%rbp)
L29:
  mov    -0x14(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jle    L25
  mov    -0x44(%rbp),%eax
  sub    $0x1,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  movss  -0x1c(%rbp),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x1c(%rbp)
  movss  -0x8(%rbp),%xmm0
  movaps %xmm0,%xmm1
  mulss  -0x4(%rbp),%xmm1
  mov    -0x50(%rbp),%rax
  add    $0x4,%rax
  movss  -0x1c(%rbp),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  movss  -0x2c(%rbp),%xmm0
  mulss  -0x28(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x44(%rbp),%xmm1
  movaps %xmm0,%xmm2
  divss  %xmm1,%xmm2
  movss  -0x18(%rbp),%xmm0
  movaps %xmm0,%xmm1
  subss  %xmm2,%xmm1
  movss  -0x2c(%rbp),%xmm0
  mulss  %xmm0,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2ssl -0x44(%rbp),%xmm2
  movaps %xmm0,%xmm3
  divss  %xmm2,%xmm3
  movss  -0x24(%rbp),%xmm0
  movaps %xmm0,%xmm2
  subss  %xmm3,%xmm2
  mov    -0x50(%rbp),%rax
  add    $0x8,%rax
  divss  %xmm2,%xmm1
  movaps %xmm1,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x50(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm0
  movaps %xmm0,%xmm1
  mulss  -0x10(%rbp),%xmm1
  mov    -0x50(%rbp),%rax
  add    $0xc,%rax
  movss  -0xc(%rbp),%xmm0
  subss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
L10:
  nop
  leave
  ret
```

assistant: ```c
void linetrend(float *x, float *y, int n, float *res) {
  float mean_x, mean_y, std_x, std_y;
  float sum_x, sum_y, sum_x2, sum_y2;
  float cov, sum_xy;
  int i;
  sum_x = 0;
  sum_y = 0;
  sum_x2 = 0;
  sum_y2 = 0;
  for (i = 1; i <= n; i++) {
    sum_x += x[i];
    sum_x2 += (x[i] * x[i]);
    sum_y += y[i];
    sum_y2 += (y[i] * y[i]);
  }
  mean_x = sum_x / n;
  mean_y = sum_y / n;
  std_x = sum_x2 / n - mean_x * mean_x;
  std_y = sum_y2 / n - mean_y * mean_y;
  if ((std_x <= 0) | (std_y <= 0)) {
    res[1] = 0;
    res[2] = 0;
    res[3] = 0;
  } else {
    std_x = sqrt(std_x);
    std_y = sqrt(std_y);
    cov = 0;
    sum_xy = 0;
    for (i = 1; i <= n; i++) {
      cov += (x[i] - mean_x) * (y[i] - mean_y);
      sum_xy += (x[i] * y[i]);
    }
    cov = cov / (n - 1);
    res[1] = cov / (std_x * std_y);
    res[2] = (sum_xy - sum_x * sum_y / n) / (sum_x2 - sum_x * sum_x / n);
    res[3] = mean_y - (res[2]) * mean_x;
  }
}
```