user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<cntsrtna>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  lea    0x0(,%rcx,4),%r13d
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  lea    0x0(,%rbx,4),%r14d
  sub    $0x48,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %r13d,%edi
  mov    %esi,0x4(%rsp)
  call   <malloc@plt>
  mov    %r13d,%edi
  mov    %rax,%rbp
  call   <malloc@plt>
  mov    %r14d,%edi
  mov    %rax,%r13
  call   <malloc@plt>
  mov    %r14d,%edi
  mov    %rax,%r15
  call   <malloc@plt>
  mov    %r14d,%edi
  mov    %rax,0x8(%rsp)
  call   <malloc@plt>
  mov    0x10(%rsp),%r8
  mov    %rax,0x28(%rsp)
  mov    %rax,%rdx
  xor    %eax,%eax
  test   %ebx,%ebx
  jle    L110
  nopl   0x0(%rax)
L52:
  mov    %eax,(%rdx)
  add    $0x1,%eax
  add    $0x4,%rdx
  cmp    %eax,%ebx
  jne    L52
L110:
  subl   $0x1,0x4(%rsp)
  js     L84
  lea    -0x1(%r12),%eax
  mov    0x28(%rsp),%rcx
  mov    0x4(%rsp),%r14d
  mov    %rbp,%rdi
  lea    0x4(,%rax,4),%rax
  mov    %rax,0x30(%rsp)
  mov    %rcx,%r10
  lea    -0x1(%rbx),%eax
  sub    0x8(%rsp),%r10
  imul   %ebx,%r14d
  lea    0x4(%rcx,%rax,4),%rax
  sub    %r15,%rcx
  mov    %rax,0x38(%rsp)
  mov    %rcx,%r9
  lea    -0x4(%rbp),%rcx
  mov    %r8,%rbp
  sub    %r13,%rcx
L4:
  test   %r12d,%r12d
  jle    L17
  mov    0x30(%rsp),%rdx
  xor    %esi,%esi
  mov    %rcx,0x20(%rsp)
  mov    %r9,0x18(%rsp)
  mov    %r10,0x10(%rsp)
  call   <memset@plt>
  mov    0x20(%rsp),%rcx
  mov    0x18(%rsp),%r9
  mov    0x10(%rsp),%r10
  mov    %rax,%rdi
L17:
  test   %ebx,%ebx
  jle    L74
  mov    0x28(%rsp),%rax
  mov    0x8(%rsp),%rsi
  mov    0x38(%rsp),%r8
  mov    %rax,%rdx
  sub    %rax,%rsi
  nop
L26:
  mov    (%rdx),%eax
  add    %r14d,%eax
  cltq
  movslq 0x0(%rbp,%rax,4),%rax
  mov    %eax,(%rsi,%rdx,1)
  add    $0x4,%rdx
  addl   $0x1,(%rdi,%rax,4)
  cmp    %rdx,%r8
  jne    L26
  movl   $0x0,0x0(%r13)
  cmp    $0x1,%r12d
  jle    L68
L10:
  lea    0x4(%r13),%rax
  xor    %esi,%esi
  mov    $0x1,%edx
  jmp    L106
  nopw   0x0(%rax,%rax,1)
L98:
  add    $0x4,%rax
L106:
  add    (%rcx,%rax,1),%esi
  add    $0x1,%edx
  mov    %esi,(%rax)
  cmp    %edx,%r12d
  jg     L98
  test   %ebx,%ebx
  jle    L90
L68:
  mov    0x8(%rsp),%rdx
  xor    %esi,%esi
  nopl   0x0(%rax)
L43:
  movslq (%rdx),%rax
  add    $0x1,%esi
  lea    0x0(%r13,%rax,4),%r8
  movslq (%r8),%rax
  lea    0x1(%rax),%r11d
  mov    %r11d,(%r8)
  mov    (%r10,%rdx,1),%r8d
  add    $0x4,%rdx
  mov    %r8d,(%r15,%rax,4)
  cmp    %esi,%ebx
  jg     L43
  mov    %r15,%rax
  xor    %edx,%edx
  nopw   0x0(%rax,%rax,1)
L20:
  mov    (%rax),%esi
  add    $0x1,%edx
  mov    %esi,(%r9,%rax,1)
  add    $0x4,%rax
  cmp    %edx,%ebx
  jg     L20
L90:
  subl   $0x1,0x4(%rsp)
  mov    0x4(%rsp),%eax
  sub    %ebx,%r14d
  cmp    $0xffffffff,%eax
  jne    L4
  mov    %rdi,%rbp
L84:
  mov    %r15,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rax
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L74:
  movl   $0x0,0x0(%r13)
  cmp    $0x1,%r12d
  jg     L10
  jmp    L90
```

assistant: ```c
unsigned int *cntsrtna(unsigned int *sx, int k, int r, int na) {
  int *sxc = (int *)malloc(na * sizeof(int));
  int *bc = (int *)malloc(na * sizeof(int));
  int *sxl = (int *)malloc(r * sizeof(int));
  int *cc = (int *)malloc(r * sizeof(int));
  int *regroup = (int *)malloc(r * sizeof(int));
  int i, j;
  for (i = 0; i < r; ++i)
    regroup[i] = i;
  for (j = k - 1; j >= 0; --j) {
    for (i = 0; i < na; ++i)
      sxc[i] = 0;
    for (i = 0; i < r; ++i) {
      cc[i] = sx[regroup[i] + j * r];
      sxc[cc[i]]++;
    }
    bc[0] = 0;
    for (i = 1; i < na; ++i)
      bc[i] = bc[i - 1] + sxc[i - 1];
    for (i = 0; i < r; ++i)
      sxl[bc[cc[i]]++] = regroup[i];
    for (i = 0; i < r; ++i) {
      regroup[i] = sxl[i];
    }
  }
  free(sxl);
  free(bc);
  free(sxc);
  free(cc);
  return regroup;
}
```