user: What would the C source look like for the assembly code provided here?

```asm
<get_angle_count>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    %ecx,-0x38(%rbp)
  mov    %r8d,%eax
  mov    %r9d,-0x40(%rbp)
  mov    %al,-0x3c(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L17
L47:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jg     L79
  mov    $0x0,%eax
  jmp    L84
L79:
  movl   $0x1,-0x10(%rbp)
  movl   $0x1,-0xc(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L46
L99:
  mov    -0x4(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  je     L64
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jge    L92
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    %eax,%eax
  lea    0x1(%rax),%edx
  mov    -0x10(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    %eax,%eax
  lea    -0x1(%rax),%edx
  mov    -0xc(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L85
L92:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  lea    0x1(%rax),%edx
  mov    -0x10(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  lea    0x1(%rax),%edx
  mov    -0xc(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L85
L64:
  nop
L85:
  addl   $0x1,-0x4(%rbp)
L46:
  mov    -0x4(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L99
  mov    -0x10(%rbp),%eax
  sub    -0xc(%rbp),%eax
  add    %eax,-0x14(%rbp)
  addl   $0x1,-0x8(%rbp)
L17:
  mov    -0x8(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L47
  cmpb   $0x0,-0x3c(%rbp)
  jne    L0
  mov    -0x14(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x14(%rbp)
L0:
  mov    -0x14(%rbp),%eax
L84:
  pop    %rbp
  ret
```

assistant: ```c
int get_angle_count(int *size, int *distances, int Nd, int Ndist, char bidirectional, int force2Ddim) {
  int Na;
  int Na_d, Na_dd;
  int dist_idx, dim_idx;
  Na = 0;
  for (dist_idx = 0; dist_idx < Ndist; dist_idx++) {
    if (distances[dist_idx] < 1)
      return 0;
    Na_d = 1;
    Na_dd = 1;
    for (dim_idx = 0; dim_idx < Nd; dim_idx++) {
      if (dim_idx == force2Ddim)
        continue;
      if (distances[dist_idx] < size[dim_idx]) {
        Na_d *= (2 * distances[dist_idx] + 1);
        Na_dd *= (2 * distances[dist_idx] - 1);
      } else {
        Na_d *= (2 * (size[dim_idx] - 1) + 1);
        Na_dd *= (2 * (size[dim_idx] - 1) + 1);
      }
    }
    Na += (Na_d - Na_dd);
  }
  if (!bidirectional)
    Na /= 2;
  return Na;
}
```