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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x2d0,%rsp
  mov    %edi,-0x2c4(%rbp)
  mov    %rsi,-0x2d0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D61(%rip),%rax
  mov    %rax,%rsi
  lea    D55(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x298(%rbp)
  lea    D61(%rip),%rax
  mov    %rax,%rsi
  lea    D76(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x290(%rbp)
  lea    D61(%rip),%rax
  mov    %rax,%rsi
  lea    D56(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x288(%rbp)
  lea    D61(%rip),%rax
  mov    %rax,%rsi
  lea    D68(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x280(%rbp)
  movl   $0x0,-0x2b0(%rbp)
  movl   $0x0,-0x2ac(%rbp)
  movl   $0x0,-0x2a8(%rbp)
  movl   $0x0,-0x2a4(%rbp)
  movl   $0x0,-0x2b4(%rbp)
  jmp    L171
L133:
  mov    -0x2b4(%rbp),%eax
  cltq
  movl   $0x0,-0x270(%rbp,%rax,4)
  addl   $0x1,-0x2b4(%rbp)
L171:
  cmpl   $0x7e,-0x2b4(%rbp)
  jle    L133
  cmpl   $0x1,-0x2c4(%rbp)
  jle    L88
  mov    -0x2d0(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    %rax,-0x278(%rbp)
  mov    -0x278(%rbp),%rax
  lea    D36(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x2a0(%rbp)
  cmpq   $0x0,-0x2a0(%rbp)
  jne    L39
  mov    $0xffffffff,%eax
  jmp    L169
L88:
  lea    D36(%rip),%rax
  mov    %rax,%rsi
  lea    D148(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x2a0(%rbp)
  jmp    L39
L119:
  movl   $0x0,-0x2b4(%rbp)
  jmp    L9
L110:
  mov    -0x2b4(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  test   %al,%al
  js     L156
  mov    -0x2b4(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  movzbl %al,%eax
  movslq %eax,%rdx
  mov    -0x270(%rbp,%rdx,4),%edx
  add    $0x1,%edx
  cltq
  mov    %edx,-0x270(%rbp,%rax,4)
  mov    -0x2b4(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <is_vowel@plt>
  test   %rax,%rax
  je     L159
  mov    -0x2b4(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    -0x290(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <fputc@plt>
  addl   $0x1,-0x2b0(%rbp)
  jmp    L156
L159:
  mov    -0x2b4(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <is_space@plt>
  test   %rax,%rax
  je     L11
  addl   $0x1,-0x2ac(%rbp)
  jmp    L156
L11:
  mov    -0x2b4(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <is_consonant@plt>
  test   %rax,%rax
  je     L40
  mov    -0x2b4(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    -0x288(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <fputc@plt>
  addl   $0x1,-0x2a8(%rbp)
  jmp    L156
L40:
  mov    -0x2b4(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <is_digit@plt>
  test   %rax,%rax
  je     L156
  mov    -0x2b4(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    -0x280(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <fputc@plt>
  addl   $0x1,-0x2a4(%rbp)
L156:
  addl   $0x1,-0x2b4(%rbp)
L9:
  mov    -0x2b4(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  test   %al,%al
  jne    L110
L39:
  mov    -0x2a0(%rbp),%rdx
  lea    -0x70(%rbp),%rax
  mov    $0x64,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L119
  lea    D97(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x2b0(%rbp),%edx
  mov    -0x2ac(%rbp),%eax
  add    %eax,%edx
  mov    -0x2a8(%rbp),%eax
  add    %eax,%edx
  mov    -0x2a4(%rbp),%eax
  lea    (%rdx,%rax,1),%esi
  mov    -0x2a8(%rbp),%r8d
  mov    -0x2ac(%rbp),%edi
  mov    -0x2b0(%rbp),%edx
  mov    -0x298(%rbp),%rax
  sub    $0x8,%rsp
  mov    -0x2a4(%rbp),%ecx
  push   %rcx
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %edx,%ecx
  mov    %esi,%edx
  lea    D124(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  add    $0x10,%rsp
  mov    -0x298(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x2b,%edx
  mov    $0x1,%esi
  lea    D79(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  movl   $0x21,-0x2b4(%rbp)
  jmp    L166
L5:
  mov    -0x2b4(%rbp),%eax
  cltq
  mov    -0x270(%rbp,%rax,4),%eax
  test   %eax,%eax
  jle    L178
  mov    -0x2b4(%rbp),%eax
  cltq
  mov    -0x270(%rbp,%rax,4),%ecx
  mov    -0x2b4(%rbp),%eax
  movsbl %al,%edx
  mov    -0x298(%rbp),%rax
  lea    D121(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
L178:
  addl   $0x1,-0x2b4(%rbp)
L166:
  cmpl   $0x7e,-0x2b4(%rbp)
  jle    L5
  mov    -0x2a0(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x298(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x290(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x288(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x280(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
L169:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L10
  call   <__stack_chk_fail@plt>
L10:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D61
datatype: string
name: parse_data
arguments: data_tag: D55
datatype: string
name: parse_data
arguments: data_tag: D76
datatype: string
name: parse_data
arguments: data_tag: D56
datatype: string
name: parse_data
arguments: data_tag: D68
datatype: string
name: parse_data
arguments: data_tag: D36
datatype: string
name: parse_data
arguments: data_tag: D148
datatype: string
name: parse_data
arguments: data_tag: D97
datatype: string
name: parse_data
arguments: data_tag: D124
datatype: string
name: parse_data
arguments: data_tag: D79
datatype: string
name: parse_data
arguments: data_tag: D121
datatype: string

tool: D61: w

tool: D55: riepilogo.txt

tool: D76: vocali.txt

tool: D56: consonanti.txt

tool: D68: cifre.txt

tool: D36: r

tool: D148: input.txt

tool: D97: foo

tool: D124: Totale: %i
Vocali: %i
Spazi: %i
Consonanti: %i
Cifre: %d



tool: D79: Conteggio dei caratteri (simboli inclusi):


tool: D121: %c -> %i


assistant: ```c
int main(int argc, char *argv[]) {
  FILE *input;
  FILE *o_summary = fopen("riepilogo.txt", "w");
  FILE *o_vowels = fopen("vocali.txt", "w");
  FILE *o_consonants = fopen("consonanti.txt", "w");
  FILE *o_digits = fopen("cifre.txt", "w");
  char line[100];
  char *filename;
  int ascii[128];
  int i;
  int n_vowels = 0;
  int n_spaces = 0;
  int n_consonants = 0;
  int n_digits = 0;
  for (i = 0; i < 127; i++) {
    ascii[i] = 0;
  }
  if (argc > 1) {
    filename = argv[1];
    input = fopen(filename, "r");
    if (!input)
      return -1;
  } else {
    input = fopen("input.txt", "r");
  }
  while (fgets(line, 100, input)) {
    i = 0;
    while (line[i] != '\0') {
      if ((unsigned char)line[i] <= 127) {
        ascii[(unsigned char)line[i]]++;
        if (is_vowel(line[i])) {
          fprintf(o_vowels, "%c", line[i]);
          n_vowels++;
        } else if (is_space(line[i])) {
          n_spaces++;
        } else if (is_consonant(line[i])) {
          fprintf(o_consonants, "%c", line[i]);
          n_consonants++;
        } else if (is_digit(line[i])) {
          fprintf(o_digits, "%c", line[i]);
          n_digits++;
        }
      }
      i++;
    }
  }
  puts("foo");
  fprintf(o_summary, "Totale: %i\nVocali: %i\nSpazi: %i\nConsonanti: %i\nCifre: %d\n\n", n_vowels + n_spaces + n_consonants + n_digits, n_vowels, n_spaces, n_consonants, n_digits);
  fprintf(o_summary, "Conteggio dei caratteri (simboli inclusi):\n");
  for (i = 33; i < 127; i++) {
    if (ascii[i] > 0)
      fprintf(o_summary, "%c -> %i\n", (char)i, ascii[i]);
  }
  fclose(input);
  fclose(o_summary);
  fclose(o_vowels);
  fclose(o_consonants);
  fclose(o_digits);
  return 0;
}
```