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

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x150,%rsp
  lea    D10(%rip),%rdi
  lea    D84(%rip),%r12
  xor    %ebx,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x1148(%rsp)
  xor    %eax,%eax
  lea    0x1a0(%rsp),%rbp
  call   <printf@plt>
  lea    0x8(%rsp),%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  lea    D73(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x8(%rsp),%ecx
  test   %ecx,%ecx
  jle    L45
  nopw   0x0(%rax,%rax,1)
L102:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  add    $0x1,%ebx
  add    $0x4,%rbp
  call   <scanf@plt>
  cmp    %ebx,0x8(%rsp)
  jg     L102
L45:
  lea    D56(%rip),%rdi
  xor    %eax,%eax
  lea    0x10(%rsp),%rbp
  xor    %ebx,%ebx
  call   <printf@plt>
  lea    0xc(%rsp),%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  lea    D59(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0xc(%rsp),%edx
  test   %edx,%edx
  jle    L168
  nopl   0x0(%rax,%rax,1)
L106:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  add    $0x1,%ebx
  add    $0x4,%rbp
  call   <scanf@plt>
  cmp    %ebx,0xc(%rsp)
  jg     L106
L168:
  lea    D77(%rip),%rdi
  xor    %r14d,%r14d
  lea    D4(%rip),%r13
  call   <puts@plt>
  mov    0xc(%rsp),%eax
  lea    D23(%rip),%r12
  lea    D66(%rip),%rbp
  test   %eax,%eax
  jle    L51
  nopl   0x0(%rax)
L60:
  mov    0x8(%rsp),%edx
  xor    %ebx,%ebx
  test   %edx,%edx
  jle    L162
  mov    0x10(%rsp,%r14,4),%ecx
  lea    0x1a0(%rsp),%rax
  xor    %ebx,%ebx
  jmp    L88
  nopl   0x0(%rax,%rax,1)
L157:
  add    $0x1,%ebx
  add    $0x4,%rax
  cmp    %edx,%ebx
  je     L131
L88:
  cmp    (%rax),%ecx
  jne    L157
  test   %ebx,%ebx
  je     L9
  lea    -0x1(%rdx),%eax
  cmp    %ebx,%eax
  je     L134
  lea    0x1(%rbx),%eax
  mov    %r12,%rdi
  cltq
  mov    0x1a0(%rsp,%rax,4),%edx
  lea    -0x1(%rbx),%eax
  cltq
  mov    0x1a0(%rsp,%rax,4),%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x8(%rsp),%edx
L162:
  cmp    %edx,%ebx
  je     L131
L36:
  add    $0x1,%r14
  cmp    %r14d,0xc(%rsp)
  jg     L60
L51:
  mov    0x1148(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L46
  add    $0x1150,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L131:
  mov    %r13,%rdi
  call   <puts@plt>
  jmp    L36
  nopw   0x0(%rax,%rax,1)
L9:
  mov    0x1a4(%rsp),%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x8(%rsp),%edx
  jmp    L162
  nopw   0x0(%rax,%rax,1)
L134:
  lea    -0x2(%rdx),%eax
  mov    %rbp,%rdi
  cltq
  mov    0x1a0(%rsp,%rax,4),%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x8(%rsp),%edx
  jmp    L162
L46:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D10
type_infered: string
name: disassemble_data
arguments: tag: D84
type_infered: string
name: disassemble_data
arguments: tag: D73
type_infered: string
name: disassemble_data
arguments: tag: D56
type_infered: string
name: disassemble_data
arguments: tag: D59
type_infered: string
name: disassemble_data
arguments: tag: D77
type_infered: string
name: disassemble_data
arguments: tag: D4
type_infered: string
name: disassemble_data
arguments: tag: D23
type_infered: string
name: disassemble_data
arguments: tag: D66
type_infered: string

tool: D10: Please input the number of integers:

tool: D84: %d

tool: D73: Please input the integers:

tool: D56: Please input the times of query:

tool: D59: Please input the integers you want to query:

tool: D77: The result is:

tool: D4: NULL

tool: D23: %d %d


tool: D66: %d


assistant: ```c
int main() {
  int n, m, num[1000], query[100], i, j;
  printf("Please input the number of integers:");
  scanf("%d", &n);
  printf("Please input the integers:");
  for (i = 0; i < n; i++)
    scanf("%d", &num[i]);
  printf("Please input the times of query:");
  scanf("%d", &m);
  printf("Please input the integers you want to query:");
  for (i = 0; i < m; i++)
    scanf("%d", &query[i]);
  printf("The result is:\n");
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++)
      if (query[i] == num[j]) {
        if (j == 0)
          printf("%d\n", num[1]);
        else if (j == n - 1)
          printf("%d\n", num[n - 2]);
        else
          printf("%d %d\n", num[j - 1], num[j + 1]);
        break;
      }
    if (j == n)
      printf("NULL\n");
  }
  return 0;
}
```