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>
 
char str1[4001], str2[4001];
int len1, len2;
short cache[4000][4000];
 
int MAX(int m, int n){
    return m>n ? m : n;
}
 
int calc_max(int a, int b){
    int res;
    if(a<0 || b<0)
        return 0;
    if(cache[a][b] != -1)
        return cache[a][b];
    if(str1[a] == str2[b]){
        res = calc_max(a-1, b-1) + 1;
    }
    else{
        res = 0;
    }
    cache[a][b] = res;
    return res;
}
 
int main(){
 
  while(scanf("%s%s", str1, str2) != EOF){
    int a, b, num, max=0;
    len1 = strlen(str1);
    len2 = strlen(str2);
    for(a=0; a<len1; a++) for(b=0; b<len2; b++)
        cache[a][b] = -1;
    for(a=0; a<len1; a++) for(b=0; b<len2; b++)
        max = MAX(calc_max(a, b), max);
    printf("%d\n", max);
  }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	str1
	.bss
	.align 32
	.type	str1, @object
	.size	str1, 4001
str1:
	.zero	4001
	.globl	str2
	.align 32
	.type	str2, @object
	.size	str2, 4001
str2:
	.zero	4001
	.globl	len1
	.align 4
	.type	len1, @object
	.size	len1, 4
len1:
	.zero	4
	.globl	len2
	.align 4
	.type	len2, @object
	.size	len2, 4
len2:
	.zero	4
	.globl	cache
	.align 32
	.type	cache, @object
	.size	cache, 32000000
cache:
	.zero	32000000
	.text
	.globl	MAX
	.type	MAX, @function
MAX:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	MAX, .-MAX
	.globl	calc_max
	.type	calc_max, @function
calc_max:
.LFB1:
	.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)
	cmpl	$0, -20(%rbp)
	js	.L4
	cmpl	$0, -24(%rbp)
	jns	.L5
.L4:
	movl	$0, %eax
	jmp	.L6
