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

```asm
<calculate_force>:
  endbr64
  movsd  D46(%rip),%xmm4
  mulsd  %xmm0,%xmm4
  test   %ecx,%ecx
  jle    L56
  push   %r15
  movapd %xmm0,%xmm3
  mov    %rdx,%r15
  push   %r14
  mov    %rdi,%r14
  lea    -0x1(%rcx),%edi
  push   %r13
  lea    (%rdi,%rdi,2),%rax
  push   %r12
  lea    0x18(%r14,%rax,8),%rcx
  mov    %r14,%rax
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x28,%rsp
  nopw   0x0(%rax,%rax,1)
L61:
  movq   $0x0,(%rax)
  add    $0x18,%rax
  movq   $0x0,-0x10(%rax)
  movq   $0x0,-0x8(%rax)
  cmp    %rcx,%rax
  jne    L61
  movapd %xmm4,%xmm6
  xorpd  D43(%rip),%xmm6
  lea    0x8(%rbx,%rdi,8),%r12
  movsd  %xmm6,0x18(%rsp)
  nop
L11:
  mov    (%rbx),%rsi
  xor    %r13d,%r13d
  mov    (%rsi),%rax
  mov    (%rax),%rax
  cvttsd2si (%rax),%ebp
  test   %ebp,%ebp
  jle    L31
  nopl   0x0(%rax,%rax,1)
L14:
  add    $0x1,%r13
  movapd %xmm3,%xmm0
  mov    %r15,%rdi
  movsd  %xmm4,0x10(%rsp)
  mov    (%rsi,%r13,8),%rax
  movsd  %xmm3,0x8(%rsp)
  mov    (%rax),%rsi
  call   <distance_periodic@plt>
  mov    (%rbx),%rsi
  movsd  0x10(%rsp),%xmm4
  xor    %eax,%eax
  movsd  D24(%rip),%xmm2
  movsd  D1(%rip),%xmm1
  mov    (%rsi,%r13,8),%rcx
  movsd  0x8(%rsp),%xmm3
  divsd  %xmm0,%xmm2
  movapd %xmm2,%xmm0
  mulsd  %xmm2,%xmm0
  mulsd  %xmm2,%xmm0
  mulsd  %xmm0,%xmm1
  subsd  D46(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mulsd  %xmm2,%xmm1
L89:
  mov    (%rcx,%rax,1),%rdx
  movsd  (%r15,%rax,1),%xmm0
  subsd  (%rdx),%xmm0
  comisd %xmm4,%xmm0
  jbe    L41
  subsd  %xmm3,%xmm0
L53:
  mulsd  %xmm1,%xmm0
  addsd  (%r14,%rax,1),%xmm0
  movsd  %xmm0,(%r14,%rax,1)
  add    $0x8,%rax
  cmp    $0x18,%rax
  jne    L89
  lea    0x1(%r13),%eax
  cmp    %eax,%ebp
  jge    L14
L31:
  add    $0x8,%rbx
  add    $0x18,%r14
  add    $0x18,%r15
  cmp    %rbx,%r12
  jne    L11
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L41:
  movsd  0x18(%rsp),%xmm5
  comisd %xmm0,%xmm5
  jbe    L53
  addsd  %xmm3,%xmm0
  jmp    L53
L56:
  ret
```

tool_calls: name: parse_data
arguments: data_label: D46
type: f64
name: parse_data
arguments: data_label: D43
type: byte[16]
name: parse_data
arguments: data_label: D24
type: f64
name: parse_data
arguments: data_label: D1
type: f64

tool: D46: 0.5

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

tool: D24: 1

tool: D1: 48

assistant: ```c
void calculate_force(double forces[][3], double ****neighbor, double particles[][3], double region, int amount) {
  int i, j, k;
  double r = region / 2.;
  for (i = 0; i < amount; i++) {
    for (j = 0; j < 3; j++) {
      forces[i][j] = 0;
    }
  }
#pragma omp parallel for private(j, k)
  for (i = 0; i < amount; i++) {
    int neighbors = *neighbor[i][0][0];
    for (j = 1; j <= neighbors; j++) {
      double d = distance_periodic(particles[i], *neighbor[i][j], region);
      double di = 1. / d;
      double d3 = di * di * di;
      for (k = 0; k < 3; k++) {
        double dl = particles[i][k] - *neighbor[i][j][k];
        if (dl > r) {
          dl -= region;
        } else if (dl < -r) {
          dl += region;
        }
        forces[i][k] += 48. * d3 * (d3 - 0.5) * di * dl;
      }
    }
  }
#pragma omp barrier
}
```