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    0x12(%rsp),%rsi
  lea    D5(%rip),%rdi
  call   <scanf@plt>
  movswq 0x12(%rsp),%rdi
  shl    $0x3,%edi
  movswl %di,%edi
  call   <malloc@plt>
  mov    %rax,(%rsp)
  movswl 0x12(%rsp),%edi
  call   <malloc@plt>
  mov    %rax,%r14
  cmpw   $0x0,0x12(%rsp)
  jle    L46
  mov    $0x0,%r15d
  lea    0x16(%rsp),%rax
  mov    %rax,0x8(%rsp)
  lea    D5(%rip),%r13
L102:
  mov    0x8(%rsp),%rsi
  lea    D63(%rip),%rdi
  call   <scanf@plt>
  movswl 0x16(%rsp),%edi
  lea    0x2(%rdi,%rdi,1),%edi
  movswl %di,%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  movswq %r15w,%rax
  mov    (%rsp),%rcx
  lea    (%rcx,%rax,8),%r12
  mov    %rdx,(%r12)
  movb   $0xff,(%r14,%rax,1)
  mov    (%r12),%rax
  movzwl 0x16(%rsp),%edx
  mov    %dx,(%rax)
  mov    (%r12),%rsi
  cmpw   $0x0,(%rsi)
  jle    L219
  mov    $0x1,%ebp
L184:
  movswq %bp,%rbx
  add    %rbx,%rbx
  add    %rbx,%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  add    (%r12),%rbx
  subw   $0x1,(%rbx)
  add    $0x1,%ebp
  mov    (%r12),%rsi
  cmp    %bp,(%rsi)
  jge    L184
L219:
  add    $0x1,%r15d
  cmp    %r15w,0x12(%rsp)
  jg     L102
L46:
  movw   $0x0,0x14(%rsp)
  cmpw   $0x0,0x12(%rsp)
  jle    L109
  mov    $0x0,%ebx
  lea    0x14(%rsp),%rbp
  jmp    L168
L137:
  add    $0x1,%ebx
  cmp    %bx,0x12(%rsp)
  jle    L128
L168:
  movswq %bx,%rax
  add    %r14,%rax
  cmpb   $0xff,(%rax)
  jne    L137
  addw   $0x1,0x14(%rsp)
  addb   $0x1,(%rax)
  movswl %bx,%ecx
  mov    %r14,%rdx
  mov    (%rsp),%rsi
  mov    %rbp,%rdi
  call   <dfs@plt>
  jmp    L137
L128:
  movzwl 0x14(%rsp),%eax
  cmp    $0xffff,%ax
  je     L167
L215:
  movswl %ax,%esi
  lea    D5(%rip),%rdi
  call   <printf@plt>
  cmpw   $0x0,0x12(%rsp)
  jle    L182
  mov    $0x0,%ebx
  lea    D22(%rip),%rbp
  jmp    L144
L167:
  lea    D34(%rip),%rdi
  call   <puts@plt>
  jmp    L62
L109:
  mov    $0x0,%eax
  jmp    L215
L201:
  add    $0x1,%ebx
  cmp    %bx,0x12(%rsp)
  jle    L182
L144:
  movswq %bx,%rax
  cmpb   $0x0,(%r14,%rax,1)
  jne    L201
  lea    0x1(%rbx),%esi
  movswl %si,%esi
  mov    %rbp,%rdi
  call   <printf@plt>
  jmp    L201
L182:
  mov    $0xa,%edi
  call   <putchar@plt>
  movzwl 0x12(%rsp),%esi
  sub    0x14(%rsp),%si
  movswl %si,%esi
  lea    D5(%rip),%rdi
  call   <printf@plt>
  cmpw   $0x0,0x12(%rsp)
  jle    L192
  mov    $0x0,%ebx
  lea    D22(%rip),%rbp
  jmp    L157
L44:
  add    $0x1,%ebx
  cmp    %bx,0x12(%rsp)
  jle    L192
L157:
  movswq %bx,%rax
  cmpb   $0x0,(%r14,%rax,1)
  je     L44
  lea    0x1(%rbx),%esi
  movswl %si,%esi
  mov    %rbp,%rdi
  call   <printf@plt>
  jmp    L44
L192:
  mov    $0xa,%edi
  call   <putchar@plt>
L62:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L124
  mov    $0x0,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L124:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D5
datatype: string
name: retrieve_data
arguments: data_label: D63
datatype: string
name: retrieve_data
arguments: data_label: D22
datatype: string
name: retrieve_data
arguments: data_label: D34
datatype: string

tool: D5: %hd

tool: D63: %*d %hd

tool: D22:  %hd

tool: D34: 0
0

assistant: ```c
int main() {
  char *set;
  short n, nSet0, neighbors, i, j, **E;
  scanf("%hd", &n);
  E = (short **)malloc(n * sizeof(short *));
  set = (char *)malloc(n);
  for (i = 0; i < n; ++i) {
    scanf("%*d %hd", &neighbors);
    E[i] = (short *)malloc((neighbors + 1) * sizeof(short));
    set[i] = -1;
    E[i][0] = neighbors;
    for (j = 1; j <= E[i][0]; ++j) {
      scanf("%hd", &E[i][j]);
      --E[i][j];
    }
  }
  nSet0 = 0;
  for (i = 0; i < n; ++i) {
    if (set[i] == -1) {
      ++nSet0;
      ++set[i];
      dfs(&nSet0, E, set, i);
    }
  }
  if (nSet0 == -1) {
    puts("0\n0");
    return 0;
  }
  printf("%hd", nSet0);
  for (i = 0; i < n; ++i) {
    if (!set[i]) {
      printf(" %hd", i + 1);
    }
  }
  putchar('\n');
  printf("%hd", n - nSet0);
  for (i = 0; i < n; ++i) {
    if (set[i]) {
      printf(" %hd", i + 1);
    }
  }
  putchar('\n');
  return 0;
}
```