.L5:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$4000, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	cache(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	cmpw	$-1, %ax
	je	.L7
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$4000, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	cache(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	cwtl
	jmp	.L6
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	str1(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	str2(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L8
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	calc_max
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L9
.L8:
	movl	$0, -4(%rbp)
.L9:
	movl	-4(%rbp), %eax
	movl	%eax, %ecx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$4000, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	cache(%rip), %rax
	movw	%cx, (%rdx,%rax)
	movl	-4(%rbp), %eax
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	calc_max, .-calc_max
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%s%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L11
.L20:
	movl	$0, -4(%rbp)
	leaq	str1(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, len1(%rip)
	leaq	str2(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, len2(%rip)
	movl	$0, -12(%rbp)
	jmp	.L12
.L15:
	movl	$0, -8(%rbp)
	jmp	.L13
.L14:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$4000, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	cache(%rip), %rax
	movw	$-1, (%rdx,%rax)
	addl	$1, -8(%rbp)
.L13:
	movl	len2(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L14
	addl	$1, -12(%rbp)
.L12:
	movl	len1(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L15
	movl	$0, -12(%rbp)
	jmp	.L16
.L19:
	movl	$0, -8(%rbp)
	jmp	.L17
.L18:
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	calc_max
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	MAX
	movl	%eax, -4(%rbp)
	addl	$1, -8(%rbp)
.L17:
	movl	len2(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L18
	addl	$1, -12(%rbp)
.L16:
	movl	len1(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L19
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L11:
	leaq	str2(%rip), %rax
	movq	%rax, %rdx
	leaq	str1(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L20
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	MAX
	.type	MAX, @function
MAX:
.LFB35:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovge	%esi, %eax
	ret
	.cfi_endproc
.LFE35:
	.size	MAX, .-MAX
	.p2align 4
	.globl	calc_max
	.type	calc_max, @function
calc_max:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xorl	%eax, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%edi, %ebx
	orl	%esi, %ebx
	js	.L3
	movslq	%edi, %rbx
	movslq	%esi, %r12
	leaq	cache(%rip), %rbp
	imulq	$4000, %rbx, %rcx
	addq	%r12, %rcx
	movzwl	0(%rbp,%rcx,2), %edx
	cmpw	$-1, %dx
	jne	.L10
	leaq	str2(%rip), %rdx
	leaq	str1(%rip), %r8
	xorl	%ecx, %ecx
	movzbl	(%rdx,%r12), %edx
	cmpb	%dl, (%r8,%rbx)
	je	.L11
.L6:
	imulq	$4000, %rbx, %rdx
	addq	%r12, %rdx
	movw	%cx, 0(%rbp,%rdx,2)
.L3:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movswl	%dx, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	subl	$1, %esi
	subl	$1, %edi
	call	calc_max
	addl	$1, %eax
	movl	%eax, %ecx
	jmp	.L6
	.cfi_endproc
.LFE36:
	.size	calc_max, .-calc_max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%s%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB37:
	.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
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	.p2align 4,,10
	.p2align 3
.L13:
	xorl	%eax, %eax
	leaq	str2(%rip), %rdx
	leaq	str1(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L63
	leaq	str1(%rip), %rdi
	call	strlen@PLT
	leaq	str2(%rip), %rdi
	movl	%eax, len1(%rip)
	movq	%rax, %rbx
	call	strlen@PLT
	xorl	%edx, %edx
	movq	%rax, 8(%rsp)
	movl	%eax, len2(%rip)
	testq	%rbx, %rbx
	je	.L15
	movq	%rax, %rdi
	testq	%rax, %rax
	je	.L17
	leal	-1(%rbx), %eax
	leaq	(%rdi,%rdi), %rsi
	imulq	$8000, %rax, %rax
	movl	%esi, %r10d
	movl	%esi, %r11d
	movl	%esi, %r9d
	leaq	cache(%rip), %rdx
	andl	$4, %r10d
	andl	$2, %r11d
	leaq	8000(%rdx), %rcx
	leaq	(%rax,%rcx), %r8
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L66:
	testl	%r10d, %r10d
	jne	.L64
	testl	%esi, %esi
	je	.L19
	movb	$-1, (%rdx)
	testl	%r11d, %r11d
	jne	.L65
.L19:
	addq	$8000, %rdx
	cmpq	%r8, %rdx
	je	.L17
.L22:
	cmpl	$8, %esi
	jb	.L66
	leaq	8(%rdx), %rdi
	movq	%rdx, %rcx
	movq	$-1, (%rdx)
	movq	$-1, %rax
	andq	$-8, %rdi
	addq	$8000, %rdx
	movq	$-1, -8008(%rdx,%r9)
	subq	%rdi, %rcx
	addl	%esi, %ecx
	shrl	$3, %ecx
	rep stosq
	cmpq	%r8, %rdx
	jne	.L22
.L17:
	leal	-5(%rbx), %eax
	leaq	cache(%rip), %r14
	movl	$-5, %edi
	xorl	%edx, %edx
	movl	%eax, 28(%rsp)
	movl	8(%rsp), %eax
	leaq	str1(%rip), %r15
	movq	$0, 16(%rsp)
	leal	-5(%rax), %r8d
	.p2align 4,,10
	.p2align 3
.L16:
	cmpq	$0, 8(%rsp)
	leal	1(%rdi), %r13d
	je	.L40
	leal	4(%rdi), %eax
	leaq	str2(%rip), %r10
	movq	%r14, %r9
	movl	$-5, %esi
	shrl	$31, %eax
	leaq	-8000(%r14), %r11
	leal	1(%rdi), %r13d
	movl	%eax, 24(%rsp)
	leal	2(%rdi), %eax
	leaq	-16000(%r14), %rbx
	shrl	$31, %eax
	leaq	-24000(%r14), %rbp
	movl	%eax, 48(%rsp)
	.p2align 4,,10
	.p2align 3
.L38:
	movswl	(%r9), %eax
	leal	1(%rsi), %r12d
	cmpw	$-1, %ax
	jne	.L24
	movzbl	(%r10), %eax
	cmpb	%al, (%r15)
	je	.L67
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	leal	1(%rsi), %r12d
.L25:
	movw	%cx, (%r9)
.L24:
	cmpl	%eax, %edx
	movl	%r12d, %esi
	cmovl	%eax, %edx
	addq	$2, %r9
	addq	$1, %r10
	addq	$2, %r11
	addq	$2, %rbx
	addq	$2, %rbp
	cmpl	%r12d, %r8d
	jne	.L38
.L40:
	subq	$8000, 16(%rsp)
	addq	$8000, %r14
	addq	$1, %r15
	movl	%r13d, %edi
	cmpl	28(%rsp), %r13d
	jne	.L16
.L15:
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L67:
	cmpb	$0, 24(%rsp)
	jne	.L43
	movl	%esi, %eax
	addl	$4, %eax
	js	.L43
	movswl	-2(%r11), %eax
	cmpw	$-1, %ax
	je	.L27
	addl	$1, %eax
	leal	1(%rsi), %r12d
	movl	%eax, %ecx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L43:
	movl	$1, %ecx
	movl	$1, %eax
	leal	1(%rsi), %r12d
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L27:
	movzbl	-1(%r10), %eax
	cmpb	%al, -1(%r15)
	je	.L68
	xorl	%r12d, %r12d
	movl	$1, %ecx
	movl	$1, %eax
	movw	%r12w, 32(%rsp)
	leal	1(%rsi), %r12d
.L28:
	movzwl	32(%rsp), %esi
	movw	%si, -2(%r11)
	jmp	.L25
.L64:
	movl	$-1, (%rdx)
	movl	$-1, -4(%rdx,%r9)
	jmp	.L19
.L68:
	movl	%edi, %eax
	addl	$3, %eax
	js	.L45
	movl	%esi, %eax
	addl	$3, %eax
	js	.L45
	movzwl	-4(%rbx), %ecx
	cmpw	$-1, %cx
	je	.L30
	movswl	%cx, %eax
	addl	$1, %ecx
	leal	1(%rsi), %r12d
	addl	$2, %eax
	movw	%cx, 32(%rsp)
	movl	%eax, %ecx
	jmp	.L28
.L65:
	movl	$-1, %r13d
	movw	%r13w, -2(%rdx,%r9)
	jmp	.L19
.L63:
	addq	$72, %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
.L30:
	.cfi_restore_state
	movzbl	-2(%r10), %ecx
	xorl	%eax, %eax
	leal	1(%rsi), %r12d
	cmpb	%cl, -2(%r15)
	je	.L69
.L31:
	leal	1(%rax), %ecx
	movw	%ax, -4(%rbx)
	addl	$2, %eax
	movw	%cx, 32(%rsp)
	movl	%eax, %ecx
	jmp	.L28
.L45:
	movl	$1, %r12d
	movl	$2, %ecx
	movl	$2, %eax
	movw	%r12w, 32(%rsp)
	leal	1(%rsi), %r12d
	jmp	.L28
.L69:
	cmpb	$0, 48(%rsp)
	jne	.L47
	movl	%esi, %eax
	addl	$2, %eax
	js	.L47
	movswl	-6(%rbp), %eax
	cmpw	$-1, %ax
	jne	.L32
	movzbl	-3(%r10), %eax
	cmpb	%al, -3(%r15)
	je	.L70
	xorl	%eax, %eax
	leal	1(%rsi), %r12d
.L34:
	movw	%ax, -6(%rbp)
.L32:
	addl	$1, %eax
	jmp	.L31
.L47:
	xorl	%eax, %eax
	leal	1(%rsi), %r12d
	jmp	.L32
.L70:
	leal	1(%rsi), %r12d
	testl	%r13d, %r13d
	js	.L49
	movl	%esi, %r12d
	addl	$1, %r12d
	js	.L49
	movq	16(%rsp), %rcx
	movq	%rcx, %rax
	addq	%r9, %rax
	movq	%rax, 32(%rsp)
	movq	$-32000, %rax
	subq	%rcx, %rax
	movq	32(%rsp), %rcx
	movq	%rax, 40(%rsp)
	movswl	-8(%rcx,%rax), %eax
	cmpw	$-1, %ax
	jne	.L35
	movzbl	-4(%r10), %ecx
	xorl	%eax, %eax
	cmpb	%cl, -4(%r15)
	je	.L71
.L37:
	movq	40(%rsp), %rcx
	movq	32(%rsp), %rsi
	movw	%ax, -8(%rsi,%rcx)
.L35:
	addl	$1, %eax
	jmp	.L34
.L49:
	xorl	%eax, %eax
	jmp	.L35
.L71:
	movl	%r8d, 60(%rsp)
	movl	%edx, 56(%rsp)
	movl	%edi, 52(%rsp)
	call	calc_max
	movl	60(%rsp), %r8d
	movl	56(%rsp), %edx
	movl	52(%rsp), %edi
	addl	$1, %eax
	jmp	.L37
	.cfi_endproc
.LFE37:
	.size	main, .-main
	.globl	cache
	.bss
	.align 32
	.type	cache, @object
	.size	cache, 32000000
cache:
	.zero	32000000
	.globl	len2
	.align 4
	.type	len2, @object
	.size	len2, 4
len2:
	.zero	4
	.globl	len1
	.align 4
	.type	len1, @object
	.size	len1, 4
len1:
	.zero	4
	.globl	str2
	.align 32
	.type	str2, @object
	.size	str2, 4001
str2:
	.zero	4001
	.globl	str1
	.align 32
	.type	str1, @object
	.size	str1, 4001
str1:
	.zero	4001
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	MAX
	.type	MAX, @function
MAX:
.LFB35:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovge	%esi, %eax
	ret
	.cfi_endproc
.LFE35:
	.size	MAX, .-MAX
	.p2align 4
	.globl	calc_max
	.type	calc_max, @function
calc_max:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xorl	%eax, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%edi, %ebx
	orl	%esi, %ebx
	js	.L3
	movslq	%edi, %rbx
	movslq	%esi, %r12
	leaq	cache(%rip), %rbp
	imulq	$4000, %rbx, %rcx
	addq	%r12, %rcx
	movzwl	0(%rbp,%rcx,2), %edx
	cmpw	$-1, %dx
	jne	.L10
	leaq	str2(%rip), %rdx
	leaq	str1(%rip), %r8
	xorl	%ecx, %ecx
	movzbl	(%rdx,%r12), %edx
	cmpb	%dl, (%r8,%rbx)
	je	.L11
.L6:
	imulq	$4000, %rbx, %rdx
	addq	%r12, %rdx
	movw	%cx, 0(%rbp,%rdx,2)
.L3:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movswl	%dx, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	subl	$1, %esi
	subl	$1, %edi
	call	calc_max
	addl	$1, %eax
	movl	%eax, %ecx
	jmp	.L6
	.cfi_endproc
.LFE36:
	.size	calc_max, .-calc_max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%s%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB37:
	.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
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	.p2align 4,,10
	.p2align 3
.L13:
	xorl	%eax, %eax
	leaq	str2(%rip), %rdx
	leaq	str1(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L63
	leaq	str1(%rip), %rdi
	call	strlen@PLT
	leaq	str2(%rip), %rdi
	movl	%eax, len1(%rip)
	movq	%rax, %rbx
	call	strlen@PLT
	xorl	%edx, %edx
	movq	%rax, 8(%rsp)
	movl	%eax, len2(%rip)
	testq	%rbx, %rbx
	je	.L15
	movq	%rax, %rdi
	testq	%rax, %rax
	je	.L17
	leal	-1(%rbx), %eax
	leaq	(%rdi,%rdi), %rsi
	imulq	$8000, %rax, %rax
	movl	%esi, %r10d
	movl	%esi, %r11d
	movl	%esi, %r9d
	leaq	cache(%rip), %rdx
	andl	$4, %r10d
	andl	$2, %r11d
	leaq	8000(%rdx), %rcx
	leaq	(%rax,%rcx), %r8
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L66:
	testl	%r10d, %r10d
	jne	.L64
	testl	%esi, %esi
	je	.L19
	movb	$-1, (%rdx)
	testl	%r11d, %r11d
	jne	.L65
.L19:
	addq	$8000, %rdx
	cmpq	%r8, %rdx
	je	.L17
.L22:
	cmpl	$8, %esi
	jb	.L66
	leaq	8(%rdx), %rdi
	movq	%rdx, %rcx
	movq	$-1, (%rdx)
	movq	$-1, %rax
	andq	$-8, %rdi
	addq	$8000, %rdx
	movq	$-1, -8008(%rdx,%r9)
	subq	%rdi, %rcx
	addl	%esi, %ecx
	shrl	$3, %ecx
	rep stosq
	cmpq	%r8, %rdx
	jne	.L22
.L17:
	leal	-5(%rbx), %eax
	leaq	cache(%rip), %r14
	movl	$-5, %edi
	xorl	%edx, %edx
	movl	%eax, 28(%rsp)
	movl	8(%rsp), %eax
	leaq	str1(%rip), %r15
	movq	$0, 16(%rsp)
	leal	-5(%rax), %r8d
	.p2align 4,,10
	.p2align 3
.L16:
	cmpq	$0, 8(%rsp)
	leal	1(%rdi), %r13d
	je	.L40
	leal	4(%rdi), %eax
	leaq	str2(%rip), %r10
	movq	%r14, %r9
	movl	$-5, %esi
	shrl	$31, %eax
	leaq	-8000(%r14), %r11
	leal	1(%rdi), %r13d
	movl	%eax, 24(%rsp)
	leal	2(%rdi), %eax
	leaq	-16000(%r14), %rbx
	shrl	$31, %eax
	leaq	-24000(%r14), %rbp
	movl	%eax, 48(%rsp)
	.p2align 4,,10
	.p2align 3
.L38:
	movswl	(%r9), %eax
	leal	1(%rsi), %r12d
	cmpw	$-1, %ax
	jne	.L24
	movzbl	(%r10), %eax
	cmpb	%al, (%r15)
	je	.L67
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	leal	1(%rsi), %r12d
.L25:
	movw	%cx, (%r9)
.L24:
	cmpl	%eax, %edx
	movl	%r12d, %esi
	cmovl	%eax, %edx
	addq	$2, %r9
	addq	$1, %r10
	addq	$2, %r11
	addq	$2, %rbx
	addq	$2, %rbp
	cmpl	%r12d, %r8d
	jne	.L38
.L40:
	subq	$8000, 16(%rsp)
	addq	$8000, %r14
	addq	$1, %r15
	movl	%r13d, %edi
	cmpl	28(%rsp), %r13d
	jne	.L16
.L15:
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L67:
	cmpb	$0, 24(%rsp)
	jne	.L43
	movl	%esi, %eax
	addl	$4, %eax
	js	.L43
	movswl	-2(%r11), %eax
	cmpw	$-1, %ax
	je	.L27
	addl	$1, %eax
	leal	1(%rsi), %r12d
	movl	%eax, %ecx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L43:
	movl	$1, %ecx
	movl	$1, %eax
	leal	1(%rsi), %r12d
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L27:
	movzbl	-1(%r10), %eax
	cmpb	%al, -1(%r15)
	je	.L68
	xorl	%r12d, %r12d
	movl	$1, %ecx
	movl	$1, %eax
	movw	%r12w, 32(%rsp)
	leal	1(%rsi), %r12d
.L28:
	movzwl	32(%rsp), %esi
	movw	%si, -2(%r11)
	jmp	.L25
.L64:
	movl	$-1, (%rdx)
	movl	$-1, -4(%rdx,%r9)
	jmp	.L19
.L68:
	movl	%edi, %eax
	addl	$3, %eax
	js	.L45
	movl	%esi, %eax
	addl	$3, %eax
	js	.L45
	movzwl	-4(%rbx), %ecx
	cmpw	$-1, %cx
	je	.L30
	movswl	%cx, %eax
	addl	$1, %ecx
	leal	1(%rsi), %r12d
	addl	$2, %eax
	movw	%cx, 32(%rsp)
	movl	%eax, %ecx
	jmp	.L28
.L65:
	movl	$-1, %r13d
	movw	%r13w, -2(%rdx,%r9)
	jmp	.L19
.L63:
	addq	$72, %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
.L30:
	.cfi_restore_state
	movzbl	-2(%r10), %ecx
	xorl	%eax, %eax
	leal	1(%rsi), %r12d
	cmpb	%cl, -2(%r15)
	je	.L69
.L31:
	leal	1(%rax), %ecx
	movw	%ax, -4(%rbx)
	addl	$2, %eax
	movw	%cx, 32(%rsp)
	movl	%eax, %ecx
	jmp	.L28
.L45:
	movl	$1, %r12d
	movl	$2, %ecx
	movl	$2, %eax
	movw	%r12w, 32(%rsp)
	leal	1(%rsi), %r12d
	jmp	.L28
.L69:
	cmpb	$0, 48(%rsp)
	jne	.L47
	movl	%esi, %eax
	addl	$2, %eax
	js	.L47
	movswl	-6(%rbp), %eax
	cmpw	$-1, %ax
	jne	.L32
	movzbl	-3(%r10), %eax
	cmpb	%al, -3(%r15)
	je	.L70
	xorl	%eax, %eax
	leal	1(%rsi), %r12d
.L34:
	movw	%ax, -6(%rbp)
.L32:
	addl	$1, %eax
	jmp	.L31
.L47:
	xorl	%eax, %eax
	leal	1(%rsi), %r12d
	jmp	.L32
.L70:
	leal	1(%rsi), %r12d
	testl	%r13d, %r13d
	js	.L49
	movl	%esi, %r12d
	addl	$1, %r12d
	js	.L49
	movq	16(%rsp), %rcx
	movq	%rcx, %rax
	addq	%r9, %rax
	movq	%rax, 32(%rsp)
	movq	$-32000, %rax
	subq	%rcx, %rax
	movq	32(%rsp), %rcx
	movq	%rax, 40(%rsp)
	movswl	-8(%rcx,%rax), %eax
	cmpw	$-1, %ax
	jne	.L35
	movzbl	-4(%r10), %ecx
	xorl	%eax, %eax
	cmpb	%cl, -4(%r15)
	je	.L71
.L37:
	movq	40(%rsp), %rcx
	movq	32(%rsp), %rsi
	movw	%ax, -8(%rsi,%rcx)
.L35:
	addl	$1, %eax
	jmp	.L34
.L49:
	xorl	%eax, %eax
	jmp	.L35
.L71:
	movl	%r8d, 60(%rsp)
	movl	%edx, 56(%rsp)
	movl	%edi, 52(%rsp)
	call	calc_max
	movl	60(%rsp), %r8d
	movl	56(%rsp), %edx
	movl	52(%rsp), %edi
	addl	$1, %eax
	jmp	.L37
	.cfi_endproc
.LFE37:
	.size	main, .-main
	.globl	cache
	.bss
	.align 32
	.type	cache, @object
	.size	cache, 32000000
cache:
	.zero	32000000
	.globl	len2
	.align 4
	.type	len2, @object
	.size	len2, 4
len2:
	.zero	4
	.globl	len1
	.align 4
	.type	len1, @object
	.size	len1, 4
len1:
	.zero	4
	.globl	str2
	.align 32
	.type	str2, @object
	.size	str2, 4001
str2:
	.zero	4001
	.globl	str1
	.align 32
	.type	str1, @object
	.size	str1, 4001
str1:
	.zero	4001
	.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>
 
char str1[4001], str2[4001];
int len1, len2;
short cache[4000][4000];
 
int MAX(int m, int n){
    return m>n ? m : n;
}
 
int calc_max(int a, int b){
    int res;
    if(a<0 || b<0)
        return 0;
    if(cache[a][b] != -1)
        return cache[a][b];
    if(str1[a] == str2[b]){
        res = calc_max(a-1, b-1) + 1;
    }
    else{
        res = 0;
    }
    cache[a][b] = res;
    return res;
}
 
int main(){
 
  while(scanf("%s%s", str1, str2) != EOF){
    int a, b, num, max=0;
    len1 = strlen(str1);
    len2 = strlen(str2);
    for(a=0; a<len1; a++) for(b=0; b<len2; b++)
        cache[a][b] = -1;
    for(a=0; a<len1; a++) for(b=0; b<len2; b++)
        max = MAX(calc_max(a, b), max);
    printf("%d\n", max);
  }
    return 0;
}
Nnne
 ABRACADAARA
ECADADABRBCRDARA
UPWJCIRUCAXIIRGL
SBQNYBSBZDFNEV
 DBRACAAAARA
ECADADBBRBCRDARA
LCRIIXACURIGJWPU
SBQNYBSBZDFOEV
 DBRACAAAARA
ECADADBBRBBRDARA
LCRIIXACURIGJWPU
SBQNYBSBFDZOEU
 DBRACAAA@RA
ECADADBBRBBRDARA
LCRIIXACURIGJWPU
SBQNYBSBFDZOEU
 CARBR@AA?CB
ABRDRBSBAACADACD
LDRTIXAWURIHKCOI
BBDDYRTBDNZOUQ
 AD?BB>ARCBQ
CBBDQARCBEB@ADRA
OVKRMDAESKVVHKXI
ZBARNTWBBCYCOQ
 A>?BR@BQ@BD
BSDACBFQERB@CBBA
IVXVOCJHEAJURKMR
BA@CQXAYNSYTBP
 Nnnd
 ABRACADAARA
ECADADABRBCRDARA
LGRIIXACURICJWPU
SBQNYBSBZDFNEV

0
 4
0
 3
0
 3
1
 2
1
 2
2
 4
1
 1
1
 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 <string.h>
 
char str1[4001], str2[4001];
int len1, len2;
short cache[4000][4000];
 
int MAX(int m, int n){
    return m>n ? m : n;
}
 
int calc_max(int a, int b){
    int res;
    if(a<0 || b<0)
        return 0;
    if(cache[a][b] != -1)
        return cache[a][b];
    if(str1[a] == str2[b]){
        res = calc_max(a-1, b-1) + 1;
    }
    else{
        res = 0;
    }
    cache[a][b] = res;
    return res;
}
 
int main(){
 
  while(scanf("%s%s", str1, str2) != EOF){
    int a, b, num, max=0;
    len1 = strlen(str1);
    len2 = strlen(str2);
    for(a=0; a<len1; a++) for(b=0; b<len2; b++)
        cache[a][b] = -1;
    for(a=0; a<len1; a++) for(b=0; b<len2; b++)
        max = MAX(calc_max(a, b), max);
    printf("%d\n", max);
  }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	str1
	.bss
	.align 32
	.type	str1, @object
	.size	str1, 4001
str1:
	.zero	4001
	.globl	str2
	.align 32
	.type	str2, @object
	.size	str2, 4001
str2:
	.zero	4001
	.globl	len1
	.align 4
	.type	len1, @object
	.size	len1, 4
len1:
	.zero	4
	.globl	len2
	.align 4
	.type	len2, @object
	.size	len2, 4
len2:
	.zero	4
	.globl	cache
	.align 32
	.type	cache, @object
	.size	cache, 32000000
cache:
	.zero	32000000
	.text
	.globl	MAX
	.type	MAX, @function
MAX:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	MAX, .-MAX
	.globl	calc_max
	.type	calc_max, @function
calc_max:
.LFB1:
	.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)
	cmpl	$0, -20(%rbp)
	js	.L4
	cmpl	$0, -24(%rbp)
	jns	.L5
.L4:
	movl	$0, %eax
	jmp	.L6
.L5:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$4000, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	cache(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	cmpw	$-1, %ax
	je	.L7
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$4000, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	cache(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	cwtl
	jmp	.L6
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	str1(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	str2(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L8
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	calc_max
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L9
.L8:
	movl	$0, -4(%rbp)
.L9:
	movl	-4(%rbp), %eax
	movl	%eax, %ecx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$4000, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	cache(%rip), %rax
	movw	%cx, (%rdx,%rax)
	movl	-4(%rbp), %eax
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	calc_max, .-calc_max
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%s%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L11
.L20:
	movl	$0, -4(%rbp)
	leaq	str1(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, len1(%rip)
	leaq	str2(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, len2(%rip)
	movl	$0, -12(%rbp)
	jmp	.L12
.L15:
	movl	$0, -8(%rbp)
	jmp	.L13
.L14:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$4000, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	cache(%rip), %rax
	movw	$-1, (%rdx,%rax)
	addl	$1, -8(%rbp)
.L13:
	movl	len2(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L14
	addl	$1, -12(%rbp)
.L12:
	movl	len1(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L15
	movl	$0, -12(%rbp)
	jmp	.L16
.L19:
	movl	$0, -8(%rbp)
	jmp	.L17
.L18:
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	calc_max
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	MAX
	movl	%eax, -4(%rbp)
	addl	$1, -8(%rbp)
.L17:
	movl	len2(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L18
	addl	$1, -12(%rbp)
.L16:
	movl	len1(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L19
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L11:
	leaq	str2(%rip), %rax
	movq	%rax, %rdx
	leaq	str1(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L20
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	str1
	.bss
	.align 32
	.type	str1, @object
	.size	str1, 4001
str1:
	.zero	4001
	.globl	str2
	.align 32
	.type	str2, @object
	.size	str2, 4001
str2:
	.zero	4001
	.globl	len1
	.align 4
	.type	len1, @object
	.size	len1, 4
len1:
	.zero	4
	.globl	len2
	.align 4
	.type	len2, @object
	.size	len2, 4
len2:
	.zero	4
	.globl	cache
	.align 32
	.type	cache, @object
	.size	cache, 32000000
cache:
	.zero	32000000
	.text
	.globl	MAX
	.type	MAX, @function
MAX:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	MAX, .-MAX
	.globl	calc_max
	.type	calc_max, @function
calc_max:
.LFB1:
	.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)
	cmpl	$0, -20(%rbp)
	js	.L4
	cmpl	$0, -24(%rbp)
	jns	.L5
.L4:
	movl	$0, %eax
	jmp	.L6
.L5:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$4000, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	cache(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	cmpw	$-1, %ax
	je	.L7
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$4000, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	cache(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	cwtl
	jmp	.L6
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	str1(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	str2(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L8
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	calc_max
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L9
.L8:
	movl	$0, -4(%rbp)
.L9:
	movl	-4(%rbp), %eax
	movl	%eax, %ecx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$4000, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	cache(%rip), %rax
	movw	%cx, (%rdx,%rax)
	movl	-4(%rbp), %eax
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	calc_max, .-calc_max
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%s%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L11
.L20:
	movl	$0, -4(%rbp)
	leaq	str1(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, len1(%rip)
	leaq	str2(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, len2(%rip)
	movl	$0, -12(%rbp)
	jmp	.L12
.L15:
	movl	$0, -8(%rbp)
	jmp	.L13
.L14:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$4000, %rax, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rax), %rdx
	leaq	cache(%rip), %rax
	movw	$-1, (%rdx,%rax)
	addl	$1, -8(%rbp)
.L13:
	movl	len2(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L14
	addl	$1, -12(%rbp)
.L12:
	movl	len1(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L15
	movl	$0, -12(%rbp)
	jmp	.L16
.L19:
	movl	$0, -8(%rbp)
	jmp	.L17
.L18:
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	calc_max
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	MAX
	movl	%eax, -4(%rbp)
	addl	$1, -8(%rbp)
.L17:
	movl	len2(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L18
	addl	$1, -12(%rbp)
.L16:
	movl	len1(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L19
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L11:
	leaq	str2(%rip), %rax
	movq	%rax, %rdx
	leaq	str1(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L20
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
