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

```asm
<count_3>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x30(%rbp)
  movq   $0x0,-0x28(%rbp)
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  movl   $0x0,-0x38(%rbp)
  mov    -0x38(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x3c(%rbp),%eax
  mov    %eax,-0x40(%rbp)
  mov    -0x40(%rbp),%eax
  mov    %eax,-0x48(%rbp)
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D45(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L86
L115:
  cmpl   $0x2f,-0x34(%rbp)
  jle    L159
  cmpl   $0x39,-0x34(%rbp)
  jg     L159
  mov    -0x34(%rbp),%eax
  sub    $0x30,%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp,%rdx,4),%edx
  add    $0x1,%edx
  cltq
  mov    %edx,-0x30(%rbp,%rax,4)
  jmp    L86
L159:
  cmpl   $0x20,-0x34(%rbp)
  je     L75
  cmpl   $0x9,-0x34(%rbp)
  je     L75
  cmpl   $0xa,-0x34(%rbp)
  jne    L136
L75:
  addl   $0x1,-0x3c(%rbp)
  jmp    L86
L136:
  addl   $0x1,-0x40(%rbp)
L86:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,-0x34(%rbp)
  cmpl   $0x7e,-0x34(%rbp)
  jne    L115
  lea    D103(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x3c(%rbp),%edx
  mov    -0x40(%rbp),%eax
  mov    %eax,%esi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D54(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x44(%rbp)
  jmp    L26
L64:
  mov    -0x44(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  cmp    %eax,-0x38(%rbp)
  jge    L205
  mov    -0x44(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  mov    %eax,-0x38(%rbp)
L205:
  addl   $0x1,-0x44(%rbp)
L26:
  cmpl   $0x9,-0x44(%rbp)
  jle    L64
  mov    -0x38(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  jmp    L210
L133:
  mov    -0x44(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%esi
  lea    D64(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L177
L62:
  nop
  mov    -0x44(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jle    L133
L177:
  movl   $0x0,-0x48(%rbp)
  jmp    L161
L202:
  mov    -0x48(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  cmp    %eax,-0x44(%rbp)
  jg     L107
  lea    D100(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L4
L107:
  lea    D88(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L4:
  addl   $0x1,-0x48(%rbp)
L161:
  cmpl   $0x9,-0x48(%rbp)
  jle    L202
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D69(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  subl   $0x1,-0x44(%rbp)
L210:
  cmpl   $0x0,-0x44(%rbp)
  jns    L62
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x44(%rbp)
  jmp    L1
L214:
  mov    -0x44(%rbp),%eax
  mov    %eax,%esi
  lea    D97(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x44(%rbp)
L1:
  cmpl   $0x9,-0x44(%rbp)
  jle    L214
  nop
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L183
  call   <__stack_chk_fail@plt>
L183:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D1
type_infered: string
name: parse_data
arguments: tag: D45
type_infered: string
name: parse_data
arguments: tag: D103
type_infered: string
name: parse_data
arguments: tag: D17
type_infered: string
name: parse_data
arguments: tag: D54
type_infered: string
name: parse_data
arguments: tag: D64
type_infered: string
name: parse_data
arguments: tag: D100
type_infered: string
name: parse_data
arguments: tag: D88
type_infered: string
name: parse_data
arguments: tag: D69
type_infered: string
name: parse_data
arguments: tag: D3
type_infered: string
name: parse_data
arguments: tag: D97
type_infered: string

tool: D1: If you've got something to say, say it!

tool: D45: Just put " ~ " when you've finished..


tool: D103: 
Finished? Ok...


tool: D17: In all you mambo-jumbo you had %d letters and %d white spaces


tool: D54: 

Also, heres a vertical histogram of how many 0-9 numbers you've said:


tool: D64: times x %d|

tool: D100:  * 

tool: D88:    

tool: D69: ----------------------------------------

tool: D3:   Number |

tool: D97:  %d 

assistant: ```c
count_3(void) {
  int nre[10] = {0};
  int i, x, c, char_nr, space_nr, nr_maxim;
  i = char_nr = space_nr = nr_maxim = 0;
  puts("If you've got something to say, say it!");
  puts("Just put \" ~ \" when you've finished..\n");
  while ((c = getchar()) != '~') {
    if (c >= '0' && c <= '9')
      nre[c - '0']++;
    else if (c == ' ' || c == '\t' || c == '\n')
      space_nr++;
    else
      char_nr++;
  }
  puts("\nFinished? Ok...\n");
  printf("In all you mambo-jumbo you had %d letters and %d white spaces\n", char_nr, space_nr);
  puts("\n\nAlso, heres a vertical histogram of how many 0-9 numbers you've said:\n");
  for (x = 0; x < 10; x++)
    if (nr_maxim < nre[x])
      nr_maxim = nre[x];
  for (x = nr_maxim; x >= 0; x--) {
    while (x <= nr_maxim) {
      printf("times x %d|", x + 1);
      break;
    }
    for (i = 0; i < 10; i++) {
      if (nre[i] >= x)
        printf(" * ");
      else
        printf("   ");
    }
    putchar('\n');
    puts("----------------------------------------");
  }
  printf("  Number |");
  for (x = 0; x < 10; x++)
    printf(" %d ", x);
}
```