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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rsi
  lea    D36(%rip),%rdi
  call   <scanf@plt>
  mov    0x10(%rsp),%eax
  lea    0x0(,%rax,4),%edi
  call   <malloc@plt>
  mov    %rax,%r13
  mov    0x10(%rsp),%eax
  lea    0x0(,%rax,4),%edi
  call   <malloc@plt>
  cmpl   $0x0,0x10(%rsp)
  jle    L60
  mov    %rax,%r14
  mov    $0x0,%r12d
  mov    $0x0,%ebp
  mov    $0x0,%ebx
  mov    $0x0,%r15d
  movl   $0x0,0x4(%rsp)
  movl   $0x0,0xc(%rsp)
  movl   $0x0,0x8(%rsp)
  jmp    L35
L68:
  add    %edx,0xc(%rsp)
L40:
  add    $0x1,%ebp
L93:
  add    $0x1,%ebx
  cmp    %ebx,0x10(%rsp)
  jle    L27
L35:
  lea    0x14(%rsp),%rsi
  lea    D36(%rip),%rdi
  call   <scanf@plt>
  mov    0x14(%rsp),%edx
  test   $0x1,%dl
  jne    L159
  movslq %ebp,%rax
  mov    %edx,0x0(%r13,%rax,4)
  addl   $0x1,0x4(%rsp)
  test   %ebp,%ebp
  jle    L68
  mov    %r13,%rax
  lea    -0x1(%rbp),%ecx
  lea    0x4(%r13,%rcx,4),%rdi
  mov    $0x0,%ecx
L129:
  cmp    (%rax),%edx
  sete   %sil
  movzbl %sil,%esi
  add    %esi,%ecx
  add    $0x4,%rax
  cmp    %rax,%rdi
  jne    L129
  test   %ecx,%ecx
  jne    L40
  jmp    L68
L159:
  movslq %r12d,%rax
  mov    %edx,(%r14,%rax,4)
  add    $0x1,%r15d
  test   %r12d,%r12d
  jle    L50
  mov    %r14,%rax
  lea    -0x1(%r12),%ecx
  lea    0x4(%r14,%rcx,4),%rdi
  mov    $0x0,%ecx
L32:
  cmp    (%rax),%edx
  sete   %sil
  movzbl %sil,%esi
  add    %esi,%ecx
  add    $0x4,%rax
  cmp    %rax,%rdi
  jne    L32
  test   %ecx,%ecx
  je     L50
L63:
  add    $0x1,%r12d
  jmp    L93
L50:
  add    %edx,0x8(%rsp)
  jmp    L63
L27:
  mov    0xc(%rsp),%ecx
  cmp    %ecx,0x8(%rsp)
  jge    L107
  mov    %r15d,%edx
  mov    0x4(%rsp),%esi
  lea    D38(%rip),%rdi
  call   <printf@plt>
L141:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L74
  mov    $0x0,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L60:
  mov    $0x0,%r15d
  movl   $0x0,0x4(%rsp)
  movl   $0x0,0x8(%rsp)
L107:
  mov    0x8(%rsp),%ecx
  mov    %r15d,%edx
  mov    0x4(%rsp),%esi
  lea    D38(%rip),%rdi
  call   <printf@plt>
  jmp    L141
L74:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D36
type: string
name: unpack_data
arguments: tag: D38
type: string

tool: D36: %d

tool: D38: %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;
}
```