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>
#define BLACK 0
#define WHITE 1
#define GRAY -1


int a[101][101];

int n;
int color[101];
int time=0;
int d[101];
int k;
int head=0,tail=0;
int queue[101];

void BFS (int);

void Enqueue(int u){
    if(tail == 101)tail=0;
    queue[tail] =u;
    tail++;
}

int Dequeue(void){
    if(head==101)head=0;
    return queue[head++];
    
}



int main(void){
    int t,u,i,j;

    
    
    scanf("%d",&n);
    
    
   for(i=1;j<=n;i++){
        for(j=1;j<=n;j++){
            a[i][j]=0;
        }
    }
    
    for(i=1;i<=n;i++){
        scanf("%d",&u);
        scanf("%d",&k);
        for(j=1;j<=k;j++){
            scanf("%d",&t);
            a[i][t] =1;
        }
        
    }
    

      BFS(1);
        
        for(i=1;i<=n;i++){
            if(d[i]==2147483647)d[i]=-1;
            printf("%d %d",i,d[i]);
            printf("\n");
        }
        
    return 0;
}
  
void BFS(int s){
        int u,v,i;
        int empty=0;
        
        
        for(u=1;u<=n;u++){
            color[u]=WHITE;
            d[u]=2147483647;
        }
        
        color[s]=GRAY;
        d[s]=0;

    
        Enqueue(s);
        empty++;
        
        while(empty!=0){
            u=Dequeue();
            empty--;
            for(v=1;v<=n;v++){
               //v=a[u][v];
                if(color[v] == WHITE && a[u][v]==1){
                    color[v]=GRAY;
                    d[v]=d[u]+1;
                    Enqueue(v);
                    empty++;
                }
            }
           //
            color[u]=BLACK;
        }
   
        
}

    
    ```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 40804
a:
	.zero	40804
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	color
	.align 32
	.type	color, @object
	.size	color, 404
color:
	.zero	404
	.globl	time
	.align 4
	.type	time, @object
	.size	time, 4
time:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 404
d:
	.zero	404
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	head
	.align 4
	.type	head, @object
	.size	head, 4
head:
	.zero	4
	.globl	tail
	.align 4
	.type	tail, @object
	.size	tail, 4
tail:
	.zero	4
	.globl	queue
	.align 32
	.type	queue, @object
	.size	queue, 404
queue:
	.zero	404
	.text
	.globl	Enqueue
	.type	Enqueue, @function
Enqueue:
.LFB0:
	.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	tail(%rip), %eax
	cmpl	$101, %eax
	jne	.L2
	movl	$0, tail(%rip)
.L2:
	movl	tail(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	queue(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	tail(%rip), %eax
	addl	$1, %eax
	movl	%eax, tail(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	Enqueue, .-Enqueue
	.globl	Dequeue
	.type	Dequeue, @function
Dequeue:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	head(%rip), %eax
	cmpl	$101, %eax
	jne	.L4
	movl	$0, head(%rip)
.L4:
	movl	head(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, head(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	queue(%rip), %rax
	movl	(%rdx,%rax), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	Dequeue, .-Dequeue
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -16(%rbp)
	jmp	.L7
.L10:
	movl	$1, -12(%rbp)
	jmp	.L8
.L9:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L8:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L9
	addl	$1, -16(%rbp)
.L7:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L10
	movl	$1, -16(%rbp)
	jmp	.L11
.L14:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	k(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -12(%rbp)
	jmp	.L12
.L13:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L12:
	movl	k(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L13
	addl	$1, -16(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L14
	movl	$1, %edi
	call	BFS
	movl	$1, -16(%rbp)
	jmp	.L15
.L17:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$2147483647, %eax
	jne	.L16
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$-1, (%rdx,%rax)
.L16:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -16(%rbp)
.L15:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L17
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.globl	BFS
	.type	BFS, @function
BFS:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	$0, -4(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L21
.L22:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$2147483647, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L21:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L22
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	Enqueue
	addl	$1, -4(%rbp)
	jmp	.L23
.L27:
	call	Dequeue
	movl	%eax, -12(%rbp)
	subl	$1, -4(%rbp)
	movl	$1, -8(%rbp)
	jmp	.L24
.L26:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L25
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L25
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	Enqueue
	addl	$1, -4(%rbp)
.L25:
	addl	$1, -8(%rbp)
.L24:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L26
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	$0, (%rdx,%rax)
.L23:
	cmpl	$0, -4(%rbp)
	jne	.L27
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	BFS, .-BFS
	.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	Enqueue
	.type	Enqueue, @function
Enqueue:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	tail(%rip), %rax
	leal	1(%rax), %edx
	cmpl	$101, %eax
	jne	.L2
	movl	$1, %edx
	xorl	%eax, %eax
.L2:
	leaq	queue(%rip), %rcx
	movl	%edx, tail(%rip)
	movl	%edi, (%rcx,%rax,4)
	ret
	.cfi_endproc
.LFE23:
	.size	Enqueue, .-Enqueue
	.p2align 4
	.globl	Dequeue
	.type	Dequeue, @function
Dequeue:
.LFB24:
	.cfi_startproc
	endbr64
	movslq	head(%rip), %rax
	leal	1(%rax), %edx
	cmpl	$101, %eax
	jne	.L6
	movl	$1, %edx
	xorl	%eax, %eax
.L6:
	movl	%edx, head(%rip)
	leaq	queue(%rip), %rdx
	movl	(%rdx,%rax,4), %eax
	ret
	.cfi_endproc
.LFE24:
	.size	Dequeue, .-Dequeue
	.p2align 4
	.globl	BFS
	.type	BFS, @function
BFS:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edi, %esi
	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
	movl	n(%rip), %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	testl	%r12d, %r12d
	jle	.L38
	leal	-1(%r12), %eax
	cmpl	$2, %eax
	jbe	.L25
	movl	%r12d, %eax
	movdqa	.LC0(%rip), %xmm1
	movdqa	.LC1(%rip), %xmm0
	leaq	color(%rip), %rdx
	shrl	$2, %eax
	leaq	d(%rip), %rbx
	leal	-1(%rax), %ecx
	movl	$4, %eax
	salq	$4, %rcx
	addq	$20, %rcx
	.p2align 4,,10
	.p2align 3
.L13:
	movups	%xmm1, (%rdx,%rax)
	movups	%xmm0, (%rbx,%rax)
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L13
	movl	%r12d, %ecx
	andl	$-4, %ecx
	leal	1(%rcx), %eax
	cmpl	%ecx, %r12d
	je	.L15
.L12:
	movslq	%eax, %rcx
	movl	$1, (%rdx,%rcx,4)
	movl	$2147483647, (%rbx,%rcx,4)
	leal	1(%rax), %ecx
	cmpl	%r12d, %ecx
	jg	.L15
	movslq	%ecx, %rcx
	addl	$2, %eax
	movl	$1, (%rdx,%rcx,4)
	movl	$2147483647, (%rbx,%rcx,4)
	cmpl	%eax, %r12d
	jl	.L15
	cltq
	movl	$1, (%rdx,%rax,4)
	movl	$2147483647, (%rbx,%rax,4)
.L15:
	movslq	%esi, %rax
	movl	$-1, (%rdx,%rax,4)
	movl	$0, (%rbx,%rax,4)
	movslq	tail(%rip), %rax
	leal	1(%rax), %r11d
	cmpl	$101, %eax
	jne	.L10
	movl	$1, %r11d
	xorl	%eax, %eax
.L10:
	movl	%r11d, tail(%rip)
	leaq	queue(%rip), %rbp
	movl	head(%rip), %r10d
	xorl	%r13d, %r13d
	movl	%esi, 0(%rbp,%rax,4)
	movl	$1, %r9d
	leal	1(%r12), %esi
	leaq	a(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L22:
	cmpl	$101, %r10d
	je	.L26
	movslq	%r10d, %rax
	addl	$1, %r10d
.L17:
	movslq	0(%rbp,%rax,4), %rdi
	subl	$1, %r9d
	testl	%r12d, %r12d
	jle	.L18
	imulq	$404, %rdi, %r8
	movl	$1, %eax
	addq	%r14, %r8
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$1, %rax
	cmpq	%rsi, %rax
	je	.L18
.L21:
	cmpl	$1, (%rdx,%rax,4)
	movl	%eax, %ecx
	jne	.L19
	cmpl	$1, (%r8,%rax,4)
	jne	.L19
	movl	(%rbx,%rdi,4), %r15d
	movl	$-1, (%rdx,%rax,4)
	addl	$1, %r15d
	cmpl	$101, %r11d
	je	.L27
	movslq	%r11d, %r13
	addl	$1, %r11d
.L20:
	movl	%r15d, (%rbx,%rax,4)
	addq	$1, %rax
	addl	$1, %r9d
	movl	%ecx, 0(%rbp,%r13,4)
	movl	$1, %r13d
	cmpq	%rsi, %rax
	jne	.L21
	.p2align 4,,10
	.p2align 3
.L18:
	movl	$0, (%rdx,%rdi,4)
	testl	%r9d, %r9d
	jne	.L22
	movl	%r10d, head(%rip)
	testb	%r13b, %r13b
	je	.L8
	movl	%r11d, tail(%rip)
.L8:
	popq	%rbx
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	movl	$1, %r10d
	xorl	%eax, %eax
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L27:
	movl	$1, %r11d
	xorl	%r13d, %r13d
	jmp	.L20
.L38:
	leaq	color(%rip), %rdx
	leaq	d(%rip), %rbx
	jmp	.L15
.L25:
	movl	$1, %eax
	leaq	color(%rip), %rdx
	leaq	d(%rip), %rbx
	jmp	.L12
	.cfi_endproc
.LFE26:
	.size	BFS, .-BFS
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d"
.LC3:
	.string	"%d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	n(%rip), %rsi
	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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC2(%rip), %rbx
	movq	%rbx, %rdi
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %r12d
	testl	%r12d, %r12d
	js	.L43
	leal	-1(%r12), %eax
	leaq	408+a(%rip), %rdi
	leaq	4(,%rax,4), %rdx
	movl	$4, %eax
	cmovle	%rax, %rdx
	xorl	%esi, %esi
	call	memset@PLT
.L43:
	leaq	20(%rsp), %rax
	movl	$1, %r14d
	leaq	a(%rip), %rbp
	movq	%rax, 8(%rsp)
	testl	%r12d, %r12d
	jle	.L42
.L41:
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	k(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	k(%rip), %eax
	testl	%eax, %eax
	jle	.L47
	movslq	%r14d, %rax
	movl	$1, %r15d
	leaq	16(%rsp), %r13
	leaq	(%rax,%rax,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,4), %r12
	.p2align 4,,10
	.p2align 3
.L46:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%rbx, %rdi
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movslq	16(%rsp), %rax
	addq	%r12, %rax
	cmpl	%r15d, k(%rip)
	movl	$1, 0(%rbp,%rax,4)
	jge	.L46
.L47:
	addl	$1, %r14d
	cmpl	%r14d, n(%rip)
	jge	.L41
.L42:
	movl	$1, %edi
	movl	$1, %ebx
	leaq	d(%rip), %rbp
	call	BFS
	movl	n(%rip), %edx
	leaq	.LC3(%rip), %r12
	testl	%edx, %edx
	jle	.L45
	.p2align 4,,10
	.p2align 3
.L44:
	movl	0(%rbp,%rbx,4), %ecx
	movl	%ebx, %edx
	cmpl	$2147483647, %ecx
	jne	.L48
	movl	$-1, 0(%rbp,%rbx,4)
	movl	$-1, %ecx
.L48:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	movl	$10, %edi
	call	putchar@PLT
	cmpl	%ebx, n(%rip)
	jge	.L44
.L45:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L61
	addq	$40, %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
.L61:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	queue
	.bss
	.align 32
	.type	queue, @object
	.size	queue, 404
queue:
	.zero	404
	.globl	tail
	.align 4
	.type	tail, @object
	.size	tail, 4
tail:
	.zero	4
	.globl	head
	.align 4
	.type	head, @object
	.size	head, 4
head:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 404
d:
	.zero	404
	.globl	time
	.align 4
	.type	time, @object
	.size	time, 4
time:
	.zero	4
	.globl	color
	.align 32
	.type	color, @object
	.size	color, 404
color:
	.zero	404
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 40804
a:
	.zero	40804
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.align 16
.LC1:
	.long	2147483647
	.long	2147483647
	.long	2147483647
	.long	2147483647
	.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	Enqueue
	.type	Enqueue, @function
Enqueue:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	tail(%rip), %rax
	leal	1(%rax), %edx
	cmpl	$101, %eax
	jne	.L2
	movl	$1, %edx
	xorl	%eax, %eax
.L2:
	leaq	queue(%rip), %rcx
	movl	%edx, tail(%rip)
	movl	%edi, (%rcx,%rax,4)
	ret
	.cfi_endproc
.LFE23:
	.size	Enqueue, .-Enqueue
	.p2align 4
	.globl	Dequeue
	.type	Dequeue, @function
Dequeue:
.LFB24:
	.cfi_startproc
	endbr64
	movslq	head(%rip), %rax
	leal	1(%rax), %edx
	cmpl	$101, %eax
	jne	.L6
	movl	$1, %edx
	xorl	%eax, %eax
.L6:
	movl	%edx, head(%rip)
	leaq	queue(%rip), %rdx
	movl	(%rdx,%rax,4), %eax
	ret
	.cfi_endproc
.LFE24:
	.size	Dequeue, .-Dequeue
	.p2align 4
	.globl	BFS
	.type	BFS, @function
BFS:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edi, %esi
	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
	movl	n(%rip), %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	testl	%r12d, %r12d
	jle	.L38
	leal	-1(%r12), %eax
	cmpl	$2, %eax
	jbe	.L25
	movl	%r12d, %eax
	movdqa	.LC0(%rip), %xmm1
	movdqa	.LC1(%rip), %xmm0
	leaq	color(%rip), %rdx
	shrl	$2, %eax
	leaq	d(%rip), %rbx
	leal	-1(%rax), %ecx
	movl	$4, %eax
	salq	$4, %rcx
	addq	$20, %rcx
	.p2align 4,,10
	.p2align 3
.L13:
	movups	%xmm1, (%rdx,%rax)
	movups	%xmm0, (%rbx,%rax)
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L13
	movl	%r12d, %ecx
	andl	$-4, %ecx
	leal	1(%rcx), %eax
	cmpl	%ecx, %r12d
	je	.L15
.L12:
	movslq	%eax, %rcx
	movl	$1, (%rdx,%rcx,4)
	movl	$2147483647, (%rbx,%rcx,4)
	leal	1(%rax), %ecx
	cmpl	%r12d, %ecx
	jg	.L15
	movslq	%ecx, %rcx
	addl	$2, %eax
	movl	$1, (%rdx,%rcx,4)
	movl	$2147483647, (%rbx,%rcx,4)
	cmpl	%eax, %r12d
	jl	.L15
	cltq
	movl	$1, (%rdx,%rax,4)
	movl	$2147483647, (%rbx,%rax,4)
.L15:
	movslq	%esi, %rax
	movl	$-1, (%rdx,%rax,4)
	movl	$0, (%rbx,%rax,4)
	movslq	tail(%rip), %rax
	leal	1(%rax), %r11d
	cmpl	$101, %eax
	jne	.L10
	movl	$1, %r11d
	xorl	%eax, %eax
.L10:
	movl	%r11d, tail(%rip)
	leaq	queue(%rip), %rbp
	movl	head(%rip), %r10d
	xorl	%r13d, %r13d
	movl	%esi, 0(%rbp,%rax,4)
	movl	$1, %r9d
	leal	1(%r12), %esi
	leaq	a(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L22:
	cmpl	$101, %r10d
	je	.L26
	movslq	%r10d, %rax
	addl	$1, %r10d
.L17:
	movslq	0(%rbp,%rax,4), %rdi
	subl	$1, %r9d
	testl	%r12d, %r12d
	jle	.L18
	imulq	$404, %rdi, %r8
	movl	$1, %eax
	addq	%r14, %r8
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$1, %rax
	cmpq	%rsi, %rax
	je	.L18
.L21:
	cmpl	$1, (%rdx,%rax,4)
	movl	%eax, %ecx
	jne	.L19
	cmpl	$1, (%r8,%rax,4)
	jne	.L19
	movl	(%rbx,%rdi,4), %r15d
	movl	$-1, (%rdx,%rax,4)
	addl	$1, %r15d
	cmpl	$101, %r11d
	je	.L27
	movslq	%r11d, %r13
	addl	$1, %r11d
.L20:
	movl	%r15d, (%rbx,%rax,4)
	addq	$1, %rax
	addl	$1, %r9d
	movl	%ecx, 0(%rbp,%r13,4)
	movl	$1, %r13d
	cmpq	%rsi, %rax
	jne	.L21
	.p2align 4,,10
	.p2align 3
.L18:
	movl	$0, (%rdx,%rdi,4)
	testl	%r9d, %r9d
	jne	.L22
	movl	%r10d, head(%rip)
	testb	%r13b, %r13b
	je	.L8
	movl	%r11d, tail(%rip)
.L8:
	popq	%rbx
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	movl	$1, %r10d
	xorl	%eax, %eax
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L27:
	movl	$1, %r11d
	xorl	%r13d, %r13d
	jmp	.L20
.L38:
	leaq	color(%rip), %rdx
	leaq	d(%rip), %rbx
	jmp	.L15
.L25:
	movl	$1, %eax
	leaq	color(%rip), %rdx
	leaq	d(%rip), %rbx
	jmp	.L12
	.cfi_endproc
.LFE26:
	.size	BFS, .-BFS
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d"
.LC3:
	.string	"%d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	n(%rip), %rsi
	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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC2(%rip), %rbx
	movq	%rbx, %rdi
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %r12d
	testl	%r12d, %r12d
	js	.L43
	leal	-1(%r12), %eax
	leaq	408+a(%rip), %rdi
	leaq	4(,%rax,4), %rdx
	movl	$4, %eax
	cmovle	%rax, %rdx
	xorl	%esi, %esi
	call	memset@PLT
.L43:
	leaq	20(%rsp), %rax
	movl	$1, %r14d
	leaq	a(%rip), %rbp
	movq	%rax, 8(%rsp)
	testl	%r12d, %r12d
	jle	.L42
.L41:
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	k(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	k(%rip), %eax
	testl	%eax, %eax
	jle	.L47
	movslq	%r14d, %rax
	movl	$1, %r15d
	leaq	16(%rsp), %r13
	leaq	(%rax,%rax,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,4), %r12
	.p2align 4,,10
	.p2align 3
.L46:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%rbx, %rdi
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movslq	16(%rsp), %rax
	addq	%r12, %rax
	cmpl	%r15d, k(%rip)
	movl	$1, 0(%rbp,%rax,4)
	jge	.L46
.L47:
	addl	$1, %r14d
	cmpl	%r14d, n(%rip)
	jge	.L41
.L42:
	movl	$1, %edi
	movl	$1, %ebx
	leaq	d(%rip), %rbp
	call	BFS
	movl	n(%rip), %edx
	leaq	.LC3(%rip), %r12
	testl	%edx, %edx
	jle	.L45
	.p2align 4,,10
	.p2align 3
.L44:
	movl	0(%rbp,%rbx,4), %ecx
	movl	%ebx, %edx
	cmpl	$2147483647, %ecx
	jne	.L48
	movl	$-1, 0(%rbp,%rbx,4)
	movl	$-1, %ecx
.L48:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	movl	$10, %edi
	call	putchar@PLT
	cmpl	%ebx, n(%rip)
	jge	.L44
.L45:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L61
	addq	$40, %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
.L61:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	queue
	.bss
	.align 32
	.type	queue, @object
	.size	queue, 404
queue:
	.zero	404
	.globl	tail
	.align 4
	.type	tail, @object
	.size	tail, 4
tail:
	.zero	4
	.globl	head
	.align 4
	.type	head, @object
	.size	head, 4
head:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 404
d:
	.zero	404
	.globl	time
	.align 4
	.type	time, @object
	.size	time, 4
time:
	.zero	4
	.globl	color
	.align 32
	.type	color, @object
	.size	color, 404
color:
	.zero	404
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 40804
a:
	.zero	40804
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.align 16
.LC1:
	.long	2147483647
	.long	2147483647
	.long	2147483647
	.long	2147483647
	.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>
#define BLACK 0
#define WHITE 1
#define GRAY -1


int a[101][101];

int n;
int color[101];
int time=0;
int d[101];
int k;
int head=0,tail=0;
int queue[101];

void BFS (int);

void Enqueue(int u){
    if(tail == 101)tail=0;
    queue[tail] =u;
    tail++;
}

int Dequeue(void){
    if(head==101)head=0;
    return queue[head++];
    
}



int main(void){
    int t,u,i,j;

    
    
    scanf("%d",&n);
    
    
   for(i=1;j<=n;i++){
        for(j=1;j<=n;j++){
            a[i][j]=0;
        }
    }
    
    for(i=1;i<=n;i++){
        scanf("%d",&u);
        scanf("%d",&k);
        for(j=1;j<=k;j++){
            scanf("%d",&t);
            a[i][t] =1;
        }
        
    }
    

      BFS(1);
        
        for(i=1;i<=n;i++){
            if(d[i]==2147483647)d[i]=-1;
            printf("%d %d",i,d[i]);
            printf("\n");
        }
        
    return 0;
}
  
void BFS(int s){
        int u,v,i;
        int empty=0;
        
        
        for(u=1;u<=n;u++){
            color[u]=WHITE;
            d[u]=2147483647;
        }
        
        color[s]=GRAY;
        d[s]=0;

    
        Enqueue(s);
        empty++;
        
        while(empty!=0){
            u=Dequeue();
            empty--;
            for(v=1;v<=n;v++){
               //v=a[u][v];
                if(color[v] == WHITE && a[u][v]==1){
                    color[v]=GRAY;
                    d[v]=d[u]+1;
                    Enqueue(v);
                    empty++;
                }
            }
           //
            color[u]=BLACK;
        }
   
        
}

    
    
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>
#define BLACK 0
#define WHITE 1
#define GRAY -1


int a[101][101];

int n;
int color[101];
int time=0;
int d[101];
int k;
int head=0,tail=0;
int queue[101];

void BFS (int);

void Enqueue(int u){
    if(tail == 101)tail=0;
    queue[tail] =u;
    tail++;
}

int Dequeue(void){
    if(head==101)head=0;
    return queue[head++];
    
}



int main(void){
    int t,u,i,j;

    
    
    scanf("%d",&n);
    
    
   for(i=1;j<=n;i++){
        for(j=1;j<=n;j++){
            a[i][j]=0;
        }
    }
    
    for(i=1;i<=n;i++){
        scanf("%d",&u);
        scanf("%d",&k);
        for(j=1;j<=k;j++){
            scanf("%d",&t);
            a[i][t] =1;
        }
        
    }
    

      BFS(1);
        
        for(i=1;i<=n;i++){
            if(d[i]==2147483647)d[i]=-1;
            printf("%d %d",i,d[i]);
            printf("\n");
        }
        
    return 0;
}
  
void BFS(int s){
        int u,v,i;
        int empty=0;
        
        
        for(u=1;u<=n;u++){
            color[u]=WHITE;
            d[u]=2147483647;
        }
        
        color[s]=GRAY;
        d[s]=0;

    
        Enqueue(s);
        empty++;
        
        while(empty!=0){
            u=Dequeue();
            empty--;
            for(v=1;v<=n;v++){
               //v=a[u][v];
                if(color[v] == WHITE && a[u][v]==1){
                    color[v]=GRAY;
                    d[v]=d[u]+1;
                    Enqueue(v);
                    empty++;
                }
            }
           //
            color[u]=BLACK;
        }
   
        
}

    
    ```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 40804
