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

```asm
<detrend_lsq>:
  endbr64
  lea    -0x1(%rsi),%r10d
  pxor   %xmm5,%xmm5
  pxor   %xmm3,%xmm3
  cvtsi2sd %r10d,%xmm5
  mulsd  D1(%rip),%xmm5
  cvtsi2sd %esi,%xmm3
  test   %esi,%esi
  jle    L112
  cmp    $0x1,%esi
  je     L79
  mov    %esi,%r9d
  pxor   %xmm6,%xmm6
  mov    %rdi,%rax
  shr    %r9d
  movapd %xmm6,%xmm0
  sub    $0x1,%r9d
  shl    $0x4,%r9
  lea    0x10(%rdi,%r9,1),%r9
L113:
  movsd  (%rax),%xmm1
  add    $0x10,%rax
  addsd  %xmm1,%xmm0
  movsd  -0x8(%rax),%xmm1
  addsd  %xmm1,%xmm0
  cmp    %r9,%rax
  jne    L113
  mov    %esi,%eax
  and    $0xfffffffe,%eax
  test   $0x1,%sil
  je     L108
L1:
  cltq
  addsd  (%rdi,%rax,8),%xmm0
L108:
  movapd %xmm0,%xmm2
  mov    %esi,%r9d
  movapd %xmm6,%xmm4
  xor    %eax,%eax
  divsd  %xmm3,%xmm2
  movapd %xmm6,%xmm3
  nopl   0x0(%rax)
L21:
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  subsd  %xmm5,%xmm1
  movapd %xmm1,%xmm0
  mulsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm4
  movsd  (%rdi,%rax,8),%xmm0
  add    $0x1,%rax
  subsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm3
  cmp    %r9,%rax
  jne    L21
  divsd  %xmm4,%xmm3
  movsd  %xmm3,(%rcx)
  mulsd  %xmm5,%xmm3
  subsd  %xmm3,%xmm2
  movsd  %xmm2,(%r8)
  mulsd  (%rcx),%xmm6
  movsd  (%rdi),%xmm0
  addsd  %xmm2,%xmm6
  subsd  %xmm6,%xmm0
  movsd  %xmm0,(%rdx)
  cmp    $0x1,%esi
  je     L67
  push   %rbp
  lea    -0x2(%rsi),%r9d
  push   %rbx
  lea    (%rdx,%rax,8),%rbx
  mov    %rdx,%rax
  sub    %rdi,%rax
  sub    $0x8,%rax
  cmp    $0x10,%rax
  seta   %r11b
  cmp    $0x2,%r9d
  seta   %al
  and    %eax,%r11d
  cmp    %rbx,%rcx
  setae  %al
  cmp    %rdx,%rcx
  setbe  %bpl
  or     %ebp,%eax
  test   %al,%r11b
  je     L32
  cmp    %rbx,%r8
  setae  %al
  cmp    %rdx,%r8
  setbe  %r11b
  or     %r11b,%al
  je     L32
  mov    %r10d,%eax
  movsd  (%r8),%xmm5
  movsd  (%rcx),%xmm4
  shr    $0x2,%eax
  movdqa D6(%rip),%xmm3
  movdqa D21(%rip),%xmm6
  lea    -0x1(%rax),%r9d
  unpcklpd %xmm5,%xmm5
  unpcklpd %xmm4,%xmm4
  mov    $0x8,%eax
  shl    $0x5,%r9
  add    $0x28,%r9
  nopl   0x0(%rax,%rax,1)
L80:
  movdqa %xmm3,%xmm0
  movupd 0x10(%rdi,%rax,1),%xmm2
  paddd  %xmm6,%xmm3
  pshufd $0xee,%xmm0,%xmm1
  cvtdq2pd %xmm0,%xmm0
  cvtdq2pd %xmm1,%xmm1
  mulpd  %xmm4,%xmm1
  mulpd  %xmm4,%xmm0
  addpd  %xmm5,%xmm1
  addpd  %xmm5,%xmm0
  subpd  %xmm1,%xmm2
  movupd (%rdi,%rax,1),%xmm1
  subpd  %xmm0,%xmm1
  movups %xmm2,0x10(%rdx,%rax,1)
  movups %xmm1,(%rdx,%rax,1)
  add    $0x20,%rax
  cmp    %r9,%rax
  jne    L80
  mov    %r10d,%eax
  and    $0xfffffffc,%eax
  lea    0x1(%rax),%r11d
  cmp    %r10d,%eax
  je     L69
  pxor   %xmm0,%xmm0
  movslq %r11d,%r10
  cvtsi2sd %r11d,%xmm0
  mulsd  (%rcx),%xmm0
  movsd  (%rdi,%r10,8),%xmm1
  lea    0x0(,%r10,8),%r9
  addsd  (%r8),%xmm0
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rdx,%r10,8)
  lea    0x2(%rax),%r10d
  cmp    %esi,%r10d
  jge    L69
  pxor   %xmm0,%xmm0
  movsd  0x8(%rdi,%r9,1),%xmm1
  add    $0x3,%eax
  cvtsi2sd %r10d,%xmm0
  mulsd  (%rcx),%xmm0
  addsd  (%r8),%xmm0
  subsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%rdx,%r9,1)
  cmp    %eax,%esi
  jle    L69
  pxor   %xmm0,%xmm0
  movsd  0x10(%rdi,%r9,1),%xmm1
  cvtsi2sd %eax,%xmm0
  mulsd  (%rcx),%xmm0
  addsd  (%r8),%xmm0
  subsd  %xmm0,%xmm1
  movsd  %xmm1,0x10(%rdx,%r9,1)
L69:
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L32:
  add    $0x2,%r9
  mov    $0x1,%eax
  nopl   0x0(%rax)
L60:
  pxor   %xmm0,%xmm0
  movsd  (%rdi,%rax,8),%xmm1
  cvtsi2sd %eax,%xmm0
  mulsd  (%rcx),%xmm0
  addsd  (%r8),%xmm0
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r9
  jne    L60
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L112:
  pxor   %xmm0,%xmm0
  movapd %xmm0,%xmm1
  divsd  %xmm0,%xmm1
  divsd  %xmm3,%xmm0
  movsd  %xmm1,(%rcx)
  mulsd  %xmm5,%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%r8)
  ret
  nopw   0x0(%rax,%rax,1)
L67:
  ret
L79:
  pxor   %xmm6,%xmm6
  xor    %eax,%eax
  movapd %xmm6,%xmm0
  jmp    L1
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D1
type: f32[2]
name: extract_symbolic_data
arguments: data_label: D6
type: byte[16]
name: extract_symbolic_data
arguments: data_label: D21
type: byte[16]

tool: {"D1": [0.0,1.75]}

tool: {"D6": [0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

tool: {"D21": [0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

assistant: ```c
void detrend_lsq(double *source, int n, double *dest, double *slope, double *intercept) {
  int i;
  double x = 0.0, y = 0.0, xmean = 0.0, ymean = 0.0, xvar = 0.0, xy = 0.0;
  xmean = (double)(n - 1) / 2.0;
  for (i = 0; i < n; i++)
    ymean += source[i];
  ymean /= (double)n;
  for (i = 0; i < n; i++) {
    x = (double)i - xmean;
    y = source[i] - ymean;
    xvar += x * x;
    xy += x * y;
  }
  *slope = xy / xvar;
  *intercept = ymean - *slope * xmean;
  for (i = 0; i < n; i++) {
    y = *slope * (double)i + *intercept;
    dest[i] = source[i] - y;
  }
}
```