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

```asm
<CountSort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %esi,-0x6c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rsi
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x60(%rbp)
  movl   $0x0,-0x5c(%rbp)
  jmp    L106
L107:
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x60(%rbp),%edx
  cmp    %eax,%edx
  cmovge %edx,%eax
  mov    %eax,-0x60(%rbp)
  addl   $0x1,-0x5c(%rbp)
L106:
  mov    -0x5c(%rbp),%eax
  cmp    -0x6c(%rbp),%eax
  jl     L107
  mov    -0x60(%rbp),%eax
  add    $0x1,%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x48(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  movslq %eax,%rdx
  mov    %rdx,%rcx
  mov    $0x0,%ebx
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%ebx
  mov    $0x0,%edx
  div    %rbx
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L86:
  cmp    %rdx,%rsp
  je     L104
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L86
L104:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L22
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L22:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x40(%rbp)
  movl   $0x0,-0x58(%rbp)
  jmp    L99
L4:
  mov    -0x40(%rbp),%rax
  mov    -0x58(%rbp),%edx
  movslq %edx,%rdx
  movl   $0x0,(%rax,%rdx,4)
  addl   $0x1,-0x58(%rbp)
L99:
  mov    -0x60(%rbp),%eax
  cmp    -0x58(%rbp),%eax
  jge    L4
  movl   $0x0,-0x54(%rbp)
  jmp    L90
L127:
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x40(%rbp),%rdx
  movslq %eax,%rcx
  mov    (%rdx,%rcx,4),%edx
  lea    0x1(%rdx),%ecx
  mov    -0x40(%rbp),%rdx
  cltq
  mov    %ecx,(%rdx,%rax,4)
  addl   $0x1,-0x54(%rbp)
L90:
  mov    -0x54(%rbp),%eax
  cmp    -0x6c(%rbp),%eax
  jl     L127
  mov    -0x60(%rbp),%eax
  add    $0x1,%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x38(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  movslq %eax,%rdx
  mov    %rdx,%r8
  mov    $0x0,%r9d
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L0:
  cmp    %rdx,%rsp
  je     L158
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L0
L158:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L98
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L98:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,(%rax)
  movl   $0x1,-0x50(%rbp)
  jmp    L50
L109:
  mov    -0x50(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x30(%rbp),%rax
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%ecx
  mov    -0x40(%rbp),%rax
  mov    -0x50(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  add    %eax,%ecx
  mov    -0x30(%rbp),%rax
  mov    -0x50(%rbp),%edx
  movslq %edx,%rdx
  mov    %ecx,(%rax,%rdx,4)
  addl   $0x1,-0x50(%rbp)
L50:
  mov    -0x60(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jge    L109
  mov    -0x60(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
  jmp    L179
L39:
  mov    -0x30(%rbp),%rax
  mov    -0x4c(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x68(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x30(%rbp),%rax
  mov    -0x4c(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  lea    -0x1(%rax),%ecx
  mov    -0x30(%rbp),%rax
  mov    -0x4c(%rbp),%edx
  movslq %edx,%rdx
  mov    %ecx,(%rax,%rdx,4)
L110:
  mov    -0x30(%rbp),%rax
  mov    -0x4c(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  test   %eax,%eax
  jne    L39
  subl   $0x1,-0x4c(%rbp)
L179:
  cmpl   $0x0,-0x4c(%rbp)
  jns    L110
  mov    %rsi,%rsp
  nop
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L66
  call   <__stack_chk_fail@plt>
L66:
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
```

assistant: ```c
void CountSort(int *A, int n) {
  int maxValue = A[0];
  for (int i = 0; i < n; i++)
    maxValue = (maxValue > A[i]) ? (maxValue) : A[i];
  int B[maxValue + 1];
  for (int i = 0; i < maxValue + 1; i++)
    B[i] = 0;
  for (int i = 0; i < n; i++)
    B[A[i]]++;
  int C[maxValue + 1];
  C[0] = B[0];
  for (int i = 1; i < maxValue + 1; i++)
    C[i] = C[i - 1] + B[i];
  for (int i = maxValue; i >= 0; i--) {
    while (C[i]) {
      A[C[i] - 1] = i;
      C[i]--;
    }
  }
}
```