user: Converte this assembly snippet into its equivalent C code:

```asm
<stage_one>:
  endbr64
  push   %r15
  lea    -0x1(%r8),%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,0x30(%rsp)
  mov    0x90(%rsp),%r14
  mov    %rdx,0x38(%rsp)
  mov    0xa0(%rsp),%r12
  mov    %rcx,0x48(%rsp)
  mov    %r8d,0x40(%rsp)
  mov    %eax,0x44(%rsp)
  test   %eax,%eax
  jle    L42
  mov    0x40(%rsp),%eax
  mov    %rsi,%rbp
  mov    %r9,%r15
  xor    %r13d,%r13d
  sub    $0x2,%eax
  mov    %eax,0x28(%rsp)
  mov    0x38(%rsp),%rax
  mov    %rax,0x18(%rsp)
  mov    0x98(%rsp),%rax
  mov    %rax,0x20(%rsp)
  nopl   0x0(%rax)
L14:
  mov    0x28(%rsp),%ecx
  movq   $0x0,(%r12)
  movq   $0x0,0x8(%r12)
  lea    0x1(%rcx),%eax
  test   %eax,%eax
  jle    L20
  movslq %r13d,%rax
  mov    0x30(%rsp),%rsi
  add    0x40(%rsp),%r13d
  mov    %ecx,%ebx
  mov    %r13d,0x2c(%rsp)
  lea    (%rsi,%rax,8),%r9
  movslq %r13d,%rax
  lea    (%rsi,%rax,8),%r8
  xor    %eax,%eax
  nopl   0x0(%rax)
L17:
  movsd  (%r8,%rax,8),%xmm1
  movsd  (%r9,%rax,8),%xmm0
  mov    %rax,%rdx
  movapd %xmm1,%xmm2
  movsd  %xmm0,(%r15,%rax,8)
  divsd  %xmm0,%xmm2
  movsd  %xmm2,(%r14,%rax,8)
  addsd  (%r12),%xmm0
  add    $0x1,%rax
  addsd  0x8(%r12),%xmm1
  movsd  %xmm0,(%r12)
  movsd  %xmm1,0x8(%r12)
  cmp    %rdx,%rbx
  jne    L17
  divsd  %xmm0,%xmm1
  mov    0x20(%rsp),%rax
  xor    %r13d,%r13d
  movsd  %xmm1,0x0(%rbp)
  movsd  (%r12),%xmm0
  pxor   %xmm1,%xmm1
  movsd  %xmm0,(%rax)
  nopl   (%rax)
L26:
  movsd  (%r14,%r13,8),%xmm0
  subsd  0x0(%rbp),%xmm0
  mov    $0x2,%edi
  movsd  %xmm1,0x10(%rsp)
  movsd  (%r15,%r13,8),%xmm3
  movsd  %xmm3,0x8(%rsp)
  call   <pow@plt>
  mulsd  0x8(%rsp),%xmm0
  movsd  0x10(%rsp),%xmm1
  mov    %r13,%rax
  add    $0x1,%r13
  addsd  %xmm0,%xmm1
  cmp    %rax,%rbx
  jne    L26
L62:
  mov    0x28(%rsp),%eax
  pxor   %xmm0,%xmm0
  mov    0x18(%rsp),%rsi
  add    $0x8,%rbp
  addq   $0x8,0x20(%rsp)
  mov    0x2c(%rsp),%r13d
  cvtsi2sd %eax,%xmm0
  add    $0x8,%rsi
  sub    $0x1,%eax
  mov    %eax,0x28(%rsp)
  divsd  %xmm0,%xmm1
  movsd  %xmm1,-0x8(%rsi)
  mov    %rsi,0x18(%rsp)
  cmp    $0xffffffff,%eax
  jne    L14
L42:
  movslq 0x40(%rsp),%rbx
  mov    0x38(%rsp),%r14
  mov    %rbx,%r15
  shl    $0x3,%rbx
  movsd  -0x18(%r14,%rbx,1),%xmm2
  lea    -0x20(%r14,%rbx,1),%rbp
  movsd  0x0(%rbp),%xmm0
  movapd %xmm2,%xmm1
  movsd  %xmm2,0x10(%rsp)
  call   <fmin@plt>
  movsd  0x10(%rsp),%xmm2
  mov    $0x2,%edi
  movsd  %xmm0,0x8(%rsp)
  movapd %xmm2,%xmm0
  call   <pow@plt>
  movsd  0x8(%rsp),%xmm1
  divsd  0x0(%rbp),%xmm0
  call   <fmin@plt>
  mov    0x44(%rsp),%edx
  lea    -0x2(%r15),%ecx
  xor    %eax,%eax
  movsd  %xmm0,-0x10(%r14,%rbx,1)
  test   %edx,%edx
  jle    L55
  mov    0x38(%rsp),%rsi
  mov    0x48(%rsp),%rdi
  mov    0x98(%rsp),%r8
  nop
L79:
  mov    %rax,%rdx
  movsd  (%rsi,%rax,8),%xmm0
  divsd  (%r8,%rax,8),%xmm0
  movsd  %xmm0,(%rdi,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rcx
  jne    L79
L55:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L20:
  pxor   %xmm0,%xmm0
  mov    0x20(%rsp),%rax
  pxor   %xmm1,%xmm1
  divsd  %xmm0,%xmm0
  movsd  %xmm0,0x0(%rbp)
  movsd  (%r12),%xmm0
  movsd  %xmm0,(%rax)
  mov    0x40(%rsp),%eax
  add    %r13d,%eax
  mov    %eax,0x2c(%rsp)
  jmp    L62
```

assistant: ```c
void stage_one(double *vec, double *fact, double *sigmas, double *var_f, int p, double *Cik, double *Cik1_Cik, double *ECik, double *col_sums) {
  int j, m;
  double cik, cik_1, sigmacum;
  for (j = 0; j < p - 1; ++j) {
    col_sums[0] = 0.;
    col_sums[1] = 0., sigmacum = 0;
    for (m = 0; m < (p - (j + 1)); ++m) {
      cik = vec[(m + j * p)];
      cik_1 = vec[(m + (1 + j) * p)];
      Cik[m] = cik;
      Cik1_Cik[m] = cik_1 / cik;
      col_sums[0] += cik;
      col_sums[1] += cik_1;
    }
    fact[j] = col_sums[1] / col_sums[0];
    ECik[j] = col_sums[0];
    for (m = 0; m < (p - (j + 1)); ++m) {
      sigmacum += Cik[m] * pow((Cik1_Cik[m] - fact[j]), 2);
    }
    sigmas[j] = sigmacum / (p - j - 2);
  }
  sigmas[p - 2] = fmin(pow(sigmas[p - 3], 2) / sigmas[p - 4], fmin(sigmas[p - 4], sigmas[p - 3]));
  for (j = 0; j < p - 1; ++j) {
    var_f[j] = sigmas[j] / ECik[j];
  }
}
```