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

```asm
<TwophaseStokes_VOF_SO_2D_Evaluate>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  movsd  %xmm1,(%rsp)
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm4,0x18(%rsp)
  mov    %rdx,0x20(%rsp)
  mov    0x70(%rsp),%r15
  test   %edi,%edi
  jle    L18
  mov    %rsi,%r12
  mov    %r8,%r13
  mov    %r9,%r14
  mov    %edi,%eax
  shl    $0x3,%rax
  mov    %rax,0x28(%rsp)
  mov    $0x0,%ebx
  mov    D18(%rip),%rbp
L10:
  mov    0x20(%rsp),%rax
  movsd  (%rax,%rbx,1),%xmm1
  movq   %rbp,%xmm0
  call   <fmin@plt>
  mov    %eax,%edi
  pxor   %xmm0,%xmm0
  call   <fmax@plt>
  movapd %xmm0,%xmm1
  movq   %rbp,%xmm0
  subsd  %xmm1,%xmm0
  movsd  (%rsp),%xmm2
  mulsd  %xmm0,%xmm2
  movsd  0x10(%rsp),%xmm3
  mulsd  %xmm1,%xmm3
  addsd  %xmm3,%xmm2
  mulsd  0x8(%rsp),%xmm0
  mulsd  0x18(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  (%r14,%rbx,1),%xmm1
  mov    0x78(%rsp),%rax
  movsd  %xmm1,(%rax,%rbx,1)
  mov    0x80(%rsp),%rax
  mov    %rbp,(%rax,%rbx,1)
  movsd  (%r15,%rbx,1),%xmm1
  mov    0x88(%rsp),%rax
  movsd  %xmm1,(%rax,%rbx,1)
  mov    0x90(%rsp),%rax
  mov    %rbp,(%rax,%rbx,1)
  movsd  (%r14,%rbx,1),%xmm1
  mov    0x98(%rsp),%rax
  movsd  %xmm1,(%rax,%rbx,2)
  movsd  (%r15,%rbx,1),%xmm1
  movsd  %xmm1,0x8(%rax,%rbx,2)
  mov    0xa0(%rsp),%rax
  mov    %rbp,(%rax,%rbx,2)
  mov    0xa8(%rsp),%rax
  mov    %rbp,0x8(%rax,%rbx,2)
  mov    0xb0(%rsp),%rax
  movsd  %xmm0,(%rax,%rbx,4)
  movsd  %xmm0,0x18(%rax,%rbx,4)
  mov    0xb8(%rsp),%rax
  movsd  %xmm0,(%rax,%rbx,4)
  movsd  %xmm0,0x18(%rax,%rbx,4)
  movsd  (%r12),%xmm0
  xorpd  D6(%rip),%xmm0
  mov    0xc0(%rsp),%rax
  movsd  %xmm0,(%rax,%rbx,1)
  movsd  0x8(%r12),%xmm0
  xorpd  D6(%rip),%xmm0
  mov    0xc8(%rsp),%rax
  movsd  %xmm0,(%rax,%rbx,1)
  movsd  0x0(%r13,%rbx,2),%xmm0
  divsd  %xmm2,%xmm0
  mov    0xd0(%rsp),%rax
  movsd  %xmm0,(%rax,%rbx,1)
  movq   %rbp,%xmm1
  divsd  %xmm2,%xmm1
  mov    0xd8(%rsp),%rax
  movsd  %xmm1,(%rax,%rbx,2)
  movsd  0x8(%r13,%rbx,2),%xmm0
  divsd  %xmm2,%xmm0
  mov    0xe0(%rsp),%rax
  movsd  %xmm0,(%rax,%rbx,1)
  mov    0xe8(%rsp),%rax
  movsd  %xmm1,0x8(%rax,%rbx,2)
  add    $0x8,%rbx
  cmp    0x28(%rsp),%rbx
  jne    L10
L18:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D18
type: f64
name: disassemble_data
arguments: data_label: D6
type: f32[4]

tool: D18: 1

tool: {"D6": [0.0,-0.0,0.0,0.0]}

assistant: ```c
void TwophaseStokes_VOF_SO_2D_Evaluate(const int nPoints, const double eps, const double rho_0, const double nu_0, const double rho_1, const double nu_1, const double *g, const double *vof, const double *p, const double *grad_p, const double *u, const double *v, double *mom_u_acc, double *dmom_u_acc_u, double *mom_v_acc, double *dmom_v_acc_v, double *mass_adv, double *dmass_adv_u, double *dmass_adv_v, double *mom_u_diff_ten, double *mom_v_diff_ten, double *mom_u_source, double *mom_v_source, double *mom_u_ham, double *dmom_u_ham_grad_p, double *mom_v_ham, double *dmom_v_ham_grad_p) {
  int k;
  double rho, nu, H;
  for (k = 0; k < nPoints; k++) {
    H = fmax(0.0, fmin(1.0, vof[k]));
    rho = rho_0 * (1.0 - H) + rho_1 * H;
    nu = nu_0 * (1.0 - H) + nu_1 * H;
    mom_u_acc[k] = u[k];
    dmom_u_acc_u[k] = 1.0;
    mom_v_acc[k] = v[k];
    dmom_v_acc_v[k] = 1.0;
    mass_adv[k * 2 + 0] = u[k];
    mass_adv[k * 2 + 1] = v[k];
    dmass_adv_u[k * 2 + 0] = 1.0;
    dmass_adv_v[k * 2 + 1] = 1.0;
    mom_u_diff_ten[k * 4 + 0] = nu;
    mom_u_diff_ten[k * 4 + 3] = nu;
    mom_v_diff_ten[k * 4 + 0] = nu;
    mom_v_diff_ten[k * 4 + 3] = nu;
    mom_u_source[k] = -g[0];
    mom_v_source[k] = -g[1];
    mom_u_ham[k] = grad_p[k * 2 + 0] / rho;
    dmom_u_ham_grad_p[k * 2 + 0] = 1.0 / rho;
    mom_v_ham[k] = grad_p[k * 2 + 1] / rho;
    dmom_v_ham_grad_p[k * 2 + 1] = 1.0 / rho;
  }
}
```