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

```asm
<redistanceLevelSetCoefficientsEvaluate>:
  endbr64
  push   %r15
  movslq %edi,%rax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdx,0x20(%rsp)
  mov    0xa0(%rsp),%r15
  mov    %r9,0x28(%rsp)
  movsd  %xmm0,0x18(%rsp)
  test   %eax,%eax
  jle    L47
  mov    %rax,0x30(%rsp)
  mov    %esi,%eax
  mov    %r8,%rbx
  mov    %rcx,%r10
  shr    %eax
  mov    %esi,%ecx
  xor    %ebp,%ebp
  xor    %r12d,%r12d
  lea    -0x1(%rax),%r8d
  lea    -0x1(%rsi),%eax
  and    $0xfffffffe,%ecx
  mov    %esi,%edi
  add    $0x1,%rax
  add    $0x1,%r8
  mov    %ecx,%r13d
  mov    %rax,0x38(%rsp)
  shl    $0x4,%r8
  mov    %r8,%r14
  xchg   %ax,%ax
L159:
  movsd  (%r10,%r12,8),%xmm0
  mov    0x28(%rsp),%rax
  mov    %edi,0x10(%rsp)
  mov    D10(%rip),%rcx
  mov    %r10,0x8(%rsp)
  movsd  %xmm0,(%rax,%r12,8)
  mov    0x90(%rsp),%rax
  movsd  0x18(%rsp),%xmm0
  mov    %rcx,(%rax,%r12,8)
  mov    0x98(%rsp),%rax
  movq   $0x0,(%rax,%r12,8)
  mov    0x20(%rsp),%rax
  movsd  (%rax,%r12,8),%xmm1
  call   <smoothedHeaviside@plt>
  mov    0x10(%rsp),%edi
  mov    0x8(%rsp),%r10
  movapd %xmm0,%xmm3
  mov    0xa8(%rsp),%rax
  addsd  %xmm0,%xmm3
  subsd  D10(%rip),%xmm3
  test   %edi,%edi
  movapd %xmm3,%xmm0
  xorpd  D0(%rip),%xmm0
  movsd  %xmm0,(%rax,%r12,8)
  jle    L42
  cmp    $0x1,%edi
  je     L130
  movslq %ebp,%r9
  pxor   %xmm0,%xmm0
  lea    (%rbx,%r9,8),%rax
  lea    (%rax,%r14,1),%rdx
  cs nopw 0x0(%rax,%rax,1)
L37:
  movupd (%rax),%xmm2
  add    $0x10,%rax
  mulpd  %xmm2,%xmm2
  addsd  %xmm2,%xmm0
  unpckhpd %xmm2,%xmm2
  addsd  %xmm2,%xmm0
  cmp    %rdx,%rax
  jne    L37
  mov    %r13d,%eax
  cmp    %r13d,%edi
  je     L13
L155:
  add    %ebp,%eax
  cltq
  movsd  (%rbx,%rax,8),%xmm1
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
L13:
  pxor   %xmm6,%xmm6
  ucomisd %xmm0,%xmm6
  ja     L19
  sqrtsd %xmm0,%xmm0
  movapd %xmm3,%xmm1
  mov    0x98(%rsp),%rax
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax,%r12,8)
L167:
  lea    0x0(,%r9,8),%rax
  addsd  D17(%rip),%xmm0
  lea    0x8(%rax),%rdx
  lea    (%r15,%rax,1),%rsi
  lea    (%rbx,%rdx,1),%r11
  cmp    %r11,%rsi
  je     L45
  cmp    $0x1,%edi
  je     L45
  movapd %xmm3,%xmm4
  movapd %xmm0,%xmm2
  add    %rbx,%rax
  xor    %edx,%edx
  unpcklpd %xmm4,%xmm4
  unpcklpd %xmm2,%xmm2
  nopl   0x0(%rax)
L80:
  movupd (%rax,%rdx,1),%xmm1
  mulpd  %xmm4,%xmm1
  divpd  %xmm2,%xmm1
  movups %xmm1,(%rsi,%rdx,1)
  add    $0x10,%rdx
  cmp    %r14,%rdx
  jne    L80
  cmp    %r13d,%edi
  je     L139
  lea    0x0(%rbp,%r13,1),%eax
  cltq
  mulsd  (%rbx,%rax,8),%xmm3
  divsd  %xmm0,%xmm3
  movsd  %xmm3,(%r15,%rax,8)
L139:
  add    $0x1,%r12
  add    %edi,%ebp
  cmp    0x30(%rsp),%r12
  jne    L159
L47:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L45:
  add    0x38(%rsp),%r9
  shl    $0x3,%r9
  jmp    L18
  nopl   0x0(%rax,%rax,1)
L55:
  add    $0x8,%rdx
L18:
  movsd  (%rbx,%rax,1),%xmm1
  mulsd  %xmm3,%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,(%r15,%rax,1)
  mov    %rdx,%rax
  cmp    %rdx,%r9
  jne    L55
  jmp    L139
  nopl   0x0(%rax)
L42:
  pxor   %xmm7,%xmm7
  mov    0x98(%rsp),%rax
  mulsd  %xmm7,%xmm3
  movsd  %xmm3,(%rax,%r12,8)
  jmp    L139
L130:
  pxor   %xmm0,%xmm0
  xor    %eax,%eax
  movslq %ebp,%r9
  jmp    L155
L19:
  mov    %r10,0x48(%rsp)
  mov    %edi,0x44(%rsp)
  mov    %r9,0x10(%rsp)
  movsd  %xmm3,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x8(%rsp),%xmm3
  mov    0x10(%rsp),%r9
  mov    0x98(%rsp),%rax
  mov    0x44(%rsp),%edi
  movapd %xmm3,%xmm1
  mov    0x48(%rsp),%r10
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax,%r12,8)
  jmp    L167
```

tool_calls: name: unpack_data
arguments: label: D10
type: f64
name: unpack_data
arguments: label: D0
type: f32[4]
name: unpack_data
arguments: label: D17
type: byte[8]

tool: D10: 1

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

tool: {"D17": [0x11,0xea,0x2d,0x81,0x99,0x97,0x71,0x3d]}

assistant: ```c
void redistanceLevelSetCoefficientsEvaluate(int nPoints, int nSpace, double eps, double *u_levelSet, double *u, double *grad_u, double *m, double *dm, double *H, double *dH, double *r) {
  int i, I;
  double Si, normGradU;
  for (i = 0; i < nPoints; i++) {
    m[i] = u[i];
    dm[i] = 1.0;
    H[i] = 0.0;
    Si = -1.0 + 2.0 * smoothedHeaviside(eps, u_levelSet[i]);
    ;
    r[i] = -Si;
    normGradU = 0.0;
    for (I = 0; I < nSpace; I++)
      normGradU += grad_u[i * nSpace + I] * grad_u[i * nSpace + I];
    normGradU = sqrt(normGradU);
    H[i] = Si * normGradU;
    for (I = 0; I < nSpace; I++) {
      dH[i * nSpace + I] = Si * grad_u[i * nSpace + I] / (normGradU + 1.0e-12);
    }
  }
}
```