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

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  lea    0x30(%rsp),%r12
  lea    0x60(%rsp),%rbx
  mov    %r12,%rbp
L25:
  mov    $0x64,%edi
  call   <malloc@plt>
  mov    %rax,0x0(%rbp)
  test   %rax,%rax
  je     L60
  add    $0x8,%rbp
  cmp    %rbx,%rbp
  jne    L25
  mov    %rbx,%r14
  lea    0x90(%rsp),%r13
  mov    %rbx,%rbp
L51:
  mov    $0x64,%edi
  call   <malloc@plt>
  mov    %rax,0x0(%rbp)
  test   %rax,%rax
  je     L60
  add    $0x8,%rbp
  cmp    %r13,%rbp
  jne    L51
  lea    D43(%rip),%rdi
  lea    0x10(%rsp),%rbp
  call   <puts@plt>
  mov    %rbp,%rdx
  lea    D24(%rip),%rdi
  push   %rax
  lea    0x2c(%rsp),%rax
  push   %rax
  push   0x68(%rsp)
  lea    0x38(%rsp),%rax
  push   %rax
  push   0x70(%rsp)
  lea    0x44(%rsp),%rax
  push   %rax
  push   0x78(%rsp)
  lea    0x50(%rsp),%rax
  push   %rax
  mov    0x80(%rsp),%r9
  mov    0x78(%rsp),%rcx
  mov    0x70(%rsp),%rsi
  lea    0x54(%rsp),%r8
  call   <scanf@plt>
  add    $0x40,%rsp
  mov    %rbp,%rdi
  mov    %r12,%rsi
  mov    $0x6,%edx
  call   <validateData@plt>
  lea    0x4(%rsp),%r9
  mov    %rbx,%rcx
  mov    %r12,%rsi
  mov    %eax,%edx
  lea    0x8(%rsp),%r8
  mov    %rbp,%rdi
  call   <findFaiures@plt>
  movsd  0x8(%rsp),%xmm0
  lea    D0(%rip),%rdi
  mov    %eax,%ebp
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0x4(%rsp),%esi
  lea    D7(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  mov    %ebp,%esi
  lea    D11(%rip),%rdi
  call   <printf@plt>
  test   %ebp,%ebp
  jle    L78
  lea    -0x1(%rbp),%eax
  add    $0x8,%rbx
  lea    (%rbx,%rax,8),%rbp
  jmp    L28
  nopw   0x0(%rax,%rax,1)
L4:
  add    $0x8,%rbx
L28:
  mov    (%r14),%rdi
  mov    %rbx,%r14
  call   <puts@plt>
  cmp    %rbp,%rbx
  jne    L4
L78:
  xor    %eax,%eax
L79:
  mov    0x98(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L80
  add    $0xa0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L60:
  lea    D3(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%eax
  jmp    L79
L80:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D43
data_type: string
name: unpack_data
arguments: label: D24
data_type: string
name: unpack_data
arguments: label: D0
data_type: string
name: unpack_data
arguments: label: D7
data_type: string
name: unpack_data
arguments: label: D11
data_type: string
name: unpack_data
arguments: label: D3
data_type: string

tool: D43: Please enter the names and grades of 6 students.

tool: D24: %s %d %s %d %s %d %s %d %s %d %s %d

tool: D0: 
Average grade : %lf


tool: D7: 
Maximal grade : %d


tool: D11: 
%d students failed:


tool: D3: Memory allocation failed.

assistant: ```c
int main(void) {
  int i, size = 6, number_of_failed_students = 0;
  char *names[size], *failed[size];
  int grades[size];
  double avg;
  double *average = &avg;
  int max;
  int *maximal = &max;
  for (i = 0; i < size; i++) {
    names[i] = (char *)malloc(100 * sizeof(char));
    if (names[i] == NULL) {
      printf("Memory allocation failed.\n");
      return 1;
    }
  }
  for (i = 0; i < size; i++) {
    failed[i] = (char *)malloc(100 * sizeof(char));
    if (failed[i] == NULL) {
      printf("Memory allocation failed.\n");
      return 1;
    }
  }
  printf("Please enter the names and grades of 6 students.\n");
  scanf("%s %d %s %d %s %d %s %d %s %d %s %d", names[0], &grades[0], names[1], &grades[1], names[2], &grades[2], names[3], &grades[3], names[4], &grades[4], names[5], &grades[5]);
  size = validateData(grades, names, size);
  number_of_failed_students = findFaiures(grades, names, size, failed, average, maximal);
  printf("\nAverage grade : %lf\n", avg);
  printf("\nMaximal grade : %d\n", max);
  printf("\n%d students failed:\n", number_of_failed_students);
  for (i = 0; i < number_of_failed_students; i++) {
    printf("%s\n", failed[i]);
  }
  return 0;
}
```