user: Demonstrate the C code that generates the assembly output below:

```asm
<CountSort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %esi,%r8d
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    (%rdi),%ecx
  test   %esi,%esi
  jle    L104
  mov    %rdi,%rax
  lea    -0x1(%rsi),%edx
  lea    0x4(%rdi,%rdx,4),%rsi
L153:
  mov    (%rax),%edx
  cmp    %edx,%ecx
  cmovl  %edx,%ecx
  add    $0x4,%rax
  cmp    %rsi,%rax
  jne    L153
  lea    0x1(%rcx),%eax
  cltq
  lea    0x0(,%rax,4),%r10
  lea    0xf(%r10),%rdx
  mov    %rdx,%r9
  and    $0xfffffffffffffff0,%r9
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rsi
  sub    %rdx,%rsi
L183:
  cmp    %rsi,%rsp
  je     L266
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L183
L211:
  mov    %r8,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L52
  orq    $0x0,-0x8(%rsp,%rax,1)
L52:
  lea    0x3(%rsp),%rsi
  mov    %rsi,%rax
  shr    $0x2,%rax
  and    $0xfffffffffffffffc,%rsi
  mov    (%rdx),%r8d
  mov    %r8d,0x0(,%rax,4)
  test   %ecx,%ecx
  jle    L93
L281:
  lea    0x1(%rcx),%r9d
  mov    $0x1,%eax
L121:
  mov    (%rdx,%rax,4),%r8d
  add    -0x4(%rsi,%rax,4),%r8d
  mov    %r8d,(%rsi,%rax,4)
  add    $0x1,%rax
  cmp    %r9,%rax
  jne    L121
L133:
  movslq %ecx,%rcx
  jmp    L79
L93:
  je     L133
L83:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L224
  leave
  ret
L235:
  mov    %edx,-0x4(%rdi,%rax,4)
  sub    $0x1,%rax
  test   %eax,%eax
  jne    L235
  movl   $0x0,(%rsi,%rcx,4)
L46:
  sub    $0x1,%rcx
  test   %ecx,%ecx
  js     L83
L79:
  mov    %ecx,%edx
  mov    (%rsi,%rcx,4),%r8d
  movslq %r8d,%rax
  test   %r8d,%r8d
  jne    L235
  jmp    L46
L266:
  mov    %r9,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L244
  orq    $0x0,-0x8(%rsp,%rax,1)
L244:
  mov    %rsp,%rdx
  test   %ecx,%ecx
  js     L167
L38:
  mov    $0x0,%eax
L159:
  movl   $0x0,(%rdx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ecx
  jge    L159
  test   %r8d,%r8d
  jle    L222
L167:
  mov    $0x0,%eax
L8:
  movslq (%rdi,%rax,4),%rsi
  addl   $0x1,(%rdx,%rsi,4)
  add    $0x1,%rax
  cmp    %eax,%r8d
  jg     L8
L222:
  lea    0xf(%r10),%rax
  mov    %rax,%r8
  and    $0xfffffffffffffff0,%r8
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rsi
  sub    %rax,%rsi
L87:
  cmp    %rsi,%rsp
  je     L211
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L87
L104:
  lea    0x1(%rcx),%eax
  cltq
  lea    0x0(,%rax,4),%r10
  lea    0xf(%r10),%rdx
  mov    %rdx,%rax
  and    $0xfffffffffffffff0,%rax
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rsi
  sub    %rdx,%rsi
L293:
  cmp    %rsi,%rsp
  je     L124
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L293
L124:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L231
  orq    $0x0,-0x8(%rsp,%rdx,1)
L231:
  lea    0x3(%rsp),%rdx
  mov    %rdx,%r9
  shr    $0x2,%r9
  and    $0xfffffffffffffffc,%rdx
  test   %ecx,%ecx
  jns    L38
  lea    0xf(%r10),%rax
  mov    %rax,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%r8
  sub    %rax,%r8
L285:
  cmp    %r8,%rsp
  je     L185
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L285
L185:
  mov    %rsi,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L44
  orq    $0x0,-0x8(%rsp,%rax,1)
L44:
  lea    0x3(%rsp),%rsi
  mov    %rsi,%rax
  shr    $0x2,%rax
  and    $0xfffffffffffffffc,%rsi
  mov    0x0(,%r9,4),%r8d
  mov    %r8d,0x0(,%rax,4)
  test   %ecx,%ecx
  jg     L281
  jmp    L83
L224:
  call   <__stack_chk_fail@plt>
```

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]--;
    }
  }
}
```