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 N 2001

typedef struct vertex{
	short int next[N];
	short int length;
} vertex;

vertex field[N];


int count(int i,int k,int r);

int main(){
	int n,k;
	int i,j;
	int a,b;
	int r;
	scanf("%d %d",&n,&k);
	for(i = 0;i < n-1;i++){
		scanf("%d %d",&a,&b);
		field[a].next[field[a].length++] = b;
		field[b].next[field[b].length++] = a;
	}

	r = k / 2;
	b = 0;
	if(k%2){
		for(i = 1;i <= n;i++){
			for(j = 0;j < field[i].length;j++){
				a = count(i,field[i].next[j],r) + count(field[i].next[j],i,r);
				if(b < a){
					b = a;
				}
			}
		}
	}else{
		for(i = 1;i <= n;i++){
			a = count(i,0,r);
			if(b < a){
				b = a;
			}
		}		
	}

	printf("%d\n", n - b);
	return 0;
}
int count(int i,int pre,int r){
	int res = 1;
	int j;
	if(r == 0){
		return res;
	}
	for(j = 0;j < field[i].length;j++){
		if(field[i].next[j] == pre){
			continue;
		}
		res += count(field[i].next[j],i,r-1);
	}
	return res;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	field
	.bss
	.align 32
	.type	field, @object
	.size	field, 8012004
field:
	.zero	8012004
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-48(%rbp), %rdx
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -36(%rbp)
	jmp	.L2
.L3:
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-40(%rbp), %esi
	movl	-44(%rbp), %ecx
	movl	-44(%rbp), %edx
	movslq	%edx, %rax
	imulq	$4004, %rax, %rax
	leaq	4002+field(%rip), %rdi
	movzwl	(%rax,%rdi), %eax
	movl	%eax, %edi
	addl	$1, %edi
	movl	%edi, %r8d
	movslq	%edx, %rdx
	imulq	$4004, %rdx, %rdx
	leaq	4002+field(%rip), %rdi
	movw	%r8w, (%rdx,%rdi)
	cwtl
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$2002, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	field(%rip), %rax
	movw	%si, (%rdx,%rax)
	movl	-44(%rbp), %esi
	movl	-40(%rbp), %ecx
	movl	-40(%rbp), %edx
	movslq	%edx, %rax
	imulq	$4004, %rax, %rax
	leaq	4002+field(%rip), %rdi
	movzwl	(%rax,%rdi), %eax
	movl	%eax, %edi
	addl	$1, %edi
	movl	%edi, %r8d
	movslq	%edx, %rdx
	imulq	$4004, %rdx, %rdx
	leaq	4002+field(%rip), %rdi
	movw	%r8w, (%rdx,%rdi)
	cwtl
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$2002, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	field(%rip), %rax
	movw	%si, (%rdx,%rax)
	addl	$1, -36(%rbp)
.L2:
	movl	-52(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -36(%rbp)
	jl	.L3
	movl	-48(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -28(%rbp)
	movl	$0, -40(%rbp)
	movl	-48(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L4
	movl	$1, -36(%rbp)
	jmp	.L5
.L9:
	movl	$0, -32(%rbp)
	jmp	.L6
.L8:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$2002, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	field(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	movswl	%ax, %ecx
	movl	-28(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	count
	movl	%eax, %ebx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$2002, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	field(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	cwtl
	movl	-28(%rbp), %edx
	movl	-36(%rbp), %ecx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	count
	addl	%ebx, %eax
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-44(%rbp), %eax
	movl	%eax, -40(%rbp)
.L7:
	addl	$1, -32(%rbp)
.L6:
	movl	-36(%rbp), %eax
	cltq
	imulq	$4004, %rax, %rax
	leaq	4002+field(%rip), %rdx
	movzwl	(%rax,%rdx), %eax
	cwtl
	cmpl	%eax, -32(%rbp)
	jl	.L8
	addl	$1, -36(%rbp)
.L5:
	movl	-52(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L9
	jmp	.L10
.L4:
	movl	$1, -36(%rbp)
	jmp	.L11
.L13:
	movl	-28(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	count
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L12
	movl	-44(%rbp), %eax
	movl	%eax, -40(%rbp)
.L12:
	addl	$1, -36(%rbp)
.L11:
	movl	-52(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L13
.L10:
	movl	-52(%rbp), %eax
	movl	-40(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	count
	.type	count, @function
count:
.LFB7:
	.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
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	$1, -8(%rbp)
	cmpl	$0, -28(%rbp)
	jne	.L17
	movl	-8(%rbp), %eax
	jmp	.L18
.L17:
	movl	$0, -4(%rbp)
	jmp	.L19
.L22:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$2002, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	field(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	cwtl
	cmpl	%eax, -24(%rbp)
	je	.L23
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	cltq
	imulq	$2002, %rax, %rax
	addq	%rcx, %rax
	leaq	(%rax,%rax), %rcx
	leaq	field(%rip), %rax
	movzwl	(%rcx,%rax), %eax
	cwtl
	movl	-20(%rbp), %ecx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	count
	addl	%eax, -8(%rbp)
	jmp	.L21
.L23:
	nop
.L21:
	addl	$1, -4(%rbp)
.L19:
	movl	-20(%rbp), %eax
	cltq
	imulq	$4004, %rax, %rax
	leaq	4002+field(%rip), %rdx
	movzwl	(%rax,%rdx), %eax
	cwtl
	cmpl	%eax, -4(%rbp)
	jl	.L22
	movl	-8(%rbp), %eax
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	count, .-count
	.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
	.type	count.part.0, @function
count.part.0:
.LFB41:
	.cfi_startproc
	movslq	%edi, %rax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%edx, %r14d
	imulq	$4004, %rax, %rdx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	field(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	addq	%r13, %rdx
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movswl	4002(%rdx), %ecx
	movl	%edi, 64(%rsp)
	movl	%esi, 96(%rsp)
	movl	$1, 100(%rsp)
	testw	%cx, %cx
	jle	.L1
	imulq	$2002, %rax, %rax
	movq	%rdx, 24(%rsp)
	leal	-1(%rcx), %edx
	leaq	2(%r13), %rbx
	leal	-5(%r14), %r15d
	addq	%rdx, %rax
	leaq	(%rbx,%rax,2), %rax
	movq	%rax, 88(%rsp)
.L30:
	movq	24(%rsp), %rax
	movswq	(%rax), %rdx
	movl	%edx, 48(%rsp)
	cmpl	96(%rsp), %edx
	je	.L3
	movl	$1, 52(%rsp)
	cmpl	$1, %r14d
	je	.L4
	movslq	%edx, %rcx
	imulq	$4004, %rcx, %rcx
	movswl	4002(%r13,%rcx), %ecx
	testw	%cx, %cx
	jle	.L4
	imulq	$2002, %rdx, %rax
	subl	$1, %ecx
	movl	%r14d, 4(%rsp)
	imulq	$4004, %rdx, %rsi
	leaq	2+field(%rip), %rdx
	addq	%rcx, %rax
	leaq	(%rdx,%rax,2), %rax
	leaq	0(%r13,%rsi), %r12
	movq	%rax, 56(%rsp)
	movq	%r12, %r14
.L29:
	movswq	(%r14), %r11
	cmpl	%r11d, 64(%rsp)
	je	.L5
	cmpl	$2, 4(%rsp)
	movl	$1, 36(%rsp)
	je	.L6
	movslq	%r11d, %rcx
	imulq	$4004, %rcx, %rcx
	movswl	4002(%r13,%rcx), %ecx
	testw	%cx, %cx
	jle	.L6
	imulq	$2002, %r11, %rax
	subl	$1, %ecx
	leaq	2+field(%rip), %rdi
	movl	%r11d, 32(%rsp)
	imulq	$4004, %r11, %r9
	movq	%r14, 104(%rsp)
	addq	%rcx, %rax
	leaq	(%rdi,%rax,2), %rax
	addq	%r13, %r9
	movq	%rax, 40(%rsp)
	movq	%r9, %r14
.L28:
	movswq	(%r14), %r8
	cmpl	%r8d, 48(%rsp)
	je	.L7
	cmpl	$3, 4(%rsp)
	movl	$1, %r12d
	je	.L8
	movslq	%r8d, %rcx
	imulq	$4004, %rcx, %rcx
	movswl	4002(%r13,%rcx), %ecx
	testw	%cx, %cx
	jle	.L8
	imulq	$2002, %r8, %rax
	subl	$1, %ecx
	leaq	2+field(%rip), %rbx
	movq	%r14, 80(%rsp)
	imulq	$4004, %r8, %rbp
	movl	%r15d, %r14d
	movl	%r8d, %r15d
	addq	%rcx, %rax
	leaq	(%rbx,%rax,2), %rax
	addq	%r13, %rbp
	movq	%rax, 16(%rsp)
.L27:
	movswq	0(%rbp), %rsi
	movq	%rsi, %rax
	cmpl	%esi, 32(%rsp)
	je	.L9
	cmpl	$4, 4(%rsp)
	movl	$1, %r9d
	je	.L10
	movslq	%esi, %r11
	imulq	$4004, %r11, %rdi
	movswl	4002(%r13,%rdi), %edi
	testl	%edi, %edi
	jle	.L10
	testl	%r14d, %r14d
	je	.L11
	imulq	$2002, %rsi, %rax
	subl	$1, %edi
	leaq	2+field(%rip), %rcx
	movl	%r12d, 68(%rsp)
	imulq	$4004, %rsi, %rbx
	movq	%rbp, 72(%rsp)
	movl	%esi, %r12d
	movl	%r9d, %ebp
	addq	%rdi, %rax
	leaq	(%rcx,%rax,2), %rax
	addq	%r13, %rbx
	movq	%rax, 8(%rsp)
.L13:
	movswl	(%rbx), %edi
	cmpl	%edi, %r15d
	je	.L12
	movl	%r14d, %edx
	movl	%r12d, %esi
	call	count.part.0
	addl	%eax, %ebp
.L12:
	addq	$2, %rbx
	cmpq	8(%rsp), %rbx
	jne	.L13
	movl	%ebp, %r9d
	movl	68(%rsp), %r12d
	movq	72(%rsp), %rbp
.L10:
	addl	%r9d, %r12d
.L9:
	addq	$2, %rbp
	cmpq	16(%rsp), %rbp
	jne	.L27
	movl	%r14d, %r15d
	movq	80(%rsp), %r14
.L8:
	addl	%r12d, 36(%rsp)
.L7:
	addq	$2, %r14
	cmpq	40(%rsp), %r14
	jne	.L28
	movq	104(%rsp), %r14
.L6:
	movl	36(%rsp), %ebx
	addl	%ebx, 52(%rsp)
.L5:
	addq	$2, %r14
	cmpq	56(%rsp), %r14
	jne	.L29
	movl	4(%rsp), %r14d
.L4:
	movl	52(%rsp), %edx
	addl	%edx, 100(%rsp)
.L3:
	addq	$2, 24(%rsp)
	movq	24(%rsp), %rax
	cmpq	88(%rsp), %rax
	jne	.L30
.L1:
	movl	100(%rsp), %eax
	addq	$120, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	leal	-1(%rdi), %esi
	cmpl	$6, %esi
	jbe	.L40
	movd	%r15d, %xmm6
	pxor	%xmm0, %xmm0
	pxor	%xmm5, %xmm5
	movl	%edi, %esi
	imulq	$4004, %rax, %rax
	shrl	$3, %esi
	pshufd	$0, %xmm6, %xmm4
	leal	-1(%rsi), %r9d
	salq	$4, %r9
	addq	%r13, %rax
	leaq	16(%rax), %rsi
	addq	%rsi, %r9
.L16:
	movdqu	(%rax), %xmm2
	movdqa	%xmm5, %xmm3
	movq	%rsi, %rax
	pcmpgtw	%xmm2, %xmm3
	movdqa	%xmm2, %xmm1
	punpcklwd	%xmm3, %xmm1
	punpckhwd	%xmm3, %xmm2
	pcmpeqd	%xmm4, %xmm1
	pcmpeqd	%xmm4, %xmm2
	pandn	.LC0(%rip), %xmm1
	pandn	.LC0(%rip), %xmm2
	paddd	%xmm1, %xmm0
	paddd	%xmm2, %xmm0
	cmpq	%r9, %rsi
	je	.L51
	addq	$16, %rsi
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L51:
	movdqa	%xmm0, %xmm1
	movl	%edi, %eax
	psrldq	$8, %xmm1
	andl	$-8, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %r9d
	addl	$1, %r9d
	testb	$7, %dil
	je	.L10
.L15:
	imulq	$2002, %r11, %r11
	movslq	%eax, %rsi
	addq	%r11, %rsi
	movswl	0(%r13,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r9d
	leal	1(%rax), %esi
	cmpl	%esi, %edi
	jle	.L10
	movslq	%esi, %rsi
	addq	%r11, %rsi
	movswl	0(%r13,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r9d
	leal	2(%rax), %esi
	cmpl	%esi, %edi
	jle	.L10
	movslq	%esi, %rsi
	addq	%r11, %rsi
	movswl	0(%r13,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r9d
	leal	3(%rax), %esi
	cmpl	%esi, %edi
	jle	.L10
	movslq	%esi, %rsi
	addq	%r11, %rsi
	movswl	0(%r13,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r9d
	leal	4(%rax), %esi
	cmpl	%esi, %edi
	jle	.L10
	movslq	%esi, %rsi
	addq	%r11, %rsi
	movswl	0(%r13,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r9d
	leal	5(%rax), %esi
	cmpl	%esi, %edi
	jle	.L10
	movslq	%esi, %rsi
	addq	%r11, %rsi
	movswl	0(%r13,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	addl	$6, %eax
	movzbl	%sil, %esi
	addl	%esi, %r9d
	cmpl	%eax, %edi
	jle	.L10
	cltq
	addq	%rax, %r11
	movswl	0(%r13,%r11,2), %eax
	cmpl	%eax, %r15d
	setne	%al
	movzbl	%al, %eax
	addl	%eax, %r9d
	jmp	.L10
.L40:
	xorl	%eax, %eax
	jmp	.L15
	.cfi_endproc
.LFE41:
	.size	count.part.0, .-count.part.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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	.LC1(%rip), %rbx
	movq	%rbx, %rdi
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	92(%rsp), %rdx
	leaq	88(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	88(%rsp), %eax
	movl	%eax, 44(%rsp)
	cmpl	$1, %eax
	jle	.L55
	xorl	%r14d, %r14d
	leaq	100(%rsp), %r12
	leaq	96(%rsp), %rbp
	leaq	field(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L56:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	96(%rsp), %rdx
	movslq	100(%rsp), %rax
	addl	$1, %r14d
	imulq	$4004, %rdx, %rdi
	movq	%rdx, %rcx
	imulq	$2002, %rdx, %rdx
	addq	%r13, %rdi
	movswq	4002(%rdi), %rsi
	addq	%rsi, %rdx
	leal	1(%rsi), %r8d
	imulq	$4004, %rax, %rsi
	movw	%ax, 0(%r13,%rdx,2)
	imulq	$2002, %rax, %rax
	movw	%r8w, 4002(%rdi)
	addq	%r13, %rsi
	movswq	4002(%rsi), %rdx
	addq	%rdx, %rax
	leal	1(%rdx), %edi
	movw	%cx, 0(%r13,%rax,2)
	movl	88(%rsp), %eax
	movw	%di, 4002(%rsi)
	leal	-1(%rax), %edx
	cmpl	%r14d, %edx
	jg	.L56
	movl	%eax, 44(%rsp)
.L55:
	movl	92(%rsp), %eax
	movl	$0, 100(%rsp)
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	movl	%edx, 20(%rsp)
	testb	$1, %al
	jne	.L57
	cmpl	$0, 44(%rsp)
	jle	.L59
	movl	20(%rsp), %eax
	movl	$2002, %r13d
	movl	$0, 12(%rsp)
	leaq	4004+field(%rip), %r12
	movdqa	.LC0(%rip), %xmm7
	movl	$1, %r15d
	leal	-1(%rax), %ebp
	movq	%r13, %rax
	movq	%r12, %r13
	movl	%ebp, %r12d
	movq	%rax, %rbp
	.p2align 4,,10
	.p2align 3
.L116:
	movl	20(%rsp), %eax
	movl	$1, %r10d
	testl	%eax, %eax
	je	.L99
	movswl	4002(%r13), %esi
	testl	%esi, %esi
	jle	.L99
	testl	%r12d, %r12d
	je	.L100
	leal	-1(%rsi), %eax
	leaq	2+field(%rip), %rbx
	addq	%rbp, %rax
	leaq	(%rbx,%rax,2), %r14
	movq	%r13, %rbx
.L102:
	movswl	(%rbx), %edi
	testl	%edi, %edi
	je	.L101
	movl	%r12d, %edx
	movl	%r15d, %esi
	call	count.part.0
	addl	%eax, %r10d
.L101:
	addq	$2, %rbx
	cmpq	%r14, %rbx
	jne	.L102
.L99:
	movl	%r10d, 96(%rsp)
	cmpl	12(%rsp), %r10d
	jle	.L115
	movl	%r10d, 100(%rsp)
	movl	%r10d, 12(%rsp)
.L115:
	addl	$1, %r15d
	addq	$4004, %r13
	addq	$2002, %rbp
	cmpl	44(%rsp), %r15d
	jle	.L116
.L59:
	movl	44(%rsp), %edx
	xorl	%eax, %eax
	subl	100(%rsp), %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L145
	addq	$120, %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
.L57:
	.cfi_restore_state
	cmpl	$0, 44(%rsp)
	jle	.L59
	movl	20(%rsp), %eax
	movl	$0, 12(%rsp)
	movl	$1, %r15d
	movq	$2002, 72(%rsp)
	movdqa	.LC0(%rip), %xmm7
	leal	-1(%rax), %r13d
	leaq	4004+field(%rip), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L60:
	movq	24(%rsp), %rax
	movswl	4002(%rax), %eax
	movl	%eax, 40(%rsp)
	testl	%eax, %eax
	jle	.L98
	movl	%eax, %ebx
	leal	-1(%rax), %eax
	leaq	2+field(%rip), %rcx
	movq	24(%rsp), %rbp
	movl	%eax, 52(%rsp)
	addq	72(%rsp), %rax
	leaq	(%rcx,%rax,2), %r12
	movl	%ebx, %eax
	andl	$-8, %ebx
	shrl	$3, %eax
	movl	%ebx, 48(%rsp)
	subl	$1, %eax
	salq	$4, %rax
	leaq	16(%rbp,%rax), %rax
	movq	%rax, 56(%rsp)
	movslq	%r15d, %rax
	imulq	$2002, %rax, %rax
	movq	%rax, 64(%rsp)
	.p2align 4,,10
	.p2align 3
.L96:
	movzwl	0(%rbp), %ecx
	movl	20(%rsp), %edx
	movl	$2, %eax
	movw	%cx, 16(%rsp)
	testl	%edx, %edx
	je	.L61
	movswl	%cx, %r14d
	testl	%r13d, %r13d
	je	.L62
	movq	24(%rsp), %r10
	movl	$1, %ebx
.L64:
	movswl	(%r10), %edi
	cmpl	%edi, %r14d
	je	.L63
	movl	%r13d, %edx
	movl	%r15d, %esi
	call	count.part.0
	addl	%eax, %ebx
.L63:
	addq	$2, %r10
	cmpq	%r12, %r10
	jne	.L64
	movslq	%r14d, %rax
	leaq	field(%rip), %rcx
	imulq	$4004, %rax, %rax
	movswl	4002(%rcx,%rax), %eax
	testw	%ax, %ax
	jle	.L70
	movswq	16(%rsp), %r10
	subl	$1, %eax
	movl	%ebx, 16(%rsp)
	movl	%r14d, %ebx
	movq	%rbp, 32(%rsp)
	movl	%r13d, %ebp
	imulq	$4004, %r10, %rsi
	imulq	$2002, %r10, %r10
	addq	%rsi, %rcx
	addq	%rax, %r10
	leaq	2+field(%rip), %rax
	movq	%rcx, %r14
	leaq	(%rax,%r10,2), %rax
	movl	$1, %r10d
	movl	%r10d, %r13d
	movq	%rax, %r10
.L81:
	movswl	(%r14), %edi
	cmpl	%edi, %r15d
	je	.L80
	movl	%ebp, %edx
	movl	%ebx, %esi
	call	count.part.0
	addl	%eax, %r13d
.L80:
	addq	$2, %r14
	cmpq	%r14, %r10
	jne	.L81
	movl	%r13d, %r10d
	movl	16(%rsp), %ebx
	movl	%ebp, %r13d
	movq	32(%rsp), %rbp
.L82:
	leal	(%r10,%rbx), %eax
.L61:
	movl	%eax, 96(%rsp)
	cmpl	12(%rsp), %eax
	jle	.L95
	movl	%eax, 100(%rsp)
	movl	%eax, 12(%rsp)
.L95:
	addq	$2, %rbp
	cmpq	%r12, %rbp
	jne	.L96
.L98:
	addq	$4004, 24(%rsp)
	addl	$1, %r15d
	addq	$2002, 72(%rsp)
	cmpl	44(%rsp), %r15d
	jle	.L60
	jmp	.L59
	.p2align 4,,10
	.p2align 3
.L62:
	cmpl	$6, 52(%rsp)
	jbe	.L120
	movd	%r14d, %xmm6
	movq	24(%rsp), %rax
	pxor	%xmm0, %xmm0
	pxor	%xmm5, %xmm5
	movq	56(%rsp), %rdx
	pshufd	$0, %xmm6, %xmm4
.L67:
	movdqu	(%rax), %xmm2
	movdqa	%xmm5, %xmm3
	addq	$16, %rax
	pcmpgtw	%xmm2, %xmm3
	movdqa	%xmm2, %xmm1
	punpcklwd	%xmm3, %xmm1
	punpckhwd	%xmm3, %xmm2
	pcmpeqd	%xmm4, %xmm1
	pcmpeqd	%xmm4, %xmm2
	pandn	%xmm7, %xmm1
	pandn	%xmm7, %xmm2
	paddd	%xmm1, %xmm0
	paddd	%xmm2, %xmm0
	cmpq	%rdx, %rax
	jne	.L67
	movdqa	%xmm0, %xmm1
	movl	48(%rsp), %eax
	movl	40(%rsp), %edx
	leaq	field(%rip), %rcx
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ebx
	addl	$1, %ebx
	cmpl	%edx, %eax
	je	.L71
	movl	%edx, %edi
.L66:
	movq	64(%rsp), %rdx
	movslq	%eax, %rsi
	leaq	field(%rip), %rcx
	addq	%rdx, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r14d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %ebx
	leal	1(%rax), %esi
	cmpl	%edi, %esi
	jge	.L71
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r14d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %ebx
	leal	2(%rax), %esi
	cmpl	%esi, %edi
	jle	.L71
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r14d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %ebx
	leal	3(%rax), %esi
	cmpl	%esi, %edi
	jle	.L71
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r14d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %ebx
	leal	4(%rax), %esi
	cmpl	%esi, %edi
	jle	.L71
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r14d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %ebx
	leal	5(%rax), %esi
	cmpl	%esi, %edi
	jle	.L71
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r14d
	setne	%sil
	addl	$6, %eax
	movzbl	%sil, %esi
	addl	%esi, %ebx
	cmpl	%eax, %edi
	jle	.L71
	cltq
	addq	%rdx, %rax
	movswl	(%rcx,%rax,2), %eax
	cmpl	%eax, %r14d
	setne	%al
	movzbl	%al, %eax
	addl	%eax, %ebx
	.p2align 4,,10
	.p2align 3
.L71:
	movslq	%r14d, %r9
	imulq	$4004, %r9, %rax
	movswl	4002(%rcx,%rax), %edi
	testl	%edi, %edi
	jle	.L70
	leal	-1(%rdi), %eax
	cmpl	$6, %eax
	jbe	.L121
	movswq	16(%rsp), %rsi
	movl	%edi, %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm5, %xmm5
	shrl	$3, %eax
	movd	%r15d, %xmm6
	imulq	$4004, %rsi, %rsi
	leal	-1(%rax), %r8d
	pshufd	$0, %xmm6, %xmm4
	salq	$4, %r8
	addq	%rcx, %rsi
	leaq	16(%rsi), %rax
	addq	%rax, %r8
.L84:
	movdqu	(%rsi), %xmm2
	movdqa	%xmm5, %xmm3
	movq	%rax, %rsi
	pcmpgtw	%xmm2, %xmm3
	movdqa	%xmm2, %xmm1
	punpcklwd	%xmm3, %xmm1
	punpckhwd	%xmm3, %xmm2
	pcmpeqd	%xmm4, %xmm1
	pcmpeqd	%xmm4, %xmm2
	pandn	%xmm7, %xmm1
	pandn	%xmm7, %xmm2
	paddd	%xmm1, %xmm0
	paddd	%xmm2, %xmm0
	cmpq	%rax, %r8
	je	.L143
	addq	$16, %rax
	jmp	.L84
	.p2align 4,,10
	.p2align 3
.L70:
	leal	1(%rbx), %eax
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L143:
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	leal	1(%rax), %r10d
	movl	%edi, %eax
	andl	$-8, %eax
	testb	$7, %dil
	je	.L82
.L83:
	imulq	$2002, %r9, %r9
	movslq	%eax, %rsi
	addq	%r9, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r10d
	leal	1(%rax), %esi
	cmpl	%edi, %esi
	jge	.L82
	movslq	%esi, %rsi
	addq	%r9, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r10d
	leal	2(%rax), %esi
	cmpl	%edi, %esi
	jge	.L82
	movslq	%esi, %rsi
	addq	%r9, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r10d
	leal	3(%rax), %esi
	cmpl	%edi, %esi
	jge	.L82
	movslq	%esi, %rsi
	addq	%r9, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%r15d, %esi
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r10d
	leal	4(%rax), %esi
	cmpl	%edi, %esi
	jge	.L82
	movslq	%esi, %rsi
	addq	%r9, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r10d
	leal	5(%rax), %esi
	cmpl	%edi, %esi
	jge	.L82
	movslq	%esi, %rsi
	addq	%r9, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	addl	$6, %eax
	movzbl	%sil, %esi
	addl	%esi, %r10d
	cmpl	%edi, %eax
	jge	.L82
	cltq
	addq	%rax, %r9
	movswl	(%rcx,%r9,2), %eax
	cmpl	%eax, %r15d
	setne	%al
	movzbl	%al, %eax
	addl	%eax, %r10d
	jmp	.L82
.L120:
	movl	40(%rsp), %edi
	xorl	%eax, %eax
	movl	$1, %ebx
	jmp	.L66
.L100:
	leal	-1(%rsi), %eax
	cmpl	$6, %eax
	jbe	.L124
	movl	%esi, %eax
	pxor	%xmm2, %xmm2
	pxor	%xmm5, %xmm5
	shrl	$3, %eax
	movdqa	%xmm2, %xmm4
	subl	$1, %eax
	salq	$4, %rax
	leaq	16(%r13,%rax), %rdi
	movq	%r13, %rax
.L104:
	movdqu	(%rax), %xmm0
	movdqa	%xmm5, %xmm3
	addq	$16, %rax
	pcmpgtw	%xmm0, %xmm3
	movdqa	%xmm0, %xmm1
	punpcklwd	%xmm3, %xmm1
	punpckhwd	%xmm3, %xmm0
	pcmpeqd	%xmm4, %xmm1
	pcmpeqd	%xmm4, %xmm0
	pandn	%xmm7, %xmm1
	pandn	%xmm7, %xmm0
	paddd	%xmm1, %xmm2
	paddd	%xmm0, %xmm2
	cmpq	%rdi, %rax
	jne	.L104
	movdqa	%xmm2, %xmm0
	movl	%esi, %eax
	psrldq	$8, %xmm0
	andl	$-8, %eax
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %r10d
	addl	$1, %r10d
	testb	$7, %sil
	je	.L99
.L103:
	movslq	%r15d, %rdi
	movslq	%eax, %r11
	leaq	field(%rip), %rbx
	imulq	$2002, %rdi, %r9
	addq	%r11, %r9
	cmpw	$0, (%rbx,%r9,2)
	je	.L107
	addl	$1, %r10d
.L107:
	leal	1(%rax), %r9d
	cmpl	%r9d, %esi
	jle	.L99
	imulq	$2002, %rdi, %r11
	movslq	%r9d, %r9
	leaq	field(%rip), %rbx
	addq	%r11, %r9
	cmpw	$0, (%rbx,%r9,2)
	je	.L108
	addl	$1, %r10d
.L108:
	leal	2(%rax), %r9d
	cmpl	%r9d, %esi
	jle	.L99
	imulq	$2002, %rdi, %r11
	movslq	%r9d, %r9
	leaq	field(%rip), %rbx
	addq	%r11, %r9
	cmpw	$0, (%rbx,%r9,2)
	je	.L109
	addl	$1, %r10d
.L109:
	leal	3(%rax), %r9d
	cmpl	%r9d, %esi
	jle	.L99
	imulq	$2002, %rdi, %r11
	movslq	%r9d, %r9
	leaq	field(%rip), %rcx
	addq	%r11, %r9
	cmpw	$0, (%rcx,%r9,2)
	je	.L110
	addl	$1, %r10d
.L110:
	leal	4(%rax), %r9d
	cmpl	%r9d, %esi
	jle	.L99
	imulq	$2002, %rdi, %r11
	movslq	%r9d, %r9
	leaq	field(%rip), %rbx
	addq	%r11, %r9
	cmpw	$0, (%rbx,%r9,2)
	je	.L111
	addl	$1, %r10d
.L111:
	leal	5(%rax), %r9d
	cmpl	%r9d, %esi
	jle	.L99
	imulq	$2002, %rdi, %r11
	movslq	%r9d, %r9
	leaq	field(%rip), %rbx
	addq	%r11, %r9
	cmpw	$0, (%rbx,%r9,2)
	je	.L112
	addl	$1, %r10d
.L112:
	addl	$6, %eax
	cmpl	%eax, %esi
	jle	.L99
	imulq	$2002, %rdi, %rdi
	cltq
	leaq	field(%rip), %rcx
	addq	%rdi, %rax
	cmpw	$0, (%rcx,%rax,2)
	je	.L99
	addl	$1, %r10d
	jmp	.L99
.L121:
	xorl	%eax, %eax
	movl	$1, %r10d
	jmp	.L83
.L124:
	xorl	%eax, %eax
	jmp	.L103
.L145:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	count
	.type	count, @function
count:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	testl	%edx, %edx
	je	.L146
	movslq	%edi, %rax
	movl	%esi, %ebp
	leaq	field(%rip), %rsi
	movl	%edi, %r13d
	imulq	$4004, %rax, %r10
	addq	%rsi, %r10
	movswl	4002(%r10), %ecx
	testl	%ecx, %ecx
	jle	.L146
	movl	%edx, %ebx
	subl	$1, %ebx
	je	.L148
	imulq	$2002, %rax, %rax
	leal	-1(%rcx), %edx
	addq	%rdx, %rax
	leaq	2(%rsi), %rdx
	leaq	(%rdx,%rax,2), %r14
.L150:
	movswl	(%r10), %edi
	cmpl	%ebp, %edi
	je	.L149
	movl	%ebx, %edx
	movl	%r13d, %esi
	call	count.part.0
	addl	%eax, %r12d
.L149:
	addq	$2, %r10
	cmpq	%r10, %r14
	jne	.L150
.L146:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%r12d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L148:
	.cfi_restore_state
	leal	-1(%rcx), %edx
	cmpl	$6, %edx
	jbe	.L152
	movd	%ebp, %xmm7
	pxor	%xmm2, %xmm2
	pxor	%xmm6, %xmm6
	movl	%ecx, %edx
	shrl	$3, %edx
	movdqa	.LC0(%rip), %xmm4
	pshufd	$0, %xmm7, %xmm5
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%r10,%rdx), %rdx
.L153:
	movdqu	(%r10), %xmm0
	movdqa	%xmm6, %xmm3
	addq	$16, %r10
	pcmpgtw	%xmm0, %xmm3
	movdqa	%xmm0, %xmm1
	punpcklwd	%xmm3, %xmm1
	punpckhwd	%xmm3, %xmm0
	pcmpeqd	%xmm5, %xmm1
	pcmpeqd	%xmm5, %xmm0
	pandn	%xmm4, %xmm1
	pandn	%xmm4, %xmm0
	paddd	%xmm1, %xmm2
	paddd	%xmm0, %xmm2
	cmpq	%rdx, %r10
	jne	.L153
	movdqa	%xmm2, %xmm0
	movl	%ecx, %ebx
	psrldq	$8, %xmm0
	andl	$-8, %ebx
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %r12d
	addl	$1, %r12d
	testb	$7, %cl
	je	.L146
.L152:
	imulq	$2002, %rax, %rax
	movslq	%ebx, %rdx
	addq	%rax, %rdx
	movswl	(%rsi,%rdx,2), %edx
	cmpl	%edx, %ebp
	setne	%dl
	movzbl	%dl, %edx
	addl	%edx, %r12d
	leal	1(%rbx), %edx
	cmpl	%edx, %ecx
	jle	.L146
	movslq	%edx, %rdx
	addq	%rax, %rdx
	movswl	(%rsi,%rdx,2), %edx
	cmpl	%edx, %ebp
	setne	%dl
	movzbl	%dl, %edx
	addl	%edx, %r12d
	leal	2(%rbx), %edx
	cmpl	%edx, %ecx
	jle	.L146
	movslq	%edx, %rdx
	addq	%rax, %rdx
	movswl	(%rsi,%rdx,2), %edx
	cmpl	%edx, %ebp
	setne	%dl
	movzbl	%dl, %edx
	addl	%edx, %r12d
	leal	3(%rbx), %edx
	cmpl	%edx, %ecx
	jle	.L146
	movslq	%edx, %rdx
	addq	%rax, %rdx
	movswl	(%rsi,%rdx,2), %edx
	cmpl	%edx, %ebp
	setne	%dl
	movzbl	%dl, %edx
	addl	%edx, %r12d
	leal	4(%rbx), %edx
	cmpl	%edx, %ecx
	jle	.L146
	movslq	%edx, %rdx
	addq	%rax, %rdx
	movswl	(%rsi,%rdx,2), %edx
	cmpl	%edx, %ebp
	setne	%dl
	movzbl	%dl, %edx
	addl	%edx, %r12d
	leal	5(%rbx), %edx
	cmpl	%edx, %ecx
	jle	.L146
	movslq	%edx, %rdx
	addq	%rax, %rdx
	movswl	(%rsi,%rdx,2), %edx
	cmpl	%edx, %ebp
	setne	%dl
	movzbl	%dl, %edx
	addl	%edx, %r12d
	leal	6(%rbx), %edx
	cmpl	%edx, %ecx
	jle	.L146
	movslq	%edx, %rdx
	addq	%rdx, %rax
	movswl	(%rsi,%rax,2), %eax
	cmpl	%eax, %ebp
	setne	%al
	movzbl	%al, %eax
	addl	%eax, %r12d
	jmp	.L146
	.cfi_endproc
.LFE40:
	.size	count, .-count
	.globl	field
	.bss
	.align 32
	.type	field, @object
	.size	field, 8012004
field:
	.zero	8012004
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.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
	.type	count.part.0, @function
count.part.0:
.LFB41:
	.cfi_startproc
	movslq	%edi, %rax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%edx, %r14d
	imulq	$4004, %rax, %rdx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	field(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	addq	%r13, %rdx
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movswl	4002(%rdx), %ecx
	movl	%edi, 64(%rsp)
	movl	%esi, 96(%rsp)
	movl	$1, 100(%rsp)
	testw	%cx, %cx
	jle	.L1
	imulq	$2002, %rax, %rax
	movq	%rdx, 24(%rsp)
	leal	-1(%rcx), %edx
	leaq	2(%r13), %rbx
	leal	-5(%r14), %r15d
	addq	%rdx, %rax
	leaq	(%rbx,%rax,2), %rax
	movq	%rax, 88(%rsp)
.L30:
	movq	24(%rsp), %rax
	movswq	(%rax), %rdx
	movl	%edx, 48(%rsp)
	cmpl	96(%rsp), %edx
	je	.L3
	movl	$1, 52(%rsp)
	cmpl	$1, %r14d
	je	.L4
	movslq	%edx, %rcx
	imulq	$4004, %rcx, %rcx
	movswl	4002(%r13,%rcx), %ecx
	testw	%cx, %cx
	jle	.L4
	imulq	$2002, %rdx, %rax
	subl	$1, %ecx
	movl	%r14d, 4(%rsp)
	imulq	$4004, %rdx, %rsi
	leaq	2+field(%rip), %rdx
	addq	%rcx, %rax
	leaq	(%rdx,%rax,2), %rax
	leaq	0(%r13,%rsi), %r12
	movq	%rax, 56(%rsp)
	movq	%r12, %r14
.L29:
	movswq	(%r14), %r11
	cmpl	%r11d, 64(%rsp)
	je	.L5
	cmpl	$2, 4(%rsp)
	movl	$1, 36(%rsp)
	je	.L6
	movslq	%r11d, %rcx
	imulq	$4004, %rcx, %rcx
	movswl	4002(%r13,%rcx), %ecx
	testw	%cx, %cx
	jle	.L6
	imulq	$2002, %r11, %rax
	subl	$1, %ecx
	leaq	2+field(%rip), %rdi
	movl	%r11d, 32(%rsp)
	imulq	$4004, %r11, %r9
	movq	%r14, 104(%rsp)
	addq	%rcx, %rax
	leaq	(%rdi,%rax,2), %rax
	addq	%r13, %r9
	movq	%rax, 40(%rsp)
	movq	%r9, %r14
.L28:
	movswq	(%r14), %r8
	cmpl	%r8d, 48(%rsp)
	je	.L7
	cmpl	$3, 4(%rsp)
	movl	$1, %r12d
	je	.L8
	movslq	%r8d, %rcx
	imulq	$4004, %rcx, %rcx
	movswl	4002(%r13,%rcx), %ecx
	testw	%cx, %cx
	jle	.L8
	imulq	$2002, %r8, %rax
	subl	$1, %ecx
	leaq	2+field(%rip), %rbx
	movq	%r14, 80(%rsp)
	imulq	$4004, %r8, %rbp
	movl	%r15d, %r14d
	movl	%r8d, %r15d
	addq	%rcx, %rax
	leaq	(%rbx,%rax,2), %rax
	addq	%r13, %rbp
	movq	%rax, 16(%rsp)
.L27:
	movswq	0(%rbp), %rsi
	movq	%rsi, %rax
	cmpl	%esi, 32(%rsp)
	je	.L9
	cmpl	$4, 4(%rsp)
	movl	$1, %r9d
	je	.L10
	movslq	%esi, %r11
	imulq	$4004, %r11, %rdi
	movswl	4002(%r13,%rdi), %edi
	testl	%edi, %edi
	jle	.L10
	testl	%r14d, %r14d
	je	.L11
	imulq	$2002, %rsi, %rax
	subl	$1, %edi
	leaq	2+field(%rip), %rcx
	movl	%r12d, 68(%rsp)
	imulq	$4004, %rsi, %rbx
	movq	%rbp, 72(%rsp)
	movl	%esi, %r12d
	movl	%r9d, %ebp
	addq	%rdi, %rax
	leaq	(%rcx,%rax,2), %rax
	addq	%r13, %rbx
	movq	%rax, 8(%rsp)
.L13:
	movswl	(%rbx), %edi
	cmpl	%edi, %r15d
	je	.L12
	movl	%r14d, %edx
	movl	%r12d, %esi
	call	count.part.0
	addl	%eax, %ebp
.L12:
	addq	$2, %rbx
	cmpq	8(%rsp), %rbx
	jne	.L13
	movl	%ebp, %r9d
	movl	68(%rsp), %r12d
	movq	72(%rsp), %rbp
.L10:
	addl	%r9d, %r12d
.L9:
	addq	$2, %rbp
	cmpq	16(%rsp), %rbp
	jne	.L27
	movl	%r14d, %r15d
	movq	80(%rsp), %r14
.L8:
	addl	%r12d, 36(%rsp)
.L7:
	addq	$2, %r14
	cmpq	40(%rsp), %r14
	jne	.L28
	movq	104(%rsp), %r14
.L6:
	movl	36(%rsp), %ebx
	addl	%ebx, 52(%rsp)
.L5:
	addq	$2, %r14
	cmpq	56(%rsp), %r14
	jne	.L29
	movl	4(%rsp), %r14d
.L4:
	movl	52(%rsp), %edx
	addl	%edx, 100(%rsp)
.L3:
	addq	$2, 24(%rsp)
	movq	24(%rsp), %rax
	cmpq	88(%rsp), %rax
	jne	.L30
.L1:
	movl	100(%rsp), %eax
	addq	$120, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	leal	-1(%rdi), %esi
	cmpl	$6, %esi
	jbe	.L40
	movd	%r15d, %xmm6
	pxor	%xmm0, %xmm0
	pxor	%xmm5, %xmm5
	movl	%edi, %esi
	imulq	$4004, %rax, %rax
	shrl	$3, %esi
	pshufd	$0, %xmm6, %xmm4
	leal	-1(%rsi), %r9d
	salq	$4, %r9
	addq	%r13, %rax
	leaq	16(%rax), %rsi
	addq	%rsi, %r9
.L16:
	movdqu	(%rax), %xmm2
	movdqa	%xmm5, %xmm3
	movq	%rsi, %rax
	pcmpgtw	%xmm2, %xmm3
	movdqa	%xmm2, %xmm1
	punpcklwd	%xmm3, %xmm1
	punpckhwd	%xmm3, %xmm2
	pcmpeqd	%xmm4, %xmm1
	pcmpeqd	%xmm4, %xmm2
	pandn	.LC0(%rip), %xmm1
	pandn	.LC0(%rip), %xmm2
	paddd	%xmm1, %xmm0
	paddd	%xmm2, %xmm0
	cmpq	%r9, %rsi
	je	.L51
	addq	$16, %rsi
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L51:
	movdqa	%xmm0, %xmm1
	movl	%edi, %eax
	psrldq	$8, %xmm1
	andl	$-8, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %r9d
	addl	$1, %r9d
	testb	$7, %dil
	je	.L10
.L15:
	imulq	$2002, %r11, %r11
	movslq	%eax, %rsi
	addq	%r11, %rsi
	movswl	0(%r13,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r9d
	leal	1(%rax), %esi
	cmpl	%esi, %edi
	jle	.L10
	movslq	%esi, %rsi
	addq	%r11, %rsi
	movswl	0(%r13,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r9d
	leal	2(%rax), %esi
	cmpl	%esi, %edi
	jle	.L10
	movslq	%esi, %rsi
	addq	%r11, %rsi
	movswl	0(%r13,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r9d
	leal	3(%rax), %esi
	cmpl	%esi, %edi
	jle	.L10
	movslq	%esi, %rsi
	addq	%r11, %rsi
	movswl	0(%r13,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r9d
	leal	4(%rax), %esi
	cmpl	%esi, %edi
	jle	.L10
	movslq	%esi, %rsi
	addq	%r11, %rsi
	movswl	0(%r13,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r9d
	leal	5(%rax), %esi
	cmpl	%esi, %edi
	jle	.L10
	movslq	%esi, %rsi
	addq	%r11, %rsi
	movswl	0(%r13,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	addl	$6, %eax
	movzbl	%sil, %esi
	addl	%esi, %r9d
	cmpl	%eax, %edi
	jle	.L10
	cltq
	addq	%rax, %r11
	movswl	0(%r13,%r11,2), %eax
	cmpl	%eax, %r15d
	setne	%al
	movzbl	%al, %eax
	addl	%eax, %r9d
	jmp	.L10
.L40:
	xorl	%eax, %eax
	jmp	.L15
	.cfi_endproc
.LFE41:
	.size	count.part.0, .-count.part.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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	.LC1(%rip), %rbx
	movq	%rbx, %rdi
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	92(%rsp), %rdx
	leaq	88(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	88(%rsp), %eax
	movl	%eax, 44(%rsp)
	cmpl	$1, %eax
	jle	.L55
	xorl	%r14d, %r14d
	leaq	100(%rsp), %r12
	leaq	96(%rsp), %rbp
	leaq	field(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L56:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	96(%rsp), %rdx
	movslq	100(%rsp), %rax
	addl	$1, %r14d
	imulq	$4004, %rdx, %rdi
	movq	%rdx, %rcx
	imulq	$2002, %rdx, %rdx
	addq	%r13, %rdi
	movswq	4002(%rdi), %rsi
	addq	%rsi, %rdx
	leal	1(%rsi), %r8d
	imulq	$4004, %rax, %rsi
	movw	%ax, 0(%r13,%rdx,2)
	imulq	$2002, %rax, %rax
	movw	%r8w, 4002(%rdi)
	addq	%r13, %rsi
	movswq	4002(%rsi), %rdx
	addq	%rdx, %rax
	leal	1(%rdx), %edi
	movw	%cx, 0(%r13,%rax,2)
	movl	88(%rsp), %eax
	movw	%di, 4002(%rsi)
	leal	-1(%rax), %edx
	cmpl	%r14d, %edx
	jg	.L56
	movl	%eax, 44(%rsp)
.L55:
	movl	92(%rsp), %eax
	movl	$0, 100(%rsp)
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	movl	%edx, 20(%rsp)
	testb	$1, %al
	jne	.L57
	cmpl	$0, 44(%rsp)
	jle	.L59
	movl	20(%rsp), %eax
	movl	$2002, %r13d
	movl	$0, 12(%rsp)
	leaq	4004+field(%rip), %r12
	movdqa	.LC0(%rip), %xmm7
	movl	$1, %r15d
	leal	-1(%rax), %ebp
	movq	%r13, %rax
	movq	%r12, %r13
	movl	%ebp, %r12d
	movq	%rax, %rbp
	.p2align 4,,10
	.p2align 3
.L116:
	movl	20(%rsp), %eax
	movl	$1, %r10d
	testl	%eax, %eax
	je	.L99
	movswl	4002(%r13), %esi
	testl	%esi, %esi
	jle	.L99
	testl	%r12d, %r12d
	je	.L100
	leal	-1(%rsi), %eax
	leaq	2+field(%rip), %rbx
	addq	%rbp, %rax
	leaq	(%rbx,%rax,2), %r14
	movq	%r13, %rbx
.L102:
	movswl	(%rbx), %edi
	testl	%edi, %edi
	je	.L101
	movl	%r12d, %edx
	movl	%r15d, %esi
	call	count.part.0
	addl	%eax, %r10d
.L101:
	addq	$2, %rbx
	cmpq	%r14, %rbx
	jne	.L102
.L99:
	movl	%r10d, 96(%rsp)
	cmpl	12(%rsp), %r10d
	jle	.L115
	movl	%r10d, 100(%rsp)
	movl	%r10d, 12(%rsp)
.L115:
	addl	$1, %r15d
	addq	$4004, %r13
	addq	$2002, %rbp
	cmpl	44(%rsp), %r15d
	jle	.L116
.L59:
	movl	44(%rsp), %edx
	xorl	%eax, %eax
	subl	100(%rsp), %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L145
	addq	$120, %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
.L57:
	.cfi_restore_state
	cmpl	$0, 44(%rsp)
	jle	.L59
	movl	20(%rsp), %eax
	movl	$0, 12(%rsp)
	movl	$1, %r15d
	movq	$2002, 72(%rsp)
	movdqa	.LC0(%rip), %xmm7
	leal	-1(%rax), %r13d
	leaq	4004+field(%rip), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L60:
	movq	24(%rsp), %rax
	movswl	4002(%rax), %eax
	movl	%eax, 40(%rsp)
	testl	%eax, %eax
	jle	.L98
	movl	%eax, %ebx
	leal	-1(%rax), %eax
	leaq	2+field(%rip), %rcx
	movq	24(%rsp), %rbp
	movl	%eax, 52(%rsp)
	addq	72(%rsp), %rax
	leaq	(%rcx,%rax,2), %r12
	movl	%ebx, %eax
	andl	$-8, %ebx
	shrl	$3, %eax
	movl	%ebx, 48(%rsp)
	subl	$1, %eax
	salq	$4, %rax
	leaq	16(%rbp,%rax), %rax
	movq	%rax, 56(%rsp)
	movslq	%r15d, %rax
	imulq	$2002, %rax, %rax
	movq	%rax, 64(%rsp)
	.p2align 4,,10
	.p2align 3
.L96:
	movzwl	0(%rbp), %ecx
	movl	20(%rsp), %edx
	movl	$2, %eax
	movw	%cx, 16(%rsp)
	testl	%edx, %edx
	je	.L61
	movswl	%cx, %r14d
	testl	%r13d, %r13d
	je	.L62
	movq	24(%rsp), %r10
	movl	$1, %ebx
.L64:
	movswl	(%r10), %edi
	cmpl	%edi, %r14d
	je	.L63
	movl	%r13d, %edx
	movl	%r15d, %esi
	call	count.part.0
	addl	%eax, %ebx
.L63:
	addq	$2, %r10
	cmpq	%r12, %r10
	jne	.L64
	movslq	%r14d, %rax
	leaq	field(%rip), %rcx
	imulq	$4004, %rax, %rax
	movswl	4002(%rcx,%rax), %eax
	testw	%ax, %ax
	jle	.L70
	movswq	16(%rsp), %r10
	subl	$1, %eax
	movl	%ebx, 16(%rsp)
	movl	%r14d, %ebx
	movq	%rbp, 32(%rsp)
	movl	%r13d, %ebp
	imulq	$4004, %r10, %rsi
	imulq	$2002, %r10, %r10
	addq	%rsi, %rcx
	addq	%rax, %r10
	leaq	2+field(%rip), %rax
	movq	%rcx, %r14
	leaq	(%rax,%r10,2), %rax
	movl	$1, %r10d
	movl	%r10d, %r13d
	movq	%rax, %r10
.L81:
	movswl	(%r14), %edi
	cmpl	%edi, %r15d
	je	.L80
	movl	%ebp, %edx
	movl	%ebx, %esi
	call	count.part.0
	addl	%eax, %r13d
.L80:
	addq	$2, %r14
	cmpq	%r14, %r10
	jne	.L81
	movl	%r13d, %r10d
	movl	16(%rsp), %ebx
	movl	%ebp, %r13d
	movq	32(%rsp), %rbp
.L82:
	leal	(%r10,%rbx), %eax
.L61:
	movl	%eax, 96(%rsp)
	cmpl	12(%rsp), %eax
	jle	.L95
	movl	%eax, 100(%rsp)
	movl	%eax, 12(%rsp)
.L95:
	addq	$2, %rbp
	cmpq	%r12, %rbp
	jne	.L96
.L98:
	addq	$4004, 24(%rsp)
	addl	$1, %r15d
	addq	$2002, 72(%rsp)
	cmpl	44(%rsp), %r15d
	jle	.L60
	jmp	.L59
	.p2align 4,,10
	.p2align 3
.L62:
	cmpl	$6, 52(%rsp)
	jbe	.L120
	movd	%r14d, %xmm6
	movq	24(%rsp), %rax
	pxor	%xmm0, %xmm0
	pxor	%xmm5, %xmm5
	movq	56(%rsp), %rdx
	pshufd	$0, %xmm6, %xmm4
.L67:
	movdqu	(%rax), %xmm2
	movdqa	%xmm5, %xmm3
	addq	$16, %rax
	pcmpgtw	%xmm2, %xmm3
	movdqa	%xmm2, %xmm1
	punpcklwd	%xmm3, %xmm1
	punpckhwd	%xmm3, %xmm2
	pcmpeqd	%xmm4, %xmm1
	pcmpeqd	%xmm4, %xmm2
	pandn	%xmm7, %xmm1
	pandn	%xmm7, %xmm2
	paddd	%xmm1, %xmm0
	paddd	%xmm2, %xmm0
	cmpq	%rdx, %rax
	jne	.L67
	movdqa	%xmm0, %xmm1
	movl	48(%rsp), %eax
	movl	40(%rsp), %edx
	leaq	field(%rip), %rcx
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ebx
	addl	$1, %ebx
	cmpl	%edx, %eax
	je	.L71
	movl	%edx, %edi
.L66:
	movq	64(%rsp), %rdx
	movslq	%eax, %rsi
	leaq	field(%rip), %rcx
	addq	%rdx, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r14d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %ebx
	leal	1(%rax), %esi
	cmpl	%edi, %esi
	jge	.L71
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r14d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %ebx
	leal	2(%rax), %esi
	cmpl	%esi, %edi
	jle	.L71
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r14d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %ebx
	leal	3(%rax), %esi
	cmpl	%esi, %edi
	jle	.L71
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r14d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %ebx
	leal	4(%rax), %esi
	cmpl	%esi, %edi
	jle	.L71
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r14d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %ebx
	leal	5(%rax), %esi
	cmpl	%esi, %edi
	jle	.L71
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r14d
	setne	%sil
	addl	$6, %eax
	movzbl	%sil, %esi
	addl	%esi, %ebx
	cmpl	%eax, %edi
	jle	.L71
	cltq
	addq	%rdx, %rax
	movswl	(%rcx,%rax,2), %eax
	cmpl	%eax, %r14d
	setne	%al
	movzbl	%al, %eax
	addl	%eax, %ebx
	.p2align 4,,10
	.p2align 3
.L71:
	movslq	%r14d, %r9
	imulq	$4004, %r9, %rax
	movswl	4002(%rcx,%rax), %edi
	testl	%edi, %edi
	jle	.L70
	leal	-1(%rdi), %eax
	cmpl	$6, %eax
	jbe	.L121
	movswq	16(%rsp), %rsi
	movl	%edi, %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm5, %xmm5
	shrl	$3, %eax
	movd	%r15d, %xmm6
	imulq	$4004, %rsi, %rsi
	leal	-1(%rax), %r8d
	pshufd	$0, %xmm6, %xmm4
	salq	$4, %r8
	addq	%rcx, %rsi
	leaq	16(%rsi), %rax
	addq	%rax, %r8
.L84:
	movdqu	(%rsi), %xmm2
	movdqa	%xmm5, %xmm3
	movq	%rax, %rsi
	pcmpgtw	%xmm2, %xmm3
	movdqa	%xmm2, %xmm1
	punpcklwd	%xmm3, %xmm1
	punpckhwd	%xmm3, %xmm2
	pcmpeqd	%xmm4, %xmm1
	pcmpeqd	%xmm4, %xmm2
	pandn	%xmm7, %xmm1
	pandn	%xmm7, %xmm2
	paddd	%xmm1, %xmm0
	paddd	%xmm2, %xmm0
	cmpq	%rax, %r8
	je	.L143
	addq	$16, %rax
	jmp	.L84
	.p2align 4,,10
	.p2align 3
.L70:
	leal	1(%rbx), %eax
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L143:
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	leal	1(%rax), %r10d
	movl	%edi, %eax
	andl	$-8, %eax
	testb	$7, %dil
	je	.L82
.L83:
	imulq	$2002, %r9, %r9
	movslq	%eax, %rsi
	addq	%r9, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r10d
	leal	1(%rax), %esi
	cmpl	%edi, %esi
	jge	.L82
	movslq	%esi, %rsi
	addq	%r9, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r10d
	leal	2(%rax), %esi
	cmpl	%edi, %esi
	jge	.L82
	movslq	%esi, %rsi
	addq	%r9, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r10d
	leal	3(%rax), %esi
	cmpl	%edi, %esi
	jge	.L82
	movslq	%esi, %rsi
	addq	%r9, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%r15d, %esi
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r10d
	leal	4(%rax), %esi
	cmpl	%edi, %esi
	jge	.L82
	movslq	%esi, %rsi
	addq	%r9, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %r10d
	leal	5(%rax), %esi
	cmpl	%edi, %esi
	jge	.L82
	movslq	%esi, %rsi
	addq	%r9, %rsi
	movswl	(%rcx,%rsi,2), %esi
	cmpl	%esi, %r15d
	setne	%sil
	addl	$6, %eax
	movzbl	%sil, %esi
	addl	%esi, %r10d
	cmpl	%edi, %eax
	jge	.L82
	cltq
	addq	%rax, %r9
	movswl	(%rcx,%r9,2), %eax
	cmpl	%eax, %r15d
	setne	%al
	movzbl	%al, %eax
	addl	%eax, %r10d
	jmp	.L82
.L120:
	movl	40(%rsp), %edi
	xorl	%eax, %eax
	movl	$1, %ebx
	jmp	.L66
.L100:
	leal	-1(%rsi), %eax
	cmpl	$6, %eax
	jbe	.L124
	movl	%esi, %eax
	pxor	%xmm2, %xmm2
	pxor	%xmm5, %xmm5
	shrl	$3, %eax
	movdqa	%xmm2, %xmm4
	subl	$1, %eax
	salq	$4, %rax
	leaq	16(%r13,%rax), %rdi
	movq	%r13, %rax
.L104:
	movdqu	(%rax), %xmm0
	movdqa	%xmm5, %xmm3
	addq	$16, %rax
	pcmpgtw	%xmm0, %xmm3
	movdqa	%xmm0, %xmm1
	punpcklwd	%xmm3, %xmm1
	punpckhwd	%xmm3, %xmm0
	pcmpeqd	%xmm4, %xmm1
	pcmpeqd	%xmm4, %xmm0
	pandn	%xmm7, %xmm1
	pandn	%xmm7, %xmm0
	paddd	%xmm1, %xmm2
	paddd	%xmm0, %xmm2
	cmpq	%rdi, %rax
	jne	.L104
	movdqa	%xmm2, %xmm0
	movl	%esi, %eax
	psrldq	$8, %xmm0
	andl	$-8, %eax
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %r10d
	addl	$1, %r10d
	testb	$7, %sil
	je	.L99
.L103:
	movslq	%r15d, %rdi
	movslq	%eax, %r11
	leaq	field(%rip), %rbx
	imulq	$2002, %rdi, %r9
	addq	%r11, %r9
	cmpw	$0, (%rbx,%r9,2)
	je	.L107
	addl	$1, %r10d
.L107:
	leal	1(%rax), %r9d
	cmpl	%r9d, %esi
	jle	.L99
	imulq	$2002, %rdi, %r11
	movslq	%r9d, %r9
	leaq	field(%rip), %rbx
	addq	%r11, %r9
	cmpw	$0, (%rbx,%r9,2)
	je	.L108
	addl	$1, %r10d
.L108:
	leal	2(%rax), %r9d
	cmpl	%r9d, %esi
	jle	.L99
	imulq	$2002, %rdi, %r11
	movslq	%r9d, %r9
	leaq	field(%rip), %rbx
	addq	%r11, %r9
	cmpw	$0, (%rbx,%r9,2)
	je	.L109
	addl	$1, %r10d
.L109:
	leal	3(%rax), %r9d
	cmpl	%r9d, %esi
	jle	.L99
	imulq	$2002, %rdi, %r11
	movslq	%r9d, %r9
	leaq	field(%rip), %rcx
	addq	%r11, %r9
	cmpw	$0, (%rcx,%r9,2)
	je	.L110
	addl	$1, %r10d
.L110:
	leal	4(%rax), %r9d
	cmpl	%r9d, %esi
	jle	.L99
	imulq	$2002, %rdi, %r11
	movslq	%r9d, %r9
	leaq	field(%rip), %rbx
	addq	%r11, %r9
	cmpw	$0, (%rbx,%r9,2)
	je	.L111
	addl	$1, %r10d
.L111:
	leal	5(%rax), %r9d
	cmpl	%r9d, %esi
	jle	.L99
	imulq	$2002, %rdi, %r11
	movslq	%r9d, %r9
	leaq	field(%rip), %rbx
	addq	%r11, %r9
	cmpw	$0, (%rbx,%r9,2)
	je	.L112
	addl	$1, %r10d
.L112:
	addl	$6, %eax
	cmpl	%eax, %esi
	jle	.L99
	imulq	$2002, %rdi, %rdi
	cltq
	leaq	field(%rip), %rcx
	addq	%rdi, %rax
	cmpw	$0, (%rcx,%rax,2)
	je	.L99
	addl	$1, %r10d
	jmp	.L99
.L121:
	xorl	%eax, %eax
	movl	$1, %r10d
	jmp	.L83
.L124:
	xorl	%eax, %eax
	jmp	.L103
.L145:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	count
	.type	count, @function
count:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	testl	%edx, %edx
	je	.L146
	movslq	%edi, %rax
	movl	%esi, %ebp
	leaq	field(%rip), %rsi
	movl	%edi, %r13d
	imulq	$4004, %rax, %r10
	addq	%rsi, %r10
	movswl	4002(%r10), %ecx
	testl	%ecx, %ecx
	jle	.L146
	movl	%edx, %ebx
	subl	$1, %ebx
	je	.L148
	imulq	$2002, %rax, %rax
	leal	-1(%rcx), %edx
	addq	%rdx, %rax
	leaq	2(%rsi), %rdx
	leaq	(%rdx,%rax,2), %r14
.L150:
	movswl	(%r10), %edi
	cmpl	%ebp, %edi
	je	.L149
	movl	%ebx, %edx
	movl	%r13d, %esi
	call	count.part.0
	addl	%eax, %r12d
.L149:
	addq	$2, %r10
	cmpq	%r10, %r14
	jne	.L150
.L146:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%r12d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L148:
	.cfi_restore_state
	leal	-1(%rcx), %edx
	cmpl	$6, %edx
	jbe	.L152
	movd	%ebp, %xmm7
	pxor	%xmm2, %xmm2
	pxor	%xmm6, %xmm6
	movl	%ecx, %edx
	shrl	$3, %edx
	movdqa	.LC0(%rip), %xmm4
	pshufd	$0, %xmm7, %xmm5
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%r10,%rdx), %rdx
.L153:
	movdqu	(%r10), %xmm0
	movdqa	%xmm6, %xmm3
	addq	$16, %r10
	pcmpgtw	%xmm0, %xmm3
	movdqa	%xmm0, %xmm1
	punpcklwd	%xmm3, %xmm1
	punpckhwd	%xmm3, %xmm0
	pcmpeqd	%xmm5, %xmm1
	pcmpeqd	%xmm5, %xmm0
	pandn	%xmm4, %xmm1
	pandn	%xmm4, %xmm0
	paddd	%xmm1, %xmm2
	paddd	%xmm0, %xmm2
	cmpq	%rdx, %r10
	jne	.L153
	movdqa	%xmm2, %xmm0
	movl	%ecx, %ebx
	psrldq	$8, %xmm0
	andl	$-8, %ebx
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %r12d
	addl	$1, %r12d
	testb	$7, %cl
	je	.L146
.L152:
	imulq	$2002, %rax, %rax
	movslq	%ebx, %rdx
	addq	%rax, %rdx
	movswl	(%rsi,%rdx,2), %edx
	cmpl	%edx, %ebp
	setne	%dl
	movzbl	%dl, %edx
	addl	%edx, %r12d
	leal	1(%rbx), %edx
	cmpl	%edx, %ecx
	jle	.L146
	movslq	%edx, %rdx
	addq	%rax, %rdx
	movswl	(%rsi,%rdx,2), %edx
	cmpl	%edx, %ebp
	setne	%dl
	movzbl	%dl, %edx
	addl	%edx, %r12d
	leal	2(%rbx), %edx
	cmpl	%edx, %ecx
	jle	.L146
	movslq	%edx, %rdx
	addq	%rax, %rdx
	movswl	(%rsi,%rdx,2), %edx
	cmpl	%edx, %ebp
	setne	%dl
	movzbl	%dl, %edx
	addl	%edx, %r12d
	leal	3(%rbx), %edx
	cmpl	%edx, %ecx
	jle	.L146
	movslq	%edx, %rdx
	addq	%rax, %rdx
	movswl	(%rsi,%rdx,2), %edx
	cmpl	%edx, %ebp
	setne	%dl
	movzbl	%dl, %edx
	addl	%edx, %r12d
	leal	4(%rbx), %edx
	cmpl	%edx, %ecx
	jle	.L146
	movslq	%edx, %rdx
	addq	%rax, %rdx
	movswl	(%rsi,%rdx,2), %edx
	cmpl	%edx, %ebp
	setne	%dl
	movzbl	%dl, %edx
	addl	%edx, %r12d
	leal	5(%rbx), %edx
	cmpl	%edx, %ecx
	jle	.L146
	movslq	%edx, %rdx
	addq	%rax, %rdx
	movswl	(%rsi,%rdx,2), %edx
	cmpl	%edx, %ebp
	setne	%dl
	movzbl	%dl, %edx
	addl	%edx, %r12d
	leal	6(%rbx), %edx
	cmpl	%edx, %ecx
	jle	.L146
	movslq	%edx, %rdx
	addq	%rdx, %rax
	movswl	(%rsi,%rax,2), %eax
	cmpl	%eax, %ebp
	setne	%al
	movzbl	%al, %eax
	addl	%eax, %r12d
	jmp	.L146
	.cfi_endproc
.LFE40:
	.size	count, .-count
	.globl	field
	.bss
	.align 32
	.type	field, @object
	.size	field, 8012004
field:
	.zero	8012004
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.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 N 2001

typedef struct vertex{
	short int next[N];
	short int length;
} vertex;

vertex field[N];


int count(int i,int k,int r);

int main(){
	int n,k;
	int i,j;
	int a,b;
	int r;
	scanf("%d %d",&n,&k);
	for(i = 0;i < n-1;i++){
		scanf("%d %d",&a,&b);
		field[a].next[field[a].length++] = b;
		field[b].next[field[b].length++] = a;
	}

	r = k / 2;
	b = 0;
	if(k%2){
		for(i = 1;i <= n;i++){
			for(j = 0;j < field[i].length;j++){
				a = count(i,field[i].next[j],r) + count(field[i].next[j],i,r);
				if(b < a){
					b = a;
				}
			}
		}
	}else{
		for(i = 1;i <= n;i++){
			a = count(i,0,r);
			if(b < a){
				b = a;
			}
		}		
	}

	printf("%d\n", n - b);
	return 0;
}
int count(int i,int pre,int r){
	int res = 1;
	int j;
	if(r == 0){
		return res;
	}
	for(j = 0;j < field[i].length;j++){
		if(field[i].next[j] == pre){
			continue;
		}
		res += count(field[i].next[j],i,r-1);
	}
	return res;
}

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
 6 2
0 3
3 2
4 2
1 6
5 6
 6 0
1 3
6 2
4 2
1 6
5 6
 6 7
1 2
3 4
4 2
1 6
5 6
 6 5
1 3
3 2
4 2
1 6
5 6
 6 1
1 2
3 4
4 2
1 6
5 6
 6 5
1 3
3 2
4 1
1 6
5 6

4
 0
 1
 3
 3
 5
 0
 0
 4
 0

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 N 2001

typedef struct vertex{
	short int next[N];
	short int length;
} vertex;

vertex field[N];


int count(int i,int k,int r);

int main(){
	int n,k;
	int i,j;
	int a,b;
	int r;
	scanf("%d %d",&n,&k);
	for(i = 0;i < n-1;i++){
		scanf("%d %d",&a,&b);
		field[a].next[field[a].length++] = b;
		field[b].next[field[b].length++] = a;
	}

	r = k / 2;
	b = 0;
	if(k%2){
		for(i = 1;i <= n;i++){
			for(j = 0;j < field[i].length;j++){
				a = count(i,field[i].next[j],r) + count(field[i].next[j],i,r);
				if(b < a){
					b = a;
				}
			}
		}
	}else{
		for(i = 1;i <= n;i++){
			a = count(i,0,r);
			if(b < a){
				b = a;
			}
		}		
	}

	printf("%d\n", n - b);
	return 0;
}
int count(int i,int pre,int r){
	int res = 1;
	int j;
	if(r == 0){
		return res;
	}
	for(j = 0;j < field[i].length;j++){
		if(field[i].next[j] == pre){
			continue;
		}
		res += count(field[i].next[j],i,r-1);
	}
	return res;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	field
	.bss
	.align 32
	.type	field, @object
	.size	field, 8012004
field:
	.zero	8012004
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-48(%rbp), %rdx
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -36(%rbp)
	jmp	.L2
.L3:
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-40(%rbp), %esi
	movl	-44(%rbp), %ecx
	movl	-44(%rbp), %edx
	movslq	%edx, %rax
	imulq	$4004, %rax, %rax
	leaq	4002+field(%rip), %rdi
	movzwl	(%rax,%rdi), %eax
	movl	%eax, %edi
	addl	$1, %edi
	movl	%edi, %r8d
	movslq	%edx, %rdx
	imulq	$4004, %rdx, %rdx
	leaq	4002+field(%rip), %rdi
	movw	%r8w, (%rdx,%rdi)
	cwtl
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$2002, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	field(%rip), %rax
	movw	%si, (%rdx,%rax)
	movl	-44(%rbp), %esi
	movl	-40(%rbp), %ecx
	movl	-40(%rbp), %edx
	movslq	%edx, %rax
	imulq	$4004, %rax, %rax
	leaq	4002+field(%rip), %rdi
	movzwl	(%rax,%rdi), %eax
	movl	%eax, %edi
	addl	$1, %edi
	movl	%edi, %r8d
	movslq	%edx, %rdx
	imulq	$4004, %rdx, %rdx
	leaq	4002+field(%rip), %rdi
	movw	%r8w, (%rdx,%rdi)
	cwtl
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$2002, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	field(%rip), %rax
	movw	%si, (%rdx,%rax)
	addl	$1, -36(%rbp)
.L2:
	movl	-52(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -36(%rbp)
	jl	.L3
	movl	-48(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -28(%rbp)
	movl	$0, -40(%rbp)
	movl	-48(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L4
	movl	$1, -36(%rbp)
	jmp	.L5
.L9:
	movl	$0, -32(%rbp)
	jmp	.L6
.L8:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$2002, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	field(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	movswl	%ax, %ecx
	movl	-28(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	count
	movl	%eax, %ebx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$2002, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	field(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	cwtl
	movl	-28(%rbp), %edx
	movl	-36(%rbp), %ecx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	count
	addl	%ebx, %eax
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-44(%rbp), %eax
	movl	%eax, -40(%rbp)
.L7:
	addl	$1, -32(%rbp)
.L6:
	movl	-36(%rbp), %eax
	cltq
	imulq	$4004, %rax, %rax
	leaq	4002+field(%rip), %rdx
	movzwl	(%rax,%rdx), %eax
	cwtl
	cmpl	%eax, -32(%rbp)
	jl	.L8
	addl	$1, -36(%rbp)
.L5:
	movl	-52(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L9
	jmp	.L10
.L4:
	movl	$1, -36(%rbp)
	jmp	.L11
.L13:
	movl	-28(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	count
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L12
	movl	-44(%rbp), %eax
	movl	%eax, -40(%rbp)
.L12:
	addl	$1, -36(%rbp)
.L11:
	movl	-52(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L13
.L10:
	movl	-52(%rbp), %eax
	movl	-40(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	count
	.type	count, @function
count:
.LFB7:
	.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
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	$1, -8(%rbp)
	cmpl	$0, -28(%rbp)
	jne	.L17
	movl	-8(%rbp), %eax
	jmp	.L18
.L17:
	movl	$0, -4(%rbp)
	jmp	.L19
.L22:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$2002, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	field(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	cwtl
	cmpl	%eax, -24(%rbp)
	je	.L23
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	cltq
	imulq	$2002, %rax, %rax
	addq	%rcx, %rax
	leaq	(%rax,%rax), %rcx
	leaq	field(%rip), %rax
	movzwl	(%rcx,%rax), %eax
	cwtl
	movl	-20(%rbp), %ecx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	count
	addl	%eax, -8(%rbp)
	jmp	.L21
.L23:
	nop
.L21:
	addl	$1, -4(%rbp)
.L19:
	movl	-20(%rbp), %eax
	cltq
	imulq	$4004, %rax, %rax
	leaq	4002+field(%rip), %rdx
	movzwl	(%rax,%rdx), %eax
	cwtl
	cmpl	%eax, -4(%rbp)
	jl	.L22
	movl	-8(%rbp), %eax
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	count, .-count
	.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	field
	.bss
	.align 32
	.type	field, @object
	.size	field, 8012004
field:
	.zero	8012004
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-48(%rbp), %rdx
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -36(%rbp)
	jmp	.L2
.L3:
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-40(%rbp), %esi
	movl	-44(%rbp), %ecx
	movl	-44(%rbp), %edx
	movslq	%edx, %rax
	imulq	$4004, %rax, %rax
	leaq	4002+field(%rip), %rdi
	movzwl	(%rax,%rdi), %eax
	movl	%eax, %edi
	addl	$1, %edi
	movl	%edi, %r8d
	movslq	%edx, %rdx
	imulq	$4004, %rdx, %rdx
	leaq	4002+field(%rip), %rdi
	movw	%r8w, (%rdx,%rdi)
	cwtl
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$2002, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	field(%rip), %rax
	movw	%si, (%rdx,%rax)
	movl	-44(%rbp), %esi
	movl	-40(%rbp), %ecx
	movl	-40(%rbp), %edx
	movslq	%edx, %rax
	imulq	$4004, %rax, %rax
	leaq	4002+field(%rip), %rdi
	movzwl	(%rax,%rdi), %eax
	movl	%eax, %edi
	addl	$1, %edi
	movl	%edi, %r8d
	movslq	%edx, %rdx
	imulq	$4004, %rdx, %rdx
	leaq	4002+field(%rip), %rdi
	movw	%r8w, (%rdx,%rdi)
	cwtl
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$2002, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	field(%rip), %rax
	movw	%si, (%rdx,%rax)
	addl	$1, -36(%rbp)
.L2:
	movl	-52(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -36(%rbp)
	jl	.L3
	movl	-48(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -28(%rbp)
	movl	$0, -40(%rbp)
	movl	-48(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L4
	movl	$1, -36(%rbp)
	jmp	.L5
.L9:
	movl	$0, -32(%rbp)
	jmp	.L6
.L8:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$2002, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	field(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	movswl	%ax, %ecx
	movl	-28(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	count
	movl	%eax, %ebx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$2002, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	field(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	cwtl
	movl	-28(%rbp), %edx
	movl	-36(%rbp), %ecx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	count
	addl	%ebx, %eax
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-44(%rbp), %eax
	movl	%eax, -40(%rbp)
.L7:
	addl	$1, -32(%rbp)
.L6:
	movl	-36(%rbp), %eax
	cltq
	imulq	$4004, %rax, %rax
	leaq	4002+field(%rip), %rdx
	movzwl	(%rax,%rdx), %eax
	cwtl
	cmpl	%eax, -32(%rbp)
	jl	.L8
	addl	$1, -36(%rbp)
.L5:
	movl	-52(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L9
	jmp	.L10
.L4:
	movl	$1, -36(%rbp)
	jmp	.L11
.L13:
	movl	-28(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	count
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L12
	movl	-44(%rbp), %eax
	movl	%eax, -40(%rbp)
.L12:
	addl	$1, -36(%rbp)
.L11:
	movl	-52(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L13
.L10:
	movl	-52(%rbp), %eax
	movl	-40(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	count
	.type	count, @function
count:
.LFB7:
	.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
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	$1, -8(%rbp)
	cmpl	$0, -28(%rbp)
	jne	.L17
	movl	-8(%rbp), %eax
	jmp	.L18
.L17:
	movl	$0, -4(%rbp)
	jmp	.L19
.L22:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$2002, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	field(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	cwtl
	cmpl	%eax, -24(%rbp)
	je	.L23
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	cltq
	imulq	$2002, %rax, %rax
	addq	%rcx, %rax
	leaq	(%rax,%rax), %rcx
	leaq	field(%rip), %rax
	movzwl	(%rcx,%rax), %eax
	cwtl
	movl	-20(%rbp), %ecx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	count
	addl	%eax, -8(%rbp)
	jmp	.L21
.L23:
	nop
.L21:
	addl	$1, -4(%rbp)
.L19:
	movl	-20(%rbp), %eax
	cltq
	imulq	$4004, %rax, %rax
	leaq	4002+field(%rip), %rdx
	movzwl	(%rax,%rdx), %eax
	cwtl
	cmpl	%eax, -4(%rbp)
	jl	.L22
	movl	-8(%rbp), %eax
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	count, .-count
	.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:
