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

```asm
<test_sort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D16(%rip),%rax
  mov    %rax,-0x68(%rbp)
  lea    D21(%rip),%rax
  mov    %rax,-0x50(%rbp)
  lea    D18(%rip),%rax
  mov    %rax,-0x48(%rbp)
  lea    D68(%rip),%rax
  mov    %rax,-0x40(%rbp)
  lea    D74(%rip),%rax
  mov    %rax,-0x30(%rbp)
  lea    D41(%rip),%rax
  mov    %rax,-0x28(%rbp)
  lea    D29(%rip),%rax
  mov    %rax,-0x20(%rbp)
  lea    D18(%rip),%rax
  mov    %rax,-0x18(%rbp)
  lea    -0x60(%rbp),%rdx
  lea    -0x70(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <array_sort@plt>
  lea    -0x60(%rbp),%rdx
  lea    -0x68(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <array_sort@plt>
  mov    -0x68(%rbp),%rax
  lea    D16(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <str_cmp@plt>
  test   %rax,%rax
  je     L37
  mov    $0x49,%edi
  call   <fail_test@plt>
L37:
  mov    -0x60(%rbp),%eax
  test   %eax,%eax
  je     L92
  mov    $0x4b,%edi
  call   <fail_test@plt>
L92:
  lea    -0x60(%rbp),%rdx
  lea    -0x50(%rbp),%rax
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <array_sort@plt>
  mov    -0x50(%rbp),%rax
  lea    D18(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <str_cmp@plt>
  test   %rax,%rax
  je     L151
  mov    $0x4f,%edi
  call   <fail_test@plt>
L151:
  mov    -0x48(%rbp),%rax
  lea    D21(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <str_cmp@plt>
  test   %rax,%rax
  je     L48
  mov    $0x51,%edi
  call   <fail_test@plt>
L48:
  mov    -0x40(%rbp),%rax
  lea    D68(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <str_cmp@plt>
  test   %rax,%rax
  je     L65
  mov    $0x53,%edi
  call   <fail_test@plt>
L65:
  mov    -0x60(%rbp),%eax
  cmp    $0x1,%eax
  jne    L158
  mov    -0x5c(%rbp),%eax
  test   %eax,%eax
  jne    L158
  mov    -0x58(%rbp),%eax
  cmp    $0x2,%eax
  je     L102
L158:
  mov    $0x59,%edi
  call   <fail_test@plt>
L102:
  lea    -0x60(%rbp),%rdx
  lea    -0x30(%rbp),%rax
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <array_sort@plt>
  mov    -0x30(%rbp),%rax
  lea    D29(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <str_cmp@plt>
  test   %rax,%rax
  je     L169
  mov    $0x5d,%edi
  call   <fail_test@plt>
L169:
  mov    -0x28(%rbp),%rax
  lea    D18(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <str_cmp@plt>
  test   %rax,%rax
  je     L6
  mov    $0x5f,%edi
  call   <fail_test@plt>
L6:
  mov    -0x20(%rbp),%rax
  lea    D74(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <str_cmp@plt>
  test   %rax,%rax
  je     L125
  mov    $0x61,%edi
  call   <fail_test@plt>
L125:
  mov    -0x18(%rbp),%rax
  lea    D41(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <str_cmp@plt>
  test   %rax,%rax
  je     L44
  mov    $0x63,%edi
  call   <fail_test@plt>
L44:
  mov    -0x60(%rbp),%eax
  cmp    $0x2,%eax
  jne    L87
  mov    -0x5c(%rbp),%eax
  cmp    $0x3,%eax
  jne    L87
  mov    -0x58(%rbp),%eax
  test   %eax,%eax
  jne    L87
  mov    -0x54(%rbp),%eax
  cmp    $0x1,%eax
  je     L100
L87:
  mov    $0x69,%edi
  call   <fail_test@plt>
L100:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L116
  call   <__stack_chk_fail@plt>
L116:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D16
data_type: string
name: read_data
arguments: label: D21
data_type: string
name: read_data
arguments: label: D18
data_type: string
name: read_data
arguments: label: D68
data_type: string
name: read_data
arguments: label: D74
data_type: string
name: read_data
arguments: label: D41
data_type: string
name: read_data
arguments: label: D29
data_type: string

tool: D16: one

tool: D21: just

tool: D18: a

tool: D68: test

tool: D74: aa

tool: D41: aaa

tool: 

assistant: ```c
void test_sort() {
  char *empty_words[] = {};
  char *one_word[] = {"one"};
  char *three_words[] = {"just", "a", "test"};
  char *four_words[] = {"aa", "aaa", "", "a"};
  int map[4];
  array_sort(empty_words, 0, map);
  array_sort(one_word, 1, map);
  if (str_cmp(one_word[0], "one") != 0)
    fail_test(73);
  ;
  if (map[0] != 0)
    fail_test(75);
  ;
  array_sort(three_words, 3, map);
  if (str_cmp(three_words[0], "a") != 0)
    fail_test(79);
  ;
  if (str_cmp(three_words[1], "just") != 0)
    fail_test(81);
  ;
  if (str_cmp(three_words[2], "test") != 0)
    fail_test(83);
  ;
  if (map[0] != 1 || map[1] != 0 || map[2] != 2)
    fail_test(89);
  ;
  array_sort(four_words, 4, map);
  if (str_cmp(four_words[0], "") != 0)
    fail_test(93);
  ;
  if (str_cmp(four_words[1], "a") != 0)
    fail_test(95);
  ;
  if (str_cmp(four_words[2], "aa") != 0)
    fail_test(97);
  ;
  if (str_cmp(four_words[3], "aaa") != 0)
    fail_test(99);
  ;
  if (map[0] != 2 || map[1] != 3 || map[2] != 0 || map[3] != 1)
    fail_test(105);
  ;
}
```