user: Translate the below assembly code into C programming language:

```asm
<groundwaterTransportCoefficientsEvaluate_hetMat>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  imul   %edx,%ebx
  sub    $0x178,%rsp
  mov    %r8,0x150(%rsp)
  mov    0x1e8(%rsp),%r12
  mov    %r9,0x158(%rsp)
  mov    %ebx,0xe8(%rsp)
  test   %edi,%edi
  jle    L141
  test   %esi,%esi
  jle    L141
  mov    %edi,%eax
  mov    %rcx,%rdx
  mov    %rcx,0x108(%rsp)
  mov    %r13d,%ecx
  sub    $0x1,%eax
  imul   %esi,%ebx
  mov    %r13d,%edi
  mov    %r12,%rbp
  lea    0x4(%rdx,%rax,4),%rax
  xor    %edx,%edx
  movapd %xmm0,%xmm2
  and    $0xfffffffe,%edi
  mov    %rax,0x148(%rsp)
  mov    %r13d,%eax
  imul   %esi,%ecx
  mov    %rdx,%r11
  shr    %eax
  pxor   %xmm4,%xmm4
  mov    %ebx,0x160(%rsp)
  movslq %esi,%rbx
  mov    %eax,0x128(%rsp)
  sub    $0x1,%eax
  add    $0x1,%rax
  mov    %rbx,0x140(%rsp)
  shl    $0x4,%rax
  mov    %ecx,0x13c(%rsp)
  mov    %rax,0xf8(%rsp)
  movslq %r13d,%rax
  lea    0x1(%rax),%rbx
  mov    %r13d,%eax
  mov    %edi,0xec(%rsp)
  lea    0x0(,%rbx,8),%rcx
  mov    %rax,0xf0(%rsp)
  sub    $0x1,%rax
  imul   %rcx,%rax
  test   %rcx,%rcx
  mov    %rbx,0xa0(%rsp)
  lea    -0x8(%rcx),%r15
  mov    %rcx,0x88(%rsp)
  movq   $0x0,0x130(%rsp)
  cmovs  %rax,%r11
  cmovns %rax,%rdx
  shl    $0x4,%rbx
  mov    %rcx,%rax
  mov    %rbx,0x120(%rsp)
  sub    $0x10,%rbx
  sub    $0x10,%rax
  mov    %rbx,0xb0(%rsp)
  imul   %r13d,%edi
  lea    -0x1(%rsi),%ebx
  mov    %ebx,0x164(%rsp)
  mov    0x1c0(%rsp),%rbx
  mov    %r11,0x110(%rsp)
  add    $0x8,%rbx
  mov    %rax,0x68(%rsp)
  mov    %rdx,0x118(%rsp)
  mov    %edi,0xcc(%rsp)
  movl   $0x0,0x138(%rsp)
  movl   $0x0,0x12c(%rsp)
  mov    %rbx,0x168(%rsp)
  mov    %r15,0x100(%rsp)
  mov    %r13d,%r15d
L224:
  mov    0x108(%rsp),%rax
  mov    0x150(%rsp),%rbx
  pxor   %xmm3,%xmm3
  mov    0x1c0(%rsp),%r12
  mov    0x1c8(%rsp),%rcx
  movslq (%rax),%rax
  mov    0x1b0(%rsp),%r10
  mov    0x1b8(%rsp),%r13
  shl    $0x3,%rax
  add    %rax,%rbx
  add    %rax,%r10
  mov    %rbx,0x60(%rsp)
  mov    0x130(%rsp),%rbx
  lea    0x0(,%rbx,8),%rdx
  add    %rdx,%rcx
  add    %rdx,%r12
  add    0x1d0(%rsp),%rdx
  mov    %rdx,0xb8(%rsp)
  mov    0x164(%rsp),%edx
  mov    %rcx,0xc0(%rsp)
  add    %rbx,%rdx
  mov    0x168(%rsp),%rbx
  lea    (%rbx,%rdx,8),%rbx
  mov    0x1b0(%rsp),%rdx
  mov    %rbx,0xe0(%rsp)
  mov    0x158(%rsp),%rbx
  lea    (%rbx,%rax,1),%r14
  add    $0x8,%rax
  add    %rax,%rdx
  add    %rbx,%rax
  mov    %r14,%r11
  mov    %r15d,%r14d
  mov    %rax,0x98(%rsp)
  mov    0x138(%rsp),%eax
  mov    %rbp,%r15
  mov    %r10,%rbp
  mov    %rdx,0x90(%rsp)
  mov    %eax,0xc8(%rsp)
  mov    0x12c(%rsp),%eax
  mov    %eax,0x20(%rsp)
  nopw   0x0(%rax,%rax,1)
L37:
  mov    0x60(%rsp),%rax
  mov    0xc0(%rsp),%rbx
  movsd  (%rax),%xmm0
  mulsd  (%r12),%xmm0
  movsd  %xmm0,(%rbx)
  movsd  (%rax),%xmm0
  mov    0xb8(%rsp),%rax
  movsd  %xmm0,(%rax)
  test   %r14d,%r14d
  jle    L257
  movslq 0x20(%rsp),%rbx
  mov    0xf0(%rsp),%r8
  lea    0x8(%r12),%rdx
  mov    0x1e0(%rsp),%rsi
  mov    0x1d8(%rsp),%rdi
  mov    %rdx,0xa8(%rsp)
  lea    0x0(,%rbx,8),%rax
  add    %rbx,%r8
  mov    %rbx,0x70(%rsp)
  mov    0x1d8(%rsp),%r10
  lea    0x8(%rax),%rcx
  add    %rax,%rsi
  shl    $0x3,%r8
  add    %rax,%rdi
  lea    0x0(%r13,%rcx,1),%r9
  lea    0x10(%rax),%rbx
  cmp    %r9,%rsi
  lea    0x0(%r13,%rax,1),%rdx
  setne  %r9b
  add    %rcx,%r10
  cmp    %r10,%rsi
  setne  %r10b
  and    %r9d,%r10d
  cmp    $0x1,%r14d
  setne  %r9b
  and    %r9d,%r10d
  mov    0x1d8(%rsp),%r9
  add    %r8,%r9
  cmp    %r9,%r12
  setae  %r9b
  cmp    %rdi,0xa8(%rsp)
  setbe  (%rsp)
  add    0x1e0(%rsp),%r8
  or     (%rsp),%r9b
  and    %r10d,%r9d
  cmp    %r8,%r12
  setae  %r8b
  cmp    %rsi,0xa8(%rsp)
  setbe  %r10b
  or     %r10d,%r8d
  test   %r8b,%r9b
  je     L324
  lea    0x0(%r13,%rbx,1),%r8
  cmp    %r8,%rdi
  setae  %r9b
  add    0x1d8(%rsp),%rbx
  cmp    %rbx,%rdx
  setae  %r8b
  or     %r9b,%r8b
  je     L324
  movsd  (%r12),%xmm7
  xor    %eax,%eax
  movapd %xmm3,%xmm6
  movapd %xmm3,%xmm1
  mov    0xf8(%rsp),%rcx
  unpcklpd %xmm7,%xmm7
  nopl   (%rax)
L309:
  movupd (%rdx,%rax,1),%xmm0
  mulpd  %xmm7,%xmm0
  movups %xmm0,(%rdi,%rax,1)
  movupd (%rdx,%rax,1),%xmm0
  movups %xmm0,(%rsi,%rax,1)
  mulpd  %xmm0,%xmm0
  add    $0x10,%rax
  addsd  %xmm0,%xmm1
  unpckhpd %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rax,%rcx
  jne    L309
  mov    0xec(%rsp),%ebx
  cmp    %ebx,%r14d
  je     L321
  mov    0x20(%rsp),%eax
  add    %ebx,%eax
  mov    0x1d8(%rsp),%rbx
  cltq
  lea    0x0(%r13,%rax,8),%rdx
  movsd  (%rdx),%xmm0
  mulsd  (%r12),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  mov    0x1e0(%rsp),%rbx
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
L321:
  ucomisd %xmm1,%xmm6
  ja     L312
  sqrtsd %xmm1,%xmm1
  comisd %xmm6,%xmm1
  jbe    L24
L23:
  mov    0x70(%rsp),%rax
  lea    -0x1(%r14),%edi
  xor    %r8d,%r8d
  xor    %r12d,%r12d
  movslq 0xc8(%rsp),%rdx
  mov    %edi,0x24(%rsp)
  movapd %xmm1,%xmm5
  mov    %r8d,%r9d
  lea    0x0(%r13,%rax,8),%rax
  mov    %r12,%r8
  unpcklpd %xmm5,%xmm5
  mov    %r13,%r12
  mov    %rax,0xd0(%rsp)
  mov    %rax,%rcx
  lea    0x0(,%rdx,8),%rax
  mov    %edx,%r13d
  lea    (%r15,%rax,1),%rbx
  add    $0x8,%rax
  mov    %rdx,0x38(%rsp)
  mov    %rbx,0x78(%rsp)
  lea    (%r15,%rax,1),%rbx
  mov    %rax,0x28(%rsp)
  mov    %edi,%eax
  mov    %rbx,%r10
  mov    0x100(%rsp),%rbx
  mov    %rdx,0xd8(%rsp)
  mov    %rax,0x80(%rsp)
  nop
L259:
  movsd  0x0(%rbp),%xmm7
  movsd  (%r11),%xmm6
  lea    0x0(%r13,%r9,1),%eax
  mov    %r8d,(%rsp)
  movsd  (%rcx),%xmm8
  mov    %eax,0x8(%rsp)
  subsd  %xmm7,%xmm6
  mov    0x60(%rsp),%rax
  mulsd  %xmm1,%xmm7
  movapd %xmm6,%xmm0
  movsd  (%rax),%xmm6
  lea    0x1(%r8),%eax
  mulsd  %xmm8,%xmm0
  mov    %eax,0x5c(%rsp)
  mulsd  %xmm2,%xmm6
  mulsd  %xmm8,%xmm0
  addsd  %xmm7,%xmm6
  divsd  %xmm1,%xmm0
  addsd  %xmm6,%xmm0
  movsd  %xmm0,-0x8(%r10)
  cmp    %r8,0x80(%rsp)
  je     L251
  mov    0x24(%rsp),%edi
  mov    0x38(%rsp),%rax
  xor    %esi,%esi
  add    %rdi,%rax
  mov    %rdi,0x50(%rsp)
  lea    0x0(,%rax,8),%rdx
  lea    -0x1(%rdi),%rax
  imul   %rbx,%rax
  mov    %rdx,0x30(%rsp)
  mov    0x68(%rsp),%rdx
  add    0x28(%rsp),%rdx
  test   %r14d,%r14d
  cmovs  %rax,%rsi
  xor    %edi,%edi
  add    %rdx,%rsi
  test   %r14d,%r14d
  cmovs  %rdi,%rax
  mov    %r14d,%edi
  mov    %rsi,0x48(%rsp)
  sub    %r8d,%edi
  add    %rax,%rdx
  lea    (%r15,%rsi,1),%rax
  mov    0x30(%rsp),%rsi
  mov    %rdx,0x40(%rsp)
  add    %r15,%rdx
  cmp    $0x2,%edi
  lea    0x10(%rcx),%rdi
  mov    %rax,0x18(%rsp)
  lea    0x8(%r15,%rsi,1),%rax
  setne  %sil
  cmp    %rdi,%r10
  mov    %rdx,0x10(%rsp)
  setne  %dil
  lea    0x8(%rcx),%rdx
  and    %edi,%esi
  cmp    %r10,%rdx
  setbe  %dil
  cmp    %rcx,%rax
  setbe  0x5b(%rsp)
  or     0x5b(%rsp),%dil
  and    %esi,%edi
  cmp    0x90(%rsp),%r10
  setae  %sil
  cmp    %rax,%rbp
  setae  0x5b(%rsp)
  or     0x5b(%rsp),%sil
  and    %edi,%esi
  cmp    0x98(%rsp),%r10
  setae  %dil
  cmp    %rax,%r11
  setae  %al
  or     %eax,%edi
  mov    0x40(%rsp),%rax
  and    %esi,%edi
  cmp    0x28(%rsp),%rax
  mov    0x30(%rsp),%rsi
  setl   %al
  cmp    %rsi,0x48(%rsp)
  setg   %sil
  or     %esi,%eax
  and    %edi,%eax
  cmp    %rcx,0x10(%rsp)
  setb   %sil
  cmp    %rcx,0x18(%rsp)
  seta   %dil
  or     %edi,%esi
  and    %esi,%eax
  mov    0x70(%rsp),%rsi
  mov    %eax,%edi
  lea    (%r8,%rsi,1),%rax
  add    0x50(%rsp),%rax
  lea    (%r12,%rax,8),%rax
  cmp    %rax,0x18(%rsp)
  seta   %al
  cmp    %rdx,0x10(%rsp)
  setb   %sil
  or     %eax,%esi
  and    %edi,%esi
  cmp    %rbp,0x18(%rsp)
  seta   %al
  cmp    %rbp,0x10(%rsp)
  setb   %dil
  or     %edi,%eax
  test   %al,%sil
  je     L105
  cmp    %r11,0x18(%rsp)
  seta   %al
  cmp    %r11,0x10(%rsp)
  setb   %sil
  or     %al,%sil
  je     L105
  movsd  (%r11),%xmm6
  subsd  0x0(%rbp),%xmm6
  mov    %rcx,0x10(%rsp)
  mulsd  (%rcx),%xmm6
  mov    0x24(%rsp),%edi
  mov    0x68(%rsp),%rax
  mov    0xb0(%rsp),%rcx
  shr    %edi
  lea    (%rax,%r10,1),%rsi
  shl    $0x4,%rdi
  xor    %eax,%eax
  unpcklpd %xmm6,%xmm6
  nopl   0x0(%rax)
L287:
  movupd (%rdx,%rax,1),%xmm0
  mulpd  %xmm6,%xmm0
  divpd  %xmm5,%xmm0
  movups %xmm0,(%r10,%rax,1)
  add    $0x10,%rax
  movlpd %xmm0,(%rsi)
  movhpd %xmm0,(%rsi,%rbx,1)
  add    %rcx,%rsi
  cmp    %rdi,%rax
  jne    L287
  mov    0x24(%rsp),%edi
  mov    0x5c(%rsp),%eax
  mov    0x10(%rsp),%rcx
  mov    %edi,%esi
  and    $0xfffffffe,%esi
  add    %esi,%eax
  cmp    %edi,%esi
  je     L135
  mov    0x20(%rsp),%edi
  movsd  (%r11),%xmm0
  subsd  0x0(%rbp),%xmm0
  mulsd  (%rcx),%xmm0
  lea    (%rdi,%rax,1),%ecx
  movslq %ecx,%rcx
  mulsd  (%r12,%rcx,8),%xmm0
  mov    0x8(%rsp),%ecx
  add    %eax,%ecx
  imul   %r14d,%eax
  movslq %ecx,%rcx
  divsd  %xmm1,%xmm0
  add    %r13d,%eax
  add    (%rsp),%eax
  cltq
  movsd  %xmm0,(%r15,%rcx,8)
  movsd  %xmm0,(%r15,%rax,8)
L135:
  lea    0x1(%r8),%rdi
  lea    (%r14,%r9,1),%esi
L201:
  mov    0x88(%rsp),%rcx
  mov    %rdi,%r8
  add    %rcx,0x28(%rsp)
  mov    %esi,%r9d
  mov    0xa0(%rsp),%rdi
  add    %rbx,0x78(%rsp)
  add    %rcx,%r10
  subl   $0x1,0x24(%rsp)
  mov    %rdx,%rcx
  add    %rdi,0x38(%rsp)
  jmp    L259
  nopw   0x0(%rax,%rax,1)
L105:
  lea    (%r14,%r9,1),%esi
  lea    0x1(%r8),%rdi
  add    0xd8(%rsp),%r8
  mov    %r13d,(%rsp)
  movslq %esi,%r9
  mov    0x78(%rsp),%r13
  mov    %rdi,%rax
  add    %r9,%r8
  mov    0xd0(%rsp),%r9
  lea    (%r15,%r8,8),%r8
  xchg   %ax,%ax
L328:
  movsd  (%r11),%xmm0
  subsd  0x0(%rbp),%xmm0
  mulsd  (%rcx),%xmm0
  mulsd  (%r9,%rax,8),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,0x0(%r13,%rax,8)
  add    $0x1,%rax
  movsd  %xmm0,(%r8)
  add    %rbx,%r8
  cmp    %eax,%r14d
  jg     L328
  mov    (%rsp),%r13d
  jmp    L201
  nopl   0x0(%rax)
L251:
  mov    %r12,%r13
L129:
  mov    0xe8(%rsp),%ebx
  add    %r14d,0x20(%rsp)
  add    %ebx,0xc8(%rsp)
  mov    0xa8(%rsp),%r12
  addq   $0x8,0xc0(%rsp)
  addq   $0x8,0xb8(%rsp)
  cmp    0xe0(%rsp),%r12
  jne    L37
  mov    0x13c(%rsp),%edx
  mov    %r15,%rbp
  add    %edx,0x12c(%rsp)
  mov    %r14d,%r15d
  addq   $0x4,0x108(%rsp)
  mov    0x160(%rsp),%edx
  mov    0x108(%rsp),%rax
  add    %edx,0x138(%rsp)
  mov    0x140(%rsp),%rdx
  add    %rdx,0x130(%rsp)
  cmp    0x148(%rsp),%rax
  jne    L224
L141:
  add    $0x178,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L24:
  test   %r14d,%r14d
  jle    L129
L45:
  movslq 0xc8(%rsp),%rax
  mov    0x110(%rsp),%rbx
  shl    $0x3,%rax
  lea    (%rax,%rbx,1),%rdx
  mov    0x60(%rsp),%rbx
  add    %r15,%rdx
  cmp    %rdx,%rbx
  mov    0x118(%rsp),%rdx
  setb   %cl
  add    %rax,%rdx
  add    %r15,%rdx
  cmp    %rdx,%rbx
  seta   %dl
  add    %r15,%rax
  or     %cl,%dl
  je     L279
  lea    -0x1(%r14),%edx
  cmp    $0x8,%edx
  jbe    L279
  movsd  (%rbx),%xmm0
  mov    0x128(%rsp),%edi
  xor    %edx,%edx
  mov    0x88(%rsp),%rcx
  mov    0x120(%rsp),%rsi
  mulsd  %xmm2,%xmm0
  nopl   (%rax)
L278:
  add    $0x1,%edx
  movsd  %xmm0,(%rax)
  movsd  %xmm0,(%rax,%rcx,1)
  add    %rsi,%rax
  cmp    %edi,%edx
  jne    L278
  mov    0xec(%rsp),%ebx
  cmp    %ebx,%r14d
  je     L129
  mov    0xc8(%rsp),%eax
  add    0xcc(%rsp),%eax
  add    %ebx,%eax
  mov    0x60(%rsp),%rbx
  cltq
  movsd  (%rbx),%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,(%r15,%rax,8)
  jmp    L129
L324:
  mov    0x70(%rsp),%rbx
  lea    -0x1(%r14),%edx
  movapd %xmm4,%xmm6
  mov    0x1d8(%rsp),%rsi
  mov    0x1e0(%rsp),%rdi
  movapd %xmm4,%xmm1
  lea    0x1(%rdx,%rbx,1),%rdx
  shl    $0x3,%rdx
  jmp    L270
  nopl   0x0(%rax)
L46:
  add    $0x8,%rcx
L270:
  movsd  0x0(%r13,%rax,1),%xmm0
  mulsd  (%r12),%xmm0
  movsd  %xmm0,(%rsi,%rax,1)
  movsd  0x0(%r13,%rax,1),%xmm0
  movsd  %xmm0,(%rdi,%rax,1)
  mulsd  %xmm0,%xmm0
  mov    %rcx,%rax
  addsd  %xmm0,%xmm1
  cmp    %rcx,%rdx
  jne    L46
  jmp    L321
L257:
  lea    0x8(%r12),%rax
  mov    %rax,0xa8(%rsp)
  jmp    L129
L279:
  mov    0x60(%rsp),%rcx
  mov    0x88(%rsp),%rsi
  xor    %edx,%edx
  nopl   0x0(%rax,%rax,1)
L112:
  movsd  (%rcx),%xmm0
  add    $0x1,%edx
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  add    %rsi,%rax
  cmp    %edx,%r14d
  jne    L112
  jmp    L129
L312:
  movapd %xmm1,%xmm0
  mov    %r11,0x8(%rsp)
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm6,(%rsp)
  call   <sqrt@plt>
  movsd  (%rsp),%xmm6
  pxor   %xmm4,%xmm4
  mov    0x8(%rsp),%r11
  movsd  0x10(%rsp),%xmm2
  movapd %xmm0,%xmm1
  movapd %xmm4,%xmm3
  comisd %xmm6,%xmm0
  ja     L23
  jmp    L45
```

