user: Converte this assembly snippet into its equivalent C code:

```asm
<count_4>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xa0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x84(%rbp)
  mov    -0x84(%rbp),%eax
  mov    %eax,-0x88(%rbp)
  mov    -0x88(%rbp),%eax
  mov    %eax,-0x8c(%rbp)
  mov    -0x8c(%rbp),%eax
  mov    %eax,-0x94(%rbp)
  lea    -0x80(%rbp),%rdx
  mov    $0x0,%eax
  mov    $0xd,%ecx
  mov    %rdx,%rdi
  rep stos %rax,%es:(%rdi)
  mov    %rdi,%rdx
  mov    %eax,(%rdx)
  add    $0x4,%rdx
  movl   $0x0,-0x90(%rbp)
  jmp    L98
L209:
  cmpl   $0x40,-0x98(%rbp)
  jle    L61
  cmpl   $0x7a,-0x98(%rbp)
  jg     L61
  mov    -0x98(%rbp),%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,-0x98(%rbp)
  mov    -0x98(%rbp),%eax
  sub    $0x41,%eax
  movslq %eax,%rdx
  mov    -0x80(%rbp,%rdx,4),%edx
  add    $0x1,%edx
  cltq
  mov    %edx,-0x80(%rbp,%rax,4)
  addl   $0x1,-0x8c(%rbp)
  movl   $0x1,-0x90(%rbp)
  jmp    L140
L61:
  cmpl   $0x2f,-0x98(%rbp)
  jle    L146
  cmpl   $0x39,-0x98(%rbp)
  jg     L146
  addl   $0x1,-0x88(%rbp)
  movl   $0x1,-0x90(%rbp)
  jmp    L140
L146:
  cmpl   $0x20,-0x98(%rbp)
  je     L11
  cmpl   $0x9,-0x98(%rbp)
  je     L11
  cmpl   $0xa,-0x98(%rbp)
  jne    L140
L11:
  movl   $0x0,-0x90(%rbp)
L140:
  cmpl   $0x0,-0x90(%rbp)
  jne    L98
  addl   $0x1,-0x84(%rbp)
  movl   $0x1,-0x90(%rbp)
L98:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,-0x98(%rbp)
  cmpl   $0x7e,-0x98(%rbp)
  jne    L209
  mov    -0x88(%rbp),%ecx
  mov    -0x8c(%rbp),%edx
  mov    -0x84(%rbp),%eax
  mov    %eax,%esi
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x9c(%rbp)
  jmp    L16
L255:
  mov    -0x9c(%rbp),%eax
  cltq
  mov    -0x80(%rbp,%rax,4),%eax
  cmp    %eax,-0x94(%rbp)
  jge    L13
  mov    -0x9c(%rbp),%eax
  cltq
  mov    -0x80(%rbp,%rax,4),%eax
  mov    %eax,-0x94(%rbp)
L13:
  addl   $0x1,-0x9c(%rbp)
L16:
  cmpl   $0x19,-0x9c(%rbp)
  jle    L255
  mov    -0x94(%rbp),%eax
  mov    %eax,-0x9c(%rbp)
  jmp    L195
L217:
  mov    -0x9c(%rbp),%eax
  mov    %eax,%esi
  lea    D63(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L29
L57:
  nop
  mov    -0x9c(%rbp),%eax
  cmp    -0x94(%rbp),%eax
  jle    L217
L29:
  movl   $0x0,-0x98(%rbp)
  jmp    L251
L232:
  mov    -0x98(%rbp),%eax
  cltq
  mov    -0x80(%rbp,%rax,4),%eax
  cmp    %eax,-0x9c(%rbp)
  jg     L171
  lea    D57(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L134
L171:
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L134:
  addl   $0x1,-0x98(%rbp)
L251:
  cmpl   $0x19,-0x98(%rbp)
  jle    L232
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  subl   $0x1,-0x9c(%rbp)
L195:
  cmpl   $0x0,-0x9c(%rbp)
  jns    L57
  lea    D46(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x41,-0x9c(%rbp)
  jmp    L245
L4:
  mov    -0x9c(%rbp),%eax
  mov    %eax,%esi
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x9c(%rbp)
L245:
  cmpl   $0x5a,-0x9c(%rbp)
  jle    L4
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L105
  call   <__stack_chk_fail@plt>
L105:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D31
type: string
name: disassemble_data
arguments: data_tag: D63
type: string
name: disassemble_data
arguments: data_tag: D57
type: string
name: disassemble_data
arguments: data_tag: D2
type: string
name: disassemble_data
arguments: data_tag: D7
type: string
name: disassemble_data
arguments: data_tag: D46
type: string
name: disassemble_data
arguments: data_tag: D36
type: string

tool: D31: So you had %d words with %d letters and %d numbers




tool: D63: Times x %d|

tool: D57:  * 

tool: D2:    

tool: D7: ----------------------------------------------------------------------------------------

tool: D46:   Letter |

tool: D36:  %c 

assistant: ```c
void count_4(void) {
  int x, c, nr_maxim, state, lit, nre, words;
  nr_maxim = lit = nre = words = 0;
  int litere[27] = {0};
  state = 0;
  while ((c = getchar()) != '~') {
    if (c >= 'A' && c <= 'z') {
      c = toupper(c);
      litere[c - 'A']++;
      lit++;
      state = 1;
    } else if (c >= '0' && c <= '9') {
      nre++;
      state = 1;
    } else if (c == ' ' || c == '\t' || c == '\n')
      state = 0;
    if (state == 0) {
      words++;
      state = 1;
    }
  }
  printf("So you had %d words with %d letters and %d numbers\n\n\n", words, lit, nre);
  for (x = 0; x < 26; x++) {
    if (nr_maxim < litere[x]) {
      nr_maxim = litere[x];
    }
  }
  for (x = nr_maxim; x >= 0; x--) {
    while (x <= nr_maxim) {
      printf("Times x %d|", x);
      break;
    }
    for (c = 0; c < 26; c++) {
      if (litere[c] >= x)
        printf(" * ");
      else
        printf("   ");
    }
    putchar('\n');
    puts("----------------------------------------------------------------------------------------");
  }
  printf("  Letter |");
  for (x = 65; x < 91; x++)
    printf(" %c ", x);
}
```