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

```c
#include<stdio.h>
#include<stdlib.h>
#define ll long long
#define max(p,q)((p)>(q)?(p):(q))

int dp[10010];//dp[i]=i本のマッチを使って作れる最大桁数
int a[10];
int c[10]={0,2,5,5,4,5,6,3,7,6};
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=0;i<m;i++){
		int t;
		scanf("%d",&t);
		a[t]++;
	}
	dp[0]=1;
	for(int i=0;i<n;i++)if(dp[i]){
		//配るDP
		for(int j=0;j<10;j++)if(a[j]){
			dp[i+c[j]]=max(dp[i+c[j]],dp[i]+1);
		}
	}
	while(n){
		for(int i=9;i>=1;i--)if(a[i]&&n>=c[i]){
			if(dp[n-c[i]]+1==dp[n]){
				putchar('0'+i);
				n-=c[i];
				break;
			}
		}
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 40040
dp:
	.zero	40040
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 40
a:
	.zero	40
	.globl	c
	.data
	.align 32
	.type	c, @object
	.size	c, 40
c:
	.long	0
	.long	2
	.long	5
	.long	5
	.long	4
	.long	5
	.long	6
	.long	3
	.long	7
	.long	6
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L2
.L3:
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -24(%rbp)
.L2:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L3
	movl	$1, dp(%rip)
	movl	$0, -20(%rbp)
	jmp	.L4
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L5
	movl	$0, -16(%rbp)
	jmp	.L6
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L7
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	c(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	-20(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-16(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	c(%rip), %rcx
	movl	(%rsi,%rcx), %esi
	movl	-20(%rbp), %ecx
	addl	%esi, %ecx
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L7:
	addl	$1, -16(%rbp)
.L6:
	cmpl	$9, -16(%rbp)
	jle	.L8
.L5:
	addl	$1, -20(%rbp)
.L4:
	movl	-36(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L9
	jmp	.L10
.L14:
	movl	$9, -12(%rbp)
	jmp	.L11
.L13:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L12
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L12
	movl	-36(%rbp), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	c(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movl	-12(%rbp), %eax
	addl	$48, %eax
	movl	%eax, %edi
	call	putchar@PLT
	movl	-36(%rbp), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	c(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -36(%rbp)
	jmp	.L10
.L12:
	subl	$1, -12(%rbp)
.L11:
	cmpl	$0, -12(%rbp)
	jg	.L13
.L10:
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	a(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	128(%rsp), %rdx
	leaq	124(%rsp), %rsi
	leaq	132(%rsp), %r13
	call	__isoc99_scanf@PLT
	movl	128(%rsp), %edi
	testl	%edi, %edi
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	132(%rsp), %rax
	addl	$1, 0(%rbp,%rax,4)
	cmpl	%ebx, 128(%rsp)
	jg	.L2
.L5:
	movl	4+a(%rip), %eax
	movl	124(%rsp), %r10d
	movl	$1, dp(%rip)
	leaq	dp(%rip), %rbx
	movl	16+a(%rip), %r12d
	movl	20+a(%rip), %r15d
	movl	%eax, 16(%rsp)
	movl	4+c(%rip), %eax
	movl	24+a(%rip), %r14d
	movl	28+a(%rip), %r13d
	movl	%eax, 68(%rsp)
	movl	8+a(%rip), %eax
	movl	32+a(%rip), %r9d
	movl	36+a(%rip), %r11d
	movl	%eax, 12(%rsp)
	movl	8+c(%rip), %eax
	movl	36+c(%rip), %ebp
	movl	%eax, 44(%rsp)
	movl	12+a(%rip), %eax
	movl	%eax, 52(%rsp)
	movl	12+c(%rip), %eax
	movl	%eax, 36(%rsp)
	movl	16+c(%rip), %eax
	movl	%eax, 40(%rsp)
	movl	20+c(%rip), %eax
	movl	%eax, 32(%rsp)
	movl	24+c(%rip), %eax
	movl	%eax, 28(%rsp)
	movl	28+c(%rip), %eax
	movl	%eax, 24(%rsp)
	movl	32+c(%rip), %eax
	movl	%eax, 20(%rsp)
	testl	%r10d, %r10d
	jle	.L4
	movl	%eax, %esi
	movl	28(%rsp), %edi
	movl	a(%rip), %eax
	movq	%rbx, %rdx
	subl	%ebp, %esi
	leal	(%r10,%rbp), %r8d
	movl	%esi, 56(%rsp)
	movl	24(%rsp), %esi
	subl	%ebp, %edi
	movl	%edi, 64(%rsp)
	movl	40(%rsp), %edi
	subl	%ebp, %esi
	movl	%eax, 48(%rsp)
	movl	%ebp, %eax
	movl	%esi, 60(%rsp)
	movl	32(%rsp), %esi
	subl	%ebp, %edi
	movl	%edi, 72(%rsp)
	movl	44(%rsp), %edi
	subl	%ebp, %esi
	movl	%esi, 104(%rsp)
	movl	36(%rsp), %esi
	subl	%ebp, %edi
	movl	%edi, 88(%rsp)
	movl	c(%rip), %edi
	subl	%ebp, %esi
	movl	%esi, 80(%rsp)
	movl	68(%rsp), %esi
	subl	%ebp, %edi
	movl	%edi, 108(%rsp)
	subl	%ebp, %esi
	movl	%esi, 96(%rsp)
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %eax
	addq	$4, %rdx
	cmpl	%r8d, %eax
	je	.L4
.L19:
	movl	(%rdx), %ecx
	testl	%ecx, %ecx
	je	.L8
	movl	48(%rsp), %esi
	testl	%esi, %esi
	je	.L9
	movl	108(%rsp), %esi
	addl	$1, %ecx
	addl	%eax, %esi
	movslq	%esi, %rsi
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L9:
	movl	16(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L10
	movl	96(%rsp), %edi
	leal	(%rdi,%rax), %esi
	movl	(%rdx), %edi
	movslq	%esi, %rsi
	leal	1(%rdi), %ecx
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L10:
	movl	12(%rsp), %edi
	testl	%edi, %edi
	je	.L11
	movl	88(%rsp), %esi
	movl	(%rdx), %edi
	addl	%eax, %esi
	leal	1(%rdi), %ecx
	movslq	%esi, %rsi
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L11:
	movl	52(%rsp), %esi
	testl	%esi, %esi
	je	.L12
	movl	80(%rsp), %esi
	movl	(%rdx), %edi
	addl	%eax, %esi
	leal	1(%rdi), %ecx
	movslq	%esi, %rsi
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L12:
	testl	%r12d, %r12d
	je	.L13
	movl	72(%rsp), %esi
	movl	(%rdx), %edi
	addl	%eax, %esi
	leal	1(%rdi), %ecx
	movslq	%esi, %rsi
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L13:
	testl	%r15d, %r15d
	je	.L14
	movl	104(%rsp), %esi
	movl	(%rdx), %edi
	addl	%eax, %esi
	leal	1(%rdi), %ecx
	movslq	%esi, %rsi
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L14:
	testl	%r14d, %r14d
	je	.L15
	movl	64(%rsp), %esi
	movl	(%rdx), %edi
	addl	%eax, %esi
	leal	1(%rdi), %ecx
	movslq	%esi, %rsi
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L15:
	testl	%r13d, %r13d
	je	.L16
	movl	60(%rsp), %esi
	movl	(%rdx), %edi
	addl	%eax, %esi
	leal	1(%rdi), %ecx
	movslq	%esi, %rsi
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L16:
	testl	%r9d, %r9d
	je	.L17
	movl	56(%rsp), %esi
	movl	(%rdx), %edi
	addl	%eax, %esi
	leal	1(%rdi), %ecx
	movslq	%esi, %rsi
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L17:
	testl	%r11d, %r11d
	je	.L8
	movl	(%rdx), %edi
	movslq	%eax, %rsi
	leal	1(%rdi), %ecx
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	addl	$1, %eax
	addq	$4, %rdx
	movl	%ecx, (%rbx,%rsi,4)
	cmpl	%r8d, %eax
	jne	.L19
.L4:
	movl	%ebp, 48(%rsp)
	movl	52(%rsp), %edx
.L6:
	movl	%r10d, %r8d
	subl	32(%rsp), %r8d
	movl	%r10d, %edi
	subl	20(%rsp), %edi
	movl	%r8d, 52(%rsp)
	movl	%r10d, %r8d
	subl	40(%rsp), %r8d
	movslq	%edi, %rdi
	movl	%r8d, 56(%rsp)
	movl	%r10d, %esi
	movl	%r10d, %ecx
	subl	24(%rsp), %esi
	subl	28(%rsp), %ecx
	movl	%r10d, %r8d
	subl	36(%rsp), %r8d
	movslq	%esi, %rsi
	movl	%r8d, 60(%rsp)
	movl	%r10d, %r8d
	subl	44(%rsp), %r8d
	movl	%r10d, %eax
	movq	%rdi, 80(%rsp)
	movslq	%ecx, %rdi
	subl	48(%rsp), %eax
	movl	%r8d, 64(%rsp)
	cltq
	movq	%rsi, 88(%rsp)
	movq	%rdi, 96(%rsp)
	movq	%rax, 72(%rsp)
	movslq	%r10d, %rax
.L31:
	movslq	52(%rsp), %r8
	movslq	56(%rsp), %rdi
	movslq	60(%rsp), %rsi
	movslq	64(%rsp), %rbp
.L30:
	testl	%r10d, %r10d
	je	.L20
	testl	%r11d, %r11d
	je	.L21
	cmpl	48(%rsp), %r10d
	jl	.L21
	movq	72(%rsp), %rcx
	movl	(%rbx,%rcx,4), %ecx
	movl	%ecx, 104(%rsp)
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	je	.L35
.L21:
	testl	%r9d, %r9d
	je	.L23
	cmpl	20(%rsp), %r10d
	jl	.L23
	movq	80(%rsp), %rcx
	movl	(%rbx,%rcx,4), %ecx
	movl	%ecx, 104(%rsp)
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	je	.L36
.L23:
	testl	%r13d, %r13d
	je	.L24
	cmpl	24(%rsp), %r10d
	jl	.L24
	movq	88(%rsp), %rcx
	movl	(%rbx,%rcx,4), %ecx
	movl	%ecx, 104(%rsp)
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	je	.L37
.L24:
	testl	%r14d, %r14d
	je	.L25
	cmpl	28(%rsp), %r10d
	jl	.L25
	movq	96(%rsp), %rcx
	movl	(%rbx,%rcx,4), %ecx
	movl	%ecx, 104(%rsp)
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	je	.L38
.L25:
	testl	%r15d, %r15d
	je	.L26
	cmpl	32(%rsp), %r10d
	jl	.L26
	movl	(%rbx,%r8,4), %ecx
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	je	.L39
.L26:
	testl	%r12d, %r12d
	je	.L27
	cmpl	40(%rsp), %r10d
	jl	.L27
	movl	(%rbx,%rdi,4), %ecx
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	je	.L40
.L27:
	testl	%edx, %edx
	je	.L28
	cmpl	36(%rsp), %r10d
	jl	.L28
	movl	(%rbx,%rsi,4), %ecx
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	je	.L41
.L28:
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L29
	cmpl	44(%rsp), %r10d
	jl	.L29
	movl	(%rbx,%rbp,4), %ecx
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	je	.L42
.L29:
	movl	16(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L30
	movl	68(%rsp), %edi
	cmpl	%edi, %r10d
	jl	.L31
	movl	%r10d, %ecx
	subl	%edi, %ecx
	movslq	%ecx, %rcx
	movl	(%rbx,%rcx,4), %ecx
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	jne	.L31
	movl	$1, %ebp
	.p2align 4,,10
	.p2align 3
.L22:
	movq	stdout(%rip), %rsi
	leal	48(%rbp), %edi
	call	putc@PLT
	movl	124(%rsp), %r10d
	leaq	c(%rip), %rax
	movl	36+a(%rip), %r11d
	subl	(%rax,%rbp,4), %r10d
	movl	28+c(%rip), %eax
	movl	%r10d, 124(%rsp)
	movl	32+a(%rip), %r9d
	movl	%eax, 24(%rsp)
	movl	8+c(%rip), %eax
	movl	28+a(%rip), %r13d
	movl	24+a(%rip), %r14d
	movl	%eax, 44(%rsp)
	movl	12+c(%rip), %eax
	movl	20+a(%rip), %r15d
	movl	16+a(%rip), %r12d
	movl	%eax, 36(%rsp)
	movl	16+c(%rip), %eax
	movl	12+a(%rip), %edx
	movl	%eax, 40(%rsp)
	movl	20+c(%rip), %eax
	movl	%eax, 32(%rsp)
	movl	24+c(%rip), %eax
	movl	%eax, 28(%rsp)
	movl	32+c(%rip), %eax
	movl	%eax, 20(%rsp)
	movl	36+c(%rip), %eax
	movl	%eax, 48(%rsp)
	movl	8+a(%rip), %eax
	movl	%eax, 12(%rsp)
	movl	4+a(%rip), %eax
	movl	%eax, 16(%rsp)
	movl	4+c(%rip), %eax
	movl	%eax, 68(%rsp)
	jmp	.L6
.L20:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L108
	addq	$152, %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
.L40:
	.cfi_restore_state
	movl	$4, %ebp
	jmp	.L22
.L39:
	movl	$5, %ebp
	jmp	.L22
.L38:
	movl	$6, %ebp
	jmp	.L22
.L37:
	movl	$7, %ebp
	jmp	.L22
.L36:
	movl	$8, %ebp
	jmp	.L22
.L35:
	movl	$9, %ebp
	jmp	.L22
.L42:
	movl	$2, %ebp
	jmp	.L22
.L41:
	movl	$3, %ebp
	jmp	.L22
.L108:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	c
	.data
	.align 32
	.type	c, @object
	.size	c, 40
c:
	.long	0
	.long	2
	.long	5
	.long	5
	.long	4
	.long	5
	.long	6
	.long	3
	.long	7
	.long	6
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 40
a:
	.zero	40
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 40040
dp:
	.zero	40040
	.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"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	a(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	128(%rsp), %rdx
	leaq	124(%rsp), %rsi
	leaq	132(%rsp), %r13
	call	__isoc99_scanf@PLT
	movl	128(%rsp), %edi
	testl	%edi, %edi
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	132(%rsp), %rax
	addl	$1, 0(%rbp,%rax,4)
	cmpl	%ebx, 128(%rsp)
	jg	.L2
.L5:
	movl	4+a(%rip), %eax
	movl	124(%rsp), %r10d
	movl	$1, dp(%rip)
	leaq	dp(%rip), %rbx
	movl	16+a(%rip), %r12d
	movl	20+a(%rip), %r15d
	movl	%eax, 16(%rsp)
	movl	4+c(%rip), %eax
	movl	24+a(%rip), %r14d
	movl	28+a(%rip), %r13d
	movl	%eax, 68(%rsp)
	movl	8+a(%rip), %eax
	movl	32+a(%rip), %r9d
	movl	36+a(%rip), %r11d
	movl	%eax, 12(%rsp)
	movl	8+c(%rip), %eax
	movl	36+c(%rip), %ebp
	movl	%eax, 44(%rsp)
	movl	12+a(%rip), %eax
	movl	%eax, 52(%rsp)
	movl	12+c(%rip), %eax
	movl	%eax, 36(%rsp)
	movl	16+c(%rip), %eax
	movl	%eax, 40(%rsp)
	movl	20+c(%rip), %eax
	movl	%eax, 32(%rsp)
	movl	24+c(%rip), %eax
	movl	%eax, 28(%rsp)
	movl	28+c(%rip), %eax
	movl	%eax, 24(%rsp)
	movl	32+c(%rip), %eax
	movl	%eax, 20(%rsp)
	testl	%r10d, %r10d
	jle	.L4
	movl	%eax, %esi
	movl	28(%rsp), %edi
	movl	a(%rip), %eax
	movq	%rbx, %rdx
	subl	%ebp, %esi
	leal	(%r10,%rbp), %r8d
	movl	%esi, 56(%rsp)
	movl	24(%rsp), %esi
	subl	%ebp, %edi
	movl	%edi, 64(%rsp)
	movl	40(%rsp), %edi
	subl	%ebp, %esi
	movl	%eax, 48(%rsp)
	movl	%ebp, %eax
	movl	%esi, 60(%rsp)
	movl	32(%rsp), %esi
	subl	%ebp, %edi
	movl	%edi, 72(%rsp)
	movl	44(%rsp), %edi
	subl	%ebp, %esi
	movl	%esi, 104(%rsp)
	movl	36(%rsp), %esi
	subl	%ebp, %edi
	movl	%edi, 88(%rsp)
	movl	c(%rip), %edi
	subl	%ebp, %esi
	movl	%esi, 80(%rsp)
	movl	68(%rsp), %esi
	subl	%ebp, %edi
	movl	%edi, 108(%rsp)
	subl	%ebp, %esi
	movl	%esi, 96(%rsp)
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %eax
	addq	$4, %rdx
	cmpl	%r8d, %eax
	je	.L4
.L19:
	movl	(%rdx), %ecx
	testl	%ecx, %ecx
	je	.L8
	movl	48(%rsp), %esi
	testl	%esi, %esi
	je	.L9
	movl	108(%rsp), %esi
	addl	$1, %ecx
	addl	%eax, %esi
	movslq	%esi, %rsi
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L9:
	movl	16(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L10
	movl	96(%rsp), %edi
	leal	(%rdi,%rax), %esi
	movl	(%rdx), %edi
	movslq	%esi, %rsi
	leal	1(%rdi), %ecx
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L10:
	movl	12(%rsp), %edi
	testl	%edi, %edi
	je	.L11
	movl	88(%rsp), %esi
	movl	(%rdx), %edi
	addl	%eax, %esi
	leal	1(%rdi), %ecx
	movslq	%esi, %rsi
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L11:
	movl	52(%rsp), %esi
	testl	%esi, %esi
	je	.L12
	movl	80(%rsp), %esi
	movl	(%rdx), %edi
	addl	%eax, %esi
	leal	1(%rdi), %ecx
	movslq	%esi, %rsi
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L12:
	testl	%r12d, %r12d
	je	.L13
	movl	72(%rsp), %esi
	movl	(%rdx), %edi
	addl	%eax, %esi
	leal	1(%rdi), %ecx
	movslq	%esi, %rsi
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L13:
	testl	%r15d, %r15d
	je	.L14
	movl	104(%rsp), %esi
	movl	(%rdx), %edi
	addl	%eax, %esi
	leal	1(%rdi), %ecx
	movslq	%esi, %rsi
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L14:
	testl	%r14d, %r14d
	je	.L15
	movl	64(%rsp), %esi
	movl	(%rdx), %edi
	addl	%eax, %esi
	leal	1(%rdi), %ecx
	movslq	%esi, %rsi
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L15:
	testl	%r13d, %r13d
	je	.L16
	movl	60(%rsp), %esi
	movl	(%rdx), %edi
	addl	%eax, %esi
	leal	1(%rdi), %ecx
	movslq	%esi, %rsi
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L16:
	testl	%r9d, %r9d
	je	.L17
	movl	56(%rsp), %esi
	movl	(%rdx), %edi
	addl	%eax, %esi
	leal	1(%rdi), %ecx
	movslq	%esi, %rsi
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	movl	%ecx, (%rbx,%rsi,4)
.L17:
	testl	%r11d, %r11d
	je	.L8
	movl	(%rdx), %edi
	movslq	%eax, %rsi
	leal	1(%rdi), %ecx
	movl	(%rbx,%rsi,4), %edi
	cmpl	%edi, %ecx
	cmovl	%edi, %ecx
	addl	$1, %eax
	addq	$4, %rdx
	movl	%ecx, (%rbx,%rsi,4)
	cmpl	%r8d, %eax
	jne	.L19
.L4:
	movl	%ebp, 48(%rsp)
	movl	52(%rsp), %edx
.L6:
	movl	%r10d, %r8d
	subl	32(%rsp), %r8d
	movl	%r10d, %edi
	subl	20(%rsp), %edi
	movl	%r8d, 52(%rsp)
	movl	%r10d, %r8d
	subl	40(%rsp), %r8d
	movslq	%edi, %rdi
	movl	%r8d, 56(%rsp)
	movl	%r10d, %esi
	movl	%r10d, %ecx
	subl	24(%rsp), %esi
	subl	28(%rsp), %ecx
	movl	%r10d, %r8d
	subl	36(%rsp), %r8d
	movslq	%esi, %rsi
	movl	%r8d, 60(%rsp)
	movl	%r10d, %r8d
	subl	44(%rsp), %r8d
	movl	%r10d, %eax
	movq	%rdi, 80(%rsp)
	movslq	%ecx, %rdi
	subl	48(%rsp), %eax
	movl	%r8d, 64(%rsp)
	cltq
	movq	%rsi, 88(%rsp)
	movq	%rdi, 96(%rsp)
	movq	%rax, 72(%rsp)
	movslq	%r10d, %rax
.L31:
	movslq	52(%rsp), %r8
	movslq	56(%rsp), %rdi
	movslq	60(%rsp), %rsi
	movslq	64(%rsp), %rbp
.L30:
	testl	%r10d, %r10d
	je	.L20
	testl	%r11d, %r11d
	je	.L21
	cmpl	48(%rsp), %r10d
	jl	.L21
	movq	72(%rsp), %rcx
	movl	(%rbx,%rcx,4), %ecx
	movl	%ecx, 104(%rsp)
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	je	.L35
.L21:
	testl	%r9d, %r9d
	je	.L23
	cmpl	20(%rsp), %r10d
	jl	.L23
	movq	80(%rsp), %rcx
	movl	(%rbx,%rcx,4), %ecx
	movl	%ecx, 104(%rsp)
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	je	.L36
.L23:
	testl	%r13d, %r13d
	je	.L24
	cmpl	24(%rsp), %r10d
	jl	.L24
	movq	88(%rsp), %rcx
	movl	(%rbx,%rcx,4), %ecx
	movl	%ecx, 104(%rsp)
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	je	.L37
.L24:
	testl	%r14d, %r14d
	je	.L25
	cmpl	28(%rsp), %r10d
	jl	.L25
	movq	96(%rsp), %rcx
	movl	(%rbx,%rcx,4), %ecx
	movl	%ecx, 104(%rsp)
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	je	.L38
.L25:
	testl	%r15d, %r15d
	je	.L26
	cmpl	32(%rsp), %r10d
	jl	.L26
	movl	(%rbx,%r8,4), %ecx
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	je	.L39
.L26:
	testl	%r12d, %r12d
	je	.L27
	cmpl	40(%rsp), %r10d
	jl	.L27
	movl	(%rbx,%rdi,4), %ecx
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	je	.L40
.L27:
	testl	%edx, %edx
	je	.L28
	cmpl	36(%rsp), %r10d
	jl	.L28
	movl	(%rbx,%rsi,4), %ecx
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	je	.L41
.L28:
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L29
	cmpl	44(%rsp), %r10d
	jl	.L29
	movl	(%rbx,%rbp,4), %ecx
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	je	.L42
.L29:
	movl	16(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L30
	movl	68(%rsp), %edi
	cmpl	%edi, %r10d
	jl	.L31
	movl	%r10d, %ecx
	subl	%edi, %ecx
	movslq	%ecx, %rcx
	movl	(%rbx,%rcx,4), %ecx
	addl	$1, %ecx
	cmpl	(%rbx,%rax,4), %ecx
	jne	.L31
	movl	$1, %ebp
	.p2align 4,,10
	.p2align 3
.L22:
	movq	stdout(%rip), %rsi
	leal	48(%rbp), %edi
	call	putc@PLT
	movl	124(%rsp), %r10d
	leaq	c(%rip), %rax
	movl	36+a(%rip), %r11d
	subl	(%rax,%rbp,4), %r10d
	movl	28+c(%rip), %eax
	movl	%r10d, 124(%rsp)
	movl	32+a(%rip), %r9d
	movl	%eax, 24(%rsp)
	movl	8+c(%rip), %eax
	movl	28+a(%rip), %r13d
	movl	24+a(%rip), %r14d
	movl	%eax, 44(%rsp)
	movl	12+c(%rip), %eax
	movl	20+a(%rip), %r15d
	movl	16+a(%rip), %r12d
	movl	%eax, 36(%rsp)
	movl	16+c(%rip), %eax
	movl	12+a(%rip), %edx
	movl	%eax, 40(%rsp)
	movl	20+c(%rip), %eax
	movl	%eax, 32(%rsp)
	movl	24+c(%rip), %eax
	movl	%eax, 28(%rsp)
	movl	32+c(%rip), %eax
	movl	%eax, 20(%rsp)
	movl	36+c(%rip), %eax
	movl	%eax, 48(%rsp)
	movl	8+a(%rip), %eax
	movl	%eax, 12(%rsp)
	movl	4+a(%rip), %eax
	movl	%eax, 16(%rsp)
	movl	4+c(%rip), %eax
	movl	%eax, 68(%rsp)
	jmp	.L6
.L20:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L108
	addq	$152, %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
.L40:
	.cfi_restore_state
	movl	$4, %ebp
	jmp	.L22
.L39:
	movl	$5, %ebp
	jmp	.L22
.L38:
	movl	$6, %ebp
	jmp	.L22
.L37:
	movl	$7, %ebp
	jmp	.L22
.L36:
	movl	$8, %ebp
	jmp	.L22
.L35:
	movl	$9, %ebp
	jmp	.L22
.L42:
	movl	$2, %ebp
	jmp	.L22
.L41:
	movl	$3, %ebp
	jmp	.L22
.L108:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	c
	.data
	.align 32
	.type	c, @object
	.size	c, 40
c:
	.long	0
	.long	2
	.long	5
	.long	5
	.long	4
	.long	5
	.long	6
	.long	3
	.long	7
	.long	6
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 40
a:
	.zero	40
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 40040
dp:
	.zero	40040
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
#include<stdlib.h>
#define ll long long
#define max(p,q)((p)>(q)?(p):(q))

int dp[10010];//dp[i]=i本のマッチを使って作れる最大桁数
int a[10];
int c[10]={0,2,5,5,4,5,6,3,7,6};
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=0;i<m;i++){
		int t;
		scanf("%d",&t);
		a[t]++;
	}
	dp[0]=1;
	for(int i=0;i<n;i++)if(dp[i]){
		//配るDP
		for(int j=0;j<10;j++)if(a[j]){
			dp[i+c[j]]=max(dp[i+c[j]],dp[i]+1);
		}
	}
	while(n){
		for(int i=9;i>=1;i--)if(a[i]&&n>=c[i]){
			if(dp[n-c[i]]+1==dp[n]){
				putchar('0'+i);
				n-=c[i];
				break;
			}
		}
	}
}
101 9
9 8 7 6 5 4 3 1 1
 20 4
3 7 8 7
 15 4
5 4 6
 15 7
5 3 6
 15 6
5 1 6
 12 6
5 1 6
 101 9
9 8 1 6 5 4 3 2 1
 20 4
3 7 8 5
 15 3
5 4 9
 15 7
2 3 6

71111111111111111111111111111111111111111111111111 777773 654 555 511111 111111 5111111111111111111111111111111111111111111111111 777775 954 333
Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<stdlib.h>
#define ll long long
#define max(p,q)((p)>(q)?(p):(q))

int dp[10010];//dp[i]=i本のマッチを使って作れる最大桁数
int a[10];
int c[10]={0,2,5,5,4,5,6,3,7,6};
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=0;i<m;i++){
		int t;
		scanf("%d",&t);
		a[t]++;
	}
	dp[0]=1;
	for(int i=0;i<n;i++)if(dp[i]){
		//配るDP
		for(int j=0;j<10;j++)if(a[j]){
			dp[i+c[j]]=max(dp[i+c[j]],dp[i]+1);
		}
	}
	while(n){
		for(int i=9;i>=1;i--)if(a[i]&&n>=c[i]){
			if(dp[n-c[i]]+1==dp[n]){
				putchar('0'+i);
				n-=c[i];
				break;
			}
		}
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 40040
dp:
	.zero	40040
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 40
a:
	.zero	40
	.globl	c
	.data
	.align 32
	.type	c, @object
	.size	c, 40
c:
	.long	0
	.long	2
	.long	5
	.long	5
	.long	4
	.long	5
	.long	6
	.long	3
	.long	7
	.long	6
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L2
.L3:
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -24(%rbp)
.L2:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L3
	movl	$1, dp(%rip)
	movl	$0, -20(%rbp)
	jmp	.L4
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L5
	movl	$0, -16(%rbp)
	jmp	.L6
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L7
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	c(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	-20(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-16(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	c(%rip), %rcx
	movl	(%rsi,%rcx), %esi
	movl	-20(%rbp), %ecx
	addl	%esi, %ecx
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L7:
	addl	$1, -16(%rbp)
.L6:
	cmpl	$9, -16(%rbp)
	jle	.L8
.L5:
	addl	$1, -20(%rbp)
.L4:
	movl	-36(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L9
	jmp	.L10
.L14:
	movl	$9, -12(%rbp)
	jmp	.L11
.L13:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L12
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L12
	movl	-36(%rbp), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	c(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movl	-12(%rbp), %eax
	addl	$48, %eax
	movl	%eax, %edi
	call	putchar@PLT
	movl	-36(%rbp), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	c(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -36(%rbp)
	jmp	.L10
.L12:
	subl	$1, -12(%rbp)
.L11:
	cmpl	$0, -12(%rbp)
	jg	.L13
.L10:
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 40040
dp:
	.zero	40040
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 40
a:
	.zero	40
	.globl	c
	.data
	.align 32
	.type	c, @object
	.size	c, 40
c:
	.long	0
	.long	2
	.long	5
	.long	5
	.long	4
	.long	5
	.long	6
	.long	3
	.long	7
	.long	6
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L2
.L3:
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -24(%rbp)
.L2:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L3
	movl	$1, dp(%rip)
	movl	$0, -20(%rbp)
	jmp	.L4
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L5
	movl	$0, -16(%rbp)
	jmp	.L6
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L7
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	c(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	-20(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-16(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	c(%rip), %rcx
	movl	(%rsi,%rcx), %esi
	movl	-20(%rbp), %ecx
	addl	%esi, %ecx
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L7:
	addl	$1, -16(%rbp)
.L6:
	cmpl	$9, -16(%rbp)
	jle	.L8
.L5:
	addl	$1, -20(%rbp)
.L4:
	movl	-36(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L9
	jmp	.L10
.L14:
	movl	$9, -12(%rbp)
	jmp	.L11
.L13:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L12
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L12
	movl	-36(%rbp), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	c(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movl	-12(%rbp), %eax
	addl	$48, %eax
	movl	%eax, %edi
	call	putchar@PLT
	movl	-36(%rbp), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	c(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -36(%rbp)
	jmp	.L10
.L12:
	subl	$1, -12(%rbp)
.L11:
	cmpl	$0, -12(%rbp)
	jg	.L13
.L10:
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
