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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  lea    D8(%rip),%r13
  push   %r12
  push   %rbp
  lea    D29(%rip),%rbp
  push   %rbx
  sub    $0xf8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xe8(%rsp)
  xor    %eax,%eax
  lea    0x1c(%rsp),%rbx
  nopl   0x0(%rax,%rax,1)
L36:
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  mov    0x1c(%rsp),%eax
  sub    $0x5,%eax
  cmp    $0x2d,%eax
  ja     L36
  lea    0x20(%rsp),%rax
  xor    %ebp,%ebp
  lea    D69(%rip),%r14
  mov    %rax,(%rsp)
  mov    %rax,%r12
  cs nopw 0x0(%rax,%rax,1)
L45:
  mov    %ebp,%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%ebp
  call   <printf@plt>
  mov    %r12,%rsi
  mov    %r13,%rdi
  add    $0x4,%r12
  call   <scanf@plt>
  mov    0x1c(%rsp),%eax
  cmp    %ebp,%eax
  jg     L45
  mov    0x20(%rsp),%esi
  test   %eax,%eax
  jle    L55
  mov    (%rsp),%rbx
  sub    $0x1,%eax
  lea    0x24(%rsp),%rcx
  mov    %esi,%r14d
  movl   $0x0,0xc(%rsp)
  xor    %ebp,%ebp
  xor    %r12d,%r12d
  lea    0x4(%rbx,%rax,4),%r10
  movl   $0x0,0x8(%rsp)
  mov    %esi,%eax
  mov    %esi,%ebx
  jmp    L75
  nopl   0x0(%rax)
L61:
  addl   $0x1,0x8(%rsp)
L100:
  cmp    %eax,%ebx
  cmovl  %eax,%ebx
  cmp    %eax,%r14d
  cmovg  %eax,%r14d
  cmp    %r10,%rcx
  je     L2
  mov    (%rcx),%eax
  add    $0x4,%rcx
L75:
  mov    %eax,%edx
  mov    %eax,%edi
  and    $0x1,%edx
  cmp    $0x1,%edx
  adc    $0x0,%r12d
  shr    $0x1f,%edi
  lea    (%rax,%rdi,1),%edx
  and    $0x1,%edx
  sub    %edi,%edx
  cmp    $0x1,%edx
  sete   %dl
  movzbl %dl,%edx
  add    %edx,%ebp
  test   %eax,%eax
  jg     L61
  cmp    $0x1,%eax
  sbbl   $0xffffffff,0xc(%rsp)
  jmp    L100
  cs nopw 0x0(%rax,%rax,1)
L2:
  xor    %r13d,%r13d
  lea    D78(%rip),%r15
  jmp    L43
  nopl   0x0(%rax)
L84:
  mov    (%rsp),%rax
  mov    (%rax,%r13,4),%esi
L43:
  mov    %r15,%rdi
  xor    %eax,%eax
  add    $0x1,%r13
  call   <printf@plt>
  cmp    %r13d,0x1c(%rsp)
  jg     L84
L48:
  mov    %r12d,%esi
  lea    D42(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  lea    D67(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x8(%rsp),%esi
  lea    D37(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0xc(%rsp),%esi
  lea    D68(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebx,%esi
  lea    D17(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  mov    %r14d,%esi
  lea    D15(%rip),%rdi
  call   <printf@plt>
  mov    0xe8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L20
  add    $0xf8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L55:
  movl   $0x0,0xc(%rsp)
  mov    %esi,%r14d
  mov    %esi,%ebx
  xor    %r12d,%r12d
  movl   $0x0,0x8(%rsp)
  xor    %ebp,%ebp
  jmp    L48
L20:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D8
data_type: string
name: retrieve_data
arguments: data_tag: D29
data_type: string
name: retrieve_data
arguments: data_tag: D69
data_type: string
name: retrieve_data
arguments: data_tag: D78
data_type: string
name: retrieve_data
arguments: data_tag: D42
data_type: string
name: retrieve_data
arguments: data_tag: D67
data_type: string
name: retrieve_data
arguments: data_tag: D37
data_type: string
name: retrieve_data
arguments: data_tag: D68
data_type: string
name: retrieve_data
arguments: data_tag: D17
data_type: string
name: retrieve_data
arguments: data_tag: D15
data_type: string

tool: D8: %d

tool: D29: numero de elementos del vector

tool: D69: v[%d]=


tool: D78: 
%d


tool: D42: Los numeros Pares son: %d

tool: D67: Los numeros Impares son: %d

tool: D37: Los numeros Positivos son: %d

tool: D68: Los numeros Negativos son: %d

tool: D17: El numero Mayor es: %d

tool: D15: El numero Menor es: %d

assistant: ```c
void main() {
  int vec[50];
  int x, n, par, impar, pos, neg, mayor, menor;
  do {
    printf("numero de elementos del vector");
    scanf("%d", &n);
  } while (n < 5 || n > 50);
  for (x = 0; x < n; x++) {
    printf("v[%d]=\n", x);
    scanf("%d", &vec[x]);
  }
  par = 0;
  impar = 0;
  pos = 0;
  neg = 0;
  mayor = vec[0];
  menor = vec[0];
  for (x = 0; x < n; x++) {
    if (vec[x] % 2 == 0) {
      par++;
    }
    if (vec[x] % 2 == 1) {
      impar++;
    }
    if (vec[x] > 0) {
      pos++;
    }
    if (vec[x] < 0) {
      neg++;
    }
    if (vec[x] > mayor) {
      mayor = vec[x];
    }
    if (vec[x] < menor) {
      menor = vec[x];
    }
  }
  for (x = 0; x < n; x++) {
    printf("\n%d\n", vec[x]);
  }
  printf("Los numeros Pares son: %d", par);
  printf("Los numeros Impares son: %d", impar);
  printf("Los numeros Positivos son: %d", pos);
  printf("Los numeros Negativos son: %d", neg);
  printf("El numero Mayor es: %d", mayor);
  printf("El numero Menor es: %d", menor);
}
```