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

```asm
<main>:
  endbr64
  push   %r15
  lea    D82(%rip),%r15
  push   %r14
  push   %r13
  mov    %rsi,%r13
  mov    %r15,%rsi
  push   %r12
  mov    %edi,%r12d
  lea    D111(%rip),%rdi
  push   %rbp
  push   %rbx
  sub    $0x2a8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x298(%rsp)
  xor    %eax,%eax
  lea    0x30(%rsp),%rbx
  call   <fopen@plt>
  mov    %r15,%rsi
  lea    D19(%rip),%rdi
  mov    %rax,%rbp
  call   <fopen@plt>
  mov    %r15,%rsi
  lea    D73(%rip),%rdi
  mov    %rax,%r14
  call   <fopen@plt>
  lea    D69(%rip),%rdi
  mov    %r15,%rsi
  mov    %rax,0x18(%rsp)
  call   <fopen@plt>
  mov    $0x3f,%ecx
  mov    %rbx,%rdi
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  rep stos %rax,%es:(%rdi)
  movl   $0x0,(%rdi)
  cmp    $0x1,%r12d
  jle    L126
  mov    0x8(%r13),%rdi
  lea    D72(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,0x10(%rsp)
  test   %rax,%rax
  je     L160
L132:
  movl   $0x0,0x24(%rsp)
  xor    %r12d,%r12d
  lea    0x230(%rsp),%r13
  movl   $0x0,0x20(%rsp)
  movl   $0x0,0xc(%rsp)
  nopl   0x0(%rax)
L112:
  mov    0x10(%rsp),%rdx
  mov    $0x64,%esi
  mov    %r13,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L115
  movsbq 0x230(%rsp),%rax
  mov    %r13,%r15
  test   %al,%al
  jne    L17
  jmp    L112
  nopl   (%rax)
L31:
  movsbq 0x1(%r15),%rax
  add    $0x1,%r15
  test   %al,%al
  je     L112
L17:
  test   %al,%al
  js     L31
  movsbl %al,%edi
  addl   $0x1,0x30(%rsp,%rax,4)
  call   <is_vowel@plt>
  movsbl (%r15),%edi
  test   %rax,%rax
  je     L180
  mov    %r14,%rsi
  add    $0x1,%r12d
  call   <fputc@plt>
  jmp    L31
  nopl   (%rax)
L180:
  call   <is_space@plt>
  test   %rax,%rax
  je     L193
  addl   $0x1,0xc(%rsp)
  jmp    L31
  nopl   0x0(%rax)
L193:
  movsbl (%r15),%edi
  call   <is_consonant@plt>
  movsbl (%r15),%edi
  test   %rax,%rax
  je     L121
  mov    0x18(%rsp),%rsi
  call   <fputc@plt>
  addl   $0x1,0x20(%rsp)
  jmp    L31
  nopl   0x0(%rax,%rax,1)
L121:
  call   <is_digit@plt>
  test   %rax,%rax
  je     L31
  movsbl (%r15),%edi
  mov    0x28(%rsp),%rsi
  call   <fputc@plt>
  addl   $0x1,0x24(%rsp)
  jmp    L31
L115:
  lea    D55(%rip),%rdi
  mov    $0x21,%r13d
  call   <puts@plt>
  mov    0x24(%rsp),%eax
  sub    $0x8,%rsp
  mov    %r12d,%ecx
  mov    0x14(%rsp),%r8d
  mov    0x28(%rsp),%r9d
  lea    D86(%rip),%rsi
  mov    %rbp,%rdi
  push   %rax
  lea    (%r12,%r8,1),%edx
  lea    D10(%rip),%r12
  add    %r9d,%edx
  add    %eax,%edx
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    $0x2b,%edx
  mov    %rbp,%rcx
  mov    $0x1,%esi
  lea    D71(%rip),%rdi
  call   <fwrite@plt>
  pop    %rax
  pop    %rdx
  nopw   0x0(%rax,%rax,1)
L7:
  mov    (%rbx,%r13,4),%ecx
  mov    %r13d,%edx
  test   %ecx,%ecx
  jle    L82
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
L82:
  add    $0x1,%r13
  cmp    $0x7f,%r13
  jne    L7
  mov    0x10(%rsp),%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %r14,%rdi
  call   <fclose@plt>
  mov    0x18(%rsp),%rdi
  call   <fclose@plt>
  mov    0x28(%rsp),%rdi
  call   <fclose@plt>
  xor    %eax,%eax
L9:
  mov    0x298(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L178
  add    $0x2a8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L126:
  lea    D72(%rip),%rsi
  lea    D87(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,0x10(%rsp)
  jmp    L132
L178:
  call   <__stack_chk_fail@plt>
L160:
  or     $0xffffffff,%eax
  jmp    L9
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D82
datatype: string
name: extract_symbolic_data
arguments: data_label: D111
datatype: string
name: extract_symbolic_data
arguments: data_label: D19
datatype: string
name: extract_symbolic_data
arguments: data_label: D73
datatype: string
name: extract_symbolic_data
arguments: data_label: D69
datatype: string
name: extract_symbolic_data
arguments: data_label: D72
datatype: string
name: extract_symbolic_data
arguments: data_label: D55
datatype: string
name: extract_symbolic_data
arguments: data_label: D86
datatype: string
name: extract_symbolic_data
arguments: data_label: D10
datatype: string
name: extract_symbolic_data
arguments: data_label: D71
datatype: string
name: extract_symbolic_data
arguments: data_label: D87
datatype: string

tool: D82: w

tool: D111: riepilogo.txt

tool: D19: vocali.txt

tool: D73: consonanti.txt

tool: D69: cifre.txt

tool: D72: r

tool: D55: foo

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



tool: D10: %c -> %i


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


tool: D87: input.txt

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;
}
```