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
  lea    -0x3d5000(%rsp),%r11
L89:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L89
  sub    $0x798,%rsp
  lea    D0(%rip),%rbx
  mov    %rbx,%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x3d5788(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%rsi
  lea    0x2f40(%rsp),%r14
  call   <scanf@plt>
  xor    %eax,%eax
  lea    0x30(%rsp),%rdi
  xor    %esi,%esi
  mov    $0x1f4,%ecx
  mov    %rdi,0x18(%rsp)
  mov    $0x3d2844,%edx
  rep stos %rax,%es:(%rdi)
  mov    $0x1f4,%ecx
  movl   $0x0,(%rdi)
  lea    0xfe0(%rsp),%rdi
  mov    %rdi,(%rsp)
  rep stos %rax,%es:(%rdi)
  movl   $0x0,(%rdi)
  mov    %r14,%rdi
  call   <memset@plt>
  mov    0x20(%rsp),%r8d
  test   %r8d,%r8d
  jle    L94
  lea    0x28(%rsp),%rax
  xor    %r13d,%r13d
  lea    0x2c(%rsp),%rbp
  mov    %rax,0x10(%rsp)
  lea    0x24(%rsp),%rax
  lea    0x1f90(%rsp),%r12
  mov    %rax,0x8(%rsp)
L129:
  mov    0x10(%rsp),%rdx
  mov    0x8(%rsp),%rsi
  lea    D38(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x24(%rsp),%eax
  mov    0x28(%rsp),%edi
  mov    %eax,(%r12,%r13,4)
  test   %edi,%edi
  jle    L144
  xor    %r15d,%r15d
L103:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  add    $0x1,%r15d
  call   <scanf@plt>
  movslq 0x24(%rsp),%rax
  movslq 0x2c(%rsp),%rcx
  imul   $0x3e9,%rax,%rax
  add    %rcx,%rax
  movl   $0x1,0x2f40(%rsp,%rax,4)
  cmp    %r15d,0x28(%rsp)
  jg     L103
L144:
  add    $0x1,%r13
  cmp    %r13d,0x20(%rsp)
  jg     L129
L94:
  mov    0x18(%rsp),%rdx
  mov    %r14,%rsi
  xor    %edi,%edi
  movl   $0x1,0xfe0(%rsp)
  movl   $0x1,0x30(%rsp)
  call   <dfs@plt>
  mov    (%rsp),%rdx
  mov    %r14,%rsi
  xor    %edi,%edi
  call   <rdfs@plt>
  mov    0x20(%rsp),%esi
  test   %esi,%esi
  jle    L11
  xor    %ebx,%ebx
  mov    $0x1,%eax
  lea    0x1f90(%rsp),%r12
  lea    D36(%rip),%rbp
  jmp    L146
L49:
  mov    0x20(%rsp),%edx
  add    $0x1,%rbx
  cmp    %ebx,%edx
  jle    L7
L146:
  movslq (%r12,%rbx,4),%rdx
  mov    0xfe0(%rsp,%rdx,4),%ecx
  mov    %rdx,%rsi
  test   %ecx,%ecx
  jne    L49
  mov    %rbp,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <printf@plt>
  mov    0x20(%rsp),%edx
  xor    %eax,%eax
  cmp    %ebx,%edx
  jg     L146
L7:
  test   %edx,%edx
  jle    L159
  xor    %ebx,%ebx
  lea    D45(%rip),%rbp
  jmp    L173
L127:
  add    $0x1,%rbx
  cmp    %ebx,0x20(%rsp)
  jle    L159
L173:
  movslq (%r12,%rbx,4),%rdx
  mov    %rdx,%rsi
  mov    0x30(%rsp,%rdx,4),%edx
  test   %edx,%edx
  jne    L127
  mov    %rbp,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <printf@plt>
  xor    %eax,%eax
  cmp    %ebx,0x20(%rsp)
  jg     L173
L159:
  test   %eax,%eax
  jne    L11
L43:
  mov    0x3d5788(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L124
  add    $0x3d5798,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L11:
  lea    D24(%rip),%rdi
  call   <puts@plt>
  jmp    L43
L124:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D0
type_infered: string
name: retrieve_data
arguments: data_label: D38
type_infered: string
name: retrieve_data
arguments: data_label: D36
type_infered: string
name: retrieve_data
arguments: data_label: D45
type_infered: string
name: retrieve_data
arguments: data_label: D24
type_infered: string

tool: D0: %d

tool: D38: %d%d

tool: D36: TRAPPED %d


tool: D45: UNREACHABLE %d


tool: D24: NO PROBLEMS

assistant: ```c
int main() {
  int i, j, n, s, t, u, G[1001][1001], v[1001], r[1001], p[1001];
  scanf("%d", &n);
  for (i = 0; i < 1001; i++) {
    v[i] = 0;
    r[i] = 0;
    for (j = 0; j < 1001; j++)
      G[i][j] = 0;
  }
  for (i = 0; i < n; i++) {
    scanf("%d%d", &s, &t);
    p[i] = s;
    for (j = 0; j < t; j++) {
      scanf("%d", &u);
      G[s][u] = 1;
    }
  }
  v[0] = r[0] = 1;
  dfs(0, G, v);
  rdfs(0, G, r);
  int ok = 1;
  for (i = 0; i < n; i++) {
    if (!r[p[i]]) {
      printf("TRAPPED %d\n", p[i]);
      ok = 0;
    }
  }
  for (i = 0; i < n; i++) {
    if (!v[p[i]]) {
      printf("UNREACHABLE %d\n", p[i]);
      ok = 0;
    }
  }
  if (ok)
    printf("NO PROBLEMS\n");
  return 0;
}
```