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>

int N, K;
int C[10], D;
int a[] = {10000, 1000, 100, 10, 1};
int ans;

void func(int L, int num)
{
	int i;

	if (ans != 0) return;
	if (L >= 5)
	{
		if (num >= N) ans = num;
		return;
	}

	if (N / a[L] == 0) func(L + 1, 0);
	for (i = 0; i < 10; ++i)
	{
		if (C[i]) continue;
		func(L + 1, num * 10 + i);
	}
}

int main(void)
{
	int i;

	scanf("%d %d", &N, &K);
	for (i = 0; i < K; ++i)
	{
		scanf("%d", &D);
		C[D]++;
	}

	func(0, 0);
	printf("%d\n", ans);

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 40
C:
	.zero	40
	.globl	D
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.zero	4
	.globl	a
	.data
	.align 16
	.type	a, @object
	.size	a, 20
a:
	.long	10000
	.long	1000
	.long	100
	.long	10
	.long	1
	.globl	ans
	.bss
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.text
	.globl	func
	.type	func, @function
func:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	ans(%rip), %eax
	testl	%eax, %eax
	jne	.L11
	cmpl	$4, -20(%rbp)
	jle	.L4
	movl	N(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L12
	movl	-24(%rbp), %eax
	movl	%eax, ans(%rip)
	jmp	.L12
.L4:
	movl	N(%rip), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	cltd
	idivl	%ecx
	testl	%eax, %eax
	jne	.L6
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	func
.L6:
	movl	$0, -4(%rbp)
	jmp	.L7
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-24(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	func
	jmp	.L9
.L13:
	nop
.L9:
	addl	$1, -4(%rbp)
.L7:
	cmpl	$9, -4(%rbp)
	jle	.L10
	jmp	.L1
.L11:
	nop
	jmp	.L1
.L12:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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
	leaq	K(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4(%rbp)
	jmp	.L15
.L16:
	leaq	D(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	D(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	C(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L15:
	movl	K(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L16
	movl	$0, %esi
	movl	$0, %edi
	call	func
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	func
	.type	func, @function
func:
.LFB23:
	.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	$232, %rsp
	.cfi_def_cfa_offset 288
	movl	ans(%rip), %r8d
	movl	%edi, 128(%rsp)
	testl	%r8d, %r8d
	jne	.L1
	movl	N(%rip), %ecx
	movl	%esi, %r14d
	cmpl	$4, %edi
	jg	.L138
	movslq	%edi, %rbx
	leaq	a(%rip), %rdi
	leal	2(%rbx), %eax
	movl	%eax, 144(%rsp)
	leal	3(%rbx), %eax
	movl	%eax, 132(%rsp)
	movl	%ecx, %eax
	cltd
	idivl	(%rdi,%rbx,4)
	testl	%eax, %eax
	je	.L6
	leal	1(%rbx), %eax
	leaq	40+C(%rip), %r11
	movl	%eax, 176(%rsp)
	leal	4(%rbx), %eax
	movl	%eax, 68(%rsp)
.L8:
	leal	(%r14,%r14,4), %eax
	addl	%eax, %eax
	movl	%eax, 184(%rsp)
	movl	128(%rsp), %eax
	leal	5(%rax), %edx
	leal	6(%rax), %edi
	movl	%edx, 84(%rsp)
	imull	$100, %r14d, %edx
	leal	7(%rax), %esi
	addl	$8, %eax
	movl	%edi, 44(%rsp)
	leaq	C(%rip), %rdi
	movl	%eax, 148(%rsp)
	cltq
	movl	%esi, 8(%rsp)
	movl	%edx, 180(%rsp)
	movq	%rdi, 96(%rsp)
	movq	%rdi, 168(%rsp)
	movq	%rax, 112(%rsp)
.L7:
	movq	168(%rsp), %rax
	movl	(%rax), %eax
	orl	ans(%rip), %eax
	jne	.L32
	cmpl	$5, 176(%rsp)
	movl	N(%rip), %ecx
	je	.L139
	movl	%ecx, %eax
	movslq	176(%rsp), %rsi
	leaq	a(%rip), %rdi
	cltd
	idivl	(%rdi,%rsi,4)
	testl	%eax, %eax
	je	.L35
.L37:
	movl	180(%rsp), %edx
	movq	%r11, 152(%rsp)
	leal	(%rdx,%rdx,4), %eax
	movl	%edx, 164(%rsp)
	addl	%eax, %eax
	movl	%eax, 160(%rsp)
	leaq	C(%rip), %rax
	movq	%rax, 104(%rsp)
.L36:
	movq	104(%rsp), %rax
	movl	(%rax), %eax
	orl	ans(%rip), %eax
	jne	.L55
	cmpl	$5, 144(%rsp)
	movl	N(%rip), %ecx
	je	.L140
	movl	%ecx, %eax
	movslq	144(%rsp), %rdi
	leaq	a(%rip), %rsi
	cltd
	idivl	(%rsi,%rdi,4)
	testl	%eax, %eax
	je	.L141
.L59:
	movl	160(%rsp), %edi
	movq	152(%rsp), %r11
	leal	(%rdi,%rdi,4), %eax
	movl	%edi, 140(%rsp)
	addl	%eax, %eax
	movl	%eax, 136(%rsp)
	leaq	C(%rip), %rax
	movq	%rax, 48(%rsp)
.L115:
	movq	48(%rsp), %rax
	movl	(%rax), %eax
	orl	ans(%rip), %eax
	jne	.L72
	cmpl	$5, 132(%rsp)
	movl	N(%rip), %eax
	je	.L142
	movslq	132(%rsp), %rdi
	leaq	a(%rip), %rsi
	cltd
	idivl	(%rsi,%rdi,4)
	testl	%eax, %eax
	je	.L143
.L75:
	movl	136(%rsp), %edx
	leal	(%rdx,%rdx,4), %eax
	movl	%edx, 92(%rsp)
	addl	%eax, %eax
	movl	%eax, 88(%rsp)
	leaq	C(%rip), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L114:
	movq	16(%rsp), %rax
	movl	(%rax), %eax
	orl	ans(%rip), %eax
	jne	.L77
	cmpl	$5, 68(%rsp)
	movl	N(%rip), %eax
	je	.L144
	movslq	68(%rsp), %rsi
	leaq	a(%rip), %rdi
	cltd
	idivl	(%rdi,%rsi,4)
	testl	%eax, %eax
	je	.L145
.L80:
	movl	88(%rsp), %esi
	leaq	C(%rip), %r10
	movq	%r11, %r13
	leal	(%rsi,%rsi,4), %eax
	movl	%esi, 40(%rsp)
	addl	%eax, %eax
	movl	%eax, 36(%rsp)
	.p2align 4,,10
	.p2align 3
.L113:
	movl	(%r10), %eax
	orl	ans(%rip), %eax
	jne	.L82
	cmpl	$5, 84(%rsp)
	movl	N(%rip), %eax
	je	.L146
	movslq	84(%rsp), %rdi
	leaq	a(%rip), %rsi
	cltd
	idivl	(%rsi,%rdi,4)
	testl	%eax, %eax
	je	.L147
.L85:
	movslq	44(%rsp), %rax
	movl	36(%rsp), %r11d
	movq	%r10, 120(%rsp)
	leaq	C(%rip), %r8
	movl	148(%rsp), %r10d
	movq	%rax, 72(%rsp)
	leal	(%r11,%r11,4), %r9d
	addl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L112:
	movl	(%r8), %eax
	orl	ans(%rip), %eax
	jne	.L87
	cmpl	$5, 44(%rsp)
	movl	N(%rip), %eax
	je	.L148
	movq	72(%rsp), %rdi
	leaq	a(%rip), %rsi
	cltd
	idivl	(%rsi,%rdi,4)
	testl	%eax, %eax
	je	.L149
.L90:
	movslq	8(%rsp), %rax
	leal	(%r9,%r9,4), %r12d
	movl	%r9d, 64(%rsp)
	leaq	C(%rip), %rbx
	movq	%r8, 56(%rsp)
	movq	96(%rsp), %r8
	addl	%r12d, %r12d
	movq	%rax, 24(%rsp)
	movl	128(%rsp), %eax
	addl	$9, %eax
	movl	%eax, 80(%rsp)
	movq	%r13, %rax
	movl	%r9d, %r13d
	movq	112(%rsp), %r9
	movq	%rax, %rcx
	.p2align 4,,10
	.p2align 3
.L111:
	movl	(%rbx), %eax
	orl	ans(%rip), %eax
	jne	.L92
	cmpl	$5, 8(%rsp)
	movl	N(%rip), %eax
	je	.L150
	movq	24(%rsp), %rdi
	leaq	a(%rip), %rsi
	cltd
	idivl	(%rsi,%rdi,4)
	testl	%eax, %eax
	je	.L151
.L95:
	leal	(%r12,%r12,4), %r15d
	movl	%r12d, %r14d
	leaq	C(%rip), %rbp
	addl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L110:
	movl	0(%rbp), %eax
	orl	ans(%rip), %eax
	jne	.L97
	movl	N(%rip), %eax
	cmpl	$5, %r10d
	je	.L152
	leaq	a(%rip), %rdi
	cltd
	idivl	(%rdi,%r9,4)
	testl	%eax, %eax
	je	.L153
.L100:
	movl	(%r8), %edx
	testl	%edx, %edx
	jne	.L101
	movl	80(%rsp), %edi
	movl	%r15d, %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L101:
	movl	4+C(%rip), %eax
	testl	%eax, %eax
	jne	.L102
	movl	80(%rsp), %edi
	leal	1(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L102:
	movl	8+C(%rip), %eax
	testl	%eax, %eax
	jne	.L103
	movl	80(%rsp), %edi
	leal	2(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L103:
	movl	12+C(%rip), %eax
	testl	%eax, %eax
	jne	.L104
	movl	80(%rsp), %edi
	leal	3(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L104:
	movl	16+C(%rip), %eax
	testl	%eax, %eax
	jne	.L105
	movl	80(%rsp), %edi
	leal	4(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L105:
	movl	20+C(%rip), %eax
	testl	%eax, %eax
	jne	.L106
	movl	80(%rsp), %edi
	leal	5(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L106:
	movl	24+C(%rip), %edi
	testl	%edi, %edi
	jne	.L107
	movl	80(%rsp), %edi
	leal	6(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L107:
	movl	28+C(%rip), %esi
	testl	%esi, %esi
	jne	.L108
	movl	80(%rsp), %edi
	leal	7(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L108:
	movl	32+C(%rip), %edx
	testl	%edx, %edx
	jne	.L109
	movl	80(%rsp), %edi
	leal	8(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L109:
	movl	36+C(%rip), %eax
	testl	%eax, %eax
	jne	.L97
	movl	80(%rsp), %edi
	leal	9(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L97:
	addq	$4, %rbp
	addl	$1, %r14d
	addl	$10, %r15d
	cmpq	%rbp, %rcx
	jne	.L110
.L92:
	addq	$4, %rbx
	addl	$1, %r13d
	addl	$10, %r12d
	cmpq	%rbx, %rcx
	jne	.L111
	movl	64(%rsp), %r9d
	movq	56(%rsp), %r8
	movq	%rcx, %r13
.L87:
	addq	$4, %r8
	addl	$1, %r11d
	addl	$10, %r9d
	cmpq	%r8, %r13
	jne	.L112
	movq	120(%rsp), %r10
.L82:
	addq	$4, %r10
	addl	$1, 40(%rsp)
	addl	$10, 36(%rsp)
	cmpq	%r10, %r13
	jne	.L113
	movq	%r13, %r11
.L77:
	addq	$4, 16(%rsp)
	movq	16(%rsp), %rax
	addl	$1, 92(%rsp)
	addl	$10, 88(%rsp)
	cmpq	%rax, %r11
	jne	.L114
.L72:
	addq	$4, 48(%rsp)
	movq	48(%rsp), %rax
	addl	$1, 140(%rsp)
	addl	$10, 136(%rsp)
	cmpq	%rax, %r11
	jne	.L115
.L55:
	addq	$4, 104(%rsp)
	movq	104(%rsp), %rax
	addl	$1, 164(%rsp)
	addl	$10, 160(%rsp)
	cmpq	%rax, 152(%rsp)
	jne	.L36
	movq	152(%rsp), %r11
.L32:
	addq	$4, 168(%rsp)
	movq	168(%rsp), %rax
	addl	$1, 184(%rsp)
	addl	$10, 180(%rsp)
	cmpq	%rax, %r11
	jne	.L7
.L1:
	addq	$232, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L138:
	.cfi_restore_state
	cmpl	%ecx, %esi
	jl	.L1
	movl	%esi, ans(%rip)
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L152:
	cmpl	%eax, %r14d
	jl	.L97
	movl	%r14d, ans(%rip)
	jmp	.L97
	.p2align 4,,10
	.p2align 3
.L150:
	cmpl	%eax, %r13d
	jl	.L92
	movl	%r13d, ans(%rip)
	jmp	.L92
.L148:
	cmpl	%eax, %r11d
	jl	.L87
	movl	%r11d, ans(%rip)
	jmp	.L87
.L146:
	movl	40(%rsp), %edx
	cmpl	%eax, %edx
	jl	.L82
	movl	%edx, ans(%rip)
	jmp	.L82
.L144:
	movl	92(%rsp), %edi
	cmpl	%eax, %edi
	jl	.L77
	movl	%edi, ans(%rip)
	jmp	.L77
.L142:
	movl	140(%rsp), %esi
	cmpl	%eax, %esi
	jl	.L72
	movl	%esi, ans(%rip)
	jmp	.L72
.L149:
	movl	8(%rsp), %edi
	xorl	%esi, %esi
	movl	%r10d, 80(%rsp)
	movq	%r8, 56(%rsp)
	movl	%r11d, 64(%rsp)
	movl	%r9d, 24(%rsp)
	call	func
	movl	80(%rsp), %r10d
	movq	56(%rsp), %r8
	movl	64(%rsp), %r11d
	movl	24(%rsp), %r9d
	jmp	.L90
.L147:
	movl	44(%rsp), %edi
	xorl	%esi, %esi
	movq	%r10, 24(%rsp)
	call	func
	movq	24(%rsp), %r10
	jmp	.L85
.L145:
	movl	84(%rsp), %edi
	xorl	%esi, %esi
	movq	%r11, 24(%rsp)
	call	func
	movq	24(%rsp), %r11
	jmp	.L80
.L143:
	movl	68(%rsp), %edi
	xorl	%esi, %esi
	movq	%r11, 16(%rsp)
	call	func
	movq	16(%rsp), %r11
	jmp	.L75
.L140:
	movl	164(%rsp), %eax
	cmpl	%ecx, %eax
	jl	.L55
	movl	%eax, ans(%rip)
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L153:
	movl	80(%rsp), %edi
	xorl	%esi, %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	jmp	.L100
	.p2align 4,,10
	.p2align 3
.L151:
	movl	%r10d, %edi
	xorl	%esi, %esi
	movq	%r9, 216(%rsp)
	movq	%rcx, 208(%rsp)
	movq	%r8, 200(%rsp)
	movl	%r11d, 192(%rsp)
	movl	%r10d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movq	208(%rsp), %rcx
	movq	200(%rsp), %r8
	movl	192(%rsp), %r11d
	movl	188(%rsp), %r10d
	jmp	.L95
.L141:
	movl	132(%rsp), %eax
	cmpl	$5, %eax
	je	.L59
	movslq	%eax, %rsi
	movl	%ecx, %eax
	leaq	a(%rip), %rdi
	cltd
	idivl	(%rdi,%rsi,4)
	testl	%eax, %eax
	je	.L154
.L61:
	movq	96(%rsp), %rax
	movl	(%rax), %r12d
	testl	%r12d, %r12d
	je	.L155
.L62:
	movl	4+C(%rip), %ebp
	testl	%ebp, %ebp
	je	.L156
.L63:
	movl	8+C(%rip), %ebx
	testl	%ebx, %ebx
	je	.L157
.L64:
	movl	12+C(%rip), %r11d
	testl	%r11d, %r11d
	je	.L158
.L65:
	movl	16+C(%rip), %r10d
	testl	%r10d, %r10d
	je	.L159
.L66:
	movl	20+C(%rip), %r9d
	testl	%r9d, %r9d
	je	.L160
.L67:
	movl	24+C(%rip), %r8d
	testl	%r8d, %r8d
	je	.L161
.L68:
	movl	28+C(%rip), %edi
	testl	%edi, %edi
	je	.L162
.L69:
	movl	32+C(%rip), %esi
	testl	%esi, %esi
	je	.L163
.L70:
	movl	36+C(%rip), %ecx
	testl	%ecx, %ecx
	jne	.L59
	movl	68(%rsp), %edi
	movl	$9, %esi
	call	func
	jmp	.L59
.L139:
	movl	184(%rsp), %eax
	cmpl	%ecx, %eax
	jl	.L32
	movl	%eax, ans(%rip)
	jmp	.L32
.L35:
	movl	144(%rsp), %eax
	cmpl	$5, %eax
	je	.L37
	movslq	%eax, %rdi
	movl	%ecx, %eax
	leaq	a(%rip), %rsi
	cltd
	idivl	(%rsi,%rdi,4)
	testl	%eax, %eax
	je	.L164
.L38:
	movq	96(%rsp), %r14
	movl	68(%rsp), %r13d
	xorl	%ebp, %ebp
	movq	%r11, %r15
	movslq	132(%rsp), %r12
	movl	$9, %ebx
	jmp	.L53
.L41:
	leaq	a(%rip), %rdi
	cltd
	idivl	(%rdi,%r12,4)
	testl	%eax, %eax
	je	.L165
.L43:
	movl	(%r14), %r8d
	testl	%r8d, %r8d
	jne	.L44
	leal	-9(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L44:
	movl	4+C(%rip), %edi
	testl	%edi, %edi
	jne	.L45
	leal	-8(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L45:
	movl	8+C(%rip), %esi
	testl	%esi, %esi
	jne	.L46
	leal	-7(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L46:
	movl	12+C(%rip), %ecx
	testl	%ecx, %ecx
	jne	.L47
	leal	-6(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L47:
	movl	16+C(%rip), %edx
	testl	%edx, %edx
	jne	.L48
	leal	-5(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L48:
	movl	20+C(%rip), %eax
	testl	%eax, %eax
	jne	.L49
	leal	-4(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L49:
	movl	24+C(%rip), %eax
	testl	%eax, %eax
	jne	.L50
	leal	-3(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L50:
	movl	28+C(%rip), %eax
	testl	%eax, %eax
	jne	.L51
	leal	-2(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L51:
	movl	32+C(%rip), %eax
	testl	%eax, %eax
	jne	.L52
	leal	-1(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L52:
	movl	36+C(%rip), %eax
	testl	%eax, %eax
	jne	.L40
	movl	%ebx, %esi
	movl	%r13d, %edi
	call	func
.L40:
	addq	$1, %rbp
	addl	$10, %ebx
	cmpq	$10, %rbp
	je	.L166
.L53:
	movl	(%r14,%rbp,4), %eax
	orl	ans(%rip), %eax
	jne	.L40
	cmpl	$5, 132(%rsp)
	movl	N(%rip), %eax
	jne	.L41
	cmpl	%ebp, %eax
	jg	.L40
	movl	%ebp, ans(%rip)
	jmp	.L40
.L163:
	movl	68(%rsp), %edi
	movl	$8, %esi
	call	func
	jmp	.L70
.L162:
	movl	68(%rsp), %edi
	movl	$7, %esi
	call	func
	jmp	.L69
.L161:
	movl	68(%rsp), %edi
	movl	$6, %esi
	call	func
	jmp	.L68
.L160:
	movl	68(%rsp), %edi
	movl	$5, %esi
	call	func
	jmp	.L67
.L159:
	movl	68(%rsp), %edi
	movl	$4, %esi
	call	func
	jmp	.L66
.L158:
	movl	68(%rsp), %edi
	movl	$3, %esi
	call	func
	jmp	.L65
.L157:
	movl	68(%rsp), %edi
	movl	$2, %esi
	call	func
	jmp	.L64
.L156:
	movl	68(%rsp), %edi
	movl	$1, %esi
	call	func
	jmp	.L63
.L155:
	movl	68(%rsp), %edi
	xorl	%esi, %esi
	call	func
	jmp	.L62
.L6:
	leal	1(%rbx), %edx
	leal	4(%rbx), %edi
	movl	%edx, 176(%rsp)
	leaq	40+C(%rip), %r11
	movl	%edi, 68(%rsp)
	cmpl	$4, %ebx
	je	.L8
	movl	%ecx, %eax
	movslq	%edx, %rdi
	leaq	a(%rip), %rsi
	cltd
	idivl	(%rsi,%rdi,4)
	testl	%eax, %eax
	je	.L167
.L9:
	movl	128(%rsp), %eax
	movl	%r14d, 36(%rsp)
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	leal	4(%rax), %ebp
	leaq	C(%rip), %rax
	leaq	40(%rax), %r11
	movq	%rax, 96(%rsp)
	movslq	144(%rsp), %rax
	movl	%ebp, 68(%rsp)
	movq	%rax, 16(%rsp)
	movslq	132(%rsp), %rax
	movq	%r11, 8(%rsp)
	movq	%rax, 24(%rsp)
.L30:
	movq	96(%rsp), %rax
	movl	(%rax,%r13,4), %eax
	orl	ans(%rip), %eax
	jne	.L11
	cmpl	$5, 144(%rsp)
	movl	N(%rip), %eax
	je	.L168
	movq	16(%rsp), %rsi
	leaq	a(%rip), %rdi
	cltd
	idivl	(%rdi,%rsi,4)
	testl	%eax, %eax
	je	.L169
.L14:
	leal	(%r15,%r15,4), %ebx
	leaq	C(%rip), %r14
	movl	%r15d, %r12d
	addl	%ebx, %ebx
	jmp	.L29
.L17:
	movq	24(%rsp), %rsi
	leaq	a(%rip), %rdi
	cltd
	idivl	(%rdi,%rsi,4)
	testl	%eax, %eax
	je	.L170
.L19:
	movq	96(%rsp), %rax
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	jne	.L20
	movl	%ebx, %esi
	movl	%ebp, %edi
	call	func
.L20:
	movl	4+C(%rip), %edx
	testl	%edx, %edx
	jne	.L21
	leal	1(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L21:
	movl	8+C(%rip), %eax
	testl	%eax, %eax
	jne	.L22
	leal	2(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L22:
	movl	12+C(%rip), %eax
	testl	%eax, %eax
	jne	.L23
	leal	3(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L23:
	movl	16+C(%rip), %eax
	testl	%eax, %eax
	jne	.L24
	leal	4(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L24:
	movl	20+C(%rip), %eax
	testl	%eax, %eax
	jne	.L25
	leal	5(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L25:
	movl	24+C(%rip), %eax
	testl	%eax, %eax
	jne	.L26
	leal	6(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L26:
	movl	28+C(%rip), %r11d
	testl	%r11d, %r11d
	jne	.L27
	leal	7(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L27:
	movl	32+C(%rip), %r10d
	testl	%r10d, %r10d
	jne	.L28
	leal	8(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L28:
	movl	36+C(%rip), %r9d
	testl	%r9d, %r9d
	jne	.L16
	leal	9(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L16:
	addq	$4, %r14
	addl	$1, %r12d
	addl	$10, %ebx
	cmpq	%r14, 8(%rsp)
	je	.L11
.L29:
	movl	(%r14), %eax
	orl	ans(%rip), %eax
	jne	.L16
	cmpl	$5, 132(%rsp)
	movl	N(%rip), %eax
	jne	.L17
	cmpl	%eax, %r12d
	jl	.L16
	movl	%r12d, ans(%rip)
	jmp	.L16
.L166:
	movq	%r15, %r11
	jmp	.L37
.L165:
	xorl	%esi, %esi
	movl	%r13d, %edi
	call	func
	jmp	.L43
.L154:
	movl	68(%rsp), %edi
	xorl	%esi, %esi
	call	func
	jmp	.L61
.L168:
	cmpl	%r13d, %eax
	jg	.L11
	movl	%r13d, ans(%rip)
.L11:
	addq	$1, %r13
	addl	$10, %r15d
	cmpq	$10, %r13
	jne	.L30
	movl	36(%rsp), %r14d
	movq	8(%rsp), %r11
	jmp	.L8
.L170:
	xorl	%esi, %esi
	movl	%ebp, %edi
	call	func
	jmp	.L19
.L167:
	movl	144(%rsp), %edi
	xorl	%esi, %esi
	call	func
	jmp	.L9
.L169:
	movl	132(%rsp), %edi
	xorl	%esi, %esi
	call	func
	jmp	.L14
.L164:
	movl	132(%rsp), %edi
	xorl	%esi, %esi
	movq	%r11, 16(%rsp)
	call	func
	movq	16(%rsp), %r11
	jmp	.L38
	.cfi_endproc
.LFE23:
	.size	func, .-func
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	K(%rip), %rdx
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	movl	K(%rip), %eax
	testl	%eax, %eax
	jle	.L172
	xorl	%ebx, %ebx
	leaq	D(%rip), %r13
	leaq	.LC1(%rip), %r12
	leaq	C(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L173:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	D(%rip), %rax
	addl	$1, 0(%rbp,%rax,4)
	cmpl	%ebx, K(%rip)
	jg	.L173
.L172:
	xorl	%esi, %esi
	xorl	%edi, %edi
	call	func
	movl	ans(%rip), %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	ans
	.bss
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	a
	.data
	.align 16
	.type	a, @object
	.size	a, 20
a:
	.long	10000
	.long	1000
	.long	100
	.long	10
	.long	1
	.globl	D
	.bss
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.zero	4
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 40
C:
	.zero	40
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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	func
	.type	func, @function
func:
.LFB23:
	.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	$232, %rsp
	.cfi_def_cfa_offset 288
	movl	ans(%rip), %r8d
	movl	%edi, 128(%rsp)
	testl	%r8d, %r8d
	jne	.L1
	movl	N(%rip), %ecx
	movl	%esi, %r14d
	cmpl	$4, %edi
	jg	.L138
	movslq	%edi, %rbx
	leaq	a(%rip), %rdi
	leal	2(%rbx), %eax
	movl	%eax, 144(%rsp)
	leal	3(%rbx), %eax
	movl	%eax, 132(%rsp)
	movl	%ecx, %eax
	cltd
	idivl	(%rdi,%rbx,4)
	testl	%eax, %eax
	je	.L6
	leal	1(%rbx), %eax
	leaq	40+C(%rip), %r11
	movl	%eax, 176(%rsp)
	leal	4(%rbx), %eax
	movl	%eax, 68(%rsp)
.L8:
	leal	(%r14,%r14,4), %eax
	addl	%eax, %eax
	movl	%eax, 184(%rsp)
	movl	128(%rsp), %eax
	leal	5(%rax), %edx
	leal	6(%rax), %edi
	movl	%edx, 84(%rsp)
	imull	$100, %r14d, %edx
	leal	7(%rax), %esi
	addl	$8, %eax
	movl	%edi, 44(%rsp)
	leaq	C(%rip), %rdi
	movl	%eax, 148(%rsp)
	cltq
	movl	%esi, 8(%rsp)
	movl	%edx, 180(%rsp)
	movq	%rdi, 96(%rsp)
	movq	%rdi, 168(%rsp)
	movq	%rax, 112(%rsp)
.L7:
	movq	168(%rsp), %rax
	movl	(%rax), %eax
	orl	ans(%rip), %eax
	jne	.L32
	cmpl	$5, 176(%rsp)
	movl	N(%rip), %ecx
	je	.L139
	movl	%ecx, %eax
	movslq	176(%rsp), %rsi
	leaq	a(%rip), %rdi
	cltd
	idivl	(%rdi,%rsi,4)
	testl	%eax, %eax
	je	.L35
.L37:
	movl	180(%rsp), %edx
	movq	%r11, 152(%rsp)
	leal	(%rdx,%rdx,4), %eax
	movl	%edx, 164(%rsp)
	addl	%eax, %eax
	movl	%eax, 160(%rsp)
	leaq	C(%rip), %rax
	movq	%rax, 104(%rsp)
.L36:
	movq	104(%rsp), %rax
	movl	(%rax), %eax
	orl	ans(%rip), %eax
	jne	.L55
	cmpl	$5, 144(%rsp)
	movl	N(%rip), %ecx
	je	.L140
	movl	%ecx, %eax
	movslq	144(%rsp), %rdi
	leaq	a(%rip), %rsi
	cltd
	idivl	(%rsi,%rdi,4)
	testl	%eax, %eax
	je	.L141
.L59:
	movl	160(%rsp), %edi
	movq	152(%rsp), %r11
	leal	(%rdi,%rdi,4), %eax
	movl	%edi, 140(%rsp)
	addl	%eax, %eax
	movl	%eax, 136(%rsp)
	leaq	C(%rip), %rax
	movq	%rax, 48(%rsp)
.L115:
	movq	48(%rsp), %rax
	movl	(%rax), %eax
	orl	ans(%rip), %eax
	jne	.L72
	cmpl	$5, 132(%rsp)
	movl	N(%rip), %eax
	je	.L142
	movslq	132(%rsp), %rdi
	leaq	a(%rip), %rsi
	cltd
	idivl	(%rsi,%rdi,4)
	testl	%eax, %eax
	je	.L143
.L75:
	movl	136(%rsp), %edx
	leal	(%rdx,%rdx,4), %eax
	movl	%edx, 92(%rsp)
	addl	%eax, %eax
	movl	%eax, 88(%rsp)
	leaq	C(%rip), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L114:
	movq	16(%rsp), %rax
	movl	(%rax), %eax
	orl	ans(%rip), %eax
	jne	.L77
	cmpl	$5, 68(%rsp)
	movl	N(%rip), %eax
	je	.L144
	movslq	68(%rsp), %rsi
	leaq	a(%rip), %rdi
	cltd
	idivl	(%rdi,%rsi,4)
	testl	%eax, %eax
	je	.L145
.L80:
	movl	88(%rsp), %esi
	leaq	C(%rip), %r10
	movq	%r11, %r13
	leal	(%rsi,%rsi,4), %eax
	movl	%esi, 40(%rsp)
	addl	%eax, %eax
	movl	%eax, 36(%rsp)
	.p2align 4,,10
	.p2align 3
.L113:
	movl	(%r10), %eax
	orl	ans(%rip), %eax
	jne	.L82
	cmpl	$5, 84(%rsp)
	movl	N(%rip), %eax
	je	.L146
	movslq	84(%rsp), %rdi
	leaq	a(%rip), %rsi
	cltd
	idivl	(%rsi,%rdi,4)
	testl	%eax, %eax
	je	.L147
.L85:
	movslq	44(%rsp), %rax
	movl	36(%rsp), %r11d
	movq	%r10, 120(%rsp)
	leaq	C(%rip), %r8
	movl	148(%rsp), %r10d
	movq	%rax, 72(%rsp)
	leal	(%r11,%r11,4), %r9d
	addl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L112:
	movl	(%r8), %eax
	orl	ans(%rip), %eax
	jne	.L87
	cmpl	$5, 44(%rsp)
	movl	N(%rip), %eax
	je	.L148
	movq	72(%rsp), %rdi
	leaq	a(%rip), %rsi
	cltd
	idivl	(%rsi,%rdi,4)
	testl	%eax, %eax
	je	.L149
.L90:
	movslq	8(%rsp), %rax
	leal	(%r9,%r9,4), %r12d
	movl	%r9d, 64(%rsp)
	leaq	C(%rip), %rbx
	movq	%r8, 56(%rsp)
	movq	96(%rsp), %r8
	addl	%r12d, %r12d
	movq	%rax, 24(%rsp)
	movl	128(%rsp), %eax
	addl	$9, %eax
	movl	%eax, 80(%rsp)
	movq	%r13, %rax
	movl	%r9d, %r13d
	movq	112(%rsp), %r9
	movq	%rax, %rcx
	.p2align 4,,10
	.p2align 3
.L111:
	movl	(%rbx), %eax
	orl	ans(%rip), %eax
	jne	.L92
	cmpl	$5, 8(%rsp)
	movl	N(%rip), %eax
	je	.L150
	movq	24(%rsp), %rdi
	leaq	a(%rip), %rsi
	cltd
	idivl	(%rsi,%rdi,4)
	testl	%eax, %eax
	je	.L151
.L95:
	leal	(%r12,%r12,4), %r15d
	movl	%r12d, %r14d
	leaq	C(%rip), %rbp
	addl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L110:
	movl	0(%rbp), %eax
	orl	ans(%rip), %eax
	jne	.L97
	movl	N(%rip), %eax
	cmpl	$5, %r10d
	je	.L152
	leaq	a(%rip), %rdi
	cltd
	idivl	(%rdi,%r9,4)
	testl	%eax, %eax
	je	.L153
.L100:
	movl	(%r8), %edx
	testl	%edx, %edx
	jne	.L101
	movl	80(%rsp), %edi
	movl	%r15d, %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L101:
	movl	4+C(%rip), %eax
	testl	%eax, %eax
	jne	.L102
	movl	80(%rsp), %edi
	leal	1(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L102:
	movl	8+C(%rip), %eax
	testl	%eax, %eax
	jne	.L103
	movl	80(%rsp), %edi
	leal	2(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L103:
	movl	12+C(%rip), %eax
	testl	%eax, %eax
	jne	.L104
	movl	80(%rsp), %edi
	leal	3(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L104:
	movl	16+C(%rip), %eax
	testl	%eax, %eax
	jne	.L105
	movl	80(%rsp), %edi
	leal	4(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L105:
	movl	20+C(%rip), %eax
	testl	%eax, %eax
	jne	.L106
	movl	80(%rsp), %edi
	leal	5(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L106:
	movl	24+C(%rip), %edi
	testl	%edi, %edi
	jne	.L107
	movl	80(%rsp), %edi
	leal	6(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L107:
	movl	28+C(%rip), %esi
	testl	%esi, %esi
	jne	.L108
	movl	80(%rsp), %edi
	leal	7(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L108:
	movl	32+C(%rip), %edx
	testl	%edx, %edx
	jne	.L109
	movl	80(%rsp), %edi
	leal	8(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L109:
	movl	36+C(%rip), %eax
	testl	%eax, %eax
	jne	.L97
	movl	80(%rsp), %edi
	leal	9(%r15), %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	.p2align 4,,10
	.p2align 3
.L97:
	addq	$4, %rbp
	addl	$1, %r14d
	addl	$10, %r15d
	cmpq	%rbp, %rcx
	jne	.L110
.L92:
	addq	$4, %rbx
	addl	$1, %r13d
	addl	$10, %r12d
	cmpq	%rbx, %rcx
	jne	.L111
	movl	64(%rsp), %r9d
	movq	56(%rsp), %r8
	movq	%rcx, %r13
.L87:
	addq	$4, %r8
	addl	$1, %r11d
	addl	$10, %r9d
	cmpq	%r8, %r13
	jne	.L112
	movq	120(%rsp), %r10
.L82:
	addq	$4, %r10
	addl	$1, 40(%rsp)
	addl	$10, 36(%rsp)
	cmpq	%r10, %r13
	jne	.L113
	movq	%r13, %r11
.L77:
	addq	$4, 16(%rsp)
	movq	16(%rsp), %rax
	addl	$1, 92(%rsp)
	addl	$10, 88(%rsp)
	cmpq	%rax, %r11
	jne	.L114
.L72:
	addq	$4, 48(%rsp)
	movq	48(%rsp), %rax
	addl	$1, 140(%rsp)
	addl	$10, 136(%rsp)
	cmpq	%rax, %r11
	jne	.L115
.L55:
	addq	$4, 104(%rsp)
	movq	104(%rsp), %rax
	addl	$1, 164(%rsp)
	addl	$10, 160(%rsp)
	cmpq	%rax, 152(%rsp)
	jne	.L36
	movq	152(%rsp), %r11
.L32:
	addq	$4, 168(%rsp)
	movq	168(%rsp), %rax
	addl	$1, 184(%rsp)
	addl	$10, 180(%rsp)
	cmpq	%rax, %r11
	jne	.L7
.L1:
	addq	$232, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L138:
	.cfi_restore_state
	cmpl	%ecx, %esi
	jl	.L1
	movl	%esi, ans(%rip)
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L152:
	cmpl	%eax, %r14d
	jl	.L97
	movl	%r14d, ans(%rip)
	jmp	.L97
	.p2align 4,,10
	.p2align 3
.L150:
	cmpl	%eax, %r13d
	jl	.L92
	movl	%r13d, ans(%rip)
	jmp	.L92
.L148:
	cmpl	%eax, %r11d
	jl	.L87
	movl	%r11d, ans(%rip)
	jmp	.L87
.L146:
	movl	40(%rsp), %edx
	cmpl	%eax, %edx
	jl	.L82
	movl	%edx, ans(%rip)
	jmp	.L82
.L144:
	movl	92(%rsp), %edi
	cmpl	%eax, %edi
	jl	.L77
	movl	%edi, ans(%rip)
	jmp	.L77
.L142:
	movl	140(%rsp), %esi
	cmpl	%eax, %esi
	jl	.L72
	movl	%esi, ans(%rip)
	jmp	.L72
.L149:
	movl	8(%rsp), %edi
	xorl	%esi, %esi
	movl	%r10d, 80(%rsp)
	movq	%r8, 56(%rsp)
	movl	%r11d, 64(%rsp)
	movl	%r9d, 24(%rsp)
	call	func
	movl	80(%rsp), %r10d
	movq	56(%rsp), %r8
	movl	64(%rsp), %r11d
	movl	24(%rsp), %r9d
	jmp	.L90
.L147:
	movl	44(%rsp), %edi
	xorl	%esi, %esi
	movq	%r10, 24(%rsp)
	call	func
	movq	24(%rsp), %r10
	jmp	.L85
.L145:
	movl	84(%rsp), %edi
	xorl	%esi, %esi
	movq	%r11, 24(%rsp)
	call	func
	movq	24(%rsp), %r11
	jmp	.L80
.L143:
	movl	68(%rsp), %edi
	xorl	%esi, %esi
	movq	%r11, 16(%rsp)
	call	func
	movq	16(%rsp), %r11
	jmp	.L75
.L140:
	movl	164(%rsp), %eax
	cmpl	%ecx, %eax
	jl	.L55
	movl	%eax, ans(%rip)
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L153:
	movl	80(%rsp), %edi
	xorl	%esi, %esi
	movq	%r9, 216(%rsp)
	movl	%r10d, 208(%rsp)
	movq	%rcx, 200(%rsp)
	movq	%r8, 192(%rsp)
	movl	%r11d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movl	208(%rsp), %r10d
	movq	200(%rsp), %rcx
	movq	192(%rsp), %r8
	movl	188(%rsp), %r11d
	jmp	.L100
	.p2align 4,,10
	.p2align 3
.L151:
	movl	%r10d, %edi
	xorl	%esi, %esi
	movq	%r9, 216(%rsp)
	movq	%rcx, 208(%rsp)
	movq	%r8, 200(%rsp)
	movl	%r11d, 192(%rsp)
	movl	%r10d, 188(%rsp)
	call	func
	movq	216(%rsp), %r9
	movq	208(%rsp), %rcx
	movq	200(%rsp), %r8
	movl	192(%rsp), %r11d
	movl	188(%rsp), %r10d
	jmp	.L95
.L141:
	movl	132(%rsp), %eax
	cmpl	$5, %eax
	je	.L59
	movslq	%eax, %rsi
	movl	%ecx, %eax
	leaq	a(%rip), %rdi
	cltd
	idivl	(%rdi,%rsi,4)
	testl	%eax, %eax
	je	.L154
.L61:
	movq	96(%rsp), %rax
	movl	(%rax), %r12d
	testl	%r12d, %r12d
	je	.L155
.L62:
	movl	4+C(%rip), %ebp
	testl	%ebp, %ebp
	je	.L156
.L63:
	movl	8+C(%rip), %ebx
	testl	%ebx, %ebx
	je	.L157
.L64:
	movl	12+C(%rip), %r11d
	testl	%r11d, %r11d
	je	.L158
.L65:
	movl	16+C(%rip), %r10d
	testl	%r10d, %r10d
	je	.L159
.L66:
	movl	20+C(%rip), %r9d
	testl	%r9d, %r9d
	je	.L160
.L67:
	movl	24+C(%rip), %r8d
	testl	%r8d, %r8d
	je	.L161
.L68:
	movl	28+C(%rip), %edi
	testl	%edi, %edi
	je	.L162
.L69:
	movl	32+C(%rip), %esi
	testl	%esi, %esi
	je	.L163
.L70:
	movl	36+C(%rip), %ecx
	testl	%ecx, %ecx
	jne	.L59
	movl	68(%rsp), %edi
	movl	$9, %esi
	call	func
	jmp	.L59
.L139:
	movl	184(%rsp), %eax
	cmpl	%ecx, %eax
	jl	.L32
	movl	%eax, ans(%rip)
	jmp	.L32
.L35:
	movl	144(%rsp), %eax
	cmpl	$5, %eax
	je	.L37
	movslq	%eax, %rdi
	movl	%ecx, %eax
	leaq	a(%rip), %rsi
	cltd
	idivl	(%rsi,%rdi,4)
	testl	%eax, %eax
	je	.L164
.L38:
	movq	96(%rsp), %r14
	movl	68(%rsp), %r13d
	xorl	%ebp, %ebp
	movq	%r11, %r15
	movslq	132(%rsp), %r12
	movl	$9, %ebx
	jmp	.L53
.L41:
	leaq	a(%rip), %rdi
	cltd
	idivl	(%rdi,%r12,4)
	testl	%eax, %eax
	je	.L165
.L43:
	movl	(%r14), %r8d
	testl	%r8d, %r8d
	jne	.L44
	leal	-9(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L44:
	movl	4+C(%rip), %edi
	testl	%edi, %edi
	jne	.L45
	leal	-8(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L45:
	movl	8+C(%rip), %esi
	testl	%esi, %esi
	jne	.L46
	leal	-7(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L46:
	movl	12+C(%rip), %ecx
	testl	%ecx, %ecx
	jne	.L47
	leal	-6(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L47:
	movl	16+C(%rip), %edx
	testl	%edx, %edx
	jne	.L48
	leal	-5(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L48:
	movl	20+C(%rip), %eax
	testl	%eax, %eax
	jne	.L49
	leal	-4(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L49:
	movl	24+C(%rip), %eax
	testl	%eax, %eax
	jne	.L50
	leal	-3(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L50:
	movl	28+C(%rip), %eax
	testl	%eax, %eax
	jne	.L51
	leal	-2(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L51:
	movl	32+C(%rip), %eax
	testl	%eax, %eax
	jne	.L52
	leal	-1(%rbx), %esi
	movl	%r13d, %edi
	call	func
.L52:
	movl	36+C(%rip), %eax
	testl	%eax, %eax
	jne	.L40
	movl	%ebx, %esi
	movl	%r13d, %edi
	call	func
.L40:
	addq	$1, %rbp
	addl	$10, %ebx
	cmpq	$10, %rbp
	je	.L166
.L53:
	movl	(%r14,%rbp,4), %eax
	orl	ans(%rip), %eax
	jne	.L40
	cmpl	$5, 132(%rsp)
	movl	N(%rip), %eax
	jne	.L41
	cmpl	%ebp, %eax
	jg	.L40
	movl	%ebp, ans(%rip)
	jmp	.L40
.L163:
	movl	68(%rsp), %edi
	movl	$8, %esi
	call	func
	jmp	.L70
.L162:
	movl	68(%rsp), %edi
	movl	$7, %esi
	call	func
	jmp	.L69
.L161:
	movl	68(%rsp), %edi
	movl	$6, %esi
	call	func
	jmp	.L68
.L160:
	movl	68(%rsp), %edi
	movl	$5, %esi
	call	func
	jmp	.L67
.L159:
	movl	68(%rsp), %edi
	movl	$4, %esi
	call	func
	jmp	.L66
.L158:
	movl	68(%rsp), %edi
	movl	$3, %esi
	call	func
	jmp	.L65
.L157:
	movl	68(%rsp), %edi
	movl	$2, %esi
	call	func
	jmp	.L64
.L156:
	movl	68(%rsp), %edi
	movl	$1, %esi
	call	func
	jmp	.L63
.L155:
	movl	68(%rsp), %edi
	xorl	%esi, %esi
	call	func
	jmp	.L62
.L6:
	leal	1(%rbx), %edx
	leal	4(%rbx), %edi
	movl	%edx, 176(%rsp)
	leaq	40+C(%rip), %r11
	movl	%edi, 68(%rsp)
	cmpl	$4, %ebx
	je	.L8
	movl	%ecx, %eax
	movslq	%edx, %rdi
	leaq	a(%rip), %rsi
	cltd
	idivl	(%rsi,%rdi,4)
	testl	%eax, %eax
	je	.L167
.L9:
	movl	128(%rsp), %eax
	movl	%r14d, 36(%rsp)
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	leal	4(%rax), %ebp
	leaq	C(%rip), %rax
	leaq	40(%rax), %r11
	movq	%rax, 96(%rsp)
	movslq	144(%rsp), %rax
	movl	%ebp, 68(%rsp)
	movq	%rax, 16(%rsp)
	movslq	132(%rsp), %rax
	movq	%r11, 8(%rsp)
	movq	%rax, 24(%rsp)
.L30:
	movq	96(%rsp), %rax
	movl	(%rax,%r13,4), %eax
	orl	ans(%rip), %eax
	jne	.L11
	cmpl	$5, 144(%rsp)
	movl	N(%rip), %eax
	je	.L168
	movq	16(%rsp), %rsi
	leaq	a(%rip), %rdi
	cltd
	idivl	(%rdi,%rsi,4)
	testl	%eax, %eax
	je	.L169
.L14:
	leal	(%r15,%r15,4), %ebx
	leaq	C(%rip), %r14
	movl	%r15d, %r12d
	addl	%ebx, %ebx
	jmp	.L29
.L17:
	movq	24(%rsp), %rsi
	leaq	a(%rip), %rdi
	cltd
	idivl	(%rdi,%rsi,4)
	testl	%eax, %eax
	je	.L170
.L19:
	movq	96(%rsp), %rax
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	jne	.L20
	movl	%ebx, %esi
	movl	%ebp, %edi
	call	func
.L20:
	movl	4+C(%rip), %edx
	testl	%edx, %edx
	jne	.L21
	leal	1(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L21:
	movl	8+C(%rip), %eax
	testl	%eax, %eax
	jne	.L22
	leal	2(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L22:
	movl	12+C(%rip), %eax
	testl	%eax, %eax
	jne	.L23
	leal	3(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L23:
	movl	16+C(%rip), %eax
	testl	%eax, %eax
	jne	.L24
	leal	4(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L24:
	movl	20+C(%rip), %eax
	testl	%eax, %eax
	jne	.L25
	leal	5(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L25:
	movl	24+C(%rip), %eax
	testl	%eax, %eax
	jne	.L26
	leal	6(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L26:
	movl	28+C(%rip), %r11d
	testl	%r11d, %r11d
	jne	.L27
	leal	7(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L27:
	movl	32+C(%rip), %r10d
	testl	%r10d, %r10d
	jne	.L28
	leal	8(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L28:
	movl	36+C(%rip), %r9d
	testl	%r9d, %r9d
	jne	.L16
	leal	9(%rbx), %esi
	movl	%ebp, %edi
	call	func
.L16:
	addq	$4, %r14
	addl	$1, %r12d
	addl	$10, %ebx
	cmpq	%r14, 8(%rsp)
	je	.L11
.L29:
	movl	(%r14), %eax
	orl	ans(%rip), %eax
	jne	.L16
	cmpl	$5, 132(%rsp)
	movl	N(%rip), %eax
	jne	.L17
	cmpl	%eax, %r12d
	jl	.L16
	movl	%r12d, ans(%rip)
	jmp	.L16
.L166:
	movq	%r15, %r11
	jmp	.L37
.L165:
	xorl	%esi, %esi
	movl	%r13d, %edi
	call	func
	jmp	.L43
.L154:
	movl	68(%rsp), %edi
	xorl	%esi, %esi
	call	func
	jmp	.L61
.L168:
	cmpl	%r13d, %eax
	jg	.L11
	movl	%r13d, ans(%rip)
.L11:
	addq	$1, %r13
	addl	$10, %r15d
	cmpq	$10, %r13
	jne	.L30
	movl	36(%rsp), %r14d
	movq	8(%rsp), %r11
	jmp	.L8
.L170:
	xorl	%esi, %esi
	movl	%ebp, %edi
	call	func
	jmp	.L19
.L167:
	movl	144(%rsp), %edi
	xorl	%esi, %esi
	call	func
	jmp	.L9
.L169:
	movl	132(%rsp), %edi
	xorl	%esi, %esi
	call	func
	jmp	.L14
.L164:
	movl	132(%rsp), %edi
	xorl	%esi, %esi
	movq	%r11, 16(%rsp)
	call	func
	movq	16(%rsp), %r11
	jmp	.L38
	.cfi_endproc
.LFE23:
	.size	func, .-func
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	K(%rip), %rdx
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	movl	K(%rip), %eax
	testl	%eax, %eax
	jle	.L172
	xorl	%ebx, %ebx
	leaq	D(%rip), %r13
	leaq	.LC1(%rip), %r12
	leaq	C(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L173:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	D(%rip), %rax
	addl	$1, 0(%rbp,%rax,4)
	cmpl	%ebx, K(%rip)
	jg	.L173
.L172:
	xorl	%esi, %esi
	xorl	%edi, %edi
	call	func
	movl	ans(%rip), %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	ans
	.bss
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	a
	.data
	.align 16
	.type	a, @object
	.size	a, 20
a:
	.long	10000
	.long	1000
	.long	100
	.long	10
	.long	1
	.globl	D
	.bss
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.zero	4
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 40
C:
	.zero	40
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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>

int N, K;
int C[10], D;
int a[] = {10000, 1000, 100, 10, 1};
int ans;

void func(int L, int num)
{
	int i;

	if (ans != 0) return;
	if (L >= 5)
	{
		if (num >= N) ans = num;
		return;
	}

	if (N / a[L] == 0) func(L + 1, 0);
	for (i = 0; i < 10; ++i)
	{
		if (C[i]) continue;
		func(L + 1, num * 10 + i);
	}
}

int main(void)
{
	int i;

	scanf("%d %d", &N, &K);
	for (i = 0; i < K; ++i)
	{
		scanf("%d", &D);
		C[D]++;
	}

	func(0, 0);
	printf("%d\n", ans);

	return 0;
}
1000 8
1 3 4 5 6 7 8 9

2000

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>

int N, K;
int C[10], D;
int a[] = {10000, 1000, 100, 10, 1};
int ans;

void func(int L, int num)
{
	int i;

	if (ans != 0) return;
	if (L >= 5)
	{
		if (num >= N) ans = num;
		return;
	}

	if (N / a[L] == 0) func(L + 1, 0);
	for (i = 0; i < 10; ++i)
	{
		if (C[i]) continue;
		func(L + 1, num * 10 + i);
	}
}

int main(void)
{
	int i;

	scanf("%d %d", &N, &K);
	for (i = 0; i < K; ++i)
	{
		scanf("%d", &D);
		C[D]++;
	}

	func(0, 0);
	printf("%d\n", ans);

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 40
C:
	.zero	40
	.globl	D
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.zero	4
	.globl	a
	.data
	.align 16
	.type	a, @object
	.size	a, 20
a:
	.long	10000
	.long	1000
	.long	100
	.long	10
	.long	1
	.globl	ans
	.bss
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.text
	.globl	func
	.type	func, @function
func:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	ans(%rip), %eax
	testl	%eax, %eax
	jne	.L11
	cmpl	$4, -20(%rbp)
	jle	.L4
	movl	N(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L12
	movl	-24(%rbp), %eax
	movl	%eax, ans(%rip)
	jmp	.L12
.L4:
	movl	N(%rip), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	cltd
	idivl	%ecx
	testl	%eax, %eax
	jne	.L6
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	func
.L6:
	movl	$0, -4(%rbp)
	jmp	.L7
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-24(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	func
	jmp	.L9
.L13:
	nop
.L9:
	addl	$1, -4(%rbp)
.L7:
	cmpl	$9, -4(%rbp)
	jle	.L10
	jmp	.L1
.L11:
	nop
	jmp	.L1
.L12:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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
	leaq	K(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4(%rbp)
	jmp	.L15
.L16:
	leaq	D(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	D(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	C(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L15:
	movl	K(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L16
	movl	$0, %esi
	movl	$0, %edi
	call	func
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 40
C:
	.zero	40
	.globl	D
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.zero	4
	.globl	a
	.data
	.align 16
	.type	a, @object
	.size	a, 20
a:
	.long	10000
	.long	1000
	.long	100
	.long	10
	.long	1
	.globl	ans
	.bss
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.text
	.globl	func
	.type	func, @function
func:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	ans(%rip), %eax
	testl	%eax, %eax
	jne	.L11
	cmpl	$4, -20(%rbp)
	jle	.L4
	movl	N(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L12
	movl	-24(%rbp), %eax
	movl	%eax, ans(%rip)
	jmp	.L12
.L4:
	movl	N(%rip), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	cltd
	idivl	%ecx
	testl	%eax, %eax
	jne	.L6
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	func
.L6:
	movl	$0, -4(%rbp)
	jmp	.L7
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-24(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	func
	jmp	.L9
.L13:
	nop
.L9:
	addl	$1, -4(%rbp)
.L7:
	cmpl	$9, -4(%rbp)
	jle	.L10
	jmp	.L1
.L11:
	nop
	jmp	.L1
.L12:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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
	leaq	K(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4(%rbp)
	jmp	.L15
.L16:
	leaq	D(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	D(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	C(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L15:
	movl	K(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L16
	movl	$0, %esi
	movl	$0, %edi
	call	func
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
