user: Please show me the C implementation that matches the assembly code listed below:

```asm
<fullcountingsort>:
  endbr64
  push   %r15
  lea    D19(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%rsi
  call   <scanf@plt>
  mov    0x20(%rsp),%r8d
  mov    $0x194,%edi
  mov    %r8d,%eax
  mov    %r8d,0x8(%rsp)
  shr    $0x1f,%eax
  add    %r8d,%eax
  sar    %eax
  mov    %eax,0x1c(%rsp)
  call   <malloc@plt>
  movslq 0x8(%rsp),%r14
  mov    %rax,%rbp
  lea    0x0(,%r14,4),%r15
  shl    $0x3,%r14
  mov    %r15,%rdi
  call   <malloc@plt>
  mov    %r14,%rdi
  mov    %rax,%r12
  call   <malloc@plt>
  mov    %r14,%rdi
  mov    %rax,%r13
  call   <malloc@plt>
  movslq 0x8(%rsp),%r8
  mov    %rax,%r14
  test   %r8d,%r8d
  jle    L11
  mov    %r15,%rdx
  xor    %esi,%esi
  mov    %rbp,%rdi
  call   <memset@plt>
  movslq 0x8(%rsp),%r8
  cmp    $0x1,%r8d
  jle    L11
  xor    %ecx,%ecx
  lea    0x24(%rsp),%r15
  lea    D38(%rip),%rbx
  nop
L93:
  mov    $0xb,%edi
  mov    %rcx,0x10(%rsp)
  call   <malloc@plt>
  mov    %r15,%rsi
  mov    %rbx,%rdi
  mov    %rax,%rdx
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x8(%rsp),%rdx
  mov    $0x2d,%eax
  mov    0x10(%rsp),%rcx
  mov    %ax,(%rdx)
  movslq 0x24(%rsp),%rax
  mov    %rdx,0x0(%r13,%rcx,8)
  mov    %eax,(%r12,%rcx,4)
  add    $0x1,%rcx
  addl   $0x1,0x4(%rbp,%rax,4)
  cmp    %ecx,0x1c(%rsp)
  jg     L93
  movslq 0x20(%rsp),%r8
L11:
  mov    0x1c(%rsp),%eax
  cmp    %r8d,%eax
  jge    L10
  movslq %eax,%rcx
  lea    0x24(%rsp),%r15
  lea    D38(%rip),%rbx
L30:
  mov    $0xb,%edi
  mov    %rcx,0x10(%rsp)
  call   <malloc@plt>
  mov    %r15,%rsi
  mov    %rbx,%rdi
  mov    %rax,%rdx
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x10(%rsp),%rcx
  movslq 0x24(%rsp),%rax
  mov    0x8(%rsp),%rdx
  movslq 0x20(%rsp),%r8
  mov    %eax,(%r12,%rcx,4)
  mov    %rdx,0x0(%r13,%rcx,8)
  add    $0x1,%rcx
  addl   $0x1,0x4(%rbp,%rax,4)
  cmp    %ecx,%r8d
  jg     L30
L10:
  mov    0x0(%rbp),%edx
  lea    0x4(%rbp),%rax
  lea    0x194(%rbp),%rcx
  nopl   (%rax)
L43:
  add    (%rax),%edx
  add    $0x4,%rax
  mov    %edx,-0x4(%rax)
  cmp    %rcx,%rax
  jne    L43
  test   %r8d,%r8d
  jle    L19
  xor    %eax,%eax
  nopl   (%rax)
L99:
  movslq (%r12,%rax,4),%rdx
  mov    0x0(%r13,%rax,8),%rdi
  add    $0x1,%rax
  lea    0x0(%rbp,%rdx,4),%rcx
  movslq (%rcx),%rsi
  mov    %rsi,%rdx
  mov    %rdi,(%r14,%rsi,8)
  add    $0x1,%edx
  mov    %edx,(%rcx)
  cmp    %r8,%rax
  jne    L99
  xor    %ebx,%ebx
L98:
  mov    (%r14,%rbx,8),%r15
  lea    D21(%rip),%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  mov    %r15,%rsi
  call   <printf@plt>
  mov    %r15,%rdi
  call   <free@plt>
  cmp    %ebx,0x20(%rsp)
  jg     L98
L19:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L73
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L73:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D19
type: string
name: retrieve_data
arguments: tag: D38
type: string
name: retrieve_data
arguments: tag: D21
type: string

tool: D19: %d

tool: D38: %d %s

tool: D21: %s 

assistant: ```c
int fullcountingsort(void) {
  int inputLines;
  int rank;
  char *str;
  int *ranks;
  char **strings;
  int *rankCounts;
  char **outStrings;
  scanf("%d", &inputLines);
  int numRemovedStrings = inputLines / 2;
  rankCounts = malloc(sizeof(int) * (100 + 1));
  ranks = malloc(sizeof(int) * inputLines);
  strings = malloc(sizeof(char *) * inputLines);
  outStrings = malloc(sizeof(char *) * inputLines);
  for (int i = 0; i < inputLines; i++) {
    rankCounts[i] = 0;
  }
  for (int i = 0; i < numRemovedStrings; i++) {
    str = malloc(sizeof(char) * 11);
    scanf("%d %s", &rank, str);
    str[0] = '-';
    str[1] = '\0';
    ranks[i] = rank;
    strings[i] = str;
    rankCounts[rank + 1]++;
  }
  for (int i = numRemovedStrings; i < inputLines; i++) {
    str = malloc(sizeof(char) * 11);
    scanf("%d %s", &rank, str);
    ranks[i] = rank;
    strings[i] = str;
    rankCounts[rank + 1]++;
  }
  for (int i = 1; i <= 100; i++) {
    rankCounts[i] += rankCounts[i - 1];
  }
  for (int i = 0; i < inputLines; i++) {
    int rank = ranks[i];
    int sortedIndex = rankCounts[rank];
    outStrings[sortedIndex] = strings[i];
    rankCounts[rank]++;
  }
  for (int i = 0; i < inputLines; i++) {
    str = outStrings[i];
    printf("%s ", str);
    free(str);
  }
  free(rankCounts);
  free(ranks);
  free(strings);
  free(outStrings);
  return 0;
}
```