user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<lineal>:
  endbr64
  push   %r15
  pxor   %xmm6,%xmm6
  push   %r14
  cvtsi2sd %edx,%xmm6
  push   %r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    0x90(%rsp),%rax
  mov    %edx,0x3c(%rsp)
  mov    %r8,0x20(%rsp)
  mov    %r9,0x40(%rsp)
  mov    %rax,0x48(%rsp)
  test   %edx,%edx
  jle    L38
  pxor   %xmm7,%xmm7
  mov    %rdi,%r14
  mov    %rsi,%rbp
  movslq %edx,%rbx
  xor    %eax,%eax
  movapd %xmm7,%xmm2
  movsd  %xmm7,0x30(%rsp)
  movapd %xmm7,%xmm5
  movapd %xmm7,%xmm3
  movapd %xmm7,%xmm4
  nopl   (%rax)
L9:
  movsd  (%r14,%rax,8),%xmm0
  movsd  0x0(%rbp,%rax,8),%xmm1
  add    $0x1,%rax
  addsd  %xmm0,%xmm2
  addsd  %xmm1,%xmm4
  mulsd  %xmm0,%xmm1
  mulsd  %xmm0,%xmm0
  addsd  %xmm1,%xmm3
  addsd  %xmm0,%xmm5
  cmp    %rax,%rbx
  jne    L9
  movapd %xmm2,%xmm0
  movapd %xmm4,%xmm7
  mov    0x20(%rsp),%rax
  xor    %r15d,%r15d
  mulsd  %xmm4,%xmm0
  lea    D14(%rip),%rdi
  movsd  %xmm4,0x8(%rsp)
  lea    D26(%rip),%r13
  mulsd  %xmm6,%xmm3
  mulsd  %xmm6,%xmm5
  divsd  %xmm6,%xmm7
  subsd  %xmm0,%xmm3
  movapd %xmm2,%xmm0
  mulsd  %xmm2,%xmm0
  subsd  %xmm0,%xmm5
  divsd  %xmm6,%xmm2
  movsd  %xmm7,0x28(%rsp)
  divsd  %xmm5,%xmm3
  mulsd  %xmm3,%xmm2
  movsd  %xmm3,(%r12)
  subsd  %xmm2,%xmm7
  movsd  %xmm7,(%rax)
  xor    %eax,%eax
  call   <printf@plt>
  movsd  0x30(%rsp),%xmm5
  movsd  0x8(%rsp),%xmm4
  movapd %xmm5,%xmm6
L51:
  movsd  (%r14,%r15,8),%xmm0
  movsd  (%r12),%xmm2
  mov    %r13,%rdi
  movsd  %xmm4,0x18(%rsp)
  movsd  0x0(%rbp,%r15,8),%xmm1
  mov    0x20(%rsp),%rax
  add    $0x1,%r15
  mulsd  %xmm0,%xmm2
  movapd %xmm1,%xmm3
  subsd  %xmm2,%xmm3
  movapd %xmm1,%xmm2
  subsd  (%rax),%xmm3
  mov    $0x4,%eax
  subsd  0x28(%rsp),%xmm2
  mulsd  %xmm3,%xmm3
  mulsd  %xmm2,%xmm2
  addsd  %xmm3,%xmm6
  addsd  %xmm2,%xmm5
  movsd  %xmm6,0x8(%rsp)
  movsd  %xmm5,0x10(%rsp)
  call   <printf@plt>
  cmp    %r15,%rbx
  movsd  0x8(%rsp),%xmm6
  movsd  0x10(%rsp),%xmm5
  movsd  0x18(%rsp),%xmm4
  jne    L51
L20:
  mov    0x3c(%rsp),%r14d
  pxor   %xmm1,%xmm1
  movapd %xmm6,%xmm0
  movsd  0x30(%rsp),%xmm7
  sub    $0x2,%r14d
  cvtsi2sd %r14d,%xmm1
  divsd  %xmm1,%xmm0
  ucomisd %xmm0,%xmm7
  ja     L34
  sqrtsd %xmm0,%xmm0