a:
	.zero	40804
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	color
	.align 32
	.type	color, @object
	.size	color, 404
color:
	.zero	404
	.globl	time
	.align 4
	.type	time, @object
	.size	time, 4
time:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 404
d:
	.zero	404
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	head
	.align 4
	.type	head, @object
	.size	head, 4
head:
	.zero	4
	.globl	tail
	.align 4
	.type	tail, @object
	.size	tail, 4
tail:
	.zero	4
	.globl	queue
	.align 32
	.type	queue, @object
	.size	queue, 404
queue:
	.zero	404
	.text
	.globl	Enqueue
	.type	Enqueue, @function
Enqueue:
.LFB0:
	.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	tail(%rip), %eax
	cmpl	$101, %eax
	jne	.L2
	movl	$0, tail(%rip)
.L2:
	movl	tail(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	queue(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	tail(%rip), %eax
	addl	$1, %eax
	movl	%eax, tail(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	Enqueue, .-Enqueue
	.globl	Dequeue
	.type	Dequeue, @function
Dequeue:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	head(%rip), %eax
	cmpl	$101, %eax
	jne	.L4
	movl	$0, head(%rip)
.L4:
	movl	head(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, head(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	queue(%rip), %rax
	movl	(%rdx,%rax), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	Dequeue, .-Dequeue
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -16(%rbp)
	jmp	.L7
.L10:
	movl	$1, -12(%rbp)
	jmp	.L8
.L9:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L8:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L9
	addl	$1, -16(%rbp)
.L7:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L10
	movl	$1, -16(%rbp)
	jmp	.L11
.L14:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	k(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -12(%rbp)
	jmp	.L12
.L13:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L12:
	movl	k(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L13
	addl	$1, -16(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L14
	movl	$1, %edi
	call	BFS
	movl	$1, -16(%rbp)
	jmp	.L15
.L17:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$2147483647, %eax
	jne	.L16
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$-1, (%rdx,%rax)
.L16:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -16(%rbp)
.L15:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L17
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.globl	BFS
	.type	BFS, @function
BFS:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	$0, -4(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L21
.L22:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$2147483647, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L21:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L22
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	Enqueue
	addl	$1, -4(%rbp)
	jmp	.L23
.L27:
	call	Dequeue
	movl	%eax, -12(%rbp)
	subl	$1, -4(%rbp)
	movl	$1, -8(%rbp)
	jmp	.L24
.L26:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L25
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L25
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	Enqueue
	addl	$1, -4(%rbp)
.L25:
	addl	$1, -8(%rbp)
.L24:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L26
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	$0, (%rdx,%rax)
.L23:
	cmpl	$0, -4(%rbp)
	jne	.L27
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	BFS, .-BFS
	.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	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 40804
a:
	.zero	40804
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	color
	.align 32
	.type	color, @object
	.size	color, 404
color:
	.zero	404
	.globl	time
	.align 4
	.type	time, @object
	.size	time, 4
time:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 404
d:
	.zero	404
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	head
	.align 4
	.type	head, @object
	.size	head, 4
head:
	.zero	4
	.globl	tail
	.align 4
	.type	tail, @object
	.size	tail, 4
tail:
	.zero	4
	.globl	queue
	.align 32
	.type	queue, @object
	.size	queue, 404
queue:
	.zero	404
	.text
	.globl	Enqueue
	.type	Enqueue, @function
Enqueue:
.LFB0:
	.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	tail(%rip), %eax
	cmpl	$101, %eax
	jne	.L2
	movl	$0, tail(%rip)
.L2:
	movl	tail(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	queue(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	tail(%rip), %eax
	addl	$1, %eax
	movl	%eax, tail(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	Enqueue, .-Enqueue
	.globl	Dequeue
	.type	Dequeue, @function
Dequeue:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	head(%rip), %eax
	cmpl	$101, %eax
	jne	.L4
	movl	$0, head(%rip)
.L4:
	movl	head(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, head(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	queue(%rip), %rax
	movl	(%rdx,%rax), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	Dequeue, .-Dequeue
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -16(%rbp)
	jmp	.L7
.L10:
	movl	$1, -12(%rbp)
	jmp	.L8
.L9:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L8:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L9
	addl	$1, -16(%rbp)
.L7:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L10
	movl	$1, -16(%rbp)
	jmp	.L11
.L14:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	k(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -12(%rbp)
	jmp	.L12
.L13:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L12:
	movl	k(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L13
	addl	$1, -16(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L14
	movl	$1, %edi
	call	BFS
	movl	$1, -16(%rbp)
	jmp	.L15
.L17:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$2147483647, %eax
	jne	.L16
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$-1, (%rdx,%rax)
.L16:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -16(%rbp)
.L15:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L17
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.globl	BFS
	.type	BFS, @function
BFS:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	$0, -4(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L21
.L22:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$2147483647, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L21:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L22
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	Enqueue
	addl	$1, -4(%rbp)
	jmp	.L23
.L27:
	call	Dequeue
	movl	%eax, -12(%rbp)
	subl	$1, -4(%rbp)
	movl	$1, -8(%rbp)
	jmp	.L24
.L26:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L25
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L25
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	Enqueue
	addl	$1, -4(%rbp)
.L25:
	addl	$1, -8(%rbp)
.L24:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L26
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	$0, (%rdx,%rax)
.L23:
	cmpl	$0, -4(%rbp)
	jne	.L27
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	BFS, .-BFS
	.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:
