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>
void LCS_Length(char* ,char*);
int main()
{
	char A[1001],B[1001];
	int n,i;
	scanf("%d",&n);
	for(i=0;i<n;i++) 
	{
		scanf("%s",A);
		scanf("%s",B);
		LCS_Length(A,B);
	}
	return 0;
}

void LCS_Length(char *X,char *Y)
{
	int m,n;
	int i,j;
	int c[1001][1001];
	m = strlen(X)+1;
	n = strlen(Y)+1;

	for(i=0;i<m;i++) c[i][0] = 0;
	for(j=0;j<n;j++) c[0][j] = 0;

	for(i=1;i<m;i++)
	{
		for(j=1;j<n;j++) 
		{
			if (X[i-1] == Y[j-1]) c[i][j] = c[i-1][j-1] +1;
			else if (c[i-1][j] >= c[i][j-1]) c[i][j] = c[i-1][j];
			else c[i][j] = c[i][j-1];
			//printf("ans %d %d   %d\n",i,j,c[i][j]);
		}
	}
	printf("%d\n",c[i-1][j-1]);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2048, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2036(%rbp)
	jmp	.L2
.L3:
	leaq	-2032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1024(%rbp), %rdx
	leaq	-2032(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	LCS_Length
	addl	$1, -2036(%rbp)
.L2:
	movl	-2040(%rbp), %eax
	cmpl	%eax, -2036(%rbp)
	jl	.L3
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC2:
	.string	"%d\n"
	.text
	.globl	LCS_Length
	.type	LCS_Length, @function
LCS_Length:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-4005888(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2160, %rsp
	movq	%rdi, -4008040(%rbp)
	movq	%rsi, -4008048(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-4008040(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	addl	$1, %eax
	movl	%eax, -4008024(%rbp)
	movq	-4008048(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	addl	$1, %eax
	movl	%eax, -4008020(%rbp)
	movl	$0, -4008032(%rbp)
	jmp	.L7
.L8:
	movl	-4008032(%rbp), %eax
	cltq
	imulq	$4004, %rax, %rax
	addq	%rbp, %rax
	subq	$4008016, %rax
	movl	$0, (%rax)
	addl	$1, -4008032(%rbp)
.L7:
	movl	-4008032(%rbp), %eax
	cmpl	-4008024(%rbp), %eax
	jl	.L8
	movl	$0, -4008028(%rbp)
	jmp	.L9
.L10:
	movl	-4008028(%rbp), %eax
	cltq
	movl	$0, -4008016(%rbp,%rax,4)
	addl	$1, -4008028(%rbp)
.L9:
	movl	-4008028(%rbp), %eax
	cmpl	-4008020(%rbp), %eax
	jl	.L10
	movl	$1, -4008032(%rbp)
	jmp	.L11
.L17:
	movl	$1, -4008028(%rbp)
	jmp	.L12
.L16:
	movl	-4008032(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-4008040(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-4008028(%rbp), %eax
	cltq
	leaq	-1(%rax), %rcx
	movq	-4008048(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	jne	.L13
	movl	-4008032(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4008028(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	-4008016(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-4008028(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4008032(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	%edx, -4008016(%rbp,%rax,4)
	jmp	.L14
.L13:
	movl	-4008032(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4008028(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	-4008016(%rbp,%rax,4), %edx
	movl	-4008028(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-4008032(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	-4008016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jl	.L15
	movl	-4008032(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4008028(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	-4008016(%rbp,%rax,4), %eax
	movl	-4008028(%rbp), %edx
	movslq	%edx, %rcx
	movl	-4008032(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	movl	%eax, -4008016(%rbp,%rdx,4)
	jmp	.L14
.L15:
	movl	-4008028(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-4008032(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	movl	-4008016(%rbp,%rax,4), %eax
	movl	-4008028(%rbp), %edx
	movslq	%edx, %rcx
	movl	-4008032(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	movl	%eax, -4008016(%rbp,%rdx,4)
.L14:
	addl	$1, -4008028(%rbp)
.L12:
	movl	-4008028(%rbp), %eax
	cmpl	-4008020(%rbp), %eax
	jl	.L16
	addl	$1, -4008032(%rbp)
.L11:
	movl	-4008032(%rbp), %eax
	cmpl	-4008024(%rbp), %eax
	jl	.L17
	movl	-4008032(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4008028(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	-4008016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	LCS_Length, .-LCS_Length
	.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\n"
	.text
	.p2align 4
	.globl	LCS_Length
	.type	LCS_Length, @function
LCS_Length:
.LFB36:
	.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	-4005888(%rsp), %r11
	.cfi_def_cfa 11, 4005944
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2152, %rsp
	.cfi_def_cfa_offset 4008096
	movq	%fs:40, %rax
	movq	%rax, 4008024(%rsp)
	xorl	%eax, %eax
	movq	%rsi, %rbp
	movq	%rdi, %r13
	call	strlen@PLT
	movq	%rbp, %rdi
	movq	%rax, %rbx
	leal	1(%rax), %r15d
	call	strlen@PLT
	movq	%rax, %rcx
	movl	%eax, %r8d
	leal	1(%rax), %r12d
	testl	%r15d, %r15d
	jle	.L6
	movl	%ebx, %edx
	leaq	16(%rsp), %rax
	imulq	$4004, %rdx, %rdx
	leaq	4020(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	$0, (%rax)
	addq	$4004, %rax
	cmpq	%rdx, %rax
	jne	.L5
.L6:
	movl	$-1, %r14d
	testl	%r12d, %r12d
	jle	.L4
	movl	%ecx, %eax
	leaq	16(%rsp), %rdi
	xorl	%esi, %esi
	movl	%r8d, 12(%rsp)
	leaq	4(,%rax,4), %rdx
	movq	%rcx, (%rsp)
	call	memset@PLT
	movq	(%rsp), %rcx
	movl	12(%rsp), %r8d
	movl	%ecx, %r14d
.L4:
	cmpl	$1, %r15d
	jle	.L17
	leal	-1(%rbx), %eax
	xorl	%r14d, %r14d
	cmpl	$1, %r12d
	movq	%r13, %r10
	cmovg	%ecx, %r14d
	leaq	1(%r13,%rax), %r13
	leal	-1(%r8), %eax
	leaq	4020(%rsp), %r11
	leaq	1(%rbp,%rax), %r9
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	$1, %r12d
	jle	.L14
	movzbl	(%r10), %r8d
	movq	%rbp, %rdx
	leaq	-4004(%r11), %rsi
	movq	%r11, %rcx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rcx), %eax
	movl	4(%rsi), %edi
	cmpl	%edi, %eax
	cmovl	%edi, %eax
.L10:
	addq	$1, %rdx
	movl	%eax, 4(%rcx)
	addq	$4, %rsi
	addq	$4, %rcx
	cmpq	%rdx, %r9
	je	.L14
.L11:
	cmpb	(%rdx), %r8b
	jne	.L9
	movl	(%rsi), %eax
	addl	$1, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L14:
	addq	$1, %r10
	addq	$4004, %r11
	cmpq	%r13, %r10
	jne	.L8
.L7:
	movq	4008024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	movslq	%ebx, %rax
	movslq	%r14d, %r14
	movl	$1, %edi
	imulq	$1001, %rax, %rax
	leaq	.LC0(%rip), %rsi
	addq	%r14, %rax
	movl	16(%rsp,%rax,4), %edx
	addq	$4008040, %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
	jmp	__printf_chk@PLT
.L17:
	.cfi_restore_state
	xorl	%ebx, %ebx
	jmp	.L7
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	LCS_Length, .-LCS_Length
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
.LC2:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$2056, %rsp
	.cfi_def_cfa_offset 2096
	movq	%fs:40, %rax
	movq	%rax, 2040(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L24
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r13
	leaq	.LC2(%rip), %r12
	leaq	1024(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbp, %rsi
	movq	%r13, %rdi
	call	LCS_Length
	cmpl	%ebx, 12(%rsp)
	jg	.L25
.L24:
	movq	2040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$2056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L29:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	LCS_Length
	.type	LCS_Length, @function
LCS_Length:
.LFB36:
	.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	-4005888(%rsp), %r11
	.cfi_def_cfa 11, 4005944
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2152, %rsp
	.cfi_def_cfa_offset 4008096
	movq	%fs:40, %rax
	movq	%rax, 4008024(%rsp)
	xorl	%eax, %eax
	movq	%rsi, %rbp
	movq	%rdi, %r13
	call	strlen@PLT
	movq	%rbp, %rdi
	movq	%rax, %rbx
	leal	1(%rax), %r15d
	call	strlen@PLT
	movq	%rax, %rcx
	movl	%eax, %r8d
	leal	1(%rax), %r12d
	testl	%r15d, %r15d
	jle	.L6
	movl	%ebx, %edx
	leaq	16(%rsp), %rax
	imulq	$4004, %rdx, %rdx
	leaq	4020(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	$0, (%rax)
	addq	$4004, %rax
	cmpq	%rdx, %rax
	jne	.L5
.L6:
	movl	$-1, %r14d
	testl	%r12d, %r12d
	jle	.L4
	movl	%ecx, %eax
	leaq	16(%rsp), %rdi
	xorl	%esi, %esi
	movl	%r8d, 12(%rsp)
	leaq	4(,%rax,4), %rdx
	movq	%rcx, (%rsp)
	call	memset@PLT
	movq	(%rsp), %rcx
	movl	12(%rsp), %r8d
	movl	%ecx, %r14d
.L4:
	cmpl	$1, %r15d
	jle	.L17
	leal	-1(%rbx), %eax
	xorl	%r14d, %r14d
	cmpl	$1, %r12d
	movq	%r13, %r10
	cmovg	%ecx, %r14d
	leaq	1(%r13,%rax), %r13
	leal	-1(%r8), %eax
	leaq	4020(%rsp), %r11
	leaq	1(%rbp,%rax), %r9
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	$1, %r12d
	jle	.L14
	movzbl	(%r10), %r8d
	movq	%rbp, %rdx
	leaq	-4004(%r11), %rsi
	movq	%r11, %rcx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rcx), %eax
	movl	4(%rsi), %edi
	cmpl	%edi, %eax
	cmovl	%edi, %eax
.L10:
	addq	$1, %rdx
	movl	%eax, 4(%rcx)
	addq	$4, %rsi
	addq	$4, %rcx
	cmpq	%rdx, %r9
	je	.L14
.L11:
	cmpb	(%rdx), %r8b
	jne	.L9
	movl	(%rsi), %eax
	addl	$1, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L14:
	addq	$1, %r10
	addq	$4004, %r11
	cmpq	%r13, %r10
	jne	.L8
.L7:
	movq	4008024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	movslq	%ebx, %rax
	movslq	%r14d, %r14
	movl	$1, %edi
	imulq	$1001, %rax, %rax
	leaq	.LC0(%rip), %rsi
	addq	%r14, %rax
	movl	16(%rsp,%rax,4), %edx
	addq	$4008040, %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
	jmp	__printf_chk@PLT
.L17:
	.cfi_restore_state
	xorl	%ebx, %ebx
	jmp	.L7
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	LCS_Length, .-LCS_Length
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
.LC2:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$2056, %rsp
	.cfi_def_cfa_offset 2096
	movq	%fs:40, %rax
	movq	%rax, 2040(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L24
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r13
	leaq	.LC2(%rip), %r12
	leaq	1024(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbp, %rsi
	movq	%r13, %rdi
	call	LCS_Length
	cmpl	%ebx, 12(%rsp)
	jg	.L25
.L24:
	movq	2040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$2056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L29:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <string.h>
void LCS_Length(char* ,char*);
int main()
{
	char A[1001],B[1001];
	int n,i;
	scanf("%d",&n);
	for(i=0;i<n;i++) 
	{
		scanf("%s",A);
		scanf("%s",B);
		LCS_Length(A,B);
	}
	return 0;
}

void LCS_Length(char *X,char *Y)
{
	int m,n;
	int i,j;
	int c[1001][1001];
	m = strlen(X)+1;
	n = strlen(Y)+1;

	for(i=0;i<m;i++) c[i][0] = 0;
	for(j=0;j<n;j++) c[0][j] = 0;

	for(i=1;i<m;i++)
	{
		for(j=1;j<n;j++) 
		{
			if (X[i-1] == Y[j-1]) c[i][j] = c[i-1][j-1] +1;
			else if (c[i-1][j] >= c[i][j-1]) c[i][j] = c[i-1][j];
			else c[i][j] = c[i][j-1];
			//printf("ans %d %d   %d\n",i,j,c[i][j]);
		}
	}
	printf("%d\n",c[i-1][j-1]);
}
3
abcbdab
bdcaba
abc
abc
acb
bc
 3
abcbdab
bdcaba
abc
abc
bcb
bc
 3
abcbdab
bdcaba
`bc
abc
bcb
bc
 3
badbcba
bdcaba
`bc
abc
bcb
bc
 3
badbdba
bdcaba
`bc
abc
bcb
cc
 3
badbdba
bdcaba
`bc
abd
bcb
cc
 3
badbdba
abacdb
_cb
dba
bbb
cc
 3
`bdbdab
abacdb
_cb
dba
bbb
cb
 3
`bdadab
ab`cdb
_cb
db`
bcb
cb
 3
`bdad`b
bdc`ba
bc`
dc_
bbc
bc

4
3
1
 4
3
2
 4
2
2
 5
2
2
 4
2
1
 4
1
1
 4
1
0
 3
1
1
 3
1
2
 4
1
2

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

```c
#include <stdio.h>
#include <string.h>
void LCS_Length(char* ,char*);
int main()
{
	char A[1001],B[1001];
	int n,i;
	scanf("%d",&n);
	for(i=0;i<n;i++) 
	{
		scanf("%s",A);
		scanf("%s",B);
		LCS_Length(A,B);
	}
	return 0;
}

void LCS_Length(char *X,char *Y)
{
	int m,n;
	int i,j;
	int c[1001][1001];
	m = strlen(X)+1;
	n = strlen(Y)+1;

	for(i=0;i<m;i++) c[i][0] = 0;
	for(j=0;j<n;j++) c[0][j] = 0;

	for(i=1;i<m;i++)
	{
		for(j=1;j<n;j++) 
		{
			if (X[i-1] == Y[j-1]) c[i][j] = c[i-1][j-1] +1;
			else if (c[i-1][j] >= c[i][j-1]) c[i][j] = c[i-1][j];
			else c[i][j] = c[i][j-1];
			//printf("ans %d %d   %d\n",i,j,c[i][j]);
		}
	}
	printf("%d\n",c[i-1][j-1]);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2048, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2036(%rbp)
	jmp	.L2
.L3:
	leaq	-2032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1024(%rbp), %rdx
	leaq	-2032(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	LCS_Length
	addl	$1, -2036(%rbp)
.L2:
	movl	-2040(%rbp), %eax
	cmpl	%eax, -2036(%rbp)
	jl	.L3
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC2:
	.string	"%d\n"
	.text
	.globl	LCS_Length
	.type	LCS_Length, @function
LCS_Length:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-4005888(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2160, %rsp
	movq	%rdi, -4008040(%rbp)
	movq	%rsi, -4008048(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-4008040(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	addl	$1, %eax
	movl	%eax, -4008024(%rbp)
	movq	-4008048(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	addl	$1, %eax
	movl	%eax, -4008020(%rbp)
	movl	$0, -4008032(%rbp)
	jmp	.L7
.L8:
	movl	-4008032(%rbp), %eax
	cltq
	imulq	$4004, %rax, %rax
	addq	%rbp, %rax
	subq	$4008016, %rax
	movl	$0, (%rax)
	addl	$1, -4008032(%rbp)
.L7:
	movl	-4008032(%rbp), %eax
	cmpl	-4008024(%rbp), %eax
	jl	.L8
	movl	$0, -4008028(%rbp)
	jmp	.L9
.L10:
	movl	-4008028(%rbp), %eax
	cltq
	movl	$0, -4008016(%rbp,%rax,4)
	addl	$1, -4008028(%rbp)
.L9:
	movl	-4008028(%rbp), %eax
	cmpl	-4008020(%rbp), %eax
	jl	.L10
	movl	$1, -4008032(%rbp)
	jmp	.L11
.L17:
	movl	$1, -4008028(%rbp)
	jmp	.L12
.L16:
	movl	-4008032(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-4008040(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-4008028(%rbp), %eax
	cltq
	leaq	-1(%rax), %rcx
	movq	-4008048(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	jne	.L13
	movl	-4008032(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4008028(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	-4008016(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-4008028(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4008032(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	%edx, -4008016(%rbp,%rax,4)
	jmp	.L14
.L13:
	movl	-4008032(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4008028(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	-4008016(%rbp,%rax,4), %edx
	movl	-4008028(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-4008032(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	-4008016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jl	.L15
	movl	-4008032(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4008028(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	-4008016(%rbp,%rax,4), %eax
	movl	-4008028(%rbp), %edx
	movslq	%edx, %rcx
	movl	-4008032(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	movl	%eax, -4008016(%rbp,%rdx,4)
	jmp	.L14
.L15:
	movl	-4008028(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-4008032(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	movl	-4008016(%rbp,%rax,4), %eax
	movl	-4008028(%rbp), %edx
	movslq	%edx, %rcx
	movl	-4008032(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	movl	%eax, -4008016(%rbp,%rdx,4)
.L14:
	addl	$1, -4008028(%rbp)
.L12:
	movl	-4008028(%rbp), %eax
	cmpl	-4008020(%rbp), %eax
	jl	.L16
	addl	$1, -4008032(%rbp)
.L11:
	movl	-4008032(%rbp), %eax
	cmpl	-4008024(%rbp), %eax
	jl	.L17
	movl	-4008032(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4008028(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	-4008016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	LCS_Length, .-LCS_Length
	.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"
.LC1:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2048, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2036(%rbp)
	jmp	.L2
.L3:
	leaq	-2032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1024(%rbp), %rdx
	leaq	-2032(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	LCS_Length
	addl	$1, -2036(%rbp)
.L2:
	movl	-2040(%rbp), %eax
	cmpl	%eax, -2036(%rbp)
	jl	.L3
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC2:
	.string	"%d\n"
	.text
	.globl	LCS_Length
	.type	LCS_Length, @function
LCS_Length:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-4005888(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2160, %rsp
	movq	%rdi, -4008040(%rbp)
	movq	%rsi, -4008048(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-4008040(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	addl	$1, %eax
	movl	%eax, -4008024(%rbp)
	movq	-4008048(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	addl	$1, %eax
	movl	%eax, -4008020(%rbp)
	movl	$0, -4008032(%rbp)
	jmp	.L7
.L8:
	movl	-4008032(%rbp), %eax
	cltq
	imulq	$4004, %rax, %rax
	addq	%rbp, %rax
	subq	$4008016, %rax
	movl	$0, (%rax)
	addl	$1, -4008032(%rbp)
.L7:
	movl	-4008032(%rbp), %eax
	cmpl	-4008024(%rbp), %eax
	jl	.L8
	movl	$0, -4008028(%rbp)
	jmp	.L9
.L10:
	movl	-4008028(%rbp), %eax
	cltq
	movl	$0, -4008016(%rbp,%rax,4)
	addl	$1, -4008028(%rbp)
.L9:
	movl	-4008028(%rbp), %eax
	cmpl	-4008020(%rbp), %eax
	jl	.L10
	movl	$1, -4008032(%rbp)
	jmp	.L11
.L17:
	movl	$1, -4008028(%rbp)
	jmp	.L12
.L16:
	movl	-4008032(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-4008040(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-4008028(%rbp), %eax
	cltq
	leaq	-1(%rax), %rcx
	movq	-4008048(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	jne	.L13
	movl	-4008032(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4008028(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	-4008016(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-4008028(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4008032(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	%edx, -4008016(%rbp,%rax,4)
	jmp	.L14
.L13:
	movl	-4008032(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4008028(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	-4008016(%rbp,%rax,4), %edx
	movl	-4008028(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-4008032(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	-4008016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jl	.L15
	movl	-4008032(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4008028(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	-4008016(%rbp,%rax,4), %eax
	movl	-4008028(%rbp), %edx
	movslq	%edx, %rcx
	movl	-4008032(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	movl	%eax, -4008016(%rbp,%rdx,4)
	jmp	.L14
.L15:
	movl	-4008028(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-4008032(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	movl	-4008016(%rbp,%rax,4), %eax
	movl	-4008028(%rbp), %edx
	movslq	%edx, %rcx
	movl	-4008032(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	movl	%eax, -4008016(%rbp,%rdx,4)
.L14:
	addl	$1, -4008028(%rbp)
.L12:
	movl	-4008028(%rbp), %eax
	cmpl	-4008020(%rbp), %eax
	jl	.L16
	addl	$1, -4008032(%rbp)
.L11:
	movl	-4008032(%rbp), %eax
	cmpl	-4008024(%rbp), %eax
	jl	.L17
	movl	-4008032(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4008028(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	movl	-4008016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	LCS_Length, .-LCS_Length
	.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:
