user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    -0x4c(%rbp),%rsi
  lea    D47(%rip),%rdi
  call   <scanf@plt>
  cmpl   $0x0,-0x4c(%rbp)
  jle    L259
  movl   $0x0,-0x60(%rbp)
  lea    -0x3c(%rbp),%rax
  mov    %rax,-0x80(%rbp)
  jmp    L389
L168:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L131
  orq    $0x0,-0x8(%rsp,%rdx,1)
L131:
  mov    %rsp,-0x58(%rbp)
  lea    0xf(%rcx),%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  shl    $0x4,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L61:
  cmp    %rdx,%rsp
  je     L335
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L61
L335:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L141
  orq    $0x0,-0x8(%rsp,%rdx,1)
L141:
  mov    %rsp,%r14
  test   %esi,%esi
  jle    L191
  mov    $0x0,%ebx
  lea    D28(%rip),%r12
  mov    -0x58(%rbp),%r13
  mov    -0x80(%rbp),%r15
L235:
  lea    -0x40(%rbp),%rsi
  mov    %r15,%rdx
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x40(%rbp),%eax
  mov    %eax,0x0(%r13,%rbx,4)
  mov    -0x3c(%rbp),%eax
  mov    %eax,(%r14,%rbx,4)
  add    $0x1,%rbx
  cmp    %ebx,-0x44(%rbp)
  jg     L235
L191:
  mov    -0x80(%rbp),%rsi
  lea    D47(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x48(%rbp),%eax
  mov    %eax,-0x6c(%rbp)
  add    $0x1,%eax
  mov    %eax,-0x70(%rbp)
  cltq
  lea    0xf(,%rax,4),%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  shl    $0x4,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L122:
  cmp    %rdx,%rsp
  je     L37
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L122
L37:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L71
  orq    $0x0,-0x8(%rsp,%rdx,1)
L71:
  mov    %rsp,%r15
  cmpl   $0x0,-0x70(%rbp)
  jle    L241
  mov    %r15,%rax
  mov    -0x6c(%rbp),%edx
  lea    0x4(%r15,%rdx,4),%rdx
L294:
  movl   $0x0,(%rax)
  add    $0x4,%rax
  cmp    %rax,%rdx
  jne    L294
L241:
  cmpl   $0x0,-0x44(%rbp)
  jle    L145
  mov    $0x0,%ebx
  mov    -0x58(%rbp),%r13
  jmp    L165
L72:
  mov    (%r14,%rbx,4),%eax
  mov    %eax,-0x5c(%rbp)
  mov    %eax,%edi
  call   <push@plt>
  movslq -0x5c(%rbp),%rax
  movl   $0x6,(%r15,%rax,4)
  jmp    L303
L382:
  add    $0x1,%rbx
  cmp    %ebx,-0x44(%rbp)
  jle    L145
L165:
  mov    0x0(%r13,%rbx,4),%r12d
  cmp    -0x3c(%rbp),%r12d
  je     L72
L303:
  mov    -0x3c(%rbp),%eax
  cmp    %eax,(%r14,%rbx,4)
  jne    L382
  mov    %r12d,%edi
  call   <push@plt>
  movslq %r12d,%r12
  movl   $0x6,(%r15,%r12,4)
  jmp    L382
L145:
  mov    $0x0,%eax
  call   <pop@plt>
  mov    %eax,%r13d
  cmp    $0xffffff9c,%eax
  je     L207
  mov    $0x0,%ebx
  cltq
  mov    %rax,-0x68(%rbp)
  cmpl   $0x0,-0x44(%rbp)
  jg     L57
  jmp    L145
L207:
  cmpl   $0x1,-0x70(%rbp)
  jle    L346
  mov    -0x6c(%rbp),%eax
  lea    -0x1(%rax),%r12d
  add    $0x2,%r12
  mov    $0x1,%ebx
  lea    D1(%rip),%r13
  jmp    L128
L187:
  mov    (%r14,%rbx,4),%eax
  mov    %eax,-0x5c(%rbp)
  cltq
  cmpl   $0x0,(%r15,%rax,4)
  jne    L353
  mov    -0x5c(%rbp),%edi
  call   <push@plt>
  movslq -0x5c(%rbp),%rax
  mov    -0x68(%rbp),%rcx
  mov    (%r15,%rcx,4),%ecx
  mov    %ecx,-0x5c(%rbp)
  lea    0x6(%rcx),%edx
  mov    %edx,(%r15,%rax,4)
  jmp    L353
L392:
  add    $0x1,%rbx
  cmp    %ebx,-0x44(%rbp)
  jle    L145
L57:
  mov    -0x58(%rbp),%rax
  mov    (%rax,%rbx,4),%r12d
  cmp    %r13d,%r12d
  je     L187
L353:
  cmp    %r13d,(%r14,%rbx,4)
  jne    L392
  movslq %r12d,%rax
  cmpl   $0x0,(%r15,%rax,4)
  jne    L392
  mov    %r12d,%edi
  call   <push@plt>
  movslq %r12d,%r12
  mov    -0x68(%rbp),%rax
  mov    (%r15,%rax,4),%eax
  mov    %eax,-0x5c(%rbp)
  add    $0x6,%eax
  mov    %eax,(%r15,%r12,4)
  jmp    L392
L144:
  lea    D41(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L383:
  add    $0x1,%rbx
  cmp    %rbx,%r12
  je     L346
L128:
  cmp    %ebx,-0x3c(%rbp)
  je     L383
  mov    (%r15,%rbx,4),%esi
  test   %esi,%esi
  jne    L144
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L383
L346:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    -0x78(%rbp),%rsp
  addl   $0x1,-0x60(%rbp)
  mov    -0x60(%rbp),%eax
  cmp    %eax,-0x4c(%rbp)
  jle    L259
L389:
  mov    %rsp,-0x78(%rbp)
  lea    -0x44(%rbp),%rdx
  lea    -0x48(%rbp),%rsi
  lea    D28(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x44(%rbp),%esi
  movslq %esi,%rcx
  shl    $0x2,%rcx
  lea    0xf(%rcx),%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  shl    $0x4,%rax
  mov    %rax,%rdi
  and    $0xfffffffffffff000,%rdi
  mov    %rsp,%rdx
  sub    %rdi,%rdx
L200:
  cmp    %rdx,%rsp
  je     L168
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L200
L259:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L156
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L156:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D47
type_guessed: string
name: disassemble_data
arguments: tag: D28
type_guessed: string
name: disassemble_data
arguments: tag: D1
type_guessed: string
name: disassemble_data
arguments: tag: D41
type_guessed: string

tool: D47: %i

tool: D28: %i %i

tool: D1: -1 

tool: D41: %d 

assistant: ```c
int main() {
  int q;
  scanf("%i", &q);
  for (int a0 = 0; a0 < q; a0++) {
    int n;
    int m;
    scanf("%i %i", &n, &m);
    int edl[m], edr[m];
    for (int a1 = 0; a1 < m; a1++) {
      int u;
      int v;
      scanf("%i %i", &u, &v);
      edl[a1] = u;
      edr[a1] = v;
    }
    int s;
    scanf("%i", &s);
    int r = n + 1;
    int a[r];
    for (int i = 0; i < r; i++)
      a[i] = 0;
    for (int i = 0; i < m; i++) {
      if (edl[i] == s) {
        push(edr[i]);
        a[edr[i]] = 6;
      }
      if (edr[i] == s) {
        push(edl[i]);
        a[edl[i]] = 6;
      }
    }
    while (1) {
      int get = pop();
      if (get == -100)
        break;
      for (int i = 0; i < m; i++) {
        if (edl[i] == get) {
          if (a[edr[i]] == 0) {
            push(edr[i]);
            a[edr[i]] = a[get] + 6;
          }
        }
        if (edr[i] == get) {
          if (a[edl[i]] == 0) {
            push(edl[i]);
            a[edl[i]] = a[get] + 6;
          }
        }
      }
    }
    for (int i = 1; i < r; i++) {
      if (i != s) {
        if (a[i] == 0)
          printf("-1 ");
        else
          printf("%d ", a[i]);
      }
    }
    printf("\n");
  }
  return 0;
}
```