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>
#define ll long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
#define min(p,q)((p)<(q)?(p):(q))

typedef struct edge{ll s,g,c;}E;

ll n,k,ans;
E e[4010];
ll vnow[2010];
ll epre[4010];

ll que[4010];
ll d[2010][2010];
void bfs(int k){
	ll qcnt=1;
	que[0]=k;
	d[k][k]=1;
	rep(i,0,qcnt){
		ll v=que[i];
		for(ll t=vnow[v];t!=-1;t=epre[t])if(!d[k][e[t].g]){
			que[qcnt++]=e[t].g;
			d[k][e[t].g]=d[k][v]+1;
		}
	}
}

int main(){
	scanf("%lld%lld",&n,&k);
	rep(i,0,n)vnow[i]=-1;
	
	rep(i,0,n-1){
		ll a,b;
		scanf("%lld%lld",&a,&b);
		a--;b--;
		e[2*i].s=a;
		e[2*i].g=b;
		epre[2*i]=vnow[a];
		vnow[a]=2*i;
		
		e[2*i+1].s=b;
		e[2*i+1].g=a;
		epre[2*i+1]=vnow[b];
		vnow[b]=2*i+1;
	}

	rep(i,0,n)bfs(i);
	ans=n;
	
	if(k%2==0){
		//kが偶数のとき
		//頂点iを中心にして、距離がk/2より大きな頂点の個数の最小値を求める
		rep(i,0,n){
			ll temp=0;
			rep(j,0,n)if(d[i][j]-1>k/2)temp++;
			ans=min(ans,temp);
		}
	}else{
		//kが奇数のとき
		//辺iを中心にして、距離がk/2.0より大きな頂点の個数の最小値を求める
		//⇔辺の端点どちらかからの距離もk/2より大きな以下同
		rep(i,0,n-1){
			ll temp=0;
			rep(j,0,n)if(min(d[e[2*i].s][j],d[e[2*i].g][j])-1>k/2)temp++;
			ans=min(ans,temp);
		}
	}
	printf("%lld\n",ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	k
	.align 8
	.type	k, @object
	.size	k, 8
k:
	.zero	8
	.globl	ans
	.align 8
	.type	ans, @object
	.size	ans, 8
ans:
	.zero	8
	.globl	e
	.align 32
	.type	e, @object
	.size	e, 96240
e:
	.zero	96240
	.globl	vnow
	.align 32
	.type	vnow, @object
	.size	vnow, 16080
vnow:
	.zero	16080
	.globl	epre
	.align 32
	.type	epre, @object
	.size	epre, 32080
epre:
	.zero	32080
	.globl	que
	.align 32
	.type	que, @object
	.size	que, 32080
que:
	.zero	32080
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 32320800
d:
	.zero	32320800
	.text
	.globl	bfs
	.type	bfs, @function
bfs:
.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, -36(%rbp)
	movq	$1, -32(%rbp)
	movl	-36(%rbp), %eax
	cltq
	movq	%rax, que(%rip)
	movl	-36(%rbp), %eax
	cltq
	imulq	$16088, %rax, %rax
	leaq	d(%rip), %rdx
	movq	$1, (%rax,%rdx)
	movq	$0, -24(%rbp)
	jmp	.L2
.L6:
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L3
.L5:
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	8+e(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$2010, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	jne	.L4
	movq	-32(%rbp), %rdx
	leaq	1(%rdx), %rax
	movq	%rax, -32(%rbp)
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	8+e(%rip), %rax
	movq	(%rcx,%rax), %rax
	leaq	0(,%rdx,8), %rcx
	leaq	que(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-36(%rbp), %eax
	cltq
	imulq	$2010, %rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	8+e(%rip), %rax
	movq	(%rdx,%rax), %rdx
	addq	$1, %rcx
	movl	-36(%rbp), %eax
	cltq
	imulq	$2010, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	%rcx, (%rdx,%rax)
.L4:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	epre(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -16(%rbp)
.L3:
	cmpq	$-1, -16(%rbp)
	jne	.L5
	addq	$1, -24(%rbp)
.L2:
	movq	-24(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jl	.L6
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	bfs, .-bfs
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	k(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -80(%rbp)
	jmp	.L8
.L9:
	movq	-80(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	$-1, (%rdx,%rax)
	addq	$1, -80(%rbp)
.L8:
	movq	n(%rip), %rax
	cmpq	%rax, -80(%rbp)
	jl	.L9
	movq	$0, -72(%rbp)
	jmp	.L10
.L11:
	leaq	-88(%rbp), %rdx
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-96(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -96(%rbp)
	movq	-88(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movq	-72(%rbp), %rax
	leaq	(%rax,%rax), %rcx
	movq	-96(%rbp), %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	e(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-72(%rbp), %rax
	leaq	(%rax,%rax), %rcx
	movq	-88(%rbp), %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	8+e(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-96(%rbp), %rax
	movq	-72(%rbp), %rdx
	leaq	(%rdx,%rdx), %rcx
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	(%rdx,%rax), %rax
	salq	$3, %rcx
	leaq	epre(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movq	-96(%rbp), %rax
	movq	-72(%rbp), %rdx
	leaq	(%rdx,%rdx), %rcx
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	leaq	1(%rax), %rcx
	movq	-88(%rbp), %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	e(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	leaq	1(%rax), %rcx
	movq	-96(%rbp), %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	8+e(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-88(%rbp), %rax
	movq	-72(%rbp), %rdx
	addq	%rdx, %rdx
	leaq	1(%rdx), %rcx
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	(%rdx,%rax), %rax
	salq	$3, %rcx
	leaq	epre(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movq	-72(%rbp), %rax
	leaq	(%rax,%rax), %rdx
	movq	-88(%rbp), %rax
	leaq	1(%rdx), %rcx
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addq	$1, -72(%rbp)
.L10:
	movq	n(%rip), %rax
	subq	$1, %rax
	cmpq	%rax, -72(%rbp)
	jl	.L11
	movq	$0, -64(%rbp)
	jmp	.L12
.L13:
	movq	-64(%rbp), %rax
	movl	%eax, %edi
	call	bfs
	addq	$1, -64(%rbp)
.L12:
	movq	n(%rip), %rax
	cmpq	%rax, -64(%rbp)
	jl	.L13
	movq	n(%rip), %rax
	movq	%rax, ans(%rip)
	movq	k(%rip), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L14
	movq	$0, -56(%rbp)
	jmp	.L15
.L19:
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	jmp	.L16
.L18:
	movq	-56(%rbp), %rax
	imulq	$2010, %rax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	-1(%rax), %rdx
	movq	k(%rip), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	cmpq	%rax, %rdx
	jle	.L17
	addq	$1, -48(%rbp)
.L17:
	addq	$1, -40(%rbp)
.L16:
	movq	n(%rip), %rax
	cmpq	%rax, -40(%rbp)
	jl	.L18
	movq	ans(%rip), %rdx
	movq	-48(%rbp), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, ans(%rip)
	addq	$1, -56(%rbp)
.L15:
	movq	n(%rip), %rax
	cmpq	%rax, -56(%rbp)
	jl	.L19
	jmp	.L20
.L14:
	movq	$0, -32(%rbp)
	jmp	.L21
.L25:
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L22
.L24:
	movq	-32(%rbp), %rax
	leaq	(%rax,%rax), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	8+e(%rip), %rax
	movq	(%rdx,%rax), %rax
	imulq	$2010, %rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-32(%rbp), %rax
	leaq	(%rax,%rax), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	e(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	$2010, %rax, %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	d(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	leaq	-1(%rax), %rdx
	movq	k(%rip), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	cmpq	%rax, %rdx
	jle	.L23
	addq	$1, -24(%rbp)
.L23:
	addq	$1, -16(%rbp)
.L22:
	movq	n(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L24
	movq	ans(%rip), %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, ans(%rip)
	addq	$1, -32(%rbp)
.L21:
	movq	n(%rip), %rax
	subq	$1, %rax
	cmpq	%rax, -32(%rbp)
	jl	.L25
.L20:
	movq	ans(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	bfs
	.type	bfs, @function
bfs:
.LFB39:
	.cfi_startproc
	endbr64
	movslq	%edi, %r8
	leaq	d(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$1, %edi
	imulq	$16088, %r8, %rax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	vnow(%rip), %r13
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	e(%rip), %r10
	leaq	que(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	epre(%rip), %r9
	movq	%r8, que(%rip)
	imulq	$2010, %r8, %r8
	movq	$1, (%rsi,%rax)
	.p2align 4,,10
	.p2align 3
.L6:
	movq	0(%rbp,%r12,8), %rbx
	movq	0(%r13,%rbx,8), %rax
	cmpq	$-1, %rax
	je	.L2
	addq	%r8, %rbx
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	(%rax,%rax,2), %rdx
	movq	8(%r10,%rdx,8), %rcx
	leaq	(%r8,%rcx), %rdx
	cmpq	$0, (%rsi,%rdx,8)
	jne	.L3
	movq	%rcx, 0(%rbp,%rdi,8)
	leaq	1(%rdi), %r11
	movq	(%rsi,%rbx,8), %rdi
	movq	(%r9,%rax,8), %rax
	leaq	1(%rdi), %rcx
	movq	%r11, %rdi
	movq	%rcx, (%rsi,%rdx,8)
	cmpq	$-1, %rax
	jne	.L5
.L2:
	addq	$1, %r12
	cmpq	%rdi, %r12
	jl	.L6
.L17:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	movq	(%r9,%rax,8), %rax
	cmpq	$-1, %rax
	jne	.L5
	addq	$1, %r12
	cmpq	%rdi, %r12
	jl	.L6
	jmp	.L17
	.cfi_endproc
.LFE39:
	.size	bfs, .-bfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	k(%rip), %rdx
	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	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	n(%rip), %r9
	testq	%r9, %r9
	jle	.L19
	leaq	vnow(%rip), %r12
	movl	$255, %esi
	movq	%r9, 8(%rsp)
	leaq	0(,%r9,8), %rdx
	movq	%r12, %rdi
	call	memset@PLT
	movq	8(%rsp), %r9
	cmpq	$1, %r9
	je	.L20
	leaq	24(%rsp), %rax
	xorl	%r15d, %r15d
	leaq	32(%rsp), %r13
	xorl	%ebp, %ebp
	movq	%rax, 8(%rsp)
	leaq	e(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L21:
	movq	8(%rsp), %rsi
	movq	%r13, %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	addq	$48, %r14
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rax
	movq	n(%rip), %r9
	leaq	epre(%rip), %rsi
	leaq	-1(%rax), %rdx
	movq	32(%rsp), %rax
	movq	(%r12,%rdx,8), %xmm0
	movq	%r15, (%r12,%rdx,8)
	subq	$1, %rax
	movq	%rdx, -48(%r14)
	movq	%rdx, -16(%r14)
	leaq	1(%r15), %rdx
	movhps	(%r12,%rax,8), %xmm0
	movq	%rax, -40(%r14)
	movq	%rax, -24(%r14)
	movq	%rdx, (%r12,%rax,8)
	leaq	-1(%r9), %rax
	movaps	%xmm0, (%rsi,%r15,8)
	addq	$2, %r15
	cmpq	%rbp, %rax
	jg	.L21
	testq	%r9, %r9
	jle	.L19
.L20:
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L22:
	movl	%ebx, %edi
	addq	$1, %rbx
	call	bfs
	movq	n(%rip), %r8
	cmpq	%rbx, %r8
	jg	.L22
	movq	k(%rip), %rax
	movq	%r8, ans(%rip)
	testb	$1, %al
	je	.L23
	leaq	-1(%r8), %rbp
	movq	%r8, %rbx
	testq	%rbp, %rbp
	jle	.L25
	movl	$2, %ecx
	cqto
	leaq	e(%rip), %r11
	xorl	%r12d, %r12d
	idivq	%rcx
	leaq	d(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L26:
	xorl	%esi, %esi
	testq	%r8, %r8
	jle	.L35
	movq	8(%r11), %rdx
	imulq	$16080, (%r11), %r9
	xorl	%esi, %esi
	imulq	$16080, %rdx, %rdi
	imulq	$2010, %rdx, %rdx
	leaq	(%rdi,%r13), %rcx
	addq	%r8, %rdx
	leaq	0(%r13,%rdx,8), %r10
	.p2align 4,,10
	.p2align 3
.L33:
	movq	%rcx, %rdx
	movq	(%rcx), %r14
	subq	%rdi, %rdx
	movq	(%rdx,%r9), %rdx
	cmpq	%r14, %rdx
	cmovg	%r14, %rdx
	subq	$1, %rdx
	cmpq	%rdx, %rax
	setl	%dl
	addq	$8, %rcx
	movzbl	%dl, %edx
	addq	%rdx, %rsi
	cmpq	%r10, %rcx
	jne	.L33
.L35:
	cmpq	%rsi, %rbx
	cmovg	%rsi, %rbx
	addq	$1, %r12
	addq	$48, %r11
	cmpq	%r12, %rbp
	jne	.L26
	movq	%rbx, ans(%rip)
.L25:
	movq	ans(%rip), %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L49
	addq	$56, %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
.L23:
	.cfi_restore_state
	testq	%r8, %r8
	jle	.L25
	imulq	$16088, %r8, %r9
	movl	$2, %ecx
	cqto
	idivq	%rcx
	leaq	0(,%r8,8), %r10
	leaq	d(%rip), %rdx
	leaq	(%r10,%rdx), %rdi
	addq	%rdx, %r9
	.p2align 4,,10
	.p2align 3
.L30:
	movq	%rdi, %rdx
	xorl	%esi, %esi
	subq	%r10, %rdx
	.p2align 4,,10
	.p2align 3
.L29:
	movq	(%rdx), %rbx
	leaq	-1(%rbx), %rcx
	cmpq	%rcx, %rax
	setl	%cl
	addq	$8, %rdx
	movzbl	%cl, %ecx
	addq	%rcx, %rsi
	cmpq	%rdx, %rdi
	jne	.L29
	cmpq	%rsi, %r8
	cmovg	%rsi, %r8
	addq	$16080, %rdi
	cmpq	%r9, %rdi
	jne	.L30
	movq	%r8, ans(%rip)
	jmp	.L25
.L19:
	movq	%r9, ans(%rip)
	jmp	.L25
.L49:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 32320800
d:
	.zero	32320800
	.globl	que
	.align 32
	.type	que, @object
	.size	que, 32080
que:
	.zero	32080
	.globl	epre
	.align 32
	.type	epre, @object
	.size	epre, 32080
epre:
	.zero	32080
	.globl	vnow
	.align 32
	.type	vnow, @object
	.size	vnow, 16080
vnow:
	.zero	16080
	.globl	e
	.align 32
	.type	e, @object
	.size	e, 96240
e:
	.zero	96240
	.globl	ans
	.align 8
	.type	ans, @object
	.size	ans, 8
ans:
	.zero	8
	.globl	k
	.align 8
	.type	k, @object
	.size	k, 8
k:
	.zero	8
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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	bfs
	.type	bfs, @function
bfs:
.LFB39:
	.cfi_startproc
	endbr64
	movslq	%edi, %r8
	leaq	d(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$1, %edi
	imulq	$16088, %r8, %rax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	vnow(%rip), %r13
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	e(%rip), %r10
	leaq	que(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	epre(%rip), %r9
	movq	%r8, que(%rip)
	imulq	$2010, %r8, %r8
	movq	$1, (%rsi,%rax)
	.p2align 4,,10
	.p2align 3
.L6:
	movq	0(%rbp,%r12,8), %rbx
	movq	0(%r13,%rbx,8), %rax
	cmpq	$-1, %rax
	je	.L2
	addq	%r8, %rbx
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	(%rax,%rax,2), %rdx
	movq	8(%r10,%rdx,8), %rcx
	leaq	(%r8,%rcx), %rdx
	cmpq	$0, (%rsi,%rdx,8)
	jne	.L3
	movq	%rcx, 0(%rbp,%rdi,8)
	leaq	1(%rdi), %r11
	movq	(%rsi,%rbx,8), %rdi
	movq	(%r9,%rax,8), %rax
	leaq	1(%rdi), %rcx
	movq	%r11, %rdi
	movq	%rcx, (%rsi,%rdx,8)
	cmpq	$-1, %rax
	jne	.L5
.L2:
	addq	$1, %r12
	cmpq	%rdi, %r12
	jl	.L6
.L17:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	movq	(%r9,%rax,8), %rax
	cmpq	$-1, %rax
	jne	.L5
	addq	$1, %r12
	cmpq	%rdi, %r12
	jl	.L6
	jmp	.L17
	.cfi_endproc
.LFE39:
	.size	bfs, .-bfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	k(%rip), %rdx
	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	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	n(%rip), %r9
	testq	%r9, %r9
	jle	.L19
	leaq	vnow(%rip), %r12
	movl	$255, %esi
	movq	%r9, 8(%rsp)
	leaq	0(,%r9,8), %rdx
	movq	%r12, %rdi
	call	memset@PLT
	movq	8(%rsp), %r9
	cmpq	$1, %r9
	je	.L20
	leaq	24(%rsp), %rax
	xorl	%r15d, %r15d
	leaq	32(%rsp), %r13
	xorl	%ebp, %ebp
	movq	%rax, 8(%rsp)
	leaq	e(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L21:
	movq	8(%rsp), %rsi
	movq	%r13, %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	addq	$48, %r14
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rax
	movq	n(%rip), %r9
	leaq	epre(%rip), %rsi
	leaq	-1(%rax), %rdx
	movq	32(%rsp), %rax
	movq	(%r12,%rdx,8), %xmm0
	movq	%r15, (%r12,%rdx,8)
	subq	$1, %rax
	movq	%rdx, -48(%r14)
	movq	%rdx, -16(%r14)
	leaq	1(%r15), %rdx
	movhps	(%r12,%rax,8), %xmm0
	movq	%rax, -40(%r14)
	movq	%rax, -24(%r14)
	movq	%rdx, (%r12,%rax,8)
	leaq	-1(%r9), %rax
	movaps	%xmm0, (%rsi,%r15,8)
	addq	$2, %r15
	cmpq	%rbp, %rax
	jg	.L21
	testq	%r9, %r9
	jle	.L19
.L20:
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L22:
	movl	%ebx, %edi
	addq	$1, %rbx
	call	bfs
	movq	n(%rip), %r8
	cmpq	%rbx, %r8
	jg	.L22
	movq	k(%rip), %rax
	movq	%r8, ans(%rip)
	testb	$1, %al
	je	.L23
	leaq	-1(%r8), %rbp
	movq	%r8, %rbx
	testq	%rbp, %rbp
	jle	.L25
	movl	$2, %ecx
	cqto
	leaq	e(%rip), %r11
	xorl	%r12d, %r12d
	idivq	%rcx
	leaq	d(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L26:
	xorl	%esi, %esi
	testq	%r8, %r8
	jle	.L35
	movq	8(%r11), %rdx
	imulq	$16080, (%r11), %r9
	xorl	%esi, %esi
	imulq	$16080, %rdx, %rdi
	imulq	$2010, %rdx, %rdx
	leaq	(%rdi,%r13), %rcx
	addq	%r8, %rdx
	leaq	0(%r13,%rdx,8), %r10
	.p2align 4,,10
	.p2align 3
.L33:
	movq	%rcx, %rdx
	movq	(%rcx), %r14
	subq	%rdi, %rdx
	movq	(%rdx,%r9), %rdx
	cmpq	%r14, %rdx
	cmovg	%r14, %rdx
	subq	$1, %rdx
	cmpq	%rdx, %rax
	setl	%dl
	addq	$8, %rcx
	movzbl	%dl, %edx
	addq	%rdx, %rsi
	cmpq	%r10, %rcx
	jne	.L33
.L35:
	cmpq	%rsi, %rbx
	cmovg	%rsi, %rbx
	addq	$1, %r12
	addq	$48, %r11
	cmpq	%r12, %rbp
	jne	.L26
	movq	%rbx, ans(%rip)
.L25:
	movq	ans(%rip), %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L49
	addq	$56, %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
.L23:
	.cfi_restore_state
	testq	%r8, %r8
	jle	.L25
	imulq	$16088, %r8, %r9
	movl	$2, %ecx
	cqto
	idivq	%rcx
	leaq	0(,%r8,8), %r10
	leaq	d(%rip), %rdx
	leaq	(%r10,%rdx), %rdi
	addq	%rdx, %r9
	.p2align 4,,10
	.p2align 3
.L30:
	movq	%rdi, %rdx
	xorl	%esi, %esi
	subq	%r10, %rdx
	.p2align 4,,10
	.p2align 3
.L29:
	movq	(%rdx), %rbx
	leaq	-1(%rbx), %rcx
	cmpq	%rcx, %rax
	setl	%cl
	addq	$8, %rdx
	movzbl	%cl, %ecx
	addq	%rcx, %rsi
	cmpq	%rdx, %rdi
	jne	.L29
	cmpq	%rsi, %r8
	cmovg	%rsi, %r8
	addq	$16080, %rdi
	cmpq	%r9, %rdi
	jne	.L30
	movq	%r8, ans(%rip)
	jmp	.L25
.L19:
	movq	%r9, ans(%rip)
	jmp	.L25
.L49:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 32320800
d:
	.zero	32320800
	.globl	que
	.align 32
	.type	que, @object
	.size	que, 32080
que:
	.zero	32080
	.globl	epre
	.align 32
	.type	epre, @object
	.size	epre, 32080
epre:
	.zero	32080
	.globl	vnow
	.align 32
	.type	vnow, @object
	.size	vnow, 16080
vnow:
	.zero	16080
	.globl	e
	.align 32
	.type	e, @object
	.size	e, 96240
e:
	.zero	96240
	.globl	ans
	.align 8
	.type	ans, @object
	.size	ans, 8
ans:
	.zero	8
	.globl	k
	.align 8
	.type	k, @object
	.size	k, 8
k:
	.zero	8
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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>
#define ll long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
#define min(p,q)((p)<(q)?(p):(q))

typedef struct edge{ll s,g,c;}E;

ll n,k,ans;
E e[4010];
ll vnow[2010];
ll epre[4010];

ll que[4010];
ll d[2010][2010];
void bfs(int k){
	ll qcnt=1;
	que[0]=k;
	d[k][k]=1;
	rep(i,0,qcnt){
		ll v=que[i];
		for(ll t=vnow[v];t!=-1;t=epre[t])if(!d[k][e[t].g]){
			que[qcnt++]=e[t].g;
			d[k][e[t].g]=d[k][v]+1;
		}
	}
}

int main(){
	scanf("%lld%lld",&n,&k);
	rep(i,0,n)vnow[i]=-1;
	
	rep(i,0,n-1){
		ll a,b;
		scanf("%lld%lld",&a,&b);
		a--;b--;
		e[2*i].s=a;
		e[2*i].g=b;
		epre[2*i]=vnow[a];
		vnow[a]=2*i;
		
		e[2*i+1].s=b;
		e[2*i+1].g=a;
		epre[2*i+1]=vnow[b];
		vnow[b]=2*i+1;
	}

	rep(i,0,n)bfs(i);
	ans=n;
	
	if(k%2==0){
		//kが偶数のとき
		//頂点iを中心にして、距離がk/2より大きな頂点の個数の最小値を求める
		rep(i,0,n){
			ll temp=0;
			rep(j,0,n)if(d[i][j]-1>k/2)temp++;
			ans=min(ans,temp);
		}
	}else{
		//kが奇数のとき
		//辺iを中心にして、距離がk/2.0より大きな頂点の個数の最小値を求める
		//⇔辺の端点どちらかからの距離もk/2より大きな以下同
		rep(i,0,n-1){
			ll temp=0;
			rep(j,0,n)if(min(d[e[2*i].s][j],d[e[2*i].g][j])-1>k/2)temp++;
			ans=min(ans,temp);
		}
	}
	printf("%lld\n",ans);
	return 0;
}
6 1
1 2
3 2
4 2
1 6
5 6
 6 7
1 2
3 2
4 2
1 6
5 6
 6 2
1 2
3 2
4 2
1 6
5 2
 6 2
1 3
3 2
4 2
1 6
5 6

4
 0
 1
 3

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>
#define ll long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
#define min(p,q)((p)<(q)?(p):(q))

typedef struct edge{ll s,g,c;}E;

ll n,k,ans;
E e[4010];
ll vnow[2010];
ll epre[4010];

ll que[4010];
ll d[2010][2010];
void bfs(int k){
	ll qcnt=1;
	que[0]=k;
	d[k][k]=1;
	rep(i,0,qcnt){
		ll v=que[i];
		for(ll t=vnow[v];t!=-1;t=epre[t])if(!d[k][e[t].g]){
			que[qcnt++]=e[t].g;
			d[k][e[t].g]=d[k][v]+1;
		}
	}
}

int main(){
	scanf("%lld%lld",&n,&k);
	rep(i,0,n)vnow[i]=-1;
	
	rep(i,0,n-1){
		ll a,b;
		scanf("%lld%lld",&a,&b);
		a--;b--;
		e[2*i].s=a;
		e[2*i].g=b;
		epre[2*i]=vnow[a];
		vnow[a]=2*i;
		
		e[2*i+1].s=b;
		e[2*i+1].g=a;
		epre[2*i+1]=vnow[b];
		vnow[b]=2*i+1;
	}

	rep(i,0,n)bfs(i);
	ans=n;
	
	if(k%2==0){
		//kが偶数のとき
		//頂点iを中心にして、距離がk/2より大きな頂点の個数の最小値を求める
		rep(i,0,n){
			ll temp=0;
			rep(j,0,n)if(d[i][j]-1>k/2)temp++;
			ans=min(ans,temp);
		}
	}else{
		//kが奇数のとき
		//辺iを中心にして、距離がk/2.0より大きな頂点の個数の最小値を求める
		//⇔辺の端点どちらかからの距離もk/2より大きな以下同
		rep(i,0,n-1){
			ll temp=0;
			rep(j,0,n)if(min(d[e[2*i].s][j],d[e[2*i].g][j])-1>k/2)temp++;
			ans=min(ans,temp);
		}
	}
	printf("%lld\n",ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	k
	.align 8
	.type	k, @object
	.size	k, 8
k:
	.zero	8
	.globl	ans
	.align 8
	.type	ans, @object
	.size	ans, 8
ans:
	.zero	8
	.globl	e
	.align 32
	.type	e, @object
	.size	e, 96240
e:
	.zero	96240
	.globl	vnow
	.align 32
	.type	vnow, @object
	.size	vnow, 16080
vnow:
	.zero	16080
	.globl	epre
	.align 32
	.type	epre, @object
	.size	epre, 32080
epre:
	.zero	32080
	.globl	que
	.align 32
	.type	que, @object
	.size	que, 32080
que:
	.zero	32080
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 32320800
d:
	.zero	32320800
	.text
	.globl	bfs
	.type	bfs, @function
bfs:
.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, -36(%rbp)
	movq	$1, -32(%rbp)
	movl	-36(%rbp), %eax
	cltq
	movq	%rax, que(%rip)
	movl	-36(%rbp), %eax
	cltq
	imulq	$16088, %rax, %rax
	leaq	d(%rip), %rdx
	movq	$1, (%rax,%rdx)
	movq	$0, -24(%rbp)
	jmp	.L2
.L6:
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L3
.L5:
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	8+e(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$2010, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	jne	.L4
	movq	-32(%rbp), %rdx
	leaq	1(%rdx), %rax
	movq	%rax, -32(%rbp)
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	8+e(%rip), %rax
	movq	(%rcx,%rax), %rax
	leaq	0(,%rdx,8), %rcx
	leaq	que(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-36(%rbp), %eax
	cltq
	imulq	$2010, %rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	8+e(%rip), %rax
	movq	(%rdx,%rax), %rdx
	addq	$1, %rcx
	movl	-36(%rbp), %eax
	cltq
	imulq	$2010, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	%rcx, (%rdx,%rax)
.L4:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	epre(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -16(%rbp)
.L3:
	cmpq	$-1, -16(%rbp)
	jne	.L5
	addq	$1, -24(%rbp)
.L2:
	movq	-24(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jl	.L6
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	bfs, .-bfs
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	k(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -80(%rbp)
	jmp	.L8
.L9:
	movq	-80(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	$-1, (%rdx,%rax)
	addq	$1, -80(%rbp)
.L8:
	movq	n(%rip), %rax
	cmpq	%rax, -80(%rbp)
	jl	.L9
	movq	$0, -72(%rbp)
	jmp	.L10
.L11:
	leaq	-88(%rbp), %rdx
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-96(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -96(%rbp)
	movq	-88(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movq	-72(%rbp), %rax
	leaq	(%rax,%rax), %rcx
	movq	-96(%rbp), %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	e(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-72(%rbp), %rax
	leaq	(%rax,%rax), %rcx
	movq	-88(%rbp), %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	8+e(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-96(%rbp), %rax
	movq	-72(%rbp), %rdx
	leaq	(%rdx,%rdx), %rcx
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	(%rdx,%rax), %rax
	salq	$3, %rcx
	leaq	epre(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movq	-96(%rbp), %rax
	movq	-72(%rbp), %rdx
	leaq	(%rdx,%rdx), %rcx
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	leaq	1(%rax), %rcx
	movq	-88(%rbp), %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	e(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	leaq	1(%rax), %rcx
	movq	-96(%rbp), %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	8+e(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-88(%rbp), %rax
	movq	-72(%rbp), %rdx
	addq	%rdx, %rdx
	leaq	1(%rdx), %rcx
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	(%rdx,%rax), %rax
	salq	$3, %rcx
	leaq	epre(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movq	-72(%rbp), %rax
	leaq	(%rax,%rax), %rdx
	movq	-88(%rbp), %rax
	leaq	1(%rdx), %rcx
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addq	$1, -72(%rbp)
.L10:
	movq	n(%rip), %rax
	subq	$1, %rax
	cmpq	%rax, -72(%rbp)
	jl	.L11
	movq	$0, -64(%rbp)
	jmp	.L12
.L13:
	movq	-64(%rbp), %rax
	movl	%eax, %edi
	call	bfs
	addq	$1, -64(%rbp)
.L12:
	movq	n(%rip), %rax
	cmpq	%rax, -64(%rbp)
	jl	.L13
	movq	n(%rip), %rax
	movq	%rax, ans(%rip)
	movq	k(%rip), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L14
	movq	$0, -56(%rbp)
	jmp	.L15
.L19:
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	jmp	.L16
.L18:
	movq	-56(%rbp), %rax
	imulq	$2010, %rax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	-1(%rax), %rdx
	movq	k(%rip), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	cmpq	%rax, %rdx
	jle	.L17
	addq	$1, -48(%rbp)
.L17:
	addq	$1, -40(%rbp)
.L16:
	movq	n(%rip), %rax
	cmpq	%rax, -40(%rbp)
	jl	.L18
	movq	ans(%rip), %rdx
	movq	-48(%rbp), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, ans(%rip)
	addq	$1, -56(%rbp)
.L15:
	movq	n(%rip), %rax
	cmpq	%rax, -56(%rbp)
	jl	.L19
	jmp	.L20
.L14:
	movq	$0, -32(%rbp)
	jmp	.L21
.L25:
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L22
.L24:
	movq	-32(%rbp), %rax
	leaq	(%rax,%rax), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	8+e(%rip), %rax
	movq	(%rdx,%rax), %rax
	imulq	$2010, %rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-32(%rbp), %rax
	leaq	(%rax,%rax), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	e(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	$2010, %rax, %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	d(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	leaq	-1(%rax), %rdx
	movq	k(%rip), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	cmpq	%rax, %rdx
	jle	.L23
	addq	$1, -24(%rbp)
.L23:
	addq	$1, -16(%rbp)
.L22:
	movq	n(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L24
	movq	ans(%rip), %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, ans(%rip)
	addq	$1, -32(%rbp)
.L21:
	movq	n(%rip), %rax
	subq	$1, %rax
	cmpq	%rax, -32(%rbp)
	jl	.L25
.L20:
	movq	ans(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	k
	.align 8
	.type	k, @object
	.size	k, 8
k:
	.zero	8
	.globl	ans
	.align 8
	.type	ans, @object
	.size	ans, 8
ans:
	.zero	8
	.globl	e
	.align 32
	.type	e, @object
	.size	e, 96240
e:
	.zero	96240
	.globl	vnow
	.align 32
	.type	vnow, @object
	.size	vnow, 16080
vnow:
	.zero	16080
	.globl	epre
	.align 32
	.type	epre, @object
	.size	epre, 32080
epre:
	.zero	32080
	.globl	que
	.align 32
	.type	que, @object
	.size	que, 32080
que:
	.zero	32080
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 32320800
d:
	.zero	32320800
	.text
	.globl	bfs
	.type	bfs, @function
bfs:
.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, -36(%rbp)
	movq	$1, -32(%rbp)
	movl	-36(%rbp), %eax
	cltq
	movq	%rax, que(%rip)
	movl	-36(%rbp), %eax
	cltq
	imulq	$16088, %rax, %rax
	leaq	d(%rip), %rdx
	movq	$1, (%rax,%rdx)
	movq	$0, -24(%rbp)
	jmp	.L2
.L6:
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L3
.L5:
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	8+e(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$2010, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	jne	.L4
	movq	-32(%rbp), %rdx
	leaq	1(%rdx), %rax
	movq	%rax, -32(%rbp)
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	8+e(%rip), %rax
	movq	(%rcx,%rax), %rax
	leaq	0(,%rdx,8), %rcx
	leaq	que(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-36(%rbp), %eax
	cltq
	imulq	$2010, %rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	8+e(%rip), %rax
	movq	(%rdx,%rax), %rdx
	addq	$1, %rcx
	movl	-36(%rbp), %eax
	cltq
	imulq	$2010, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	%rcx, (%rdx,%rax)
.L4:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	epre(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -16(%rbp)
.L3:
	cmpq	$-1, -16(%rbp)
	jne	.L5
	addq	$1, -24(%rbp)
.L2:
	movq	-24(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jl	.L6
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	bfs, .-bfs
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	k(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -80(%rbp)
	jmp	.L8
.L9:
	movq	-80(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	$-1, (%rdx,%rax)
	addq	$1, -80(%rbp)
.L8:
	movq	n(%rip), %rax
	cmpq	%rax, -80(%rbp)
	jl	.L9
	movq	$0, -72(%rbp)
	jmp	.L10
.L11:
	leaq	-88(%rbp), %rdx
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-96(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -96(%rbp)
	movq	-88(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movq	-72(%rbp), %rax
	leaq	(%rax,%rax), %rcx
	movq	-96(%rbp), %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	e(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-72(%rbp), %rax
	leaq	(%rax,%rax), %rcx
	movq	-88(%rbp), %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	8+e(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-96(%rbp), %rax
	movq	-72(%rbp), %rdx
	leaq	(%rdx,%rdx), %rcx
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	(%rdx,%rax), %rax
	salq	$3, %rcx
	leaq	epre(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movq	-96(%rbp), %rax
	movq	-72(%rbp), %rdx
	leaq	(%rdx,%rdx), %rcx
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	leaq	1(%rax), %rcx
	movq	-88(%rbp), %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	e(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	leaq	1(%rax), %rcx
	movq	-96(%rbp), %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	8+e(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-88(%rbp), %rax
	movq	-72(%rbp), %rdx
	addq	%rdx, %rdx
	leaq	1(%rdx), %rcx
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	(%rdx,%rax), %rax
	salq	$3, %rcx
	leaq	epre(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movq	-72(%rbp), %rax
	leaq	(%rax,%rax), %rdx
	movq	-88(%rbp), %rax
	leaq	1(%rdx), %rcx
	leaq	0(,%rax,8), %rdx
	leaq	vnow(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addq	$1, -72(%rbp)
.L10:
	movq	n(%rip), %rax
	subq	$1, %rax
	cmpq	%rax, -72(%rbp)
	jl	.L11
	movq	$0, -64(%rbp)
	jmp	.L12
.L13:
	movq	-64(%rbp), %rax
	movl	%eax, %edi
	call	bfs
	addq	$1, -64(%rbp)
.L12:
	movq	n(%rip), %rax
	cmpq	%rax, -64(%rbp)
	jl	.L13
	movq	n(%rip), %rax
	movq	%rax, ans(%rip)
	movq	k(%rip), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L14
	movq	$0, -56(%rbp)
	jmp	.L15
.L19:
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	jmp	.L16
.L18:
	movq	-56(%rbp), %rax
	imulq	$2010, %rax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	-1(%rax), %rdx
	movq	k(%rip), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	cmpq	%rax, %rdx
	jle	.L17
	addq	$1, -48(%rbp)
.L17:
	addq	$1, -40(%rbp)
.L16:
	movq	n(%rip), %rax
	cmpq	%rax, -40(%rbp)
	jl	.L18
	movq	ans(%rip), %rdx
	movq	-48(%rbp), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, ans(%rip)
	addq	$1, -56(%rbp)
.L15:
	movq	n(%rip), %rax
	cmpq	%rax, -56(%rbp)
	jl	.L19
	jmp	.L20
.L14:
	movq	$0, -32(%rbp)
	jmp	.L21
.L25:
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L22
.L24:
	movq	-32(%rbp), %rax
	leaq	(%rax,%rax), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	8+e(%rip), %rax
	movq	(%rdx,%rax), %rax
	imulq	$2010, %rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-32(%rbp), %rax
	leaq	(%rax,%rax), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	e(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	$2010, %rax, %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	d(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	leaq	-1(%rax), %rdx
	movq	k(%rip), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	cmpq	%rax, %rdx
	jle	.L23
	addq	$1, -24(%rbp)
.L23:
	addq	$1, -16(%rbp)
.L22:
	movq	n(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L24
	movq	ans(%rip), %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, ans(%rip)
	addq	$1, -32(%rbp)
.L21:
	movq	n(%rip), %rax
	subq	$1, %rax
	cmpq	%rax, -32(%rbp)
	jl	.L25
.L20:
	movq	ans(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
