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,i,j,p,num[5040],c[4],card[10],ans;
void set(int x){
    int i,j;
    if (x==k) {
        for (i=0; i<k; i++) {
            num[p]=num[p]*10;
            if (card[c[i]]>=10) {
                num[p]=num[p]*10;
            }
            num[p]+=card[c[i]];
        }
        p++;
        return;
    }
    for (i=0; i<n; i++) {
        int flag=1;
        for (j=0; j<x; j++) {
            if (c[j]==i) {
                flag=0;
                break;
            }
        }
        if (flag) {
            c[x]=i;
            set(x+1);
        }
    }
    return;
}
int main(){
    while (1) {
        scanf("%d%d",&n,&k);
        if (n==0&&k==0) {
            return 0;
        }
        for (i=0; i<n; i++) {
            scanf("%d",&card[i]);
        }
        for (i=0; i<5040; i++) {
            num[i]=0;
        }
        p=0;
        set(0);
        ans=0;
        k=p;
        while (k>0) {
            for (i=0; i<p; i++) {
                if (num[i]!=-1) {
                    ans++;
                    k--;
                    for (j=i+1; j<p; j++) {
                        if (num[i]==num[j]) {
                            k--;
                            num[j]=-1;
                        }
                    }
                }
            }
        }
        printf("%d\n",ans);
    }
}```

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	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	num
	.align 32
	.type	num, @object
	.size	num, 20160
num:
	.zero	20160
	.globl	c
	.align 16
	.type	c, @object
	.size	c, 16
c:
	.zero	16
	.globl	card
	.align 32
	.type	card, @object
	.size	card, 40
card:
	.zero	40
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.text
	.globl	set
	.type	set, @function
set:
.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	k(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L2
	movl	$0, -12(%rbp)
	jmp	.L3
.L5:
	movl	p(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	p(%rip), %ecx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %esi
	movslq	%ecx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	%esi, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	card(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$9, %eax
	jle	.L4
	movl	p(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	p(%rip), %ecx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %esi
	movslq	%ecx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	%esi, (%rdx,%rax)
.L4:
	movl	p(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	card(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	p(%rip), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L3:
	movl	k(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L5
	movl	p(%rip), %eax
	addl	$1, %eax
	movl	%eax, p(%rip)
	jmp	.L1
.L2:
	movl	$0, -12(%rbp)
	jmp	.L7
.L13:
	movl	$1, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L8
.L11:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L9
	movl	$0, -4(%rbp)
	jmp	.L10
.L9:
	addl	$1, -8(%rbp)
.L8:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L11
.L10:
	cmpl	$0, -4(%rbp)
	je	.L12
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	c(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	set
.L12:
	addl	$1, -12(%rbp)
.L7:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	set, .-set
	.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
.L29:
	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	n(%rip), %eax
	testl	%eax, %eax
	jne	.L15
	movl	k(%rip), %eax
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	jmp	.L30
.L15:
	movl	$0, i(%rip)
	jmp	.L17
.L18:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	card(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L17:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L18
	movl	$0, i(%rip)
	jmp	.L19
.L20:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L19:
	movl	i(%rip), %eax
	cmpl	$5039, %eax
	jle	.L20
	movl	$0, p(%rip)
	movl	$0, %edi
	call	set
	movl	$0, ans(%rip)
	movl	p(%rip), %eax
	movl	%eax, k(%rip)
	jmp	.L21
.L28:
	movl	$0, i(%rip)
	jmp	.L22
.L27:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L23
	movl	ans(%rip), %eax
	addl	$1, %eax
	movl	%eax, ans(%rip)
	movl	k(%rip), %eax
	subl	$1, %eax
	movl	%eax, k(%rip)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
	jmp	.L24
.L26:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	j(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	num(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L25
	movl	k(%rip), %eax
	subl	$1, %eax
	movl	%eax, k(%rip)
	movl	j(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	$-1, (%rdx,%rax)
.L25:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L24:
	movl	j(%rip), %edx
	movl	p(%rip), %eax
	cmpl	%eax, %edx
	jl	.L26
.L23:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L22:
	movl	i(%rip), %edx
	movl	p(%rip), %eax
	cmpl	%eax, %edx
	jl	.L27
.L21:
	movl	k(%rip), %eax
	testl	%eax, %eax
	jg	.L28
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L29
.L30:
	popq	%rbp
	.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	set
	.type	set, @function
set:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	cmpl	%edi, k(%rip)
	je	.L2
	movl	n(%rip), %eax
	xorl	%ebx, %ebx
	leaq	c(%rip), %r12
	movslq	%edi, %r13
	testl	%eax, %eax
	jle	.L1
.L3:
	testl	%ebp, %ebp
	jle	.L17
	cmpl	(%r12), %ebx
	je	.L16
	cmpl	$1, %ebp
	je	.L17
	cmpl	4+c(%rip), %ebx
	je	.L16
	cmpl	$2, %ebp
	je	.L17
	cmpl	8+c(%rip), %ebx
	je	.L16
	cmpl	$3, %ebp
	je	.L17
	cmpl	%ebx, 12+c(%rip)
	je	.L16
.L17:
	leal	1(%rbp), %edi
	movl	%ebx, (%r12,%r13,4)
	call	set
	movl	n(%rip), %eax
.L16:
	addl	$1, %ebx
	cmpl	%eax, %ebx
	jl	.L3
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L2:
	.cfi_restore_state
	movl	p(%rip), %edx
	testl	%edi, %edi
	jle	.L5
	movslq	c(%rip), %r8
	leaq	card(%rip), %rcx
	leaq	num(%rip), %rsi
	movslq	%edx, %rdi
	movl	(%rsi,%rdi,4), %eax
	movl	(%rcx,%r8,4), %r8d
	cmpl	$9, %r8d
	jg	.L6
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
.L7:
	addl	%r8d, %eax
	cmpl	$1, %ebp
	je	.L8
	movslq	4+c(%rip), %r8
	movl	(%rcx,%r8,4), %r8d
	cmpl	$9, %r8d
	jg	.L9
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
.L10:
	addl	%r8d, %eax
	cmpl	$2, %ebp
	je	.L8
	movslq	8+c(%rip), %r8
	movl	(%rcx,%r8,4), %r8d
	cmpl	$9, %r8d
	jg	.L11
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
.L12:
	addl	%r8d, %eax
	cmpl	$3, %ebp
	je	.L8
	movslq	12+c(%rip), %r8
	movl	(%rcx,%r8,4), %ecx
	cmpl	$9, %ecx
	jle	.L13
	imull	$100, %eax, %eax
	addl	%ecx, %eax
.L8:
	movl	%eax, (%rsi,%rdi,4)
.L5:
	addl	$1, %edx
	movl	%edx, p(%rip)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L6:
	.cfi_restore_state
	imull	$100, %eax, %eax
	jmp	.L7
.L9:
	imull	$100, %eax, %eax
	jmp	.L10
.L11:
	imull	$100, %eax, %eax
	jmp	.L12
.L13:
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	addl	%ecx, %eax
	jmp	.L8
	.cfi_endproc
.LFE23:
	.size	set, .-set
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB3:
	.section	.text.startup,"ax",@progbits
.LHOTB3:
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	4+num(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
.L102:
	leaq	k(%rip), %rdx
	xorl	%eax, %eax
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	movl	k(%rip), %ebx
	movl	%eax, %edx
	orl	%ebx, %edx
	je	.L150
	movl	$0, i(%rip)
	testl	%eax, %eax
	jle	.L43
	xorl	%eax, %eax
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L44:
	cltq
	leaq	card(%rip), %rbx
	movq	%r12, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	movl	n(%rip), %ebx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%ebx, %eax
	jl	.L44
	movl	k(%rip), %r10d
	movl	$20160, %edx
	xorl	%esi, %esi
	leaq	num(%rip), %rdi
	movl	%r10d, 24(%rsp)
	call	memset@PLT
	movl	24(%rsp), %r10d
	movl	$5040, i(%rip)
	movl	$0, p(%rip)
	testl	%r10d, %r10d
	je	.L45
	testl	%ebx, %ebx
	jle	.L95
	leaq	card(%rip), %rax
	xorl	%edx, %edx
	movb	$0, 39(%rsp)
	xorl	%ecx, %ecx
	movq	%rax, 8(%rsp)
	movslq	%ebx, %rax
	xorl	%r9d, %r9d
	xorl	%r13d, %r13d
	movq	%rax, (%rsp)
	xorl	%r11d, %r11d
	movl	%r15d, 40(%rsp)
	movl	%edx, 24(%rsp)
	cmpl	$1, %r10d
	je	.L49
.L166:
	leaq	card(%rip), %rax
	xorl	%r12d, %r12d
	movq	%rax, 16(%rsp)
.L50:
	cmpl	%r11d, %r12d
	je	.L58
	xorl	%edi, %edi
	cmpl	$2, %r10d
	je	.L162
.L53:
	movl	%edi, 28(%rsp)
	movl	%edi, %r14d
	cmpl	%edi, %r12d
	je	.L66
	cmpl	%edi, %r11d
	je	.L66
	xorl	%esi, %esi
	cmpl	$3, %r10d
	je	.L163
.L59:
	cmpl	%esi, %r11d
	movl	%esi, 32(%rsp)
	movl	%esi, %r9d
	sete	%al
	cmpl	%esi, %r12d
	sete	%dl
	orb	%dl, %al
	jne	.L76
	cmpl	%esi, %r14d
	je	.L76
	xorl	%eax, %eax
	cmpl	$4, %r10d
	je	.L164
.L67:
	cmpl	%eax, %r12d
	sete	%dl
	cmpl	%eax, %r11d
	sete	%cl
	orl	%ecx, %edx
	cmpl	%eax, %r14d
	sete	%cl
	orb	%cl, %dl
	jne	.L85
	cmpl	%r9d, %eax
	je	.L85
	movl	%eax, 16+c(%rip)
	cmpl	$5, %r10d
	je	.L146
	xorl	%edx, %edx
.L77:
	cmpl	%r12d, %edx
	sete	%cl
	cmpl	%r11d, %edx
	sete	%r8b
	orl	%r8d, %ecx
	cmpl	%edx, %r14d
	sete	%r8b
	orl	%r8d, %ecx
	cmpl	%r9d, %edx
	sete	%r8b
	orb	%r8b, %cl
	jne	.L83
	cmpl	%eax, %edx
	je	.L83
	movl	%edx, 20+c(%rip)
	cmpl	$6, %r10d
	je	.L147
	xorl	%ecx, %ecx
.L78:
	cmpl	%r11d, %ecx
	sete	%r8b
	cmpl	%r12d, %ecx
	sete	%r13b
	orl	%r13d, %r8d
	cmpl	%ecx, %r14d
	sete	%r13b
	orl	%r13d, %r8d
	cmpl	%r9d, %ecx
	sete	%r13b
	orl	%r13d, %r8d
	cmpl	%eax, %ecx
	sete	%r13b
	orb	%r13b, %r8b
	jne	.L81
	cmpl	%edx, %ecx
	je	.L81
	movl	%ecx, 24+c(%rip)
	cmpl	$7, %r10d
	je	.L148
	xorl	%r8d, %r8d
.L79:
	cmpl	%r8d, %r12d
	sete	%r13b
	cmpl	%r8d, %r11d
	sete	%r15b
	orl	%r15d, %r13d
	cmpl	%r8d, %r14d
	sete	%r15b
	orl	%r15d, %r13d
	cmpl	%r9d, %r8d
	sete	%r15b
	orl	%r15d, %r13d
	cmpl	%r8d, %eax
	sete	%r15b
	orl	%r15d, %r13d
	cmpl	%r8d, %edx
	sete	%r15b
	orb	%r15b, %r13b
	jne	.L80
	cmpl	%r8d, %ecx
	je	.L80
	movl	%r8d, 28+c(%rip)
	cmpl	$8, %r10d
	je	.L149
.L80:
	addl	$1, %r8d
	cmpl	%r8d, %ebx
	jg	.L79
.L81:
	addl	$1, %ecx
	cmpl	%ecx, %ebx
	jg	.L78
.L83:
	addl	$1, %edx
	cmpl	%edx, %ebx
	jg	.L77
.L85:
	addl	$1, %eax
	cmpl	%eax, %ebx
	jne	.L67
	movl	32(%rsp), %eax
	movl	$1, %r13d
	movl	%eax, 44(%rsp)
.L76:
	addq	$1, %rsi
	cmpq	%rsi, (%rsp)
	jne	.L59
	movl	28(%rsp), %eax
	movl	$1, %r9d
	movl	%eax, 32(%rsp)
.L66:
	addq	$1, %rdi
	cmpq	%rdi, (%rsp)
	jne	.L53
	movl	%r12d, %r14d
	movl	$1, %ecx
.L58:
	addl	$1, %r12d
	addq	$4, 16(%rsp)
	cmpl	%r12d, %ebx
	jne	.L50
	leal	1(%r11), %eax
	addq	$4, 8(%rsp)
	cmpl	%eax, %ebx
	je	.L165
.L113:
	movl	%eax, %r11d
	cmpl	$1, %r10d
	jne	.L166
.L49:
	movslq	24(%rsp), %rsi
	leaq	num(%rip), %rax
	movl	(%rax,%rsi,4), %edi
	movq	8(%rsp), %rax
	movl	(%rax), %eax
	leal	(%rdi,%rdi,4), %edx
	addl	%edx, %edx
	cmpl	$9, %eax
	jle	.L104
	imull	$100, %edi, %edx
.L104:
	addl	%edx, %eax
	leaq	num(%rip), %rdx
	addl	$1, 24(%rsp)
	movl	%eax, (%rdx,%rsi,4)
	leal	1(%r11), %eax
	addq	$4, 8(%rsp)
	movb	$1, 39(%rsp)
	cmpl	%eax, %ebx
	jne	.L113
.L165:
	movl	40(%rsp), %r15d
	movl	24(%rsp), %edx
	movl	%r11d, c(%rip)
	testb	%cl, %cl
	je	.L92
	movl	%r14d, 4+c(%rip)
.L92:
	testb	%r9b, %r9b
	je	.L93
	movl	32(%rsp), %eax
	movl	%eax, 8+c(%rip)
.L93:
	testb	%r13b, %r13b
	je	.L94
	movl	44(%rsp), %eax
	movl	%eax, 12+c(%rip)
.L94:
	cmpb	$0, 39(%rsp)
	je	.L95
	movl	%edx, p(%rip)
	movl	$0, ans(%rip)
	movl	%edx, k(%rip)
	testl	%edx, %edx
	jne	.L48
	jmp	.L47
.L43:
	movl	$20160, %edx
	xorl	%esi, %esi
	leaq	num(%rip), %rdi
	call	memset@PLT
	movl	$5040, i(%rip)
	movl	$0, p(%rip)
	testl	%ebx, %ebx
	jne	.L95
.L45:
	movl	$1, p(%rip)
	movl	$1, %edx
	movl	$0, ans(%rip)
	movl	$1, k(%rip)
.L48:
	movl	%edx, %edi
	xorl	%ebx, %ebx
	leal	1(%rdx), %r11d
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L101:
	movl	%edx, %r10d
	leaq	num(%rip), %rsi
	movl	$1, %r8d
	jmp	.L100
	.p2align 4,,10
	.p2align 3
.L96:
	addq	$1, %r8
	addq	$4, %rsi
	movl	%eax, %r10d
	cmpq	%r11, %r8
	je	.L167
.L100:
	movl	(%rsi), %ecx
	movl	%r8d, %r13d
	leal	-1(%r10), %eax
	cmpl	$-1, %ecx
	je	.L96
	addl	$1, %ebx
	subl	$1, %edi
	cmpl	%r8d, %edx
	jle	.L114
	leal	-2(%r10), %eax
	leaq	-1(%r8,%rax), %rax
	leaq	0(%rbp,%rax,4), %r9
	movq	%rsi, %rax
	jmp	.L99
	.p2align 4,,10
	.p2align 3
.L168:
	movl	(%rsi), %ecx
.L99:
	cmpl	%ecx, 4(%rax)
	jne	.L97
	movl	$-1, 4(%rax)
	subl	$1, %edi
.L97:
	addq	$4, %rax
	cmpq	%r9, %rax
	jne	.L168
	leal	-1(%r10), %eax
	addq	$1, %r8
	movl	$1, %r12d
	addq	$4, %rsi
	leal	(%rax,%r13), %r15d
	movl	%eax, %r10d
	cmpq	%r11, %r8
	jne	.L100
.L167:
	testl	%edi, %edi
	jg	.L101
	movl	%edx, i(%rip)
	xorl	%edx, %edx
	testb	%r12b, %r12b
	je	.L47
	movl	%ebx, ans(%rip)
	movl	%ebx, %edx
	movl	%r15d, j(%rip)
	movl	%edi, k(%rip)
.L47:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L102
	.p2align 4,,10
	.p2align 3
.L114:
	movl	%r8d, %r15d
	movl	$1, %r12d
	jmp	.L96
.L162:
	movslq	24(%rsp), %rdx
	leaq	num(%rip), %rax
	movl	(%rax,%rdx,4), %ecx
	movq	8(%rsp), %rax
	movl	(%rax), %eax
	cmpl	$9, %eax
	jle	.L54
	imull	$100, %ecx, %ecx
.L55:
	movq	16(%rsp), %rdi
	addl	%ecx, %eax
	movl	(%rdi), %ecx
	cmpl	$9, %ecx
	jg	.L56
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
.L57:
	addl	%eax, %ecx
	leaq	num(%rip), %rax
	addl	$1, 24(%rsp)
	movl	%r12d, %r14d
	movl	%ecx, (%rax,%rdx,4)
	movl	$1, %ecx
	movb	$1, 39(%rsp)
	jmp	.L58
.L163:
	movq	8(%rsp), %rdx
	movslq	24(%rsp), %rcx
	leaq	num(%rip), %rax
	movl	(%rdx), %edx
	movl	(%rax,%rcx,4), %eax
	cmpl	$9, %edx
	jle	.L60
	imull	$100, %eax, %eax
.L61:
	addl	%eax, %edx
	movq	16(%rsp), %rax
	movl	(%rax), %eax
	cmpl	$9, %eax
	jle	.L62
	imull	$100, %edx, %edx
.L63:
	addl	%edx, %eax
	leaq	card(%rip), %rdx
	movl	(%rdx,%rdi,4), %edx
	cmpl	$9, %edx
	jg	.L64
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
.L65:
	addl	%eax, %edx
	leaq	num(%rip), %rax
	addl	$1, 24(%rsp)
	movl	$1, %r9d
	movl	%edx, (%rax,%rcx,4)
	movl	%edi, 32(%rsp)
	movb	$1, 39(%rsp)
	jmp	.L66
.L164:
	movq	8(%rsp), %rcx
	movslq	24(%rsp), %rdx
	leaq	num(%rip), %rax
	movl	(%rcx), %ecx
	movl	(%rax,%rdx,4), %eax
	cmpl	$9, %ecx
	jle	.L68
	imull	$100, %eax, %eax
.L69:
	addl	%ecx, %eax
	movq	16(%rsp), %rcx
	movl	(%rcx), %ecx
	cmpl	$9, %ecx
	jle	.L70
	imull	$100, %eax, %eax
.L71:
	addl	%ecx, %eax
	leaq	card(%rip), %rcx
	movl	(%rcx,%rdi,4), %ecx
	cmpl	$9, %ecx
	jle	.L72
	imull	$100, %eax, %eax
.L73:
	addl	%ecx, %eax
	leaq	card(%rip), %rcx
	movl	(%rcx,%rsi,4), %ecx
	cmpl	$9, %ecx
	jg	.L74
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
.L75:
	addl	%ecx, %eax
	leaq	num(%rip), %rcx
	addl	$1, 24(%rsp)
	movl	$1, %r13d
	movl	%eax, (%rcx,%rdx,4)
	movl	%esi, 44(%rsp)
	movb	$1, 39(%rsp)
	jmp	.L76
.L95:
	movl	$0, ans(%rip)
	xorl	%edx, %edx
	movl	$0, k(%rip)
	jmp	.L47
.L56:
	imull	$100, %eax, %eax
	jmp	.L57
.L54:
	leal	(%rcx,%rcx,4), %ecx
	addl	%ecx, %ecx
	jmp	.L55
.L64:
	imull	$100, %eax, %eax
	jmp	.L65
.L62:
	leal	(%rdx,%rdx,4), %edx
	addl	%edx, %edx
	jmp	.L63
.L60:
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	jmp	.L61
.L74:
	imull	$100, %eax, %eax
	jmp	.L75
.L72:
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	jmp	.L73
.L70:
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	jmp	.L71
.L68:
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	jmp	.L69
.L150:
	addq	$56, %rsp
	.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
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB24:
.L146:
	.cfi_def_cfa_offset 112
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	leaq	c(%rip), %rax
	movl	24(%rsp), %r13d
	movl	%r12d, 4+c(%rip)
	movl	%r11d, (%rax)
	movl	28(%rsp), %eax
	movl	%r13d, p(%rip)
	movl	%eax, 8+c(%rip)
	movl	32(%rsp), %eax
	movl	%eax, 12+c(%rip)
.L149:
	leaq	c(%rip), %rax
	movl	24(%rsp), %r13d
	movl	%r12d, 4+c(%rip)
	movl	%r11d, (%rax)
	movl	28(%rsp), %eax
	movl	%r13d, p(%rip)
	movl	%eax, 8+c(%rip)
	movl	32(%rsp), %eax
	movl	%eax, 12+c(%rip)
.L148:
	leaq	c(%rip), %rax
	movl	24(%rsp), %r13d
	movl	%r12d, 4+c(%rip)
	movl	%r11d, (%rax)
	movl	28(%rsp), %eax
	movl	%r13d, p(%rip)
	movl	%eax, 8+c(%rip)
	movl	32(%rsp), %eax
	movl	%eax, 12+c(%rip)
.L147:
	leaq	c(%rip), %rax
	movl	24(%rsp), %r13d
	movl	%r12d, 4+c(%rip)
	movl	%r11d, (%rax)
	movl	28(%rsp), %eax
	movl	%r13d, p(%rip)
	movl	%eax, 8+c(%rip)
	movl	32(%rsp), %eax
	movl	%eax, 12+c(%rip)
	.cfi_endproc
.LFE24:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE3:
	.section	.text.startup
.LHOTE3:
	.globl	ans
	.bss
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	card
	.align 32
	.type	card, @object
	.size	card, 40
card:
	.zero	40
	.globl	c
	.align 16
	.type	c, @object
	.size	c, 16
c:
	.zero	16
	.globl	num
	.align 32
	.type	num, @object
	.size	num, 20160
num:
	.zero	20160
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.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	set
	.type	set, @function
set:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	cmpl	%edi, k(%rip)
	je	.L2
	movl	n(%rip), %eax
	xorl	%ebx, %ebx
	leaq	c(%rip), %r12
	movslq	%edi, %r13
	testl	%eax, %eax
	jle	.L1
.L3:
	testl	%ebp, %ebp
	jle	.L17
	cmpl	(%r12), %ebx
	je	.L16
	cmpl	$1, %ebp
	je	.L17
	cmpl	4+c(%rip), %ebx
	je	.L16
	cmpl	$2, %ebp
	je	.L17
	cmpl	8+c(%rip), %ebx
	je	.L16
	cmpl	$3, %ebp
	je	.L17
	cmpl	%ebx, 12+c(%rip)
	je	.L16
.L17:
	leal	1(%rbp), %edi
	movl	%ebx, (%r12,%r13,4)
	call	set
	movl	n(%rip), %eax
.L16:
	addl	$1, %ebx
	cmpl	%eax, %ebx
	jl	.L3
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L2:
	.cfi_restore_state
	movl	p(%rip), %edx
	testl	%edi, %edi
	jle	.L5
	movslq	c(%rip), %r8
	leaq	card(%rip), %rcx
	leaq	num(%rip), %rsi
	movslq	%edx, %rdi
	movl	(%rsi,%rdi,4), %eax
	movl	(%rcx,%r8,4), %r8d
	cmpl	$9, %r8d
	jg	.L6
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
.L7:
	addl	%r8d, %eax
	cmpl	$1, %ebp
	je	.L8
	movslq	4+c(%rip), %r8
	movl	(%rcx,%r8,4), %r8d
	cmpl	$9, %r8d
	jg	.L9
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
.L10:
	addl	%r8d, %eax
	cmpl	$2, %ebp
	je	.L8
	movslq	8+c(%rip), %r8
	movl	(%rcx,%r8,4), %r8d
	cmpl	$9, %r8d
	jg	.L11
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
.L12:
	addl	%r8d, %eax
	cmpl	$3, %ebp
	je	.L8
	movslq	12+c(%rip), %r8
	movl	(%rcx,%r8,4), %ecx
	cmpl	$9, %ecx
	jle	.L13
	imull	$100, %eax, %eax
	addl	%ecx, %eax
.L8:
	movl	%eax, (%rsi,%rdi,4)
.L5:
	addl	$1, %edx
	movl	%edx, p(%rip)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L6:
	.cfi_restore_state
	imull	$100, %eax, %eax
	jmp	.L7
.L9:
	imull	$100, %eax, %eax
	jmp	.L10
.L11:
	imull	$100, %eax, %eax
	jmp	.L12
.L13:
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	addl	%ecx, %eax
	jmp	.L8
	.cfi_endproc
.LFE23:
	.size	set, .-set
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB3:
	.section	.text.startup,"ax",@progbits
.LHOTB3:
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	4+num(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
.L102:
	leaq	k(%rip), %rdx
	xorl	%eax, %eax
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	movl	k(%rip), %ebx
	movl	%eax, %edx
	orl	%ebx, %edx
	je	.L150
	movl	$0, i(%rip)
	testl	%eax, %eax
	jle	.L43
	xorl	%eax, %eax
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L44:
	cltq
	leaq	card(%rip), %rbx
	movq	%r12, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	movl	n(%rip), %ebx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%ebx, %eax
	jl	.L44
	movl	k(%rip), %r10d
	movl	$20160, %edx
	xorl	%esi, %esi
	leaq	num(%rip), %rdi
	movl	%r10d, 24(%rsp)
	call	memset@PLT
	movl	24(%rsp), %r10d
	movl	$5040, i(%rip)
	movl	$0, p(%rip)
	testl	%r10d, %r10d
	je	.L45
	testl	%ebx, %ebx
	jle	.L95
	leaq	card(%rip), %rax
	xorl	%edx, %edx
	movb	$0, 39(%rsp)
	xorl	%ecx, %ecx
	movq	%rax, 8(%rsp)
	movslq	%ebx, %rax
	xorl	%r9d, %r9d
	xorl	%r13d, %r13d
	movq	%rax, (%rsp)
	xorl	%r11d, %r11d
	movl	%r15d, 40(%rsp)
	movl	%edx, 24(%rsp)
	cmpl	$1, %r10d
	je	.L49
.L166:
	leaq	card(%rip), %rax
	xorl	%r12d, %r12d
	movq	%rax, 16(%rsp)
.L50:
	cmpl	%r11d, %r12d
	je	.L58
	xorl	%edi, %edi
	cmpl	$2, %r10d
	je	.L162
.L53:
	movl	%edi, 28(%rsp)
	movl	%edi, %r14d
	cmpl	%edi, %r12d
	je	.L66
	cmpl	%edi, %r11d
	je	.L66
	xorl	%esi, %esi
	cmpl	$3, %r10d
	je	.L163
.L59:
	cmpl	%esi, %r11d
	movl	%esi, 32(%rsp)
	movl	%esi, %r9d
	sete	%al
	cmpl	%esi, %r12d
	sete	%dl
	orb	%dl, %al
	jne	.L76
	cmpl	%esi, %r14d
	je	.L76
	xorl	%eax, %eax
	cmpl	$4, %r10d
	je	.L164
.L67:
	cmpl	%eax, %r12d
	sete	%dl
	cmpl	%eax, %r11d
	sete	%cl
	orl	%ecx, %edx
	cmpl	%eax, %r14d
	sete	%cl
	orb	%cl, %dl
	jne	.L85
	cmpl	%r9d, %eax
	je	.L85
	movl	%eax, 16+c(%rip)
	cmpl	$5, %r10d
	je	.L146
	xorl	%edx, %edx
.L77:
	cmpl	%r12d, %edx
	sete	%cl
	cmpl	%r11d, %edx
	sete	%r8b
	orl	%r8d, %ecx
	cmpl	%edx, %r14d
	sete	%r8b
	orl	%r8d, %ecx
	cmpl	%r9d, %edx
	sete	%r8b
	orb	%r8b, %cl
	jne	.L83
	cmpl	%eax, %edx
	je	.L83
	movl	%edx, 20+c(%rip)
	cmpl	$6, %r10d
	je	.L147
	xorl	%ecx, %ecx
.L78:
	cmpl	%r11d, %ecx
	sete	%r8b
	cmpl	%r12d, %ecx
	sete	%r13b
	orl	%r13d, %r8d
	cmpl	%ecx, %r14d
	sete	%r13b
	orl	%r13d, %r8d
	cmpl	%r9d, %ecx
	sete	%r13b
	orl	%r13d, %r8d
	cmpl	%eax, %ecx
	sete	%r13b
	orb	%r13b, %r8b
	jne	.L81
	cmpl	%edx, %ecx
	je	.L81
	movl	%ecx, 24+c(%rip)
	cmpl	$7, %r10d
	je	.L148
	xorl	%r8d, %r8d
.L79:
	cmpl	%r8d, %r12d
	sete	%r13b
	cmpl	%r8d, %r11d
	sete	%r15b
	orl	%r15d, %r13d
	cmpl	%r8d, %r14d
	sete	%r15b
	orl	%r15d, %r13d
	cmpl	%r9d, %r8d
	sete	%r15b
	orl	%r15d, %r13d
	cmpl	%r8d, %eax
	sete	%r15b
	orl	%r15d, %r13d
	cmpl	%r8d, %edx
	sete	%r15b
	orb	%r15b, %r13b
	jne	.L80
	cmpl	%r8d, %ecx
	je	.L80
	movl	%r8d, 28+c(%rip)
	cmpl	$8, %r10d
	je	.L149
.L80:
	addl	$1, %r8d
	cmpl	%r8d, %ebx
	jg	.L79
.L81:
	addl	$1, %ecx
	cmpl	%ecx, %ebx
	jg	.L78
.L83:
	addl	$1, %edx
	cmpl	%edx, %ebx
	jg	.L77
.L85:
	addl	$1, %eax
	cmpl	%eax, %ebx
	jne	.L67
	movl	32(%rsp), %eax
	movl	$1, %r13d
	movl	%eax, 44(%rsp)
.L76:
	addq	$1, %rsi
	cmpq	%rsi, (%rsp)
	jne	.L59
	movl	28(%rsp), %eax
	movl	$1, %r9d
	movl	%eax, 32(%rsp)
.L66:
	addq	$1, %rdi
	cmpq	%rdi, (%rsp)
	jne	.L53
	movl	%r12d, %r14d
	movl	$1, %ecx
.L58:
	addl	$1, %r12d
	addq	$4, 16(%rsp)
	cmpl	%r12d, %ebx
	jne	.L50
	leal	1(%r11), %eax
	addq	$4, 8(%rsp)
	cmpl	%eax, %ebx
	je	.L165
.L113:
	movl	%eax, %r11d
	cmpl	$1, %r10d
	jne	.L166
.L49:
	movslq	24(%rsp), %rsi
	leaq	num(%rip), %rax
	movl	(%rax,%rsi,4), %edi
	movq	8(%rsp), %rax
	movl	(%rax), %eax
	leal	(%rdi,%rdi,4), %edx
	addl	%edx, %edx
	cmpl	$9, %eax
	jle	.L104
	imull	$100, %edi, %edx
.L104:
	addl	%edx, %eax
	leaq	num(%rip), %rdx
	addl	$1, 24(%rsp)
	movl	%eax, (%rdx,%rsi,4)
	leal	1(%r11), %eax
	addq	$4, 8(%rsp)
	movb	$1, 39(%rsp)
	cmpl	%eax, %ebx
	jne	.L113
.L165:
	movl	40(%rsp), %r15d
	movl	24(%rsp), %edx
	movl	%r11d, c(%rip)
	testb	%cl, %cl
	je	.L92
	movl	%r14d, 4+c(%rip)
.L92:
	testb	%r9b, %r9b
	je	.L93
	movl	32(%rsp), %eax
	movl	%eax, 8+c(%rip)
.L93:
	testb	%r13b, %r13b
	je	.L94
	movl	44(%rsp), %eax
	movl	%eax, 12+c(%rip)
.L94:
	cmpb	$0, 39(%rsp)
	je	.L95
	movl	%edx, p(%rip)
	movl	$0, ans(%rip)
	movl	%edx, k(%rip)
	testl	%edx, %edx
	jne	.L48
	jmp	.L47
.L43:
	movl	$20160, %edx
	xorl	%esi, %esi
	leaq	num(%rip), %rdi
	call	memset@PLT
	movl	$5040, i(%rip)
	movl	$0, p(%rip)
	testl	%ebx, %ebx
	jne	.L95
.L45:
	movl	$1, p(%rip)
	movl	$1, %edx
	movl	$0, ans(%rip)
	movl	$1, k(%rip)
.L48:
	movl	%edx, %edi
	xorl	%ebx, %ebx
	leal	1(%rdx), %r11d
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L101:
	movl	%edx, %r10d
	leaq	num(%rip), %rsi
	movl	$1, %r8d
	jmp	.L100
	.p2align 4,,10
	.p2align 3
.L96:
	addq	$1, %r8
	addq	$4, %rsi
	movl	%eax, %r10d
	cmpq	%r11, %r8
	je	.L167
.L100:
	movl	(%rsi), %ecx
	movl	%r8d, %r13d
	leal	-1(%r10), %eax
	cmpl	$-1, %ecx
	je	.L96
	addl	$1, %ebx
	subl	$1, %edi
	cmpl	%r8d, %edx
	jle	.L114
	leal	-2(%r10), %eax
	leaq	-1(%r8,%rax), %rax
	leaq	0(%rbp,%rax,4), %r9
	movq	%rsi, %rax
	jmp	.L99
	.p2align 4,,10
	.p2align 3
.L168:
	movl	(%rsi), %ecx
.L99:
	cmpl	%ecx, 4(%rax)
	jne	.L97
	movl	$-1, 4(%rax)
	subl	$1, %edi
.L97:
	addq	$4, %rax
	cmpq	%r9, %rax
	jne	.L168
	leal	-1(%r10), %eax
	addq	$1, %r8
	movl	$1, %r12d
	addq	$4, %rsi
	leal	(%rax,%r13), %r15d
	movl	%eax, %r10d
	cmpq	%r11, %r8
	jne	.L100
.L167:
	testl	%edi, %edi
	jg	.L101
	movl	%edx, i(%rip)
	xorl	%edx, %edx
	testb	%r12b, %r12b
	je	.L47
	movl	%ebx, ans(%rip)
	movl	%ebx, %edx
	movl	%r15d, j(%rip)
	movl	%edi, k(%rip)
.L47:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L102
	.p2align 4,,10
	.p2align 3
.L114:
	movl	%r8d, %r15d
	movl	$1, %r12d
	jmp	.L96
.L162:
	movslq	24(%rsp), %rdx
	leaq	num(%rip), %rax
	movl	(%rax,%rdx,4), %ecx
	movq	8(%rsp), %rax
	movl	(%rax), %eax
	cmpl	$9, %eax
	jle	.L54
	imull	$100, %ecx, %ecx
.L55:
	movq	16(%rsp), %rdi
	addl	%ecx, %eax
	movl	(%rdi), %ecx
	cmpl	$9, %ecx
	jg	.L56
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
.L57:
	addl	%eax, %ecx
	leaq	num(%rip), %rax
	addl	$1, 24(%rsp)
	movl	%r12d, %r14d
	movl	%ecx, (%rax,%rdx,4)
	movl	$1, %ecx
	movb	$1, 39(%rsp)
	jmp	.L58
.L163:
	movq	8(%rsp), %rdx
	movslq	24(%rsp), %rcx
	leaq	num(%rip), %rax
	movl	(%rdx), %edx
	movl	(%rax,%rcx,4), %eax
	cmpl	$9, %edx
	jle	.L60
	imull	$100, %eax, %eax
.L61:
	addl	%eax, %edx
	movq	16(%rsp), %rax
	movl	(%rax), %eax
	cmpl	$9, %eax
	jle	.L62
	imull	$100, %edx, %edx
.L63:
	addl	%edx, %eax
	leaq	card(%rip), %rdx
	movl	(%rdx,%rdi,4), %edx
	cmpl	$9, %edx
	jg	.L64
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
.L65:
	addl	%eax, %edx
	leaq	num(%rip), %rax
	addl	$1, 24(%rsp)
	movl	$1, %r9d
	movl	%edx, (%rax,%rcx,4)
	movl	%edi, 32(%rsp)
	movb	$1, 39(%rsp)
	jmp	.L66
.L164:
	movq	8(%rsp), %rcx
	movslq	24(%rsp), %rdx
	leaq	num(%rip), %rax
	movl	(%rcx), %ecx
	movl	(%rax,%rdx,4), %eax
	cmpl	$9, %ecx
	jle	.L68
	imull	$100, %eax, %eax
.L69:
	addl	%ecx, %eax
	movq	16(%rsp), %rcx
	movl	(%rcx), %ecx
	cmpl	$9, %ecx
	jle	.L70
	imull	$100, %eax, %eax
.L71:
	addl	%ecx, %eax
	leaq	card(%rip), %rcx
	movl	(%rcx,%rdi,4), %ecx
	cmpl	$9, %ecx
	jle	.L72
	imull	$100, %eax, %eax
.L73:
	addl	%ecx, %eax
	leaq	card(%rip), %rcx
	movl	(%rcx,%rsi,4), %ecx
	cmpl	$9, %ecx
	jg	.L74
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
.L75:
	addl	%ecx, %eax
	leaq	num(%rip), %rcx
	addl	$1, 24(%rsp)
	movl	$1, %r13d
	movl	%eax, (%rcx,%rdx,4)
	movl	%esi, 44(%rsp)
	movb	$1, 39(%rsp)
	jmp	.L76
.L95:
	movl	$0, ans(%rip)
	xorl	%edx, %edx
	movl	$0, k(%rip)
	jmp	.L47
.L56:
	imull	$100, %eax, %eax
	jmp	.L57
.L54:
	leal	(%rcx,%rcx,4), %ecx
	addl	%ecx, %ecx
	jmp	.L55
.L64:
	imull	$100, %eax, %eax
	jmp	.L65
.L62:
	leal	(%rdx,%rdx,4), %edx
	addl	%edx, %edx
	jmp	.L63
.L60:
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	jmp	.L61
.L74:
	imull	$100, %eax, %eax
	jmp	.L75
.L72:
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	jmp	.L73
.L70:
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	jmp	.L71
.L68:
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	jmp	.L69
.L150:
	addq	$56, %rsp
	.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
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB24:
.L146:
	.cfi_def_cfa_offset 112
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	leaq	c(%rip), %rax
	movl	24(%rsp), %r13d
	movl	%r12d, 4+c(%rip)
	movl	%r11d, (%rax)
	movl	28(%rsp), %eax
	movl	%r13d, p(%rip)
	movl	%eax, 8+c(%rip)
	movl	32(%rsp), %eax
	movl	%eax, 12+c(%rip)
.L149:
	leaq	c(%rip), %rax
	movl	24(%rsp), %r13d
	movl	%r12d, 4+c(%rip)
	movl	%r11d, (%rax)
	movl	28(%rsp), %eax
	movl	%r13d, p(%rip)
	movl	%eax, 8+c(%rip)
	movl	32(%rsp), %eax
	movl	%eax, 12+c(%rip)
.L148:
	leaq	c(%rip), %rax
	movl	24(%rsp), %r13d
	movl	%r12d, 4+c(%rip)
	movl	%r11d, (%rax)
	movl	28(%rsp), %eax
	movl	%r13d, p(%rip)
	movl	%eax, 8+c(%rip)
	movl	32(%rsp), %eax
	movl	%eax, 12+c(%rip)
.L147:
	leaq	c(%rip), %rax
	movl	24(%rsp), %r13d
	movl	%r12d, 4+c(%rip)
	movl	%r11d, (%rax)
	movl	28(%rsp), %eax
	movl	%r13d, p(%rip)
	movl	%eax, 8+c(%rip)
	movl	32(%rsp), %eax
	movl	%eax, 12+c(%rip)
	.cfi_endproc
.LFE24:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE3:
	.section	.text.startup
.LHOTE3:
	.globl	ans
	.bss
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	card
	.align 32
	.type	card, @object
	.size	card, 40
card:
	.zero	40
	.globl	c
	.align 16
	.type	c, @object
	.size	c, 16
c:
	.zero	16
	.globl	num
	.align 32
	.type	num, @object
	.size	num, 20160
num:
	.zero	20160
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.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,i,j,p,num[5040],c[4],card[10],ans;
void set(int x){
    int i,j;
    if (x==k) {
        for (i=0; i<k; i++) {
            num[p]=num[p]*10;
            if (card[c[i]]>=10) {
                num[p]=num[p]*10;
            }
            num[p]+=card[c[i]];
        }
        p++;
        return;
    }
    for (i=0; i<n; i++) {
        int flag=1;
        for (j=0; j<x; j++) {
            if (c[j]==i) {
                flag=0;
                break;
            }
        }
        if (flag) {
            c[x]=i;
            set(x+1);
        }
    }
    return;
}
int main(){
    while (1) {
        scanf("%d%d",&n,&k);
        if (n==0&&k==0) {
            return 0;
        }
        for (i=0; i<n; i++) {
            scanf("%d",&card[i]);
        }
        for (i=0; i<5040; i++) {
            num[i]=0;
        }
        p=0;
        set(0);
        ans=0;
        k=p;
        while (k>0) {
            for (i=0; i<p; i++) {
                if (num[i]!=-1) {
                    ans++;
                    k--;
                    for (j=i+1; j<p; j++) {
                        if (num[i]==num[j]) {
                            k--;
                            num[j]=-1;
                        }
                    }
                }
            }
        }
        printf("%d\n",ans);
    }
}
4
2
1
3
12
1
6
3
72
2
12
7
2
1
0
0
 4
2
1
3
12
1
6
3
11
2
12
7
2
1
0
0
 4
2
0
5
12
1
6
3
72
2
12
7
2
1
0
0
 4
2
1
3
12
1
6
3
9
2
12
7
2
1
0
0
 4
1
1
3
12
1
6
3
9
2
12
7
2
1
0
0
 4
2
1
1
12
1
6
3
72
2
12
7
2
1
0
0
 4
3
0
5
12
1
6
3
72
2
12
7
2
1
0
0
 4
4
1
1
12
1
6
3
72
2
12
7
2
1
0
0
 4
3
0
5
12
1
6
3
72
2
20
7
2
1
0
0
 4
1
1
3
12
1
6
3
8
2
0
7
2
1
0
0

7
68
 7
61
 12
68
 7
71
 3
71
 3
68
 24
68
 4
68
 24
71
 3
72

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,i,j,p,num[5040],c[4],card[10],ans;
void set(int x){
    int i,j;
    if (x==k) {
        for (i=0; i<k; i++) {
            num[p]=num[p]*10;
            if (card[c[i]]>=10) {
                num[p]=num[p]*10;
            }
            num[p]+=card[c[i]];
        }
        p++;
        return;
    }
    for (i=0; i<n; i++) {
        int flag=1;
        for (j=0; j<x; j++) {
            if (c[j]==i) {
                flag=0;
                break;
            }
        }
        if (flag) {
            c[x]=i;
            set(x+1);
        }
    }
    return;
}
int main(){
    while (1) {
        scanf("%d%d",&n,&k);
        if (n==0&&k==0) {
            return 0;
        }
        for (i=0; i<n; i++) {
            scanf("%d",&card[i]);
        }
        for (i=0; i<5040; i++) {
            num[i]=0;
        }
        p=0;
        set(0);
        ans=0;
        k=p;
        while (k>0) {
            for (i=0; i<p; i++) {
                if (num[i]!=-1) {
                    ans++;
                    k--;
                    for (j=i+1; j<p; j++) {
                        if (num[i]==num[j]) {
                            k--;
                            num[j]=-1;
                        }
                    }
                }
            }
        }
        printf("%d\n",ans);
    }
}```

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	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	num
	.align 32
	.type	num, @object
	.size	num, 20160
num:
	.zero	20160
	.globl	c
	.align 16
	.type	c, @object
	.size	c, 16
c:
	.zero	16
	.globl	card
	.align 32
	.type	card, @object
	.size	card, 40
card:
	.zero	40
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.text
	.globl	set
	.type	set, @function
set:
.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	k(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L2
	movl	$0, -12(%rbp)
	jmp	.L3
.L5:
	movl	p(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	p(%rip), %ecx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %esi
	movslq	%ecx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	%esi, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	card(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$9, %eax
	jle	.L4
	movl	p(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	p(%rip), %ecx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %esi
	movslq	%ecx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	%esi, (%rdx,%rax)
.L4:
	movl	p(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	card(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	p(%rip), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L3:
	movl	k(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L5
	movl	p(%rip), %eax
	addl	$1, %eax
	movl	%eax, p(%rip)
	jmp	.L1
.L2:
	movl	$0, -12(%rbp)
	jmp	.L7
.L13:
	movl	$1, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L8
.L11:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L9
	movl	$0, -4(%rbp)
	jmp	.L10
.L9:
	addl	$1, -8(%rbp)
.L8:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L11
.L10:
	cmpl	$0, -4(%rbp)
	je	.L12
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	c(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	set
.L12:
	addl	$1, -12(%rbp)
.L7:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	set, .-set
	.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
.L29:
	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	n(%rip), %eax
	testl	%eax, %eax
	jne	.L15
	movl	k(%rip), %eax
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	jmp	.L30
.L15:
	movl	$0, i(%rip)
	jmp	.L17
.L18:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	card(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L17:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L18
	movl	$0, i(%rip)
	jmp	.L19
.L20:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L19:
	movl	i(%rip), %eax
	cmpl	$5039, %eax
	jle	.L20
	movl	$0, p(%rip)
	movl	$0, %edi
	call	set
	movl	$0, ans(%rip)
	movl	p(%rip), %eax
	movl	%eax, k(%rip)
	jmp	.L21
.L28:
	movl	$0, i(%rip)
	jmp	.L22
.L27:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L23
	movl	ans(%rip), %eax
	addl	$1, %eax
	movl	%eax, ans(%rip)
	movl	k(%rip), %eax
	subl	$1, %eax
	movl	%eax, k(%rip)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
	jmp	.L24
.L26:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	j(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	num(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L25
	movl	k(%rip), %eax
	subl	$1, %eax
	movl	%eax, k(%rip)
	movl	j(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	$-1, (%rdx,%rax)
.L25:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L24:
	movl	j(%rip), %edx
	movl	p(%rip), %eax
	cmpl	%eax, %edx
	jl	.L26
.L23:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L22:
	movl	i(%rip), %edx
	movl	p(%rip), %eax
	cmpl	%eax, %edx
	jl	.L27
.L21:
	movl	k(%rip), %eax
	testl	%eax, %eax
	jg	.L28
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L29
.L30:
	popq	%rbp
	.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	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	num
	.align 32
	.type	num, @object
	.size	num, 20160
num:
	.zero	20160
	.globl	c
	.align 16
	.type	c, @object
	.size	c, 16
c:
	.zero	16
	.globl	card
	.align 32
	.type	card, @object
	.size	card, 40
card:
	.zero	40
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.text
	.globl	set
	.type	set, @function
set:
.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	k(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L2
	movl	$0, -12(%rbp)
	jmp	.L3
.L5:
	movl	p(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	p(%rip), %ecx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %esi
	movslq	%ecx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	%esi, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	card(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$9, %eax
	jle	.L4
	movl	p(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	p(%rip), %ecx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %esi
	movslq	%ecx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	%esi, (%rdx,%rax)
.L4:
	movl	p(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	card(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	p(%rip), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L3:
	movl	k(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L5
	movl	p(%rip), %eax
	addl	$1, %eax
	movl	%eax, p(%rip)
	jmp	.L1
.L2:
	movl	$0, -12(%rbp)
	jmp	.L7
.L13:
	movl	$1, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L8
.L11:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L9
	movl	$0, -4(%rbp)
	jmp	.L10
.L9:
	addl	$1, -8(%rbp)
.L8:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L11
.L10:
	cmpl	$0, -4(%rbp)
	je	.L12
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	c(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	set
.L12:
	addl	$1, -12(%rbp)
.L7:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	set, .-set
	.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
.L29:
	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	n(%rip), %eax
	testl	%eax, %eax
	jne	.L15
	movl	k(%rip), %eax
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	jmp	.L30
.L15:
	movl	$0, i(%rip)
	jmp	.L17
.L18:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	card(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L17:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L18
	movl	$0, i(%rip)
	jmp	.L19
.L20:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L19:
	movl	i(%rip), %eax
	cmpl	$5039, %eax
	jle	.L20
	movl	$0, p(%rip)
	movl	$0, %edi
	call	set
	movl	$0, ans(%rip)
	movl	p(%rip), %eax
	movl	%eax, k(%rip)
	jmp	.L21
.L28:
	movl	$0, i(%rip)
	jmp	.L22
.L27:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L23
	movl	ans(%rip), %eax
	addl	$1, %eax
	movl	%eax, ans(%rip)
	movl	k(%rip), %eax
	subl	$1, %eax
	movl	%eax, k(%rip)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
	jmp	.L24
.L26:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	j(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	num(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L25
	movl	k(%rip), %eax
	subl	$1, %eax
	movl	%eax, k(%rip)
	movl	j(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	$-1, (%rdx,%rax)
.L25:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L24:
	movl	j(%rip), %edx
	movl	p(%rip), %eax
	cmpl	%eax, %edx
	jl	.L26
.L23:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L22:
	movl	i(%rip), %edx
	movl	p(%rip), %eax
	cmpl	%eax, %edx
	jl	.L27
.L21:
	movl	k(%rip), %eax
	testl	%eax, %eax
	jg	.L28
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L29
.L30:
	popq	%rbp
	.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:
