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

```asm
<increment_counts_stop>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  mov    %r9d,-0x28(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L28
L54:
  movl   $0x0,-0x4(%rbp)
  jmp    L29
L71:
  movl   $0x0,-0x8(%rbp)
  jmp    L4
L32:
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  movsd  D40(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L21
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  D40(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  D40(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm1
  movsd  D40(%rip),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x20(%rbp),%rax
  movsd  %xmm0,(%rax)
  jmp    L0
L21:
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  movsd  D40(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
L0:
  addl   $0x1,-0x8(%rbp)
L4:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x8(%rbp)
  jl     L32
  addl   $0x1,-0x4(%rbp)
L29:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jl     L71
  addl   $0x1,-0xc(%rbp)
L28:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L54
  nop
  nop
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: data_label: D40
type: f64

tool: D40: 1

assistant: ```c
void increment_counts_stop(double *post_gamma, double *post_pi, int D, int *N, int **M, int V, int ***w, int ***s) {
  int d;
  int m;
  int n;
  for (d = 0; d < D; d++) {
    for (n = 0; n < N[d]; n++) {
      for (m = 0; m < M[d][n]; m++) {
        post_pi[2] += 1.0;
        if (s[d][n][m] == 1) {
          post_gamma[w[d][n][m] - 1] += 1;
          post_gamma[V] += 1.0;
          post_pi[0] += 1;
        } else {
          post_pi[2] += 1;
        }
      }
    }
  }
}
```