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

```asm
<ThreephaseNavierStokes_ST_LS_SO_3D_Evaluate>:
  endbr64
  push   %r15
  movslq %edi,%rax
  mov    %r9,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    0x118(%rsp),%r9
  mov    0x1f0(%rsp),%r10
  movsd  %xmm0,0x60(%rsp)
  mov    0x1f8(%rsp),%r11
  movsd  %xmm1,0x68(%rsp)
  movsd  %xmm2,(%rsp)
  movsd  %xmm3,0x8(%rsp)
  movsd  %xmm4,0x70(%rsp)
  movsd  %xmm5,0x78(%rsp)
  movsd  %xmm6,0x80(%rsp)
  movsd  %xmm7,0x88(%rsp)
  test   %eax,%eax
  jle    L38
  movsd  0xf8(%rsp),%xmm7
  mov    %rdx,%r14
  xor    %ebx,%ebx
  xor    %ebp,%ebp
  mulsd  0x100(%rsp),%xmm7
  mov    %rsi,%rdi
  mov    %rcx,%rsi
  mov    0x130(%rsp),%r13
  mov    0x128(%rsp),%rdx
  mov    %rax,0x90(%rsp)
  xor    %r12d,%r12d
  mov    %r13,%rax
  mov    0x120(%rsp),%rcx
  mov    %rdx,%r13
  mov    %rax,%rdx
  movsd  %xmm7,0x98(%rsp)
  nopl   0x0(%rax)
L0:
  movsd  (%r14,%rbp,8),%xmm1
  movsd  (%rsp),%xmm0
  mov    $0x2,%eax
  mov    %r11,0x1f8(%rsp)
  mov    %r10,0x1f0(%rsp)
  mov    %r9,0x118(%rsp)
  mov    %r8,0x58(%rsp)
  mov    %rsi,0x50(%rsp)
  mov    %rdi,0x48(%rsp)
  mov    %rcx,0x40(%rsp)
  mov    %rdx,0x38(%rsp)
  call   <smoothedHeaviside@plt>
  pxor   %xmm2,%xmm2
  movsd  (%r14,%rbp,8),%xmm1
  movsd  (%rsp),%xmm0
  cvtsi2sd %eax,%xmm2
  mov    $0x2,%eax
  movsd  %xmm2,0x20(%rsp)
  call   <smoothedDirac@plt>
  movsd  (%r14,%rbp,8),%xmm1
  movsd  0x8(%rsp),%xmm0
  mov    $0x2,%eax
  call   <smoothedHeaviside@plt>
  pxor   %xmm3,%xmm3
  movsd  (%r14,%rbp,8),%xmm1
  movsd  0x8(%rsp),%xmm0
  cvtsi2sd %eax,%xmm3
  mov    $0x2,%eax
  movsd  %xmm3,0x18(%rsp)
  call   <smoothedDirac@plt>
  pxor   %xmm4,%xmm4
  movsd  0x18(%rsp),%xmm3
  movsd  0x20(%rsp),%xmm2
  cvtsi2sd %eax,%xmm4
  mov    D37(%rip),%rax
  movq   %rax,%xmm1
  movq   %rax,%xmm0
  mov    $0x2,%eax
  subsd  %xmm3,%xmm1
  subsd  %xmm2,%xmm0
  mulsd  0x78(%rsp),%xmm0
  mulsd  0x80(%rsp),%xmm1
  movsd  %xmm4,0x10(%rsp)
  mulsd  0xf0(%rsp),%xmm3
  mulsd  0x88(%rsp),%xmm2
  movapd %xmm1,%xmm5
  movsd  (%r15,%rbp,8),%xmm1
  addsd  %xmm3,%xmm5
  addsd  %xmm0,%xmm2
  movsd  (%rsp),%xmm0
  movsd  %xmm5,0x28(%rsp)
  movsd  %xmm2,0x30(%rsp)
  call   <smoothedHeaviside@plt>
  pxor   %xmm6,%xmm6
  movsd  (%r15,%rbp,8),%xmm1
  movsd  (%rsp),%xmm0
  cvtsi2sd %eax,%xmm6
  mov    $0x2,%eax
  movsd  %xmm6,0x20(%rsp)
  call   <smoothedDirac@plt>
  movsd  (%r15,%rbp,8),%xmm1
  movsd  0x8(%rsp),%xmm0
  mov    $0x2,%eax
  call   <smoothedHeaviside@plt>
  pxor   %xmm3,%xmm3
  movsd  (%r15,%rbp,8),%xmm1
  movsd  0x8(%rsp),%xmm0
  cvtsi2sd %eax,%xmm3
  mov    $0x2,%eax
  movsd  %xmm3,0x18(%rsp)
  call   <smoothedDirac@plt>
  movsd  0x20(%rsp),%xmm6
  pxor   %xmm7,%xmm7
  movsd  0x30(%rsp),%xmm2
  cvtsi2sd %eax,%xmm7
  mov    D37(%rip),%rax
  movsd  0x18(%rsp),%xmm3
  mulsd  %xmm6,%xmm2
  movsd  0x28(%rsp),%xmm5
  mov    0x40(%rsp),%rcx
  movsd  0x98(%rsp),%xmm1
  movq   %rax,%xmm4
  mov    0x38(%rsp),%rdx
  mulsd  %xmm3,%xmm5
  movapd %xmm2,%xmm0
  movq   %rax,%xmm2
  subsd  %xmm6,%xmm2
  movq   %rax,%xmm6
  mov    0x138(%rsp),%rax
  mulsd  0xf8(%rsp),%xmm2
  subsd  %xmm3,%xmm6
  mulsd  %xmm6,%xmm1
  addsd  %xmm0,%xmm2
  movsd  0x100(%rsp),%xmm0
  mulsd  %xmm6,%xmm0
  addsd  %xmm5,%xmm0
  mulsd  %xmm2,%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm1,%xmm0
  movapd %xmm3,%xmm1
  mulsd  %xmm2,%xmm1
  movapd %xmm1,%xmm5
  mulsd  (%rcx),%xmm5
  movsd  %xmm5,(%rax,%rbp,8)
  mov    0x140(%rsp),%rax
  movsd  %xmm1,(%rax,%rbp,8)
  movsd  0x0(%r13),%xmm5
  mov    0x148(%rsp),%rax
  mulsd  %xmm1,%xmm5
  movsd  %xmm5,(%rax,%rbp,8)
  mov    0x150(%rsp),%rax
  movapd %xmm1,%xmm5
  movsd  %xmm1,(%rax,%rbp,8)
  mulsd  (%rdx),%xmm5
  mov    0x158(%rsp),%rax
  movsd  %xmm5,(%rax,%rbp,8)
  mov    0x160(%rsp),%rax
  movsd  %xmm1,(%rax,%rbp,8)
  mov    0x168(%rsp),%rax
  movsd  (%rcx),%xmm5
  movsd  %xmm5,(%rax,%rbx,1)
  movsd  0x0(%r13),%xmm5
  movsd  %xmm5,0x8(%rax,%rbx,1)
  movsd  (%rdx),%xmm5
  movsd  %xmm5,0x10(%rax,%rbx,1)
  mov    0x170(%rsp),%rax
  movapd %xmm1,%xmm5
  movsd  %xmm4,(%rax,%rbx,1)
  mov    0x178(%rsp),%rax
  movsd  %xmm4,0x8(%rax,%rbx,1)
  mov    0x180(%rsp),%rax
  movsd  %xmm4,0x10(%rax,%rbx,1)
  movsd  (%rcx),%xmm8
  mov    0x188(%rsp),%rax
  mulsd  %xmm8,%xmm5
  mulsd  %xmm8,%xmm5
  movsd  %xmm5,(%rax,%rbx,1)
  movsd  (%rcx),%xmm5
  mulsd  %xmm1,%xmm5
  mulsd  0x0(%r13),%xmm5
  movsd  %xmm5,0x8(%rax,%rbx,1)
  movsd  (%rcx),%xmm5
  mulsd  %xmm1,%xmm5
  mulsd  (%rdx),%xmm5
  movsd  %xmm5,0x10(%rax,%rbx,1)
  movapd %xmm3,%xmm5
  movsd  (%rcx),%xmm9
  mov    0x190(%rsp),%rax
  addsd  %xmm3,%xmm5
  movapd %xmm5,%xmm8
  mulsd  %xmm2,%xmm8
  mulsd  %xmm0,%xmm5
  mulsd  %xmm3,%xmm0
  mulsd  %xmm8,%xmm9
  movsd  %xmm9,(%rax,%rbx,1)
  movsd  0x0(%r13),%xmm9
  mulsd  %xmm1,%xmm9
  movsd  %xmm9,0x8(%rax,%rbx,1)
  movsd  (%rdx),%xmm9
  mulsd  %xmm1,%xmm9
  movsd  %xmm9,0x10(%rax,%rbx,1)
  movsd  (%rcx),%xmm9
  mov    0x198(%rsp),%rax
  mulsd  %xmm1,%xmm9
  movsd  %xmm9,0x8(%rax,%rbx,1)
  movsd  (%rcx),%xmm9
  mov    0x1a0(%rsp),%rax
  mulsd  %xmm1,%xmm9
  movsd  %xmm9,0x10(%rax,%rbx,1)
  movsd  0x0(%r13),%xmm9
  mov    0x1a8(%rsp),%rax
  mulsd  %xmm1,%xmm9
  mulsd  (%rcx),%xmm9
  movsd  %xmm9,(%rax,%rbx,1)
  movsd  0x0(%r13),%xmm10
  movapd %xmm1,%xmm9
  mulsd  %xmm10,%xmm9
  mulsd  %xmm10,%xmm9
  movsd  %xmm9,0x8(%rax,%rbx,1)
  movsd  0x0(%r13),%xmm9
  mulsd  %xmm1,%xmm9
  mulsd  (%rdx),%xmm9
  movsd  %xmm9,0x10(%rax,%rbx,1)
  movsd  0x0(%r13),%xmm9
  mov    0x1b0(%rsp),%rax
  mulsd  %xmm1,%xmm9
  movsd  %xmm9,(%rax,%rbx,1)
  movsd  0x0(%r13),%xmm9
  mov    0x1c0(%rsp),%rax
  mulsd  %xmm1,%xmm9
  movsd  %xmm9,0x10(%rax,%rbx,1)
  movsd  (%rcx),%xmm9
  mov    0x1b8(%rsp),%rax
  mulsd  %xmm1,%xmm9
  movsd  %xmm9,(%rax,%rbx,1)
  movsd  0x0(%r13),%xmm9
  mulsd  %xmm8,%xmm9
  movsd  %xmm9,0x8(%rax,%rbx,1)
  movsd  (%rdx),%xmm9
  mulsd  %xmm1,%xmm9
  movsd  %xmm9,0x10(%rax,%rbx,1)
  movsd  (%rdx),%xmm9
  mov    0x1c8(%rsp),%rax
  mulsd  %xmm1,%xmm9
  mulsd  (%rcx),%xmm9
  movsd  %xmm9,(%rax,%rbx,1)
  movsd  (%rdx),%xmm9
  mulsd  %xmm1,%xmm9
  mulsd  0x0(%r13),%xmm9
  movsd  %xmm9,0x8(%rax,%rbx,1)
  movsd  (%rdx),%xmm10
  movapd %xmm1,%xmm9
  mulsd  %xmm10,%xmm9
  mulsd  %xmm10,%xmm9
  movsd  %xmm9,0x10(%rax,%rbx,1)
  movsd  (%rdx),%xmm9
  mov    0x1d0(%rsp),%rax
  mulsd  %xmm1,%xmm9
  movsd  %xmm9,(%rax,%rbx,1)
  movsd  (%rdx),%xmm9
  mov    0x1d8(%rsp),%rax
  mulsd  %xmm1,%xmm9
  movsd  %xmm9,0x8(%rax,%rbx,1)
  movsd  (%rcx),%xmm9
  mov    0x1e0(%rsp),%rax
  mov    0x1f0(%rsp),%r10
  mov    0x1f8(%rsp),%r11
  mulsd  %xmm1,%xmm9
  mov    0x50(%rsp),%rsi
  movsd  %xmm9,(%rax,%rbx,1)
  movsd  0x0(%r13),%xmm9
  mulsd  %xmm1,%xmm9
  movsd  %xmm9,0x8(%rax,%rbx,1)
  mulsd  (%rdx),%xmm8
  movsd  %xmm8,0x10(%rax,%rbx,1)
  mov    0x1e8(%rsp),%rax
  movsd  %xmm5,(%rax,%r12,1)
  movsd  %xmm0,0x20(%rax,%r12,1)
  movsd  %xmm0,0x40(%rax,%r12,1)
  mov    0x200(%rsp),%rax
  movsd  %xmm0,0x18(%rax,%r12,1)
  mov    0x208(%rsp),%rax
  movsd  %xmm0,0x30(%rax,%r12,1)
  mov    0x210(%rsp),%rax
  movsd  %xmm0,(%r10,%r12,1)
  movsd  %xmm5,0x20(%r10,%r12,1)
  movsd  %xmm0,0x40(%r10,%r12,1)
  movsd  %xmm0,0x8(%rax,%r12,1)
  mov    0x218(%rsp),%rax
  movsd  %xmm0,0x38(%rax,%r12,1)
  mov    0x220(%rsp),%rax
  movsd  %xmm0,(%r11,%r12,1)
  movsd  %xmm0,0x20(%r11,%r12,1)
  movsd  %xmm5,0x40(%r11,%r12,1)
  movsd  %xmm0,0x10(%rax,%r12,1)
  mov    0x228(%rsp),%rax
  movsd  %xmm0,0x28(%rax,%r12,1)
  movsd  (%rsi,%rbx,1),%xmm8
  movsd  0x8(%rsi,%rbx,1),%xmm9
  movsd  0x10(%rsi,%rbx,1),%xmm5
  mov    0x48(%rsp),%rdi
  mulsd  %xmm9,%xmm9
  movapd %xmm8,%xmm0
  mov    0x58(%rsp),%r8
  mov    0x118(%rsp),%r9
  mulsd  %xmm8,%xmm0
  mulsd  %xmm5,%xmm5
  addsd  %xmm9,%xmm0
  addsd  %xmm5,%xmm0
  pxor   %xmm5,%xmm5
  ucomisd %xmm0,%xmm5
  ja     L27
  sqrtsd %xmm0,%xmm0
L4:
  movsd  0x60(%rsp),%xmm5
  mulsd  0x10(%rsp),%xmm3
  add    $0x8,%rcx
  add    $0x8,%r13
  mulsd  0x70(%rsp),%xmm3
  add    $0x8,%rdx
  add    $0x48,%r12
  movsd  -0x8(%rcx),%xmm9
  mulsd  %xmm2,%xmm5
  xorpd  D26(%rip),%xmm1
  mov    0x230(%rsp),%rax
  mulsd  0x68(%rsp),%xmm2
  mulsd  %xmm7,%xmm5
  movsd  (%r8,%rbp,8),%xmm7
  mulsd  %xmm6,%xmm2
  movsd  (%rdi),%xmm6
  mulsd  %xmm3,%xmm7
  mulsd  %xmm1,%xmm6
  mulsd  %xmm8,%xmm7
  divsd  %xmm0,%xmm7
  subsd  %xmm7,%xmm6
  movapd %xmm5,%xmm7
  mulsd  %xmm9,%xmm7
  mulsd  %xmm2,%xmm9
  addsd  %xmm7,%xmm6
  movapd %xmm5,%xmm7
  addsd  %xmm2,%xmm7
  addsd  %xmm9,%xmm6
  movsd  %xmm6,(%rax,%rbp,8)
  mov    0x238(%rsp),%rax
  movsd  %xmm7,(%rax,%rbp,8)
  mov    0x240(%rsp),%rax
  movq   $0x0,(%rax,%rbp,8)
  mov    0x248(%rsp),%rax
  movq   $0x0,(%rax,%rbp,8)
  movsd  (%r8,%rbp,8),%xmm8
  movsd  0x8(%rdi),%xmm6
  movsd  -0x8(%r13),%xmm9
  mulsd  %xmm3,%xmm8
  mov    0x250(%rsp),%rax
  mulsd  0x8(%rsi,%rbx,1),%xmm8
  mulsd  %xmm1,%xmm6
  divsd  %xmm0,%xmm8
  subsd  %xmm8,%xmm6
  movapd %xmm5,%xmm8
  mulsd  %xmm9,%xmm8
  mulsd  %xmm2,%xmm9
  addsd  %xmm8,%xmm6
  addsd  %xmm9,%xmm6
  movsd  %xmm6,(%rax,%rbp,8)
  mov    0x258(%rsp),%rax
  movq   $0x0,(%rax,%rbp,8)
  mov    0x260(%rsp),%rax
  movsd  %xmm7,(%rax,%rbp,8)
  mov    0x268(%rsp),%rax
  movq   $0x0,(%rax,%rbp,8)
  mulsd  (%r8,%rbp,8),%xmm3
  mulsd  0x10(%rsi,%rbx,1),%xmm3
  movsd  -0x8(%rdx),%xmm6
  mulsd  0x10(%rdi),%xmm1
  mov    0x270(%rsp),%rax
  mulsd  %xmm6,%xmm5
  mulsd  %xmm6,%xmm2
  divsd  %xmm0,%xmm3
  subsd  %xmm3,%xmm1
  addsd  %xmm5,%xmm1
  addsd  %xmm2,%xmm1
  movsd  %xmm1,(%rax,%rbp,8)
  mov    0x278(%rsp),%rax
  movq   $0x0,(%rax,%rbp,8)
  mov    0x280(%rsp),%rax
  movq   $0x0,(%rax,%rbp,8)
  mov    0x288(%rsp),%rax
  movsd  %xmm7,(%rax,%rbp,8)
  mov    0x290(%rsp),%rax
  movsd  (%r9,%rbx,1),%xmm0
  movsd  %xmm0,(%rax,%rbp,8)
  mov    0x298(%rsp),%rax
  movsd  %xmm4,(%rax,%rbx,1)
  mov    0x2a0(%rsp),%rax
  movsd  0x8(%r9,%rbx,1),%xmm0
  movsd  %xmm0,(%rax,%rbp,8)
  mov    0x2a8(%rsp),%rax
  movsd  %xmm4,0x8(%rax,%rbx,1)
  mov    0x2b0(%rsp),%rax
  movsd  0x10(%r9,%rbx,1),%xmm0
  movsd  %xmm0,(%rax,%rbp,8)
  mov    0x2b8(%rsp),%rax
  add    $0x1,%rbp
  movsd  %xmm4,0x10(%rax,%rbx,1)
  add    $0x18,%rbx
  cmp    0x90(%rsp),%rbp
  jne    L0
L38:
  add    $0xb8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L27:
  mov    %r11,0x1f8(%rsp)
  mov    %r10,0x1f0(%rsp)
  mov    %r9,0x118(%rsp)
  mov    %r8,0xa8(%rsp)
  mov    %rsi,0xa0(%rsp)
  mov    %rdi,0x58(%rsp)
  mov    %rcx,0x50(%rsp)
  mov    %rdx,0x48(%rsp)
  movsd  %xmm2,0x40(%rsp)
  movsd  %xmm7,0x38(%rsp)
  movsd  %xmm3,0x30(%rsp)
  movsd  %xmm8,0x28(%rsp)
  movsd  %xmm1,0x20(%rsp)
  movsd  %xmm6,0x18(%rsp)
  call   <sqrt@plt>
  mov    D37(%rip),%rax
  mov    0x1f8(%rsp),%r11
  mov    0x1f0(%rsp),%r10
  mov    0x118(%rsp),%r9
  mov    0x58(%rsp),%rdi
  mov    0x50(%rsp),%rcx
  movq   %rax,%xmm4
  mov    0xa8(%rsp),%r8
  mov    0xa0(%rsp),%rsi
  mov    0x48(%rsp),%rdx
  movsd  0x40(%rsp),%xmm2
  movsd  0x38(%rsp),%xmm7
  movsd  0x30(%rsp),%xmm3
  movsd  0x28(%rsp),%xmm8
  movsd  0x20(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm6
  jmp    L4
```

