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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x40(%rbp)
  movl   $0x0,-0x3c(%rbp)
  movl   $0x0,-0x38(%rbp)
  movl   $0x0,-0x34(%rbp)
  movl   $0x0,-0x30(%rbp)
  movl   $0x0,-0x28(%rbp)
  movl   $0x0,-0x24(%rbp)
  lea    -0x48(%rbp),%rax
  mov    %rax,%rsi
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x48(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x48(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L28
L76:
  lea    -0x44(%rbp),%rax
  mov    %rax,%rsi
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x44(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  jne    L147
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x44(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x34(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L75
L58:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x44(%rbp),%eax
  cmp    %eax,%edx
  jne    L18
  addl   $0x1,-0x40(%rbp)
L18:
  addl   $0x1,-0x20(%rbp)
L75:
  mov    -0x20(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L58
  cmpl   $0x0,-0x40(%rbp)
  jne    L79
  mov    -0x44(%rbp),%eax
  add    %eax,-0x38(%rbp)
L79:
  movl   $0x0,-0x40(%rbp)
  addl   $0x1,-0x28(%rbp)
  jmp    L24
L147:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  mov    -0x44(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x30(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L138
L90:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x44(%rbp),%eax
  cmp    %eax,%edx
  jne    L13
  addl   $0x1,-0x40(%rbp)
L13:
  addl   $0x1,-0x1c(%rbp)
L138:
  mov    -0x1c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L90
  cmpl   $0x0,-0x40(%rbp)
  jne    L2
  mov    -0x44(%rbp),%eax
  add    %eax,-0x3c(%rbp)
L2:
  movl   $0x0,-0x40(%rbp)
  addl   $0x1,-0x24(%rbp)
L24:
  addl   $0x1,-0x2c(%rbp)
L28:
  mov    -0x48(%rbp),%eax
  cmp    %eax,-0x2c(%rbp)
  jl     L76
  mov    -0x38(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jle    L47
  mov    -0x38(%rbp),%ecx
  mov    -0x30(%rbp),%edx
  mov    -0x34(%rbp),%eax
  mov    %eax,%esi
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L92
L47:
  mov    -0x3c(%rbp),%ecx
  mov    -0x30(%rbp),%edx
  mov    -0x34(%rbp),%eax
  mov    %eax,%esi
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L92:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L106
  call   <__stack_chk_fail@plt>
L106:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D29
type_guessed: string
name: unpack_data
arguments: data_label: D36
type_guessed: string

tool: D29: %d

tool: D36: %d
%d
%d


assistant: ```c
int main() {
  int aux = 0, cm = 0, cj = 0, J = 0, M = 0, i, j = 0, z = 0, jj, zz, n, num;
  scanf("%d", &n);
  int *fig_j = (int *)malloc(sizeof(int) * n);
  int *fig_m = (int *)malloc(sizeof(int) * n);
  for (i = 0; i < n; ++i) {
    scanf("%d", &num);
    if ((num % 2) == 0) {
      fig_j[j] = num;
      J = J + 1;
      for (jj = 0; jj < j; ++jj) {
        if (fig_j[jj] == num)
          aux = aux + 1;
      }
      if (aux == 0) {
        cj = cj + num;
      }
      aux = 0;
      j++;
    } else {
      fig_m[z] = num;
      M = M + 1;
      for (zz = 0; zz < z; ++zz) {
        if (fig_m[zz] == num)
          aux = aux + 1;
      }
      if (aux == 0) {
        cm = cm + num;
      }
      aux = 0;
      z++;
    }
  }
  if (cj > cm) {
    printf("%d\n%d\n%d\n", J, M, cj);
  } else {
    printf("%d\n%d\n%d\n", J, M, cm);
  }
  return 0;
}
```