L2:
  mov    0x40(%rsp),%rax
  movapd %xmm6,%xmm2
  movapd %xmm5,%xmm1
  lea    D10(%rip),%rdi
  movsd  %xmm0,(%rax)
  movapd %xmm5,%xmm0
  mov    0x48(%rsp),%rax
  subsd  %xmm6,%xmm0
  divsd  %xmm5,%xmm0
  movsd  %xmm0,(%rax)
  add    $0x58,%rsp
  movapd %xmm4,%xmm0
  mov    $0x3,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1060 <printf@plt>
  nopl   0x0(%rax,%rax,1)
L38:
  pxor   %xmm7,%xmm7
  mov    0x20(%rsp),%rax
  lea    D14(%rip),%rdi
  movapd %xmm7,%xmm0
  movsd  %xmm7,0x30(%rsp)
  divsd  %xmm6,%xmm0
  mulsd  %xmm7,%xmm6
  divsd  %xmm6,%xmm6
  movsd  %xmm6,(%rcx)
  mulsd  %xmm0,%xmm6
  subsd  %xmm6,%xmm0
  movsd  %xmm0,(%rax)
  xor    %eax,%eax
  call   <printf@plt>
  movsd  0x30(%rsp),%xmm5
  movapd %xmm5,%xmm4
  movapd %xmm5,%xmm6
  jmp    L20
L34:
  movsd  %xmm4,0x18(%rsp)
  movsd  %xmm6,0x10(%rsp)
  movsd  %xmm5,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x18(%rsp),%xmm4
  movsd  0x10(%rsp),%xmm6
  movsd  0x8(%rsp),%xmm5
  jmp    L2
```

tool_calls: name: retrieve_data
arguments: data_tag: D14
data_type: string
name: retrieve_data
arguments: data_tag: D26
data_type: string
name: retrieve_data
arguments: data_tag: D10
data_type: string

tool: D14: 
       Xi       |        Yi       |     (Yi-Ym)^2     |      (Yi-ao-a1X1)^2   |

tool: D26: 
    %8.4lf    |     %8.4lf    |     %8.4lf      |         %8.4lf      |

tool: D10: 
      sum       |     %8.4lf    |     %8.4lf      |         %8.4lf      |

assistant: ```c
void lineal(double *X, double *Y, int n, double *a1, double *a0, double *syx, double *r2) {
  double sumx = 0, sumy = 0, sumxy = 0, vad;
  double sumx2 = 0, st = 0, sr = 0, cdd;
  double xm, ym;
  int i;
  for (i = 0; i < n; i++) {
    sumx = sumx + X[i];
    sumy = sumy + Y[i];
    sumxy = sumxy + X[i] * Y[i];
    sumx2 = sumx2 + X[i] * X[i];
  }
  xm = sumx / n;
  ym = sumy / n;
  *a1 = (n * sumxy - sumx * sumy) / (n * sumx2 - sumx * sumx);
  *a0 = ym - *a1 * xm;
  printf("\n       Xi       |        Yi       |     (Yi-Ym)^2     |      (Yi-ao-a1X1)^2   |");
  for (i = 0; i < n; i++) {
    vad = (Y[i] - *a1 * X[i] - *a0) * (Y[i] - *a1 * X[i] - *a0);
    cdd = (Y[i] - ym) * (Y[i] - ym);
    st = st + cdd;
    sr = sr + vad;
    printf("\n    %8.4lf    |     %8.4lf    |     %8.4lf      |         %8.4lf      |", X[i], Y[i], cdd, vad);
  }
  *syx = sqrt(sr / (n - 2));
  *r2 = (st - sr) / st;
  printf("\n      sum       |     %8.4lf    |     %8.4lf      |         %8.4lf      |", sumy, st, sr);
}
```