tool_calls: name: disassemble_data
arguments: label: D37
datatype: f64
name: disassemble_data
arguments: label: D26
datatype: f32[4]

tool: D37: 1

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

assistant: ```c
void ThreephaseNavierStokes_ST_LS_SO_3D_Evaluate(const int nPoints, const double boundaryPenaltyCoef, const double volumePenaltyCoef, const double eps_rho, const double eps_mu, const double sigma, const double rho_0, const double nu_0, const double rho_1, const double nu_1, const double rho_s, const double nu_s, const double *g, const double *phi, const double *n, const double *kappa, const double *phi_s, const double *n_s, const double *p, const double *grad_p, const double *u, const double *v, const double *w, double *mom_u_acc, double *dmom_u_acc_u, double *mom_v_acc, double *dmom_v_acc_v, double *mom_w_acc, double *dmom_w_acc_w, double *mass_adv, double *dmass_adv_u, double *dmass_adv_v, double *dmass_adv_w, double *mom_u_adv, double *dmom_u_adv_u, double *dmom_u_adv_v, double *dmom_u_adv_w, double *mom_v_adv, double *dmom_v_adv_u, double *dmom_v_adv_v, double *dmom_v_adv_w, double *mom_w_adv, double *dmom_w_adv_u, double *dmom_w_adv_v, double *dmom_w_adv_w, double *mom_u_diff_ten, double *mom_v_diff_ten, double *mom_w_diff_ten, double *mom_uv_diff_ten, double *mom_uw_diff_ten, double *mom_vu_diff_ten, double *mom_vw_diff_ten, double *mom_wu_diff_ten, double *mom_wv_diff_ten, double *mom_u_source, double *dmom_u_source_u, double *dmom_u_source_v, double *dmom_u_source_w, double *mom_v_source, double *dmom_v_source_u, double *dmom_v_source_v, double *dmom_v_source_w, double *mom_w_source, double *dmom_w_source_u, double *dmom_w_source_v, double *dmom_w_source_w, double *mom_u_ham, double *dmom_u_ham_grad_p, double *mom_v_ham, double *dmom_v_ham_grad_p, double *mom_w_ham, double *dmom_w_ham_grad_p) {
  int k;
  double rho, nu, mu, H_rho, d_rho, H_mu, d_mu, H_rho_s, d_rho_s, H_mu_s, d_mu_s, norm_n, norm_n_s;
  for (k = 0; k < nPoints; k++) {
    H_rho = smoothedHeaviside(eps_rho, phi[k]);
    d_rho = smoothedDirac(eps_rho, phi[k]);
    H_mu = smoothedHeaviside(eps_mu, phi[k]);
    d_mu = smoothedDirac(eps_mu, phi[k]);
    rho = rho_0 * (1.0 - H_rho) + rho_1 * H_rho;
    nu = nu_0 * (1.0 - H_mu) + nu_1 * H_mu;
    mu = rho_0 * nu_0 * (1.0 - H_mu) + rho_1 * nu_1 * H_mu;
    H_rho_s = smoothedHeaviside(eps_rho, phi_s[k]);
    d_rho_s = smoothedDirac(eps_rho, phi_s[k]);
    H_mu_s = smoothedHeaviside(eps_mu, phi_s[k]);
    d_mu_s = smoothedDirac(eps_mu, phi_s[k]);
    rho = rho_s * (1.0 - H_rho_s) + rho * H_rho_s;
    nu = nu_s * (1.0 - H_mu_s) + nu * H_mu_s;
    mu = rho_s * nu_s * (1.0 - H_mu_s) + rho * nu * H_mu_s;
    mom_u_acc[k] = H_mu_s * rho * u[k];
    dmom_u_acc_u[k] = H_mu_s * rho;
    mom_v_acc[k] = H_mu_s * rho * v[k];
    dmom_v_acc_v[k] = H_mu_s * rho;
    mom_w_acc[k] = H_mu_s * rho * w[k];
    dmom_w_acc_w[k] = H_mu_s * rho;
    mass_adv[k * 3 + 0] = u[k];
    mass_adv[k * 3 + 1] = v[k];
    mass_adv[k * 3 + 2] = w[k];
    dmass_adv_u[k * 3 + 0] = 1.0;
    dmass_adv_v[k * 3 + 1] = 1.0;
    dmass_adv_w[k * 3 + 2] = 1.0;
    mom_u_adv[k * 3 + 0] = H_mu_s * rho * u[k] * u[k];
    mom_u_adv[k * 3 + 1] = H_mu_s * rho * u[k] * v[k];
    mom_u_adv[k * 3 + 2] = H_mu_s * rho * u[k] * w[k];
    dmom_u_adv_u[k * 3 + 0] = 2.0 * H_mu_s * rho * u[k];
    dmom_u_adv_u[k * 3 + 1] = H_mu_s * rho * v[k];
    dmom_u_adv_u[k * 3 + 2] = H_mu_s * rho * w[k];
    dmom_u_adv_v[k * 3 + 1] = H_mu_s * rho * u[k];
    dmom_u_adv_w[k * 3 + 2] = H_mu_s * rho * u[k];
    mom_v_adv[k * 3 + 0] = H_mu_s * rho * v[k] * u[k];
    mom_v_adv[k * 3 + 1] = H_mu_s * rho * v[k] * v[k];
    mom_v_adv[k * 3 + 2] = H_mu_s * rho * v[k] * w[k];
    dmom_v_adv_u[k * 3 + 0] = H_mu_s * rho * v[k];
    dmom_v_adv_w[k * 3 + 2] = H_mu_s * rho * v[k];
    dmom_v_adv_v[k * 3 + 0] = H_mu_s * rho * u[k];
    dmom_v_adv_v[k * 3 + 1] = 2.0 * H_mu_s * rho * v[k];
    dmom_v_adv_v[k * 3 + 2] = H_mu_s * rho * w[k];
    mom_w_adv[k * 3 + 0] = H_mu_s * rho * w[k] * u[k];
    mom_w_adv[k * 3 + 1] = H_mu_s * rho * w[k] * v[k];
    mom_w_adv[k * 3 + 2] = H_mu_s * rho * w[k] * w[k];
    dmom_w_adv_u[k * 3 + 0] = H_mu_s * rho * w[k];
    dmom_w_adv_v[k * 3 + 1] = H_mu_s * rho * w[k];
    dmom_w_adv_w[k * 3 + 0] = H_mu_s * rho * u[k];
    dmom_w_adv_w[k * 3 + 1] = H_mu_s * rho * v[k];
    dmom_w_adv_w[k * 3 + 2] = 2.0 * H_mu_s * rho * w[k];
    mom_u_diff_ten[k * 9 + 0] = 2.0 * H_mu_s * mu;
    mom_u_diff_ten[k * 9 + 4] = H_mu_s * mu;
    mom_u_diff_ten[k * 9 + 8] = H_mu_s * mu;
    mom_uv_diff_ten[k * 9 + 3] = H_mu_s * mu;
    mom_uw_diff_ten[k * 9 + 6] = H_mu_s * mu;
    mom_v_diff_ten[k * 9 + 0] = H_mu_s * mu;
    mom_v_diff_ten[k * 9 + 4] = 2.0 * H_mu_s * mu;
    mom_v_diff_ten[k * 9 + 8] = H_mu_s * mu;
    mom_vu_diff_ten[k * 9 + 1] = H_mu_s * mu;
    mom_vw_diff_ten[k * 9 + 7] = H_mu_s * mu;
    mom_w_diff_ten[k * 9 + 0] = H_mu_s * mu;
    mom_w_diff_ten[k * 9 + 4] = H_mu_s * mu;
    mom_w_diff_ten[k * 9 + 8] = 2.0 * H_mu_s * mu;
    mom_wu_diff_ten[k * 9 + 2] = H_mu_s * mu;
    mom_wv_diff_ten[k * 9 + 5] = H_mu_s * mu;
    norm_n = sqrt(n[k * 3 + 0] * n[k * 3 + 0] + n[k * 3 + 1] * n[k * 3 + 1] + n[k * 3 + 2] * n[k * 3 + 2]);
    mom_u_source[k] = -H_mu_s * rho * g[0] - H_mu_s * d_mu * sigma * kappa[k] * n[k * 3 + 0] / (norm_n) + boundaryPenaltyCoef * rho * d_mu_s * (u[k] - 0.0) + volumePenaltyCoef * rho * (1.0 - H_mu_s) * (u[k] - 0.0);
    dmom_u_source_u[k] = boundaryPenaltyCoef * rho * d_mu_s + volumePenaltyCoef * rho * (1.0 - H_mu_s);
    dmom_u_source_v[k] = 0.0;
    dmom_u_source_w[k] = 0.0;
    mom_v_source[k] = -H_mu_s * rho * g[1] - H_mu_s * d_mu * sigma * kappa[k] * n[k * 3 + 1] / (norm_n) + boundaryPenaltyCoef * rho * d_mu_s * (v[k] - 0.0) + volumePenaltyCoef * rho * (1.0 - H_mu_s) * (v[k] - 0.0);
    dmom_v_source_u[k] = 0.0;
    dmom_v_source_v[k] = boundaryPenaltyCoef * rho * d_mu_s + volumePenaltyCoef * rho * (1.0 - H_mu_s);
    dmom_v_source_w[k] = 0.0;
    mom_w_source[k] = -H_mu_s * rho * g[2] - H_mu_s * d_mu * sigma * kappa[k] * n[k * 3 + 2] / (norm_n) + boundaryPenaltyCoef * rho * d_mu_s * (w[k] - 0.0) + volumePenaltyCoef * rho * (1.0 - H_mu_s) * (w[k] - 0.0);
    dmom_w_source_u[k] = 0.0;
    dmom_w_source_v[k] = 0.0;
    dmom_w_source_w[k] = boundaryPenaltyCoef * rho * d_mu_s + volumePenaltyCoef * rho * (1.0 - H_mu_s);
    mom_u_ham[k] = grad_p[k * 3 + 0];
    dmom_u_ham_grad_p[k * 3 + 0] = 1.0;
    mom_v_ham[k] = grad_p[k * 3 + 1];
    dmom_v_ham_grad_p[k * 3 + 1] = 1.0;
    mom_w_ham[k] = grad_p[k * 3 + 2];
    dmom_w_ham_grad_p[k * 3 + 2] = 1.0;
  }
}
```