assistant: ```c
void groundwaterTransportCoefficientsEvaluate_hetMat(const int nSimplex, const int nPointsPerSimplex, const int nSpace, const double d, const int *materialTypes, const double *omega_types, const double *alpha_L_types, const double *alpha_T_types, const double *v, const double *u, double *m, double *dm, double *f, double *df, double *a) {
  int i, j, k, I, J, matID;
  const int nSpace2 = nSpace * nSpace;
  double norm_v;
  for (i = 0; i < nSimplex; i++) {
    matID = materialTypes[i];
    for (j = 0; j < nPointsPerSimplex; j++) {
      k = i * nPointsPerSimplex + j;
      m[k] = omega_types[matID] * u[k];
      dm[k] = omega_types[matID];
      norm_v = 0.0;
      for (I = 0; I < nSpace; I++) {
        f[k * nSpace + I] = v[k * nSpace + I] * u[k];
        df[k * nSpace + I] = v[k * nSpace + I];
        norm_v += v[k * nSpace + I] * v[k * nSpace + I];
      }
      norm_v = sqrt(norm_v);
      if (norm_v > 0.0) {
        for (I = 0; I < nSpace; I++) {
          a[k * nSpace2 + I * nSpace + I] = omega_types[matID] * d + alpha_T_types[matID] * norm_v + (alpha_L_types[matID] - alpha_T_types[matID]) * v[k * nSpace + I] * v[k * nSpace + I] / norm_v;
          for (J = I + 1; J < nSpace; J++) {
            a[k * nSpace2 + I * nSpace + J] = (alpha_L_types[matID] - alpha_T_types[matID]) * v[k * nSpace + I] * v[k * nSpace + J] / norm_v;
            a[k * nSpace2 + J * nSpace + I] = a[k * nSpace2 + I * nSpace + J];
          }
        }
      } else
        for (I = 0; I < nSpace; I++)
          a[k * nSpace2 + I * nSpace + I] = omega_types[matID] * d;
    }
  }
}
```