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

```asm
<conservativeHeadRichardsJLeverettAni>:
  endbr64
  push   %r15
  movapd %xmm0,%xmm4
  push   %r14
  mulsd  %xmm0,%xmm4
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  sub    $0xf8,%rsp
  mov    %edx,0x4(%rsp)
  mov    %rcx,%rdx
  mov    %ebx,%ecx
  imul   %ebx,%ecx
  mov    %esi,0xc4(%rsp)
  mov    %r9,0xe0(%rsp)
  movsd  %xmm1,0x8(%rsp)
  mov    %ecx,0x64(%rsp)
  test   %edi,%edi
  jle    L77
  mov    %edi,%eax
  mov    %ebx,%edi
  lea    (%rbx,%rbx,1),%r10d
  mov    %rdx,0x98(%rsp)
  sub    $0x1,%eax
  imul   %esi,%edi
  movapd %xmm0,%xmm3
  mov    %r8,%r12
  imul   %ecx,%esi
  lea    0x4(%rdx,%rax,4),%rax
  mov    %r10d,0xec(%rsp)
  mov    %rax,0xd8(%rsp)
  movslq %ebx,%rax
  shl    $0x3,%rax
  mov    %edi,0xd4(%rsp)
  lea    0x2(%r10),%edi
  mov    %rax,0x68(%rsp)
  movslq %ecx,%rax
  shl    $0x3,%rax
  mov    %esi,0xe8(%rsp)
  mov    %rax,0x70(%rsp)
  lea    -0x1(%rbx),%eax
  sub    %r10d,%eax
  mov    %edi,0xcc(%rsp)
  movl   $0x0,0xd0(%rsp)
  movl   $0x2,0xc8(%rsp)
  mov    %eax,0xc0(%rsp)
  nopl   (%rax)
L30:
  mov    0x98(%rsp),%rax
  mov    0xc4(%rsp),%edx
  movslq (%rax),%rax
  test   %edx,%edx
  jle    L25
  mov    0x130(%rsp),%rbx
  shl    $0x3,%rax
  mov    0x148(%rsp),%rdx
  mov    %r12,%rdi
  mov    0x158(%rsp),%rsi
  mov    0xcc(%rsp),%r14d
  add    %rax,%rbx
  add    %rax,%rdx
  mov    0xc8(%rsp),%r13d
  movslq 0xd0(%rsp),%r8
  mov    %rbx,0x48(%rsp)
  mov    0x150(%rsp),%rbx
  add    %rax,%rsi
  mov    %rdx,0xb0(%rsp)
  mov    0x160(%rsp),%rdx
  lea    -0x2(%r13),%ecx
  lea    0x0(,%r8,8),%rbp
  add    %rax,%rbx
  movslq %ecx,%rcx
  mov    %r14d,0x60(%rsp)
  mov    %rbx,0x58(%rsp)
  mov    0x138(%rsp),%rbx
  add    %rax,%rdx
  mov    %rdx,0x78(%rsp)
  mov    %r14d,%edx
  sub    0xec(%rsp),%edx
  add    %rax,%rbx
  sub    $0x2,%edx
  mov    %rbx,0xa8(%rsp)
  mov    0x140(%rsp),%rbx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%r15
  add    %rax,%rbx
  mov    %r15,%r14
  mov    %r13d,%r15d
  mov    %rsi,%r13
  mov    %rbx,0xb8(%rsp)
  mov    0xe0(%rsp),%rbx
  lea    (%rbx,%rax,1),%r10
  add    0x168(%rsp),%rax
  lea    0x0(,%rcx,8),%rbx
  mov    %rax,0xa0(%rsp)
  mov    0xc4(%rsp),%eax
  mov    %r10,%r12
  lea    -0x1(%rax),%r9d
  lea    0x1(%r8,%r9,1),%r8
  lea    0x0(,%r8,8),%rax
  mov    %rax,0x50(%rsp)
  jmp    L5
  nopl   0x0(%rax,%rax,1)
L62:
  mov    0x58(%rsp),%rax
  movsd  D46(%rip),%xmm6
  pxor   %xmm1,%xmm1
  movsd  %xmm1,0x40(%rsp)
  subsd  (%rax),%xmm6
  mov    D46(%rip),%rax
  movq   %rax,%xmm2
L54:
  mulsd  0x8(%rsp),%xmm11
  mov    %rdi,0x38(%rsp)
  movsd  %xmm4,0x30(%rsp)
  movsd  %xmm3,0x28(%rsp)
  movsd  %xmm1,0x20(%rsp)
  movsd  %xmm2,0x18(%rsp)
  movapd %xmm11,%xmm0
  movsd  %xmm6,0x10(%rsp)
  call   <exp@plt>
  movsd  0x28(%rsp),%xmm3
  mov    0x38(%rsp),%rdi
  movapd %xmm0,%xmm5
  movsd  0x10(%rsp),%xmm6
  mov    0x4(%rsp),%esi
  mulsd  %xmm3,%xmm5
  movsd  (%r12),%xmm0
  mov    0x178(%rsp),%rax
  movapd %xmm6,%xmm4
  movsd  0x18(%rsp),%xmm2
  movsd  0x20(%rsp),%xmm1
  mulsd  %xmm5,%xmm4
  mulsd  %xmm4,%xmm0
  movsd  0x30(%rsp),%xmm4
  movsd  %xmm0,(%rax,%rbp,1)
  movsd  0x8(%rsp),%xmm0
  movsd  (%r12),%xmm7
  mov    0x180(%rsp),%rax
  mulsd  %xmm5,%xmm0
  mulsd  0x40(%rsp),%xmm5
  mulsd  %xmm6,%xmm0
  mulsd  %xmm7,%xmm5
  mulsd  %xmm7,%xmm0
  addsd  %xmm5,%xmm0
  movsd  %xmm0,(%rax,%rbp,1)
  movsd  0x0(%r13),%xmm0
  mov    0x188(%rsp),%rax
  mulsd  %xmm4,%xmm0
  mulsd  %xmm2,%xmm0
  mulsd  (%rdi),%xmm0
  movsd  %xmm0,(%rax,%rbx,1)
  movsd  0x0(%r13),%xmm0
  mov    0x190(%rsp),%rax
  mulsd  %xmm4,%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  (%rdi),%xmm0
  movsd  %xmm0,(%rax,%rbx,1)
  movsd  0x0(%r13),%xmm0
  mov    0x198(%rsp),%rax
  mulsd  %xmm3,%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax,%r14,1)
  movsd  0x0(%r13),%xmm0
  mov    0x1a0(%rsp),%rax
  mulsd  %xmm3,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax,%r14,1)
  cmp    $0x1,%esi
  jle    L81
  mov    0x78(%rsp),%rax
  mov    0x188(%rsp),%rcx
  lea    -0x1(%r15),%r11d
  movslq %r11d,%r11
  mov    0x190(%rsp),%rdx
  movsd  (%rax),%xmm0
  mulsd  %xmm4,%xmm0
  mulsd  %xmm2,%xmm0
  mulsd  0x8(%rdi),%xmm0
  movsd  %xmm0,(%rcx,%r11,8)
  movsd  (%rax),%xmm0
  mov    0x198(%rsp),%rcx
  mulsd  %xmm4,%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  0x8(%rdi),%xmm0
  movsd  %xmm0,(%rdx,%r11,8)
  movsd  (%rax),%xmm0
  mov    0x60(%rsp),%edx
  mov    0xc0(%rsp),%r11d
  mulsd  %xmm3,%xmm0
  add    %edx,%r11d
  movslq %r11d,%r11
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,(%rcx,%r11,8)
  movsd  (%rax),%xmm0
  mov    0x1a0(%rsp),%rax
  mulsd  %xmm3,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax,%r11,8)
  cmp    $0x2,%esi
  je     L81
  mov    0xa0(%rsp),%rax
  mov    0x188(%rsp),%rcx
  movslq %r15d,%r11
  movsd  (%rax),%xmm0
  mulsd  %xmm4,%xmm0
  mulsd  %xmm2,%xmm0
  mulsd  0x10(%rdi),%xmm0
  movsd  %xmm0,(%rcx,%r11,8)
  movsd  (%rax),%xmm0
  mov    0x190(%rsp),%rcx
  mulsd  %xmm4,%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  0x10(%rdi),%xmm0
  movsd  %xmm0,(%rcx,%r11,8)
  movsd  (%rax),%xmm0
  movslq %edx,%r11
  mov    0x198(%rsp),%rdx
  mulsd  %xmm3,%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,(%rdx,%r11,8)
  movsd  (%rax),%xmm0
  mov    0x1a0(%rsp),%rax
  mulsd  %xmm3,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax,%r11,8)
L81:
  mov    0x64(%rsp),%ecx
  add    0x4(%rsp),%r15d
  add    $0x8,%rbp
  add    %ecx,0x60(%rsp)
  add    0x68(%rsp),%rbx
  add    0x70(%rsp),%r14
  cmp    0x50(%rsp),%rbp
  je     L56
L5:
  mov    0x170(%rsp),%rax
  movsd  (%rax,%rbp,1),%xmm11
  mov    0x48(%rsp),%rax
  movapd %xmm11,%xmm7
  movsd  (%rax),%xmm2
  xorpd  D8(%rip),%xmm7
  comisd %xmm2,%xmm7
  jb     L62
  divsd  %xmm2,%xmm7
  movsd  %xmm11,0x38(%rsp)
  mov    0xa8(%rsp),%rax
  mov    %rdi,0x90(%rsp)
  movsd  (%rax),%xmm9
  movsd  %xmm2,0x20(%rsp)
  movsd  %xmm4,0x88(%rsp)
  movapd %xmm9,%xmm1
  xorpd  D8(%rip),%xmm1
  movsd  %xmm3,0x80(%rsp)
  movsd  %xmm9,0x18(%rsp)
  movapd %xmm7,%xmm0
  movsd  %xmm7,0x10(%rsp)
  call   <pow@plt>
  mov    0xb0(%rsp),%rax
  movsd  0x18(%rsp),%xmm9
  movapd %xmm0,%xmm8
  movsd  D46(%rip),%xmm0
  movsd  0x10(%rsp),%xmm7
  movsd  (%rax),%xmm1
  mov    0x58(%rsp),%rax
  movapd %xmm9,%xmm10
  movsd  %xmm8,0x10(%rsp)
  movsd  0x20(%rsp),%xmm2
  mulsd  %xmm8,%xmm10
  subsd  %xmm1,%xmm0
  subsd  (%rax),%xmm0
  mulsd  %xmm7,%xmm2
  movapd %xmm0,%xmm6
  mulsd  %xmm8,%xmm6
  divsd  %xmm2,%xmm10
  addsd  %xmm1,%xmm6
  movsd  D44(%rip),%xmm1
  mulsd  %xmm9,%xmm1
  addsd  D6(%rip),%xmm1
  movsd  %xmm6,0x30(%rsp)
  divsd  %xmm9,%xmm1
  mulsd  %xmm10,%xmm0
  movsd  %xmm10,0x28(%rsp)
  movsd  %xmm0,0x40(%rsp)
  movapd %xmm8,%xmm0
  call   <pow@plt>
  movsd  0x18(%rsp),%xmm9
  movsd  D6(%rip),%xmm1
  movsd  0x10(%rsp),%xmm8
  divsd  %xmm9,%xmm1
  addsd  D46(%rip),%xmm9
  movapd %xmm8,%xmm0
  movsd  %xmm8,0x18(%rsp)
  mulsd  %xmm9,%xmm1
  call   <pow@plt>
  mov    0xb8(%rsp),%rax
  movsd  0x18(%rsp),%xmm8
  movsd  (%rax),%xmm7
  movapd %xmm8,%xmm0
  movsd  %xmm8,0x20(%rsp)
  movapd %xmm7,%xmm1
  movsd  %xmm7,0x10(%rsp)
  call   <pow@plt>
  movsd  0x10(%rsp),%xmm7
  movsd  0x20(%rsp),%xmm8
  movsd  %xmm0,0x18(%rsp)
  movapd %xmm7,%xmm1
  subsd  D46(%rip),%xmm1
  movapd %xmm8,%xmm0
  call   <pow@plt>
  movsd  0x10(%rsp),%xmm7
  movsd  0x28(%rsp),%xmm10
  movsd  0x18(%rsp),%xmm2
  movsd  0x30(%rsp),%xmm6
  mulsd  %xmm0,%xmm7
  movsd  0x38(%rsp),%xmm11
  movsd  0x80(%rsp),%xmm3
  movsd  0x88(%rsp),%xmm4
  mov    0x90(%rsp),%rdi
  movapd %xmm7,%xmm1
  mulsd  %xmm10,%xmm1
  jmp    L54
  nopl   0x0(%rax)
L56:
  mov    %rdi,%r12
L25:
  mov    0xd4(%rsp),%edx
  mov    0xc4(%rsp),%esi
  addq   $0x4,0x98(%rsp)
  mov    0x98(%rsp),%rax
  add    %edx,0xc8(%rsp)
  mov    0xe8(%rsp),%edx
  add    %esi,0xd0(%rsp)
  add    %edx,0xcc(%rsp)
  cmp    0xd8(%rsp),%rax
  jne    L30
L77:
  add    $0xf8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D46
type_infered: f64
name: disassemble_data
arguments: data_tag: D8
type_infered: f32[4]
name: disassemble_data
arguments: data_tag: D44
type_infered: f64
name: disassemble_data
arguments: data_tag: D6
type_infered: f64

tool: D46: 1

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

tool: D44: 3

tool: D6: 2

assistant: ```c
void conservativeHeadRichardsJLeverettAni(const int nSimplex, const int nPointsPerSimplex, const int nSpace, const int *materialTypes, const double rho, const double beta, const double *gravity, const double *phi, const double *psiD, const double *ns, const double *nk, const double *S_wirr, const double *S_nwr, const double *kr0x, const double *kr0y, const double *kr0z, double *u, double *mass, double *dmass, double *f, double *df, double *a, double *da) {
  int i, j, k, I, matID;
  const int nSpace2 = nSpace * nSpace;
  register double psiC, pcBar, Se, dSe, Sw, dSw, kr, dkr, rho2 = rho * rho, rhom, drhom;
  const double reg_diff = 1.0e-2;
  for (i = 0; i < nSimplex; i++) {
    matID = materialTypes[i];
    for (j = 0; j < nPointsPerSimplex; j++) {
      k = i * nPointsPerSimplex + j;
      psiC = -u[k];
      if (psiC >= psiD[matID]) {
        pcBar = psiC / psiD[matID];
        Se = pow(pcBar, -ns[matID]);
        Sw = Se * (1.0 - S_wirr[matID] - S_nwr[matID]) + S_wirr[matID];
        dSe = ns[matID] * Se / (pcBar * psiD[matID]);
        dSw = (1.0 - S_wirr[matID] - S_nwr[matID]) * dSe;
        kr = pow(Se, (2.0 + 3.0 * ns[matID]) / ns[matID]);
        dkr = ((2.0 + 3.0 * ns[matID]) / ns[matID] * pow(Se, 2.0 / ns[matID] * (1.0 + ns[matID])) * dSe);
        kr = pow(Se, nk[matID]);
        dkr = nk[matID] * pow(Se, nk[matID] - 1) * dSe;
      } else {
        Se = 1.0;
        Sw = 1.0 - S_nwr[matID];
        dSw = 0.0;
        kr = 1.0;
        dkr = 0.0;
      }
      rhom = rho * exp(beta * u[k]);
      drhom = beta * rhom;
      mass[k] = rhom * Sw * phi[matID];
      dmass[k] = rhom * dSw * phi[matID] + drhom * Sw * phi[matID];
      I = 0;
      f[k * nSpace + I] = rho2 * kr0x[matID] * kr * gravity[I];
      df[k * nSpace + I] = rho2 * kr0x[matID] * dkr * gravity[I];
      a[k * nSpace2 + I * nSpace + I] = rho * kr0x[matID] * kr;
      da[k * nSpace2 + I * nSpace + I] = rho * kr0x[matID] * dkr;
      if (nSpace > 1) {
        I = 1;
        f[k * nSpace + I] = rho2 * kr0y[matID] * kr * gravity[I];
        df[k * nSpace + I] = rho2 * kr0y[matID] * dkr * gravity[I];
        a[k * nSpace2 + I * nSpace + I] = rho * kr0y[matID] * kr;
        da[k * nSpace2 + I * nSpace + I] = rho * kr0y[matID] * dkr;
        if (nSpace > 2) {
          I = 2;
          f[k * nSpace + I] = rho2 * kr0z[matID] * kr * gravity[I];
          df[k * nSpace + I] = rho2 * kr0z[matID] * dkr * gravity[I];
          a[k * nSpace2 + I * nSpace + I] = rho * kr0z[matID] * kr;
          da[k * nSpace2 + I * nSpace + I] = rho * kr0z[matID] * dkr;
        }
      }
    }
  }
}
```