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

```asm
<compute_centroids_uint8>:
  endbr64
  push   %r15
  mov    %edx,%r15d
  push   %r14
  mov    %rsi,%r14
  push   %r13
  mov    %r8d,%r13d
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %r8d,%ebp
  imul   %ecx,%ebp
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x18,%rsp
  lea    0x0(,%rbp,8),%edi
  mov    %r8d,0xc(%rsp)
  call   <malloc@plt>
  mov    %ebp,%edi
  mov    $0x4,%esi
  mov    %rax,(%rsp)
  call   <calloc@plt>
  mov    %r13d,%edi
  mov    $0x4,%esi
  mov    %rax,%rbp
  call   <calloc@plt>
  mov    %rax,%r13
  test   %r15d,%r15d
  jle    L158
  lea    -0x1(%r15),%eax
  mov    %r14,%r10
  mov    %ebx,%r11d
  xor    %r9d,%r9d
  lea    0x4(%r14,%rax,4),%r14
  mov    %ebx,%eax
  lea    -0x1(%rbx),%r15d
  and    $0xfffffffc,%r11d
  shr    $0x2,%eax
  lea    -0x1(%rax),%r8d
  add    $0x1,%r8
  shl    $0x4,%r8
  xchg   %ax,%ax
L140:
  movslq (%r10),%rdi
  test   %ebx,%ebx
  jle    L91
  mov    %ebx,%esi
  imul   %edi,%esi
  cmp    $0x2,%r15d
  jbe    L123
  movslq %esi,%rax
  lea    0x0(%rbp,%rax,4),%rcx
  movslq %r9d,%rax
  lea    (%r12,%rax,8),%rdx
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L37:
  movdqu (%rdx,%rax,2),%xmm0
  movdqu 0x10(%rdx,%rax,2),%xmm1
  movdqu (%rcx,%rax,1),%xmm2
  shufps $0x88,%xmm1,%xmm0
  paddd  %xmm2,%xmm0
  movups %xmm0,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %r8,%rax
  jne    L37
  mov    %r11d,%eax
  cmp    %ebx,%r11d
  je     L91
L19:
  lea    (%rsi,%rax,1),%edx
  lea    (%r9,%rax,1),%ecx
  movslq %edx,%rdx
  movslq %ecx,%rcx
  mov    (%r12,%rcx,8),%rcx
  add    %ecx,0x0(%rbp,%rdx,4)
  lea    0x1(%rax),%edx
  cmp    %edx,%ebx
  jle    L91
  lea    (%rsi,%rdx,1),%ecx
  add    %r9d,%edx
  add    $0x2,%eax
  movslq %ecx,%rcx
  movslq %edx,%rdx
  mov    (%r12,%rdx,8),%rdx
  add    %edx,0x0(%rbp,%rcx,4)
  cmp    %eax,%ebx
  jle    L91
  add    %eax,%esi
  add    %r9d,%eax
  movslq %esi,%rsi
  cltq
  mov    (%r12,%rax,8),%rax
  add    %eax,0x0(%rbp,%rsi,4)
L91:
  add    $0x4,%r10
  addl   $0x1,0x0(%r13,%rdi,4)
  add    %ebx,%r9d
  cmp    %r14,%r10
  jne    L140
L158:
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L116
  mov    (%rsp),%r14
  mov    %r13,%rdi
  lea    0x0(%r13,%rax,4),%r12
  xor    %r10d,%r10d
  lea    -0x1(%rbx),%r11d
  jmp    L52
  nopl   0x0(%rax)
L95:
  add    $0x4,%rdi
  add    %ebx,%r10d
  cmp    %rdi,%r12
  je     L116
L52:
  mov    (%rdi),%esi
  test   %esi,%esi
  je     L95
  test   %ebx,%ebx
  jle    L95
  movslq %r10d,%rax
  xor    %ecx,%ecx
  lea    0x0(%rbp,%rax,4),%r9
  lea    (%r14,%rax,8),%r8
  nopl   0x0(%rax)
L121:
  mov    (%r9,%rcx,4),%eax
  cltd
  idiv   %esi
  cltq
  mov    %rax,(%r8,%rcx,8)
  mov    %rcx,%rax
  add    $0x1,%rcx
  cmp    %r11,%rax
  jne    L121
  add    $0x4,%rdi
  add    %ebx,%r10d
  cmp    %rdi,%r12
  jne    L52
L116:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    (%rsp),%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L123:
  xor    %eax,%eax
  jmp    L19
```

assistant: ```c
uint8_t *compute_centroids_uint8(uint8_t *space, int *cluster_map, int points, int dim, int k) {
  uint8_t *centroids = malloc(k * dim * sizeof(uint8_t));
  uint32_t *sums = calloc(k * dim, sizeof(uint32_t));
  int *cluster_points = calloc(k, sizeof(int));
  for (int i = 0; i < points; ++i) {
    int n = cluster_map[i];
    for (int j = 0; j < dim; ++j)
      sums[n * dim + j] = sums[n * dim + j] + (uint32_t)space[i * dim + j];
    ++cluster_points[n];
  }
  for (int n = 0; n < k; ++n) {
    if (cluster_points[n]) {
      for (int i = 0; i < dim; ++i)
        centroids[n * dim + i] = (uint8_t)(sums[n * dim + i] / cluster_points[n]);
    }
  }
  free(sums);
  free(cluster_points);
  return centroids;
}
```