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

```asm
<TwophaseNavierStokes_LS_SO_2D_Evaluate>:
  endbr64
  push   %r15
  movslq %edi,%rax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdx,0x40(%rsp)
  movsd  %xmm0,0x18(%rsp)
  movsd  %xmm1,0x20(%rsp)
  movsd  %xmm2,0x28(%rsp)
  movsd  %xmm3,0x30(%rsp)
  movsd  %xmm4,0x38(%rsp)
  test   %eax,%eax
  jle    L1
  mov    0x90(%rsp),%r13
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  mov    %r9,%r14
  mov    0x100(%rsp),%r12
  mov    0x108(%rsp),%rbp
  xor    %ebx,%ebx
  mov    %r13,%r15
  mov    %rax,%r13
  nopw   0x0(%rax,%rax,1)
L17:
  mov    0x40(%rsp),%rax
  movsd  0x18(%rsp),%xmm0
  mov    %r8,0x10(%rsp)
  add    $0x8,%r14
  mov    %rsi,0x8(%rsp)
  add    $0x8,%r15
  add    $0x20,%r12
  add    $0x20,%rbp
  movsd  (%rax,%r13,8),%xmm1
  call   <smoothedHeaviside@plt>
  mov    D12(%rip),%rax
  movsd  0x20(%rsp),%xmm3
  movapd %xmm0,%xmm1
  movsd  0x30(%rsp),%xmm4
  movq   %rax,%xmm0
  movq   %rax,%xmm2
  mov    0x98(%rsp),%rax
  subsd  %xmm1,%xmm0
  mulsd  %xmm1,%xmm4
  mulsd  0x38(%rsp),%xmm1
  mulsd  %xmm0,%xmm3
  mulsd  0x28(%rsp),%xmm0
  addsd  %xmm4,%xmm3
  addsd  %xmm1,%xmm0
  movsd  -0x8(%r14),%xmm1
  movsd  %xmm1,(%rax,%r13,8)
  mov    0xa0(%rsp),%rax
  movsd  %xmm2,(%rax,%r13,8)
  mov    0xa8(%rsp),%rax
  movsd  -0x8(%r15),%xmm1
  movsd  %xmm1,(%rax,%r13,8)
  mov    0xb0(%rsp),%rax
  movsd  %xmm2,(%rax,%r13,8)
  mov    0xb8(%rsp),%rax
  movsd  -0x8(%r14),%xmm1
  movsd  %xmm1,(%rax,%rbx,1)
  movsd  -0x8(%r15),%xmm1
  movsd  %xmm1,0x8(%rax,%rbx,1)
  mov    0xc0(%rsp),%rax
  movsd  %xmm2,(%rax,%rbx,1)
  mov    0xc8(%rsp),%rax
  movsd  %xmm2,0x8(%rax,%rbx,1)
  movsd  -0x8(%r14),%xmm1
  mov    0xd0(%rsp),%rax
  mulsd  %xmm1,%xmm1
  movsd  %xmm1,(%rax,%rbx,1)
  movsd  -0x8(%r14),%xmm1
  mulsd  -0x8(%r15),%xmm1
  movsd  %xmm1,0x8(%rax,%rbx,1)
  movsd  -0x8(%r14),%xmm1
  mov    0xd8(%rsp),%rax
  addsd  %xmm1,%xmm1
  movsd  %xmm1,(%rax,%rbx,1)
  movsd  -0x8(%r15),%xmm1
  mov    0x8(%rsp),%rsi
  mov    0x10(%rsp),%r8
  movsd  %xmm1,0x8(%rax,%rbx,1)
  mov    0xe0(%rsp),%rax
  movsd  -0x8(%r14),%xmm1
  movsd  %xmm1,0x8(%rax,%rbx,1)
  mulsd  -0x8(%r15),%xmm1
  mov    0xe8(%rsp),%rax
  movsd  %xmm1,(%rax,%rbx,1)
  movsd  -0x8(%r15),%xmm1
  mulsd  %xmm1,%xmm1
  movsd  %xmm1,0x8(%rax,%rbx,1)
  mov    0xf0(%rsp),%rax
  movsd  -0x8(%r15),%xmm1
  movsd  %xmm1,(%rax,%rbx,1)
  mov    0xf8(%rsp),%rax
  movsd  -0x8(%r14),%xmm1
  movsd  %xmm1,(%rax,%rbx,1)
  movsd  -0x8(%r15),%xmm1
  addsd  %xmm1,%xmm1
  movsd  %xmm1,0x8(%rax,%rbx,1)
  mov    0x110(%rsp),%rax
  movapd %xmm2,%xmm1
  movsd  %xmm0,-0x20(%r12)
  divsd  %xmm3,%xmm1
  movsd  %xmm0,-0x8(%r12)
  movsd  %xmm0,-0x20(%rbp)
  movsd  %xmm0,-0x8(%rbp)
  movsd  (%rsi),%xmm0
  xorpd  D15(%rip),%xmm0
  movsd  %xmm0,(%rax,%r13,8)
  mov    0x118(%rsp),%rax
  movsd  0x8(%rsi),%xmm0
  xorpd  D15(%rip),%xmm0
  movsd  %xmm0,(%rax,%r13,8)
  movsd  (%r8,%rbx,1),%xmm0
  mov    0x120(%rsp),%rax
  divsd  %xmm3,%xmm0
  movsd  %xmm0,(%rax,%r13,8)
  mov    0x128(%rsp),%rax
  movsd  %xmm1,(%rax,%rbx,1)
  movsd  0x8(%r8,%rbx,1),%xmm0
  mov    0x130(%rsp),%rax
  divsd  %xmm3,%xmm0
  movsd  %xmm0,(%rax,%r13,8)
  mov    0x138(%rsp),%rax
  add    $0x1,%r13
  movsd  %xmm1,0x8(%rax,%rbx,1)
  add    $0x10,%rbx
  cmp    0x48(%rsp),%r13
  jne    L17
L1:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D12
datatype: f64
name: unpack_data
arguments: data_label: D15
datatype: byte[16]

tool: D12: 1

tool: {"D15": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

assistant: ```c
void TwophaseNavierStokes_LS_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 *phi, 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_adv, double *dmom_u_adv_u, double *dmom_u_adv_v, double *mom_v_adv, double *dmom_v_adv_u, double *dmom_v_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 = smoothedHeaviside(eps, phi[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_adv[k * 2 + 0] = u[k] * u[k];
    mom_u_adv[k * 2 + 1] = u[k] * v[k];
    dmom_u_adv_u[k * 2 + 0] = 2.0 * u[k];
    dmom_u_adv_u[k * 2 + 1] = v[k];
    dmom_u_adv_v[k * 2 + 1] = u[k];
    mom_v_adv[k * 2 + 0] = v[k] * u[k];
    mom_v_adv[k * 2 + 1] = v[k] * v[k];
    dmom_v_adv_u[k * 2 + 0] = v[k];
    dmom_v_adv_v[k * 2 + 0] = u[k];
    dmom_v_adv_v[k * 2 + 1] = 2.0 * v[k];
    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;
  }
}
```