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 <string.h>
#include <stdlib.h>
#include <stdint.h> // int64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))

int get_int2(int *a1, int *a2) {
  scanf("%d %d", a1, a2);
  return 0;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
    int i;
    for(i = 0; i < size; i++) {
        scanf("%d", &arr[i]);
    }
    return 0;
}

#define NUM_MAX 2000
#define DIVISOR 1000000007

int main(void) {
    int anum, bnum;
    get_int2(&anum, &bnum);
    static int arr[NUM_MAX];
    static int brr[NUM_MAX];
    fget_array(arr, anum);
    fget_array(brr, bnum);

    static int64_t dp[NUM_MAX+1][NUM_MAX+1];
    int i, j;
    for(i = 0; i <= anum; i++) dp[i][0] = 1;
    for(i = 0; i <= bnum; i++) dp[0][i] = 1;
    for(i = 1; i <= anum; i++) {
        int aval = arr[i-1];
        for(j = 1; j <= bnum; j++) {
            int bval = brr[j-1];
            int64_t ret = 0;
            ret = (ret + dp[i-1][j] + dp[i][j-1] - dp[i-1][j-1] + DIVISOR)%DIVISOR;
            if(aval == bval) {
                ret = (ret + dp[i-1][j-1])%DIVISOR;
            }
            dp[i][j] = ret;
        }
    }
    printf("%d\n", (int)dp[anum][bnum]);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
	.text
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int2, .-get_int2
	.section	.rodata
.LC1:
	.string	"%d"
	.text
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.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
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L4:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L5
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fget_array, .-fget_array
	.section	.rodata
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	get_int2
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	leaq	arr.2(%rip), %rax
	movq	%rax, %rdi
	call	fget_array
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	brr.1(%rip), %rax
	movq	%rax, %rdi
	call	fget_array
	movl	$0, -32(%rbp)
	jmp	.L8
.L9:
	movl	-32(%rbp), %eax
	cltq
	imulq	$16008, %rax, %rax
	leaq	dp.0(%rip), %rdx
	movq	$1, (%rax,%rdx)
	addl	$1, -32(%rbp)
.L8:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L9
	movl	$0, -32(%rbp)
	jmp	.L10
.L11:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	$1, (%rdx,%rax)
	addl	$1, -32(%rbp)
.L10:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L11
	movl	$1, -32(%rbp)
	jmp	.L12
.L16:
	movl	-32(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	arr.2(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L13
.L15:
	movl	-28(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	brr.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
	movq	$0, -16(%rbp)
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$2001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	movslq	%edx, %rax
	imulq	$2001, %rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jne	.L14
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
.L14:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$2001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp.0(%rip), %rdx
	movq	-16(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	addl	$1, -28(%rbp)
.L13:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jle	.L15
	addl	$1, -32(%rbp)
.L12:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L16
	movl	-40(%rbp), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$2001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.local	arr.2
	.comm	arr.2,8000,32
	.local	brr.1
	.comm	brr.1,8000,32
	.local	dp.0
	.comm	dp.0,32032008,32
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
	.text
	.p2align 4
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rsi, %rdx
	xorl	%eax, %eax
	movq	%rdi, %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE51:
	.size	get_int2, .-get_int2
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
	.text
	.p2align 4
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB52:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L9
	leal	-1(%rsi), %eax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	4(%rdi,%rax,4), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%r12, %rbx
	jne	.L6
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	fget_array, .-fget_array
	.section	.rodata.str1.1
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rdx
	leaq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %eax
	testl	%eax, %eax
	jle	.L13
	leaq	arr.2(%rip), %rbx
	leal	-1(%rax), %edx
	leaq	4(%rbx), %rax
	leaq	.LC1(%rip), %rbp
	leaq	(%rax,%rdx,4), %r12
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%r12, %rbx
	jne	.L14
.L13:
	movslq	36(%rsp), %r8
	testl	%r8d, %r8d
	jle	.L15
	leaq	brr.1(%rip), %rbx
	leal	-1(%r8), %edx
	leaq	4(%rbx), %rax
	leaq	.LC1(%rip), %rbp
	leaq	(%rax,%rdx,4), %r12
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%r12, %rbx
	jne	.L16
	movslq	36(%rsp), %r8
.L15:
	movl	32(%rsp), %ecx
	leaq	dp.0(%rip), %rax
	movq	%rax, (%rsp)
	testl	%ecx, %ecx
	js	.L47
	movslq	%ecx, %rsi
	imulq	$16008, %rsi, %rdx
	movq	%rsi, 24(%rsp)
	leaq	16008(%rax), %rsi
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L18:
	movq	$1, (%rax)
	addq	$16008, %rax
	cmpq	%rdx, %rax
	jne	.L18
.L17:
	testl	%r8d, %r8d
	js	.L19
	leal	1(%r8), %esi
	je	.L35
	movl	%esi, %edx
	leaq	dp.0(%rip), %rax
	movdqa	.LC2(%rip), %xmm0
	shrl	%edx
	leaq	16(%rax), %rdi
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L21:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L21
	movl	%esi, %eax
	andl	$-2, %eax
	andl	$1, %esi
	je	.L19
.L20:
	movq	(%rsp), %rdi
	cltq
	movq	$1, (%rdi,%rax,8)
.L19:
	testl	%ecx, %ecx
	jle	.L23
	testl	%r8d, %r8d
	jle	.L23
	leaq	arr.2(%rip), %r13
	leal	-1(%rcx), %edx
	movl	$2001, %r15d
	movabsq	$-8543223828751151131, %rsi
	leaq	4(%r13), %rax
	leaq	8+dp.0(%rip), %r9
	leaq	(%rax,%rdx,4), %rax
	leaq	-4+brr.1(%rip), %r10
	movq	%rax, 8(%rsp)
	leal	-3(%r8), %eax
	shrl	%eax
	leaq	5(%rax,%rax), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L33:
	movl	0(%r13), %edi
	cmpl	$2, %r8d
	jle	.L36
	movq	16000(%r9), %rax
	movq	-8(%r9), %rbx
	leaq	16008(%r9), %r14
	movl	$3, %r11d
	movq	%r14, %r12
	movq	%rax, %rdx
.L28:
	movq	(%r9), %rcx
	subq	%rbx, %rdx
	leaq	1000000007(%rdx,%rcx), %rbp
	movq	%rbp, %rax
	imulq	%rsi
	leaq	(%rdx,%rbp), %rax
	movq	%rbp, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rbp, %rax
	subq	%rdx, %rax
	leaq	-12+brr.1(%rip), %rdx
	cmpl	%edi, (%rdx,%r11,4)
	jne	.L25
	addq	%rax, %rbx
	movq	%rbx, %rax
	imulq	%rsi
	leaq	(%rdx,%rbx), %rax
	movq	%rbx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rbx, %rax
	subq	%rdx, %rax
.L25:
	movq	%rax, (%r12)
	movq	8(%r9), %rbx
	addq	%rbx, %rax
	subq	%rcx, %rax
	leaq	1000000007(%rax), %rbp
	movq	%rbp, %rax
	imulq	%rsi
	movq	%rbp, %rax
	sarq	$63, %rax
	addq	%rbp, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	movq	%rbp, %rdx
	subq	%rax, %rdx
	leaq	-8+brr.1(%rip), %rax
	cmpl	%edi, (%rax,%r11,4)
	jne	.L26
	addq	%rdx, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
.L26:
	movq	%rdx, 8(%r12)
	movl	%r11d, %eax
	addq	$16, %r9
	addq	$2, %r11
	addq	$16, %r12
	cmpq	16(%rsp), %r11
	jne	.L28
	movl	%eax, %edx
.L24:
	movq	(%rsp), %rbx
	movslq	%edx, %r9
	leaq	-2001(%r9,%r15), %rax
	leaq	(%rbx,%rax,8), %r11
	leaq	(%r9,%r15), %rax
	leaq	(%rbx,%rax,8), %rbx
	.p2align 4,,10
	.p2align 3
.L32:
	movq	-8(%r11), %rbp
	movq	(%r11), %rcx
	addq	-8(%rbx), %rcx
	subq	%rbp, %rcx
	addq	$1000000007, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	cmpl	%edi, (%r10,%r9,4)
	jne	.L29
	leaq	(%rcx,%rbp), %rcx
	movq	%rcx, %rax
	imulq	%rsi
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	movq	%rcx, %rdx
	imulq	$1000000007, %rax, %rax
	subq	%rax, %rdx
.L29:
	addq	$1, %r9
	movq	%rdx, (%rbx)
	addq	$8, %r11
	addq	$8, %rbx
	cmpl	%r9d, %r8d
	jge	.L32
	addq	$4, %r13
	addq	$2001, %r15
	movq	%r14, %r9
	cmpq	8(%rsp), %r13
	jne	.L33
.L23:
	imulq	$2001, 24(%rsp), %rax
	movq	(%rsp), %rdi
	leaq	.LC3(%rip), %rsi
	addq	%r8, %rax
	movl	(%rdi,%rax,8), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L48
	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
.L36:
	.cfi_restore_state
	movl	$1, %edx
	leaq	16008(%r9), %r14
	jmp	.L24
.L47:
	movslq	%ecx, %rax
	movq	%rax, 24(%rsp)
	jmp	.L17
.L35:
	xorl	%eax, %eax
	jmp	.L20
.L48:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.local	dp.0
	.comm	dp.0,32032008,32
	.local	brr.1
	.comm	brr.1,8000,32
	.local	arr.2
	.comm	arr.2,8000,32
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.quad	1
	.quad	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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
	.text
	.p2align 4
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rsi, %rdx
	xorl	%eax, %eax
	movq	%rdi, %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE51:
	.size	get_int2, .-get_int2
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
	.text
	.p2align 4
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB52:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L9
	leal	-1(%rsi), %eax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	4(%rdi,%rax,4), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%r12, %rbx
	jne	.L6
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	fget_array, .-fget_array
	.section	.rodata.str1.1
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rdx
	leaq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %eax
	testl	%eax, %eax
	jle	.L13
	leaq	arr.2(%rip), %rbx
	leal	-1(%rax), %edx
	leaq	4(%rbx), %rax
	leaq	.LC1(%rip), %rbp
	leaq	(%rax,%rdx,4), %r12
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%r12, %rbx
	jne	.L14
.L13:
	movslq	36(%rsp), %r8
	testl	%r8d, %r8d
	jle	.L15
	leaq	brr.1(%rip), %rbx
	leal	-1(%r8), %edx
	leaq	4(%rbx), %rax
	leaq	.LC1(%rip), %rbp
	leaq	(%rax,%rdx,4), %r12
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%r12, %rbx
	jne	.L16
	movslq	36(%rsp), %r8
.L15:
	movl	32(%rsp), %ecx
	leaq	dp.0(%rip), %rax
	movq	%rax, (%rsp)
	testl	%ecx, %ecx
	js	.L47
	movslq	%ecx, %rsi
	imulq	$16008, %rsi, %rdx
	movq	%rsi, 24(%rsp)
	leaq	16008(%rax), %rsi
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L18:
	movq	$1, (%rax)
	addq	$16008, %rax
	cmpq	%rdx, %rax
	jne	.L18
.L17:
	testl	%r8d, %r8d
	js	.L19
	leal	1(%r8), %esi
	je	.L35
	movl	%esi, %edx
	leaq	dp.0(%rip), %rax
	movdqa	.LC2(%rip), %xmm0
	shrl	%edx
	leaq	16(%rax), %rdi
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L21:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L21
	movl	%esi, %eax
	andl	$-2, %eax
	andl	$1, %esi
	je	.L19
.L20:
	movq	(%rsp), %rdi
	cltq
	movq	$1, (%rdi,%rax,8)
.L19:
	testl	%ecx, %ecx
	jle	.L23
	testl	%r8d, %r8d
	jle	.L23
	leaq	arr.2(%rip), %r13
	leal	-1(%rcx), %edx
	movl	$2001, %r15d
	movabsq	$-8543223828751151131, %rsi
	leaq	4(%r13), %rax
	leaq	8+dp.0(%rip), %r9
	leaq	(%rax,%rdx,4), %rax
	leaq	-4+brr.1(%rip), %r10
	movq	%rax, 8(%rsp)
	leal	-3(%r8), %eax
	shrl	%eax
	leaq	5(%rax,%rax), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L33:
	movl	0(%r13), %edi
	cmpl	$2, %r8d
	jle	.L36
	movq	16000(%r9), %rax
	movq	-8(%r9), %rbx
	leaq	16008(%r9), %r14
	movl	$3, %r11d
	movq	%r14, %r12
	movq	%rax, %rdx
.L28:
	movq	(%r9), %rcx
	subq	%rbx, %rdx
	leaq	1000000007(%rdx,%rcx), %rbp
	movq	%rbp, %rax
	imulq	%rsi
	leaq	(%rdx,%rbp), %rax
	movq	%rbp, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rbp, %rax
	subq	%rdx, %rax
	leaq	-12+brr.1(%rip), %rdx
	cmpl	%edi, (%rdx,%r11,4)
	jne	.L25
	addq	%rax, %rbx
	movq	%rbx, %rax
	imulq	%rsi
	leaq	(%rdx,%rbx), %rax
	movq	%rbx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rbx, %rax
	subq	%rdx, %rax
.L25:
	movq	%rax, (%r12)
	movq	8(%r9), %rbx
	addq	%rbx, %rax
	subq	%rcx, %rax
	leaq	1000000007(%rax), %rbp
	movq	%rbp, %rax
	imulq	%rsi
	movq	%rbp, %rax
	sarq	$63, %rax
	addq	%rbp, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	movq	%rbp, %rdx
	subq	%rax, %rdx
	leaq	-8+brr.1(%rip), %rax
	cmpl	%edi, (%rax,%r11,4)
	jne	.L26
	addq	%rdx, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
.L26:
	movq	%rdx, 8(%r12)
	movl	%r11d, %eax
	addq	$16, %r9
	addq	$2, %r11
	addq	$16, %r12
	cmpq	16(%rsp), %r11
	jne	.L28
	movl	%eax, %edx
.L24:
	movq	(%rsp), %rbx
	movslq	%edx, %r9
	leaq	-2001(%r9,%r15), %rax
	leaq	(%rbx,%rax,8), %r11
	leaq	(%r9,%r15), %rax
	leaq	(%rbx,%rax,8), %rbx
	.p2align 4,,10
	.p2align 3
.L32:
	movq	-8(%r11), %rbp
	movq	(%r11), %rcx
	addq	-8(%rbx), %rcx
	subq	%rbp, %rcx
	addq	$1000000007, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	cmpl	%edi, (%r10,%r9,4)
	jne	.L29
	leaq	(%rcx,%rbp), %rcx
	movq	%rcx, %rax
	imulq	%rsi
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	movq	%rcx, %rdx
	imulq	$1000000007, %rax, %rax
	subq	%rax, %rdx
.L29:
	addq	$1, %r9
	movq	%rdx, (%rbx)
	addq	$8, %r11
	addq	$8, %rbx
	cmpl	%r9d, %r8d
	jge	.L32
	addq	$4, %r13
	addq	$2001, %r15
	movq	%r14, %r9
	cmpq	8(%rsp), %r13
	jne	.L33
.L23:
	imulq	$2001, 24(%rsp), %rax
	movq	(%rsp), %rdi
	leaq	.LC3(%rip), %rsi
	addq	%r8, %rax
	movl	(%rdi,%rax,8), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L48
	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
.L36:
	.cfi_restore_state
	movl	$1, %edx
	leaq	16008(%r9), %r14
	jmp	.L24
.L47:
	movslq	%ecx, %rax
	movq	%rax, 24(%rsp)
	jmp	.L17
.L35:
	xorl	%eax, %eax
	jmp	.L20
.L48:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.local	dp.0
	.comm	dp.0,32032008,32
	.local	brr.1
	.comm	brr.1,8000,32
	.local	arr.2
	.comm	arr.2,8000,32
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.quad	1
	.quad	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 <string.h>
#include <stdlib.h>
#include <stdint.h> // int64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))

int get_int2(int *a1, int *a2) {
  scanf("%d %d", a1, a2);
  return 0;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
    int i;
    for(i = 0; i < size; i++) {
        scanf("%d", &arr[i]);
    }
    return 0;
}

#define NUM_MAX 2000
#define DIVISOR 1000000007

int main(void) {
    int anum, bnum;
    get_int2(&anum, &bnum);
    static int arr[NUM_MAX];
    static int brr[NUM_MAX];
    fget_array(arr, anum);
    fget_array(brr, bnum);

    static int64_t dp[NUM_MAX+1][NUM_MAX+1];
    int i, j;
    for(i = 0; i <= anum; i++) dp[i][0] = 1;
    for(i = 0; i <= bnum; i++) dp[0][i] = 1;
    for(i = 1; i <= anum; i++) {
        int aval = arr[i-1];
        for(j = 1; j <= bnum; j++) {
            int bval = brr[j-1];
            int64_t ret = 0;
            ret = (ret + dp[i-1][j] + dp[i][j-1] - dp[i-1][j-1] + DIVISOR)%DIVISOR;
            if(aval == bval) {
                ret = (ret + dp[i-1][j-1])%DIVISOR;
            }
            dp[i][j] = ret;
        }
    }
    printf("%d\n", (int)dp[anum][bnum]);
    return 0;
}
10 9
9 6 5 7 5 9 8 5 6 7
8 5 8 5 5 7 9 9 7
 20 20
1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 4 4
0 4 5 6
3 4 5 6
 2 2
1 6
3 1
 20 20
1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 20 20
1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1
1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 10 9
9 6 5 7 5 9 8 5 6 7
16 6 8 5 5 7 9 9 7
 10 9
9 6 5 7 5 9 8 5 6 7
8 5 8 7 5 7 9 9 7
 4 4
0 4 5 6
3 4 5 0
 2 2
2 6
3 1

175
 923263934
 8
 2
 578000379
 672631781
 179
 153
 5
 1

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 <string.h>
#include <stdlib.h>
#include <stdint.h> // int64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))

int get_int2(int *a1, int *a2) {
  scanf("%d %d", a1, a2);
  return 0;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
    int i;
    for(i = 0; i < size; i++) {
        scanf("%d", &arr[i]);
    }
    return 0;
}

#define NUM_MAX 2000
#define DIVISOR 1000000007

int main(void) {
    int anum, bnum;
    get_int2(&anum, &bnum);
    static int arr[NUM_MAX];
    static int brr[NUM_MAX];
    fget_array(arr, anum);
    fget_array(brr, bnum);

    static int64_t dp[NUM_MAX+1][NUM_MAX+1];
    int i, j;
    for(i = 0; i <= anum; i++) dp[i][0] = 1;
    for(i = 0; i <= bnum; i++) dp[0][i] = 1;
    for(i = 1; i <= anum; i++) {
        int aval = arr[i-1];
        for(j = 1; j <= bnum; j++) {
            int bval = brr[j-1];
            int64_t ret = 0;
            ret = (ret + dp[i-1][j] + dp[i][j-1] - dp[i-1][j-1] + DIVISOR)%DIVISOR;
            if(aval == bval) {
                ret = (ret + dp[i-1][j-1])%DIVISOR;
            }
            dp[i][j] = ret;
        }
    }
    printf("%d\n", (int)dp[anum][bnum]);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
	.text
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int2, .-get_int2
	.section	.rodata
.LC1:
	.string	"%d"
	.text
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.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
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L4:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L5
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fget_array, .-fget_array
	.section	.rodata
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	get_int2
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	leaq	arr.2(%rip), %rax
	movq	%rax, %rdi
	call	fget_array
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	brr.1(%rip), %rax
	movq	%rax, %rdi
	call	fget_array
	movl	$0, -32(%rbp)
	jmp	.L8
.L9:
	movl	-32(%rbp), %eax
	cltq
	imulq	$16008, %rax, %rax
	leaq	dp.0(%rip), %rdx
	movq	$1, (%rax,%rdx)
	addl	$1, -32(%rbp)
.L8:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L9
	movl	$0, -32(%rbp)
	jmp	.L10
.L11:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	$1, (%rdx,%rax)
	addl	$1, -32(%rbp)
.L10:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L11
	movl	$1, -32(%rbp)
	jmp	.L12
.L16:
	movl	-32(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	arr.2(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L13
.L15:
	movl	-28(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	brr.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
	movq	$0, -16(%rbp)
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$2001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	movslq	%edx, %rax
	imulq	$2001, %rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jne	.L14
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
.L14:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$2001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp.0(%rip), %rdx
	movq	-16(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	addl	$1, -28(%rbp)
.L13:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jle	.L15
	addl	$1, -32(%rbp)
.L12:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L16
	movl	-40(%rbp), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$2001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.local	arr.2
	.comm	arr.2,8000,32
	.local	brr.1
	.comm	brr.1,8000,32
	.local	dp.0
	.comm	dp.0,32032008,32
	.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
	.section	.rodata
.LC0:
	.string	"%d %d"
	.text
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int2, .-get_int2
	.section	.rodata
.LC1:
	.string	"%d"
	.text
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.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
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L4:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L5
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fget_array, .-fget_array
	.section	.rodata
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	get_int2
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	leaq	arr.2(%rip), %rax
	movq	%rax, %rdi
	call	fget_array
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	brr.1(%rip), %rax
	movq	%rax, %rdi
	call	fget_array
	movl	$0, -32(%rbp)
	jmp	.L8
.L9:
	movl	-32(%rbp), %eax
	cltq
	imulq	$16008, %rax, %rax
	leaq	dp.0(%rip), %rdx
	movq	$1, (%rax,%rdx)
	addl	$1, -32(%rbp)
.L8:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L9
	movl	$0, -32(%rbp)
	jmp	.L10
.L11:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	$1, (%rdx,%rax)
	addl	$1, -32(%rbp)
.L10:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L11
	movl	$1, -32(%rbp)
	jmp	.L12
.L16:
	movl	-32(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	arr.2(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L13
.L15:
	movl	-28(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	brr.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
	movq	$0, -16(%rbp)
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$2001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	movslq	%edx, %rax
	imulq	$2001, %rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jne	.L14
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
.L14:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$2001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp.0(%rip), %rdx
	movq	-16(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	addl	$1, -28(%rbp)
.L13:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jle	.L15
	addl	$1, -32(%rbp)
.L12:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L16
	movl	-40(%rbp), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$2001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.local	arr.2
	.comm	arr.2,8000,32
	.local	brr.1
	.comm	brr.1,8000,32
	.local	dp.0
	.comm	dp.0,32032008,32
	.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:
