Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<stdlib.h>
int n,a,b;
int* t[100];
int  u[100];
int visited[100];

int v[300],v2[300];
int l=0,r=0,cnt=1;

void push(int x,int y){
  v[r]=x;
  v2[r]=y;
  r++;
}

void pop(){
  l++;
}

int main(){
  int i,j;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a);
    a--;
    scanf("%d",&u[a]);
    t[a]=malloc( sizeof(int) * u[a] );
    for(j=0;j<u[a];j++){
      scanf("%d",&t[a][j]);
      t[a][j]--;
    }
    visited[i]=-1;
  }

   
  push(0,0);
  visited[0]=0;
  while(l!=r){
    a=v[l];
    b=v2[l];
    pop();
    for(i=0;i<u[a];i++){
      if(visited[t[a][i]]==-1){
	push(t[a][i],b+1);
	visited[t[a][i]]=b+1;
      }
    }
  }
  
    
  for(i=0;i<n;i++){
    printf("%d %d\n",i+1,visited[i]);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 800
t:
	.zero	800
	.globl	u
	.align 32
	.type	u, @object
	.size	u, 400
u:
	.zero	400
	.globl	visited
	.align 32
	.type	visited, @object
	.size	visited, 400
visited:
	.zero	400
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 1200
v:
	.zero	1200
	.globl	v2
	.align 32
	.type	v2, @object
	.size	v2, 1200
v2:
	.zero	1200
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	cnt
	.data
	.align 4
	.type	cnt, @object
	.size	cnt, 4
cnt:
	.long	1
	.text
	.globl	push
	.type	push, @function
push:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	r(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	v(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	r(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	v2(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	r(%rip), %eax
	addl	$1, %eax
	movl	%eax, r(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	push, .-push
	.globl	pop
	.type	pop, @function
pop:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	l(%rip), %eax
	addl	$1, %eax
	movl	%eax, l(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	pop, .-pop
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L4
.L7:
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	a(%rip), %eax
	subl	$1, %eax
	movl	%eax, a(%rip)
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	salq	$2, %rax
	movl	a(%rip), %ebx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, %rcx
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	t(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	$0, -20(%rbp)
	jmp	.L5
.L6:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	t(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	t(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	subl	$1, %edx
	movl	%edx, (%rax)
	addl	$1, -20(%rbp)
.L5:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L6
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	$-1, (%rdx,%rax)
	addl	$1, -24(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L7
	movl	$0, %esi
	movl	$0, %edi
	call	push
	movl	$0, visited(%rip)
	jmp	.L8
.L12:
	movl	l(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, a(%rip)
	movl	l(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v2(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, b(%rip)
	movl	$0, %eax
	call	pop
	movl	$0, -24(%rbp)
	jmp	.L9
.L11:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	t(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L10
	movl	b(%rip), %eax
	leal	1(%rax), %edx
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	t(%rip), %rax
	movq	(%rcx,%rax), %rcx
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	push
	movl	b(%rip), %edx
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	t(%rip), %rax
	movq	(%rcx,%rax), %rcx
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L10:
	addl	$1, -24(%rbp)
.L9:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L11
.L8:
	movl	l(%rip), %edx
	movl	r(%rip), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	$0, -24(%rbp)
	jmp	.L13
.L14:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	leal	1(%rdx), %ecx
	movl	%eax, %edx
	movl	%ecx, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -24(%rbp)
.L13:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB39:
	.cfi_startproc
	endbr64
	movslq	r(%rip), %rdx
	leaq	v(%rip), %rcx
	movq	%rdx, %rax
	movl	%edi, (%rcx,%rdx,4)
	leaq	v2(%rip), %rcx
	addl	$1, %eax
	movl	%esi, (%rcx,%rdx,4)
	movl	%eax, r(%rip)
	ret
	.cfi_endproc
.LFE39:
	.size	push, .-push
	.p2align 4
	.globl	pop
	.type	pop, @function
pop:
.LFB40:
	.cfi_startproc
	endbr64
	addl	$1, l(%rip)
	ret
	.cfi_endproc
.LFE40:
	.size	pop, .-pop
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	__isoc99_scanf@PLT
	movl	n(%rip), %r11d
	testl	%r11d, %r11d
	jle	.L5
	xorl	%r13d, %r13d
	leaq	u(%rip), %rbp
	leaq	t(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L8:
	leaq	a(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	a(%rip), %eax
	movq	%r12, %rdi
	subl	$1, %eax
	movl	%eax, a(%rip)
	cltq
	leaq	0(%rbp,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	a(%rip), %r15
	movslq	0(%rbp,%r15,4), %rdi
	movq	%rdi, %r14
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx,%r15,8)
	movq	%rax, %rsi
	testl	%r14d, %r14d
	jle	.L6
	xorl	%r14d, %r14d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L26:
	movq	(%rbx,%rax,8), %rsi
.L7:
	leaq	0(,%r14,4), %r15
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %r14
	addq	%r15, %rsi
	call	__isoc99_scanf@PLT
	movslq	a(%rip), %rax
	movq	(%rbx,%rax,8), %rdx
	addq	%r15, %rdx
	subl	$1, (%rdx)
	movslq	a(%rip), %rax
	cmpl	%r14d, 0(%rbp,%rax,4)
	jg	.L26
.L6:
	leaq	visited(%rip), %rax
	movl	n(%rip), %r11d
	movl	$-1, (%rax,%r13,4)
	addq	$1, %r13
	cmpl	%r13d, %r11d
	jg	.L8
	movslq	r(%rip), %rax
	movslq	l(%rip), %rbx
	leaq	v(%rip), %r13
	leaq	v2(%rip), %r12
	movl	$0, visited(%rip)
	movq	%rax, %rdi
	movl	$0, (%r12,%rax,4)
	movl	$0, 0(%r13,%rax,4)
	addl	$1, %edi
	movl	%edi, r(%rip)
	cmpl	%ebx, %edi
	je	.L16
.L9:
	leaq	t(%rip), %r14
	leaq	visited(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L15:
	movslq	0(%r13,%rbx,4), %rax
	movl	(%r12,%rbx,4), %r9d
	leal	1(%rbx), %edx
	movl	%edx, l(%rip)
	movl	0(%rbp,%rax,4), %ecx
	movl	%eax, a(%rip)
	movl	%r9d, b(%rip)
	testl	%ecx, %ecx
	jle	.L12
	movq	(%r14,%rax,8), %rdx
	subl	$1, %ecx
	addl	$1, %r9d
	leaq	4(%rdx), %rax
	leaq	(%rax,%rcx,4), %r10
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$4, %rax
.L14:
	movslq	(%rdx), %rsi
	cmpl	$-1, (%r8,%rsi,4)
	movq	%rsi, %rcx
	jne	.L13
	movslq	%edi, %rsi
	addl	$1, %edi
	movl	%ecx, 0(%r13,%rsi,4)
	movl	%r9d, (%r12,%rsi,4)
	movl	%edi, r(%rip)
	movslq	(%rdx), %rdx
	movl	%r9d, (%r8,%rdx,4)
.L13:
	movq	%rax, %rdx
	cmpq	%rax, %r10
	jne	.L27
.L12:
	addq	$1, %rbx
	cmpl	%ebx, %edi
	jne	.L15
.L16:
	leaq	visited(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	testl	%r11d, %r11d
	jle	.L24
	.p2align 4,,10
	.p2align 3
.L17:
	movl	0(%rbp), %ecx
	addl	$1, %ebx
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	%ebx, %edx
	movl	$1, %edi
	addq	$4, %rbp
	call	__printf_chk@PLT
	cmpl	n(%rip), %ebx
	jl	.L17
.L24:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	movslq	r(%rip), %rax
	movslq	l(%rip), %rbx
	leaq	v(%rip), %r13
	leaq	v2(%rip), %r12
	movl	$0, visited(%rip)
	leaq	u(%rip), %rbp
	movq	%rax, %rdi
	movl	$0, (%r12,%rax,4)
	movl	$0, 0(%r13,%rax,4)
	addl	$1, %edi
	movl	%edi, r(%rip)
	cmpl	%edi, %ebx
	jne	.L9
	jmp	.L24
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.globl	cnt
	.data
	.align 4
	.type	cnt, @object
	.size	cnt, 4
cnt:
	.long	1
	.globl	r
	.bss
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	v2
	.align 32
	.type	v2, @object
	.size	v2, 1200
v2:
	.zero	1200
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 1200
v:
	.zero	1200
	.globl	visited
	.align 32
	.type	visited, @object
	.size	visited, 400
visited:
	.zero	400
	.globl	u
	.align 32
	.type	u, @object
	.size	u, 400
u:
	.zero	400
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 800
t:
	.zero	800
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB39:
	.cfi_startproc
	endbr64
	movslq	r(%rip), %rdx
	leaq	v(%rip), %rcx
	movq	%rdx, %rax
	movl	%edi, (%rcx,%rdx,4)
	leaq	v2(%rip), %rcx
	addl	$1, %eax
	movl	%esi, (%rcx,%rdx,4)
	movl	%eax, r(%rip)
	ret
	.cfi_endproc
.LFE39:
	.size	push, .-push
	.p2align 4
	.globl	pop
	.type	pop, @function
pop:
.LFB40:
	.cfi_startproc
	endbr64
	addl	$1, l(%rip)
	ret
	.cfi_endproc
.LFE40:
	.size	pop, .-pop
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	__isoc99_scanf@PLT
	movl	n(%rip), %r11d
	testl	%r11d, %r11d
	jle	.L5
	xorl	%r13d, %r13d
	leaq	u(%rip), %rbp
	leaq	t(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L8:
	leaq	a(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	a(%rip), %eax
	movq	%r12, %rdi
	subl	$1, %eax
	movl	%eax, a(%rip)
	cltq
	leaq	0(%rbp,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	a(%rip), %r15
	movslq	0(%rbp,%r15,4), %rdi
	movq	%rdi, %r14
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx,%r15,8)
	movq	%rax, %rsi
	testl	%r14d, %r14d
	jle	.L6
	xorl	%r14d, %r14d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L26:
	movq	(%rbx,%rax,8), %rsi
.L7:
	leaq	0(,%r14,4), %r15
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %r14
	addq	%r15, %rsi
	call	__isoc99_scanf@PLT
	movslq	a(%rip), %rax
	movq	(%rbx,%rax,8), %rdx
	addq	%r15, %rdx
	subl	$1, (%rdx)
	movslq	a(%rip), %rax
	cmpl	%r14d, 0(%rbp,%rax,4)
	jg	.L26
.L6:
	leaq	visited(%rip), %rax
	movl	n(%rip), %r11d
	movl	$-1, (%rax,%r13,4)
	addq	$1, %r13
	cmpl	%r13d, %r11d
	jg	.L8
	movslq	r(%rip), %rax
	movslq	l(%rip), %rbx
	leaq	v(%rip), %r13
	leaq	v2(%rip), %r12
	movl	$0, visited(%rip)
	movq	%rax, %rdi
	movl	$0, (%r12,%rax,4)
	movl	$0, 0(%r13,%rax,4)
	addl	$1, %edi
	movl	%edi, r(%rip)
	cmpl	%ebx, %edi
	je	.L16
.L9:
	leaq	t(%rip), %r14
	leaq	visited(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L15:
	movslq	0(%r13,%rbx,4), %rax
	movl	(%r12,%rbx,4), %r9d
	leal	1(%rbx), %edx
	movl	%edx, l(%rip)
	movl	0(%rbp,%rax,4), %ecx
	movl	%eax, a(%rip)
	movl	%r9d, b(%rip)
	testl	%ecx, %ecx
	jle	.L12
	movq	(%r14,%rax,8), %rdx
	subl	$1, %ecx
	addl	$1, %r9d
	leaq	4(%rdx), %rax
	leaq	(%rax,%rcx,4), %r10
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$4, %rax
.L14:
	movslq	(%rdx), %rsi
	cmpl	$-1, (%r8,%rsi,4)
	movq	%rsi, %rcx
	jne	.L13
	movslq	%edi, %rsi
	addl	$1, %edi
	movl	%ecx, 0(%r13,%rsi,4)
	movl	%r9d, (%r12,%rsi,4)
	movl	%edi, r(%rip)
	movslq	(%rdx), %rdx
	movl	%r9d, (%r8,%rdx,4)
.L13:
	movq	%rax, %rdx
	cmpq	%rax, %r10
	jne	.L27
.L12:
	addq	$1, %rbx
	cmpl	%ebx, %edi
	jne	.L15
.L16:
	leaq	visited(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	testl	%r11d, %r11d
	jle	.L24
	.p2align 4,,10
	.p2align 3
.L17:
	movl	0(%rbp), %ecx
	addl	$1, %ebx
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	%ebx, %edx
	movl	$1, %edi
	addq	$4, %rbp
	call	__printf_chk@PLT
	cmpl	n(%rip), %ebx
	jl	.L17
.L24:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	movslq	r(%rip), %rax
	movslq	l(%rip), %rbx
	leaq	v(%rip), %r13
	leaq	v2(%rip), %r12
	movl	$0, visited(%rip)
	leaq	u(%rip), %rbp
	movq	%rax, %rdi
	movl	$0, (%r12,%rax,4)
	movl	$0, 0(%r13,%rax,4)
	addl	$1, %edi
	movl	%edi, r(%rip)
	cmpl	%edi, %ebx
	jne	.L9
	jmp	.L24
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.globl	cnt
	.data
	.align 4
	.type	cnt, @object
	.size	cnt, 4
cnt:
	.long	1
	.globl	r
	.bss
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	v2
	.align 32
	.type	v2, @object
	.size	v2, 1200
v2:
	.zero	1200
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 1200
v:
	.zero	1200
	.globl	visited
	.align 32
	.type	visited, @object
	.size	visited, 400
visited:
	.zero	400
	.globl	u
	.align 32
	.type	u, @object
	.size	u, 400
u:
	.zero	400
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 800
t:
	.zero	800
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
#include<stdlib.h>
int n,a,b;
int* t[100];
int  u[100];
int visited[100];

int v[300],v2[300];
int l=0,r=0,cnt=1;

void push(int x,int y){
  v[r]=x;
  v2[r]=y;
  r++;
}

void pop(){
  l++;
}

int main(){
  int i,j;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a);
    a--;
    scanf("%d",&u[a]);
    t[a]=malloc( sizeof(int) * u[a] );
    for(j=0;j<u[a];j++){
      scanf("%d",&t[a][j]);
      t[a][j]--;
    }
    visited[i]=-1;
  }

   
  push(0,0);
  visited[0]=0;
  while(l!=r){
    a=v[l];
    b=v2[l];
    pop();
    for(i=0;i<u[a];i++){
      if(visited[t[a][i]]==-1){
	push(t[a][i],b+1);
	visited[t[a][i]]=b+1;
      }
    }
  }
  
    
  for(i=0;i<n;i++){
    printf("%d %d\n",i+1,visited[i]);
  }
  return 0;
}
4
1 2 1 4
2 1 4
3 0
4 1 3
 4
1 2 1 4
2 1 4
3 0
4 1 4
 4
1 2 2 4
2 1 4
3 0
4 1 1
 4
1 2 2 4
2 1 1
3 0
4 1 3
 4
1 2 1 1
2 1 4
3 0
4 1 4
 4
1 2 2 1
2 1 1
3 0
4 1 3
 4
1 2 1 4
3 1 4
3 0
4 1 2
 4
1 2 3 4
4 1 4
3 -1
3 1 0
 4
1 2 1 3
0 1 1
4 0
4 1 1
 4
1 2 2 1
2 1 4
3 0
3 1 0

1 0
2 -1
3 2
4 1
 1 0
2 -1
3 -1
4 1
 1 0
2 1
3 -1
4 1
 1 0
2 1
3 2
4 1
 1 0
2 -1
3 -1
4 -1
 1 0
2 1
3 -1
4 -1
 1 0
2 2
3 -1
4 1
 1 0
2 -1
3 1
4 1
 1 0
2 -1
3 1
4 -1
 1 0
2 1
3 -1
4 2

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<stdlib.h>
int n,a,b;
int* t[100];
int  u[100];
int visited[100];

int v[300],v2[300];
int l=0,r=0,cnt=1;

void push(int x,int y){
  v[r]=x;
  v2[r]=y;
  r++;
}

void pop(){
  l++;
}

int main(){
  int i,j;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a);
    a--;
    scanf("%d",&u[a]);
    t[a]=malloc( sizeof(int) * u[a] );
    for(j=0;j<u[a];j++){
      scanf("%d",&t[a][j]);
      t[a][j]--;
    }
    visited[i]=-1;
  }

   
  push(0,0);
  visited[0]=0;
  while(l!=r){
    a=v[l];
    b=v2[l];
    pop();
    for(i=0;i<u[a];i++){
      if(visited[t[a][i]]==-1){
	push(t[a][i],b+1);
	visited[t[a][i]]=b+1;
      }
    }
  }
  
    
  for(i=0;i<n;i++){
    printf("%d %d\n",i+1,visited[i]);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 800
t:
	.zero	800
	.globl	u
	.align 32
	.type	u, @object
	.size	u, 400
u:
	.zero	400
	.globl	visited
	.align 32
	.type	visited, @object
	.size	visited, 400
visited:
	.zero	400
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 1200
v:
	.zero	1200
	.globl	v2
	.align 32
	.type	v2, @object
	.size	v2, 1200
v2:
	.zero	1200
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	cnt
	.data
	.align 4
	.type	cnt, @object
	.size	cnt, 4
cnt:
	.long	1
	.text
	.globl	push
	.type	push, @function
push:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	r(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	v(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	r(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	v2(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	r(%rip), %eax
	addl	$1, %eax
	movl	%eax, r(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	push, .-push
	.globl	pop
	.type	pop, @function
pop:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	l(%rip), %eax
	addl	$1, %eax
	movl	%eax, l(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	pop, .-pop
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L4
.L7:
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	a(%rip), %eax
	subl	$1, %eax
	movl	%eax, a(%rip)
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	salq	$2, %rax
	movl	a(%rip), %ebx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, %rcx
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	t(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	$0, -20(%rbp)
	jmp	.L5
.L6:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	t(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	t(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	subl	$1, %edx
	movl	%edx, (%rax)
	addl	$1, -20(%rbp)
.L5:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L6
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	$-1, (%rdx,%rax)
	addl	$1, -24(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L7
	movl	$0, %esi
	movl	$0, %edi
	call	push
	movl	$0, visited(%rip)
	jmp	.L8
.L12:
	movl	l(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, a(%rip)
	movl	l(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v2(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, b(%rip)
	movl	$0, %eax
	call	pop
	movl	$0, -24(%rbp)
	jmp	.L9
.L11:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	t(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L10
	movl	b(%rip), %eax
	leal	1(%rax), %edx
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	t(%rip), %rax
	movq	(%rcx,%rax), %rcx
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	push
	movl	b(%rip), %edx
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	t(%rip), %rax
	movq	(%rcx,%rax), %rcx
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L10:
	addl	$1, -24(%rbp)
.L9:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L11
.L8:
	movl	l(%rip), %edx
	movl	r(%rip), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	$0, -24(%rbp)
	jmp	.L13
.L14:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	leal	1(%rdx), %ecx
	movl	%eax, %edx
	movl	%ecx, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -24(%rbp)
.L13:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 800
t:
	.zero	800
	.globl	u
	.align 32
	.type	u, @object
	.size	u, 400
u:
	.zero	400
	.globl	visited
	.align 32
	.type	visited, @object
	.size	visited, 400
visited:
	.zero	400
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 1200
v:
	.zero	1200
	.globl	v2
	.align 32
	.type	v2, @object
	.size	v2, 1200
v2:
	.zero	1200
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	cnt
	.data
	.align 4
	.type	cnt, @object
	.size	cnt, 4
cnt:
	.long	1
	.text
	.globl	push
	.type	push, @function
push:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	r(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	v(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	r(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	v2(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	r(%rip), %eax
	addl	$1, %eax
	movl	%eax, r(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	push, .-push
	.globl	pop
	.type	pop, @function
pop:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	l(%rip), %eax
	addl	$1, %eax
	movl	%eax, l(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	pop, .-pop
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L4
.L7:
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	a(%rip), %eax
	subl	$1, %eax
	movl	%eax, a(%rip)
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	salq	$2, %rax
	movl	a(%rip), %ebx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, %rcx
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	t(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	$0, -20(%rbp)
	jmp	.L5
.L6:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	t(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	t(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	subl	$1, %edx
	movl	%edx, (%rax)
	addl	$1, -20(%rbp)
.L5:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L6
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	$-1, (%rdx,%rax)
	addl	$1, -24(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L7
	movl	$0, %esi
	movl	$0, %edi
	call	push
	movl	$0, visited(%rip)
	jmp	.L8
.L12:
	movl	l(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, a(%rip)
	movl	l(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v2(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, b(%rip)
	movl	$0, %eax
	call	pop
	movl	$0, -24(%rbp)
	jmp	.L9
.L11:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	t(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L10
	movl	b(%rip), %eax
	leal	1(%rax), %edx
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	t(%rip), %rax
	movq	(%rcx,%rax), %rcx
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	push
	movl	b(%rip), %edx
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	t(%rip), %rax
	movq	(%rcx,%rax), %rcx
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L10:
	addl	$1, -24(%rbp)
.L9:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L11
.L8:
	movl	l(%rip), %edx
	movl	r(%rip), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	$0, -24(%rbp)
	jmp	.L13
.L14:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	leal	1(%rdx), %ecx
	movl	%eax, %edx
	movl	%ecx, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -24(%rbp)
.L13:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
