user: Please show me the C implementation that matches the assembly code listed below:

```asm
<stage_one>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  sub    $0x60,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8d,-0x54(%rbp)
  mov    %r9,-0x60(%rbp)
  movl   $0x0,-0x30(%rbp)
  jmp    L20
L25:
  mov    0x20(%rbp),%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    0x20(%rbp),%rax
  add    $0x8,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L33
L64:
  mov    -0x30(%rbp),%eax
  imul   -0x54(%rbp),%eax
  mov    %eax,%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x30(%rbp),%eax
  add    $0x1,%eax
  imul   -0x54(%rbp),%eax
  mov    %eax,%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x18(%rbp),%xmm0
  divsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    0x20(%rbp),%rax
  movsd  (%rax),%xmm0
  addsd  -0x20(%rbp),%xmm0
  mov    0x20(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    0x20(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mov    0x20(%rbp),%rax
  add    $0x8,%rax
  addsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L33:
  mov    -0x30(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x54(%rbp),%eax
  sub    %edx,%eax
  cmp    %eax,-0x2c(%rbp)
  jl     L64
  mov    0x20(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mov    0x20(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rax,%rdx
  mov    0x20(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%rdx)
  movl   $0x0,-0x2c(%rbp)
  jmp    L53
L51:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  movsd  %xmm3,-0x68(%rbp)
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  mov    $0x2,%edi
  movq   %rax,%xmm0
  call   <pow@plt>
  mulsd  -0x68(%rbp),%xmm0
  movsd  -0x28(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  addl   $0x1,-0x2c(%rbp)
L53:
  mov    -0x30(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x54(%rbp),%eax
  sub    %edx,%eax
  cmp    %eax,-0x2c(%rbp)
  jl     L51
  mov    -0x54(%rbp),%eax
  sub    -0x30(%rbp),%eax
  sub    $0x2,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x28(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x30(%rbp)
L20:
  mov    -0x54(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x30(%rbp)
  jl     L25
  mov    -0x54(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x18(%rax),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x54(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x20(%rax),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <fmin@plt>
  movq   %xmm0,%r12
  mov    -0x54(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x18(%rax),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    $0x2,%edi
  movq   %rax,%xmm0
  call   <pow@plt>
  movq   %xmm0,%rax
  mov    -0x54(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x3,%rdx
  lea    -0x20(%rdx),%rcx
  mov    -0x48(%rbp),%rdx
  add    %rcx,%rdx
  movsd  (%rdx),%xmm0
  movq   %rax,%xmm2
  divsd  %xmm0,%xmm2
  movq   %xmm2,%rax
  mov    -0x54(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x3,%rdx
  lea    -0x10(%rdx),%rcx
  mov    -0x48(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  movq   %r12,%xmm1
  movq   %rax,%xmm0
  call   <fmin@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  movl   $0x0,-0x30(%rbp)
  jmp    L39
L76:
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x30(%rbp)
L39:
  mov    -0x54(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x30(%rbp)
  jl     L76
  nop
  nop
  add    $0x60,%rsp
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

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];
  }
}
```