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

```asm
<countsort>:
  endbr64
  push   %rbp
  movslq %esi,%r9
  mov    %edx,%ecx
  mov    %r9,%r8
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  lea    0xf(,%r9,4),%rax
  mov    %rsp,%rsi
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rsi
  and    $0xfffffffffffffff0,%rdx
  cmp    %rsi,%rsp
  je     L77
L6:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rsi,%rsp
  jne    L6
L77:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L34
L29:
  pxor   %xmm0,%xmm0
  movq   $0x0,-0x30(%rbp)
  mov    %rsp,%rsi
  lea    -0x1(%r8),%r10d
  movaps %xmm0,-0x50(%rbp)
  movaps %xmm0,-0x40(%rbp)
  test   %r8d,%r8d
  jle    L21
  lea    -0x1(%r8),%eax
  mov    %rdi,%r11
  mov    %rax,%r10
  lea    0x4(%rdi,%rax,4),%rbx
L91:
  mov    (%r11),%eax
  add    $0x4,%r11
  cltd
  idiv   %ecx
  movslq %eax,%rdx
  mov    %eax,%r12d
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%r12d
  sar    $0x22,%rdx
  sub    %r12d,%edx
  lea    (%rdx,%rdx,4),%r12d
  add    %r12d,%r12d
  sub    %r12d,%eax
  movslq %eax,%rdx
  addl   $0x1,-0x50(%rbp,%rdx,4)
  cmp    %rbx,%r11
  jne    L91
L21:
  mov    -0x48(%rbp),%edx
  mov    -0x44(%rbp),%ebx
  mov    -0x50(%rbp),%r11d
  add    -0x4c(%rbp),%r11d
  mov    -0x40(%rbp),%eax
  add    %r11d,%edx
  mov    -0x3c(%rbp),%r13d
  add    %edx,%ebx
  mov    -0x38(%rbp),%r12d
  movd   -0x30(%rbp),%xmm4
  movd   %edx,%xmm3
  add    %ebx,%eax
  movd   -0x38(%rbp),%xmm5
  movd   -0x34(%rbp),%xmm1
  add    %eax,%r13d
  movd   -0x3c(%rbp),%xmm0
  mov    -0x34(%rbp),%r14d
  add    %r13d,%r12d
  punpckldq %xmm4,%xmm1
  movd   %r13d,%xmm6
  movd   -0x40(%rbp),%xmm7
  punpckldq %xmm5,%xmm0
  add    %r12d,%r14d
  movd   %r12d,%xmm2
  movd   -0x48(%rbp),%xmm4
  punpcklqdq %xmm1,%xmm0
  movd   %r14d,%xmm1
  movd   %ebx,%xmm5
  punpckldq %xmm1,%xmm2
  movd   %eax,%xmm1
  punpckldq %xmm5,%xmm3
  punpckldq %xmm6,%xmm1
  movd   %r11d,%xmm6
  punpcklqdq %xmm2,%xmm1
  movd   -0x44(%rbp),%xmm2
  paddd  %xmm1,%xmm0
  movd   -0x50(%rbp),%xmm1
  punpckldq %xmm7,%xmm2
  movups %xmm0,-0x3c(%rbp)
  pshufd $0xff,%xmm0,%xmm0
  punpckldq %xmm4,%xmm1
  movd   %xmm0,%eax
  add    %eax,-0x2c(%rbp)
  punpcklqdq %xmm2,%xmm1
  movd   -0x4c(%rbp),%xmm2
  punpckldq %xmm6,%xmm2
  punpcklqdq %xmm3,%xmm2
  paddd  %xmm2,%xmm1
  movups %xmm1,-0x4c(%rbp)
  test   %r10d,%r10d
  js     L87
  movslq %r10d,%r10
  nopw   0x0(%rax,%rax,1)
L50:
  mov    (%rdi,%r10,4),%r11d
  sub    $0x1,%r10
  mov    %r11d,%eax
  cltd
  idiv   %ecx
  movslq %eax,%rdx
  mov    %eax,%ebx
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%ebx
  sar    $0x22,%rdx
  sub    %ebx,%edx
  lea    (%rdx,%rdx,4),%ebx
  add    %ebx,%ebx
  sub    %ebx,%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp,%rdx,4),%eax
  sub    $0x1,%eax
  movslq %eax,%rbx
  mov    %eax,-0x50(%rbp,%rdx,4)
  mov    %r11d,(%rsi,%rbx,4)
  test   %r10d,%r10d
  jns    L50
L87:
  test   %r8d,%r8d
  jle    L55
  lea    0x0(,%r9,4),%rdx
  call   <memcpy@plt>
L55:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L70
  lea    -0x20(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
  nopl   0x0(%rax)
L34:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L29
L70:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
countsort(int a[], int n, int exp) {
  int output[n], i;
  int count[10] = {0};
  for (i = 0; i < n; i++) {
    count[((a[i] / exp) % 10)]++;
  }
  for (i = 1; i < 10; i++) {
    count[i] = count[i] + count[i - 1];
  }
  for (i = n - 1; i >= 0; i--) {
    output[count[((a[i] / exp) % 10)] - 1] = a[i];
    count[((a[i] / exp) % 10)]--;
  }
  for (i = 0; i < n; i++) {
    a[i] = output[i];
  }
}
```