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 fn[10][10]={};
int flag[10]={};
int n;
int ans=0;
 
int check(int num){
    int flaga=1;
    for(int i=1;i<=n;i++){
        if(flag[i]==0) flaga=0;
    }
    return flaga;
}
 
void route(int j,int i,int num){
    if (fn[j][i]==1&&flag[i]==0){
        flag[i]=num;
        int a=check(num);
        ans+=a;
        for (int k=2;k<=n;k++){
            route(i,k,num+1);
        }
        flag[i]=0;
    }
}
 
int main(){
    int m,i,j;
    scanf("%d %d",&n,&m);
    for (int k=0;k<m;k++){
        scanf("%d %d",&i,&j);
        fn[i][j]=1;
        fn[j][i]=1;
    }
    for (i=2;i<=n;i++){
        flag[1]=1;
        route(1,i,2);
        for (j=1;j<=n;j++)flag[j]=0;
    }
    printf("%d\n",ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	fn
	.bss
	.align 32
	.type	fn, @object
	.size	fn, 400
fn:
	.zero	400
	.globl	flag
	.align 32
	.type	flag, @object
	.size	flag, 40
flag:
	.zero	40
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.text
	.globl	check
	.type	check, @function
check:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$1, -8(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L2
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L3
	movl	$0, -8(%rbp)
.L3:
	addl	$1, -4(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L4
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	check, .-check
	.globl	route
	.type	route, @function
route:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	fn(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L10
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L10
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	flag(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	check
	movl	%eax, -4(%rbp)
	movl	ans(%rip), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, ans(%rip)
	movl	$2, -8(%rbp)
	jmp	.L8
.L9:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %ecx
	movl	-24(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	route
	addl	$1, -8(%rbp)
.L8:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L9
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	$0, (%rdx,%rax)
.L10:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	route, .-route
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %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, -12(%rbp)
	jmp	.L12
.L13:
	leaq	-16(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	fn(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-16(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	fn(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L12:
	movl	-24(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	movl	$2, -20(%rbp)
	jmp	.L14
.L17:
	movl	$1, 4+flag(%rip)
	movl	-20(%rbp), %eax
	movl	$2, %edx
	movl	%eax, %esi
	movl	$1, %edi
	call	route
	movl	$1, -16(%rbp)
	jmp	.L15
.L16:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-16(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -16(%rbp)
.L15:
	movl	-16(%rbp), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L16
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
.L14:
	movl	-20(%rbp), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L17
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.type	route.part.0, @function
route.part.0:
.LFB26:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	flag(%rip), %r11
	movslq	%edi, %r10
	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	$104, %rsp
	.cfi_def_cfa_offset 160
	movl	n(%rip), %r9d
	movl	%esi, (%r11,%r10,4)
	movl	%esi, 24(%rsp)
	testl	%r9d, %r9d
	jle	.L2
	leal	-1(%r9), %eax
	cmpl	$2, %eax
	jbe	.L73
	movdqu	4+flag(%rip), %xmm0
	movl	%r9d, %eax
	pxor	%xmm1, %xmm1
	shrl	$2, %eax
	pcmpeqd	%xmm1, %xmm0
	pandn	.LC0(%rip), %xmm0
	cmpl	$1, %eax
	je	.L4
	movdqu	20+flag(%rip), %xmm5
	pcmpeqd	%xmm5, %xmm1
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
.L4:
	movdqa	%xmm0, %xmm2
	movl	%r9d, %ecx
	psrldq	$8, %xmm2
	andl	$-4, %ecx
	movdqa	%xmm2, %xmm1
	leal	1(%rcx), %edx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%ecx, %r9d
	je	.L7
.L3:
	movslq	%edx, %rcx
	movl	(%r11,%rcx,4), %ecx
	testl	%ecx, %ecx
	cmovne	%eax, %ecx
	leal	1(%rdx), %eax
	cmpl	%eax, %r9d
	jl	.L9
	cltq
	movl	(%r11,%rax,4), %esi
	testl	%esi, %esi
	cmovne	%ecx, %esi
	addl	$2, %edx
	cmpl	%edx, %r9d
	jl	.L74
	movslq	%edx, %rdx
	movl	(%r11,%rdx,4), %eax
	testl	%eax, %eax
	cmovne	%esi, %eax
.L7:
	addl	%eax, ans(%rip)
.L5:
	movl	24(%rsp), %eax
	leaq	fn(%rip), %rdx
	leaq	8+flag(%rip), %r14
	movl	$2, %r15d
	leaq	80(%rdx), %r8
	movdqa	.LC0(%rip), %xmm2
	movq	%r10, 16(%rsp)
	addl	$1, %eax
	movl	%eax, 28(%rsp)
	leaq	(%r10,%r10,4), %rax
	movq	%r8, %r10
	movq	%r14, %r8
	leaq	(%rdx,%rax,8), %rax
	movq	%r15, %r14
	movq	%rax, 8(%rsp)
.L72:
	movq	8(%rsp), %rax
	movl	(%rax,%r14,4), %eax
	cmpl	$1, %eax
	je	.L135
.L12:
	addq	$1, %r14
	addq	$4, %r8
	addq	$40, %r10
	cmpl	%r14d, %r9d
	jge	.L72
	movq	16(%rsp), %r10
.L6:
	movl	$0, (%r11,%r10,4)
	addq	$104, %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
	.p2align 4,,10
	.p2align 3
.L135:
	.cfi_restore_state
	movl	(%r8), %ebx
	testl	%ebx, %ebx
	jne	.L12
	movl	28(%rsp), %edi
	movl	%edi, (%r8)
	testl	%r9d, %r9d
	jle	.L13
	leal	-1(%r9), %edx
	cmpl	$2, %edx
	jbe	.L75
	movdqu	4+flag(%rip), %xmm1
	movl	%r9d, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	pcmpeqd	%xmm0, %xmm1
	pandn	.LC0(%rip), %xmm1
	cmpl	$1, %eax
	je	.L15
	movdqu	20+flag(%rip), %xmm6
	pcmpeqd	%xmm6, %xmm0
	pandn	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
.L15:
	movdqa	%xmm1, %xmm3
	movl	%r9d, %ecx
	psrldq	$8, %xmm3
	andl	$-4, %ecx
	movdqa	%xmm3, %xmm0
	leal	1(%rcx), %edx
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm3
	psrldq	$4, %xmm3
	movdqa	%xmm3, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm3, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%ecx, %r9d
	je	.L18
.L14:
	movslq	%edx, %rcx
	movl	(%r11,%rcx,4), %ecx
	testl	%ecx, %ecx
	cmovne	%eax, %ecx
	leal	1(%rdx), %eax
	cmpl	%eax, %r9d
	jl	.L20
	cltq
	movl	(%r11,%rax,4), %esi
	testl	%esi, %esi
	cmovne	%ecx, %esi
	addl	$2, %edx
	cmpl	%edx, %r9d
	jl	.L76
	movslq	%edx, %rdx
	movl	(%r11,%rdx,4), %eax
	testl	%eax, %eax
	cmovne	%esi, %eax
.L18:
	addl	%eax, ans(%rip)
.L16:
	movl	24(%rsp), %eax
	movq	%r8, 32(%rsp)
	leaq	80+fn(%rip), %rcx
	leaq	8+flag(%rip), %r13
	movq	%r14, 40(%rsp)
	movdqa	.LC0(%rip), %xmm3
	movl	$2, %r15d
	addl	$2, %eax
	movl	%eax, 48(%rsp)
.L70:
	movl	(%r10,%r15,4), %eax
	cmpl	$1, %eax
	je	.L136
.L23:
	addq	$1, %r15
	addq	$4, %r13
	addq	$40, %rcx
	cmpl	%r15d, %r9d
	jge	.L70
	movq	32(%rsp), %r8
	movq	40(%rsp), %r14
.L71:
	movl	$0, (%r8)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L136:
	movl	0(%r13), %r8d
	testl	%r8d, %r8d
	jne	.L23
	movl	48(%rsp), %ebx
	movl	%ebx, 0(%r13)
	testl	%r9d, %r9d
	jle	.L24
	leal	-1(%r9), %edx
	cmpl	$2, %edx
	jbe	.L77
	movdqu	4+flag(%rip), %xmm1
	pxor	%xmm0, %xmm0
	movl	%r9d, %eax
	shrl	$2, %eax
	pcmpeqd	%xmm0, %xmm1
	pandn	%xmm3, %xmm1
	cmpl	$1, %eax
	je	.L26
	movdqu	20+flag(%rip), %xmm7
	pcmpeqd	%xmm7, %xmm0
	pandn	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
.L26:
	movdqa	%xmm1, %xmm4
	movl	%r9d, %esi
	psrldq	$8, %xmm4
	andl	$-4, %esi
	movdqa	%xmm4, %xmm0
	leal	1(%rsi), %edx
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm4, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm4
	psrldq	$4, %xmm4
	movdqa	%xmm4, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm4, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%esi, %r9d
	je	.L29
.L25:
	movslq	%edx, %rsi
	movl	(%r11,%rsi,4), %esi
	testl	%esi, %esi
	cmovne	%eax, %esi
	leal	1(%rdx), %eax
	cmpl	%eax, %r9d
	jl	.L31
	cltq
	movl	(%r11,%rax,4), %edi
	testl	%edi, %edi
	cmovne	%esi, %edi
	addl	$2, %edx
	cmpl	%edx, %r9d
	jl	.L78
	movslq	%edx, %rdx
	movl	(%r11,%rdx,4), %eax
	testl	%eax, %eax
	cmovne	%edi, %eax
.L29:
	addl	%eax, ans(%rip)
.L27:
	movl	24(%rsp), %eax
	leaq	80+fn(%rip), %r8
	leaq	8+flag(%rip), %rbp
	movq	%r8, %r12
	leal	3(%rax), %ebx
	leal	4(%rax), %edi
	addl	$5, %eax
	movl	%edi, 56(%rsp)
	movl	%eax, 60(%rsp)
	movl	%ebx, 52(%rsp)
	movl	$2, %ebx
.L68:
	movl	(%rcx,%rbx,4), %eax
	cmpl	$1, %eax
	je	.L137
.L34:
	addq	$1, %rbx
	addq	$4, %rbp
	addq	$40, %r12
	cmpl	%ebx, %r9d
	jge	.L68
.L69:
	movl	$0, 0(%r13)
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L137:
	movl	0(%rbp), %edi
	testl	%edi, %edi
	jne	.L34
	movl	52(%rsp), %edi
	movl	%edi, 0(%rbp)
	testl	%r9d, %r9d
	jle	.L35
	leal	-1(%r9), %edx
	cmpl	$2, %edx
	jbe	.L79
	movdqu	4+flag(%rip), %xmm1
	pxor	%xmm0, %xmm0
	movl	%r9d, %eax
	shrl	$2, %eax
	pcmpeqd	%xmm0, %xmm1
	pandn	%xmm2, %xmm1
	cmpl	$1, %eax
	je	.L37
	movdqu	20+flag(%rip), %xmm7
	pcmpeqd	%xmm7, %xmm0
	pandn	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
.L37:
	movdqa	%xmm1, %xmm4
	movl	%r9d, %esi
	psrldq	$8, %xmm4
	andl	$-4, %esi
	movdqa	%xmm4, %xmm0
	leal	1(%rsi), %edx
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm4, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm4
	psrldq	$4, %xmm4
	movdqa	%xmm4, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm4, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%esi, %r9d
	je	.L40
.L36:
	movslq	%edx, %rsi
	movl	(%r11,%rsi,4), %esi
	testl	%esi, %esi
	cmovne	%eax, %esi
	leal	1(%rdx), %eax
	cmpl	%eax, %r9d
	jl	.L42
	cltq
	movl	(%r11,%rax,4), %edi
	testl	%edi, %edi
	cmovne	%esi, %edi
	addl	$2, %edx
	cmpl	%edx, %r9d
	jl	.L80
	movslq	%edx, %rdx
	movl	(%r11,%rdx,4), %eax
	testl	%eax, %eax
	cmovne	%edi, %eax
.L40:
	addl	%eax, ans(%rip)
.L38:
	movq	%r10, 64(%rsp)
	leaq	88+fn(%rip), %r8
	leaq	8+flag(%rip), %rdx
	movl	$2, %r14d
.L66:
	movl	(%r12,%r14,4), %eax
	cmpl	$1, %eax
	je	.L138
.L45:
	addq	$1, %r14
	addq	$4, %rdx
	addq	$40, %r8
	cmpl	%r14d, %r9d
	jge	.L66
	movq	64(%rsp), %r10
.L67:
	movl	$0, 0(%rbp)
	jmp	.L34
.L75:
	movl	$1, %edx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L138:
	movl	(%rdx), %esi
	testl	%esi, %esi
	jne	.L45
	movl	56(%rsp), %edi
	movl	%edi, (%rdx)
	testl	%r9d, %r9d
	jle	.L46
	leal	-1(%r9), %esi
	cmpl	$2, %esi
	jbe	.L81
	movdqu	4+flag(%rip), %xmm1
	pxor	%xmm0, %xmm0
	movl	%r9d, %eax
	shrl	$2, %eax
	pcmpeqd	%xmm0, %xmm1
	pandn	%xmm2, %xmm1
	cmpl	$1, %eax
	je	.L48
	movdqu	20+flag(%rip), %xmm7
	pcmpeqd	%xmm7, %xmm0
	pandn	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
.L48:
	movdqa	%xmm1, %xmm4
	movl	%r9d, %edi
	psrldq	$8, %xmm4
	andl	$-4, %edi
	movdqa	%xmm4, %xmm0
	leal	1(%rdi), %esi
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm4, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm4
	psrldq	$4, %xmm4
	movdqa	%xmm4, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm4, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%edi, %r9d
	je	.L51
.L47:
	movslq	%esi, %rdi
	movl	(%r11,%rdi,4), %edi
	testl	%edi, %edi
	cmovne	%eax, %edi
	leal	1(%rsi), %eax
	cmpl	%r9d, %eax
	jg	.L53
	cltq
	movl	(%r11,%rax,4), %r10d
	testl	%r10d, %r10d
	cmovne	%edi, %r10d
	addl	$2, %esi
	cmpl	%esi, %r9d
	jl	.L82
	movslq	%esi, %rsi
	movl	(%r11,%rsi,4), %eax
	testl	%eax, %eax
	cmovne	%r10d, %eax
.L51:
	addl	%eax, ans(%rip)
.L49:
	cmpl	$1, (%r8)
	je	.L139
.L57:
	cmpl	$2, %r9d
	jle	.L56
	cmpl	$1, 4(%r8)
	je	.L140
.L59:
	cmpl	$3, %r9d
	jle	.L56
	cmpl	$1, 8(%r8)
	je	.L141
.L60:
	cmpl	$4, %r9d
	jle	.L56
	cmpl	$1, 12(%r8)
	je	.L142
.L61:
	cmpl	$5, %r9d
	jle	.L56
	cmpl	$1, 16(%r8)
	je	.L143
.L62:
	cmpl	$6, %r9d
	jle	.L56
	cmpl	$1, 20(%r8)
	je	.L144
.L63:
	cmpl	$7, %r9d
	jle	.L56
	cmpl	$1, 24(%r8)
	je	.L145
.L64:
	cmpl	$8, %r9d
	jle	.L56
	cmpl	$1, 28(%r8)
	jne	.L56
	movl	36+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L56
	movl	60(%rsp), %esi
	movl	$9, %edi
	movq	%rcx, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%r8, 72(%rsp)
	call	route.part.0
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	leaq	flag(%rip), %r11
	movdqa	.LC0(%rip), %xmm2
	movl	n(%rip), %r9d
	movq	72(%rsp), %r8
	movdqa	%xmm2, %xmm3
	.p2align 4,,10
	.p2align 3
.L56:
	movl	$0, (%rdx)
	jmp	.L45
.L9:
	addl	%ecx, ans(%rip)
	cmpl	$1, %r9d
	jle	.L6
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	addl	$1, ans(%rip)
	jmp	.L6
.L20:
	addl	%ecx, ans(%rip)
	cmpl	$1, %r9d
	jle	.L71
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L73:
	movl	$1, %eax
	movl	$1, %edx
	jmp	.L3
.L74:
	movl	%esi, %eax
	jmp	.L7
.L13:
	addl	$1, ans(%rip)
	jmp	.L71
.L31:
	addl	%esi, ans(%rip)
	cmpl	$1, %r9d
	jle	.L69
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L78:
	movl	%edi, %eax
	jmp	.L29
.L35:
	addl	$1, ans(%rip)
	jmp	.L67
.L141:
	movl	16+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L60
	movl	60(%rsp), %esi
	movl	$4, %edi
	movq	%rcx, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%r8, 72(%rsp)
	call	route.part.0
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	leaq	flag(%rip), %r11
	movdqa	.LC0(%rip), %xmm2
	movl	n(%rip), %r9d
	movq	72(%rsp), %r8
	movdqa	%xmm2, %xmm3
	jmp	.L60
.L76:
	movl	%esi, %eax
	jmp	.L18
.L24:
	addl	$1, ans(%rip)
	jmp	.L69
.L139:
	movl	8+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L57
	movl	60(%rsp), %esi
	movl	$2, %edi
	movq	%rcx, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%r8, 72(%rsp)
	call	route.part.0
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	leaq	flag(%rip), %r11
	movdqa	.LC0(%rip), %xmm2
	movl	n(%rip), %r9d
	movq	72(%rsp), %r8
	movdqa	%xmm2, %xmm3
	jmp	.L57
.L42:
	addl	%esi, ans(%rip)
	cmpl	$1, %r9d
	jle	.L67
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L77:
	movl	$1, %edx
	jmp	.L25
.L140:
	movl	12+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L59
	movl	60(%rsp), %esi
	movl	$3, %edi
	movq	%rcx, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%r8, 72(%rsp)
	call	route.part.0
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	leaq	flag(%rip), %r11
	movdqa	.LC0(%rip), %xmm2
	movl	n(%rip), %r9d
	movq	72(%rsp), %r8
	movdqa	%xmm2, %xmm3
	jmp	.L59
.L53:
	addl	%edi, ans(%rip)
	cmpl	$1, %r9d
	jle	.L56
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L79:
	movl	$1, %edx
	jmp	.L36
.L142:
	movl	20+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L61
	movl	60(%rsp), %esi
	movl	$5, %edi
	movq	%rcx, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%r8, 72(%rsp)
	call	route.part.0
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	leaq	flag(%rip), %r11
	movdqa	.LC0(%rip), %xmm2
	movl	n(%rip), %r9d
	movq	72(%rsp), %r8
	movdqa	%xmm2, %xmm3
	jmp	.L61
.L80:
	movl	%edi, %eax
	jmp	.L40
.L46:
	addl	$1, ans(%rip)
	jmp	.L56
.L143:
	movl	24+flag(%rip), %r10d
	testl	%r10d, %r10d
	jne	.L62
	movl	60(%rsp), %esi
	movl	$6, %edi
	movq	%rcx, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%r8, 72(%rsp)
	call	route.part.0
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	leaq	flag(%rip), %r11
	movdqa	.LC0(%rip), %xmm2
	movl	n(%rip), %r9d
	movq	72(%rsp), %r8
	movdqa	%xmm2, %xmm3
	jmp	.L62
.L81:
	movl	$1, %esi
	jmp	.L47
.L144:
	movl	28+flag(%rip), %edi
	testl	%edi, %edi
	jne	.L63
	movl	60(%rsp), %esi
	movl	$7, %edi
	movq	%rcx, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%r8, 72(%rsp)
	call	route.part.0
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	leaq	flag(%rip), %r11
	movdqa	.LC0(%rip), %xmm2
	movl	n(%rip), %r9d
	movq	72(%rsp), %r8
	movdqa	%xmm2, %xmm3
	jmp	.L63
.L82:
	movl	%r10d, %eax
	jmp	.L51
.L145:
	movl	32+flag(%rip), %esi
	testl	%esi, %esi
	jne	.L64
	movl	60(%rsp), %esi
	movl	$8, %edi
	movq	%rcx, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%r8, 72(%rsp)
	call	route.part.0
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	leaq	flag(%rip), %r11
	movdqa	.LC0(%rip), %xmm2
	movl	n(%rip), %r9d
	movq	72(%rsp), %r8
	movdqa	%xmm2, %xmm3
	jmp	.L64
	.cfi_endproc
.LFE26:
	.size	route.part.0, .-route.part.0
	.p2align 4
	.globl	check
	.type	check, @function
check:
.LFB23:
	.cfi_startproc
	endbr64
	movl	n(%rip), %edx
	testl	%edx, %edx
	jle	.L154
	leal	-1(%rdx), %eax
	cmpl	$2, %eax
	jbe	.L155
	movdqu	4+flag(%rip), %xmm0
	movl	%edx, %eax
	pxor	%xmm1, %xmm1
	shrl	$2, %eax
	pcmpeqd	%xmm1, %xmm0
	pandn	.LC0(%rip), %xmm0
	cmpl	$1, %eax
	je	.L149
	movdqu	20+flag(%rip), %xmm3
	pcmpeqd	%xmm3, %xmm1
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
.L149:
	movdqa	%xmm0, %xmm2
	movl	%edx, %esi
	psrldq	$8, %xmm2
	andl	$-4, %esi
	movdqa	%xmm2, %xmm1
	leal	1(%rsi), %ecx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%esi, %edx
	je	.L167
.L148:
	leaq	flag(%rip), %r8
	movslq	%ecx, %rsi
	movl	(%r8,%rsi,4), %esi
	testl	%esi, %esi
	cmovne	%eax, %esi
	leal	1(%rcx), %eax
	cmpl	%edx, %eax
	jg	.L156
	cltq
	movl	(%r8,%rax,4), %edi
	testl	%edi, %edi
	cmovne	%esi, %edi
	addl	$2, %ecx
	cmpl	%ecx, %edx
	jl	.L157
	movslq	%ecx, %rcx
	movl	(%r8,%rcx,4), %eax
	testl	%eax, %eax
	cmovne	%edi, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L167:
	ret
	.p2align 4,,10
	.p2align 3
.L154:
	movl	$1, %eax
	ret
.L155:
	movl	$1, %ecx
	movl	$1, %eax
	jmp	.L148
.L156:
	movl	%esi, %eax
	ret
.L157:
	movl	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	check, .-check
	.p2align 4
	.globl	route
	.type	route, @function
route:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rdi
	leaq	fn(%rip), %r8
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	(%rdi,%rdi,4), %rax
	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
	movslq	%esi, %rbx
	leaq	(%rbx,%rax,2), %rax
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movl	(%r8,%rax,4), %eax
	cmpl	$1, %eax
	je	.L226
.L168:
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L226:
	.cfi_restore_state
	leaq	flag(%rip), %r15
	movl	(%r15,%rbx,4), %edi
	testl	%edi, %edi
	jne	.L168
	movl	%edx, (%r15,%rbx,4)
	movl	%edx, %r12d
	movl	n(%rip), %edx
	testl	%edx, %edx
	jle	.L170
	leal	-1(%rdx), %ecx
	cmpl	$2, %ecx
	jbe	.L202
	movdqu	4+flag(%rip), %xmm0
	movl	%edx, %eax
	pxor	%xmm1, %xmm1
	shrl	$2, %eax
	pcmpeqd	%xmm1, %xmm0
	pandn	.LC0(%rip), %xmm0
	cmpl	$1, %eax
	je	.L172
	movdqu	20+flag(%rip), %xmm3
	pcmpeqd	%xmm3, %xmm1
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
.L172:
	movdqa	%xmm0, %xmm2
	movl	%edx, %esi
	psrldq	$8, %xmm2
	andl	$-4, %esi
	movdqa	%xmm2, %xmm1
	leal	1(%rsi), %ecx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%esi, %edx
	je	.L175
.L171:
	movslq	%ecx, %rsi
	movl	(%r15,%rsi,4), %esi
	testl	%esi, %esi
	cmovne	%eax, %esi
	leal	1(%rcx), %eax
	cmpl	%eax, %edx
	jl	.L177
	cltq
	movl	(%r15,%rax,4), %edi
	testl	%edi, %edi
	cmovne	%esi, %edi
	addl	$2, %ecx
	cmpl	%ecx, %edx
	jl	.L203
	movslq	%ecx, %rcx
	movl	(%r15,%rcx,4), %eax
	testl	%eax, %eax
	cmovne	%edi, %eax
.L175:
	addl	%eax, ans(%rip)
.L173:
	leaq	(%rbx,%rbx,4), %rax
	leal	1(%r12), %r9d
	movdqa	.LC0(%rip), %xmm8
	movl	$2, %ebp
	leaq	8+flag(%rip), %r13
	leaq	88+fn(%rip), %r14
	leaq	(%r8,%rax,8), %rcx
.L201:
	movl	(%rcx,%rbp,4), %eax
	cmpl	$1, %eax
	je	.L227
.L180:
	addq	$1, %rbp
	addq	$4, %r13
	addq	$40, %r14
	cmpl	%ebp, %edx
	jge	.L201
.L174:
	movl	$0, (%r15,%rbx,4)
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L227:
	.cfi_restore_state
	movl	0(%r13), %esi
	testl	%esi, %esi
	jne	.L180
	movl	%r9d, 0(%r13)
	testl	%edx, %edx
	jle	.L181
	leal	-1(%rdx), %esi
	cmpl	$2, %esi
	jbe	.L204
	movdqu	4+flag(%rip), %xmm1
	pxor	%xmm0, %xmm0
	movl	%edx, %eax
	shrl	$2, %eax
	pcmpeqd	%xmm0, %xmm1
	pandn	%xmm8, %xmm1
	cmpl	$1, %eax
	je	.L183
	movdqu	20+flag(%rip), %xmm4
	pcmpeqd	%xmm4, %xmm0
	pandn	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
.L183:
	movdqa	%xmm1, %xmm2
	movl	%edx, %edi
	psrldq	$8, %xmm2
	andl	$-4, %edi
	movdqa	%xmm2, %xmm0
	leal	1(%rdi), %esi
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%edi, %edx
	je	.L186
.L182:
	movslq	%esi, %rdi
	movl	(%r15,%rdi,4), %edi
	testl	%edi, %edi
	cmovne	%eax, %edi
	leal	1(%rsi), %eax
	cmpl	%eax, %edx
	jl	.L188
	cltq
	movl	(%r15,%rax,4), %r8d
	testl	%r8d, %r8d
	cmovne	%edi, %r8d
	addl	$2, %esi
	cmpl	%esi, %edx
	jl	.L205
	movslq	%esi, %rsi
	movl	(%r15,%rsi,4), %eax
	testl	%eax, %eax
	cmovne	%r8d, %eax
.L186:
	addl	%eax, ans(%rip)
.L184:
	cmpl	$1, (%r14)
	leal	2(%r12), %esi
	je	.L228
.L192:
	cmpl	$2, %edx
	jle	.L191
	cmpl	$1, 4(%r14)
	je	.L229
.L194:
	cmpl	$3, %edx
	jle	.L191
	cmpl	$1, 8(%r14)
	je	.L230
.L195:
	cmpl	$4, %edx
	jle	.L191
	cmpl	$1, 12(%r14)
	je	.L231
.L196:
	cmpl	$5, %edx
	jle	.L191
	cmpl	$1, 16(%r14)
	je	.L232
.L197:
	cmpl	$6, %edx
	jle	.L191
	cmpl	$1, 20(%r14)
	je	.L233
.L198:
	cmpl	$7, %edx
	jle	.L191
	cmpl	$1, 24(%r14)
	je	.L234
.L199:
	cmpl	$8, %edx
	jle	.L191
	cmpl	$1, 28(%r14)
	jne	.L191
	movl	36+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L191
	movl	$9, %edi
	movq	%rcx, 16(%rsp)
	movl	%r9d, 12(%rsp)
	call	route.part.0
	movl	n(%rip), %edx
	movq	16(%rsp), %rcx
	movl	12(%rsp), %r9d
	.p2align 4,,10
	.p2align 3
.L191:
	movl	$0, 0(%r13)
	jmp	.L180
	.p2align 4,,10
	.p2align 3
.L229:
	movl	12+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L194
	movl	$3, %edi
	movq	%rcx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%esi, 12(%rsp)
	call	route.part.0
	movl	n(%rip), %edx
	movq	24(%rsp), %rcx
	movl	16(%rsp), %r9d
	movl	12(%rsp), %esi
	jmp	.L194
	.p2align 4,,10
	.p2align 3
.L228:
	movl	8+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L192
	movl	$2, %edi
	movq	%rcx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%esi, 12(%rsp)
	call	route.part.0
	movl	n(%rip), %edx
	movq	24(%rsp), %rcx
	movl	16(%rsp), %r9d
	movl	12(%rsp), %esi
	jmp	.L192
.L177:
	addl	%esi, ans(%rip)
	cmpl	$1, %edx
	jle	.L174
	jmp	.L173
	.p2align 4,,10
	.p2align 3
.L170:
	addl	$1, ans(%rip)
	jmp	.L174
	.p2align 4,,10
	.p2align 3
.L230:
	movl	16+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L195
	movl	$4, %edi
	movq	%rcx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%esi, 12(%rsp)
	call	route.part.0
	movl	n(%rip), %edx
	movq	24(%rsp), %rcx
	movl	16(%rsp), %r9d
	movl	12(%rsp), %esi
	jmp	.L195
.L188:
	addl	%edi, ans(%rip)
	cmpl	$1, %edx
	jle	.L191
	jmp	.L184
	.p2align 4,,10
	.p2align 3
.L202:
	movl	$1, %ecx
	jmp	.L171
.L231:
	movl	20+flag(%rip), %r11d
	testl	%r11d, %r11d
	jne	.L196
	movl	$5, %edi
	movq	%rcx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%esi, 12(%rsp)
	call	route.part.0
	movl	n(%rip), %edx
	movq	24(%rsp), %rcx
	movl	16(%rsp), %r9d
	movl	12(%rsp), %esi
	jmp	.L196
.L203:
	movl	%edi, %eax
	jmp	.L175
.L181:
	addl	$1, ans(%rip)
	jmp	.L191
.L232:
	movl	24+flag(%rip), %r10d
	testl	%r10d, %r10d
	jne	.L197
	movl	$6, %edi
	movq	%rcx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%esi, 12(%rsp)
	call	route.part.0
	movl	n(%rip), %edx
	movq	24(%rsp), %rcx
	movl	16(%rsp), %r9d
	movl	12(%rsp), %esi
	jmp	.L197
.L204:
	movl	$1, %esi
	jmp	.L182
.L233:
	movl	28+flag(%rip), %r8d
	testl	%r8d, %r8d
	jne	.L198
	movl	$7, %edi
	movq	%rcx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%esi, 12(%rsp)
	call	route.part.0
	movl	n(%rip), %edx
	movq	24(%rsp), %rcx
	movl	16(%rsp), %r9d
	movl	12(%rsp), %esi
	jmp	.L198
.L205:
	movl	%r8d, %eax
	jmp	.L186
.L234:
	movl	32+flag(%rip), %edi
	testl	%edi, %edi
	jne	.L199
	movl	$8, %edi
	movq	%rcx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%esi, 12(%rsp)
	call	route.part.0
	movl	n(%rip), %edx
	movq	24(%rsp), %rcx
	movl	16(%rsp), %r9d
	movl	12(%rsp), %esi
	jmp	.L199
	.cfi_endproc
.LFE24:
	.size	route, .-route
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	n(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	movq	%rbx, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L239
	xorl	%r14d, %r14d
	leaq	20(%rsp), %r13
	leaq	16(%rsp), %rbp
	leaq	fn(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L236:
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	16(%rsp), %rax
	movslq	20(%rsp), %rdx
	addl	$1, %r14d
	leaq	(%rax,%rax,4), %rcx
	leaq	(%rdx,%rcx,2), %rcx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,2), %rax
	movl	$1, (%r12,%rcx,4)
	movl	$1, (%r12,%rax,4)
	cmpl	%r14d, 12(%rsp)
	jg	.L236
.L239:
	movl	n(%rip), %ebx
	leaq	flag(%rip), %r14
	movl	$2, 16(%rsp)
	movl	$2, %ebp
	leaq	fn(%rip), %r12
	leaq	4(%r14), %r13
	cmpl	$1, %ebx
	jle	.L238
	.p2align 4,,10
	.p2align 3
.L237:
	movl	$1, 4+flag(%rip)
	movslq	%ebp, %rax
	cmpl	$1, 40(%r12,%rax,4)
	je	.L250
.L240:
	movl	$1, 20(%rsp)
	testl	%ebx, %ebx
	jle	.L241
.L252:
	movslq	%ebx, %rdx
	xorl	%esi, %esi
	movq	%r13, %rdi
	addl	$1, %ebp
	salq	$2, %rdx
	call	memset@PLT
	leal	1(%rbx), %eax
	movl	%ebp, 16(%rsp)
	movl	%eax, 20(%rsp)
	cmpl	%ebp, %ebx
	jge	.L237
.L238:
	movl	ans(%rip), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L251
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L250:
	.cfi_restore_state
	movl	(%r14,%rax,4), %eax
	testl	%eax, %eax
	jne	.L240
	movl	%ebp, %edi
	movl	$2, %esi
	call	route.part.0
	movl	n(%rip), %ebx
	movl	16(%rsp), %ebp
	movl	$1, 20(%rsp)
	testl	%ebx, %ebx
	jg	.L252
	.p2align 4,,10
	.p2align 3
.L241:
	addl	$1, %ebp
	movl	%ebp, 16(%rsp)
	cmpl	%ebx, %ebp
	jle	.L237
	jmp	.L238
.L251:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	ans
	.bss
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	flag
	.align 32
	.type	flag, @object
	.size	flag, 40
flag:
	.zero	40
	.globl	fn
	.align 32
	.type	fn, @object
	.size	fn, 400
fn:
	.zero	400
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.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
	.type	route.part.0, @function
route.part.0:
.LFB26:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	flag(%rip), %r11
	movslq	%edi, %r10
	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	$104, %rsp
	.cfi_def_cfa_offset 160
	movl	n(%rip), %r9d
	movl	%esi, (%r11,%r10,4)
	movl	%esi, 24(%rsp)
	testl	%r9d, %r9d
	jle	.L2
	leal	-1(%r9), %eax
	cmpl	$2, %eax
	jbe	.L73
	movdqu	4+flag(%rip), %xmm0
	movl	%r9d, %eax
	pxor	%xmm1, %xmm1
	shrl	$2, %eax
	pcmpeqd	%xmm1, %xmm0
	pandn	.LC0(%rip), %xmm0
	cmpl	$1, %eax
	je	.L4
	movdqu	20+flag(%rip), %xmm5
	pcmpeqd	%xmm5, %xmm1
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
.L4:
	movdqa	%xmm0, %xmm2
	movl	%r9d, %ecx
	psrldq	$8, %xmm2
	andl	$-4, %ecx
	movdqa	%xmm2, %xmm1
	leal	1(%rcx), %edx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%ecx, %r9d
	je	.L7
.L3:
	movslq	%edx, %rcx
	movl	(%r11,%rcx,4), %ecx
	testl	%ecx, %ecx
	cmovne	%eax, %ecx
	leal	1(%rdx), %eax
	cmpl	%eax, %r9d
	jl	.L9
	cltq
	movl	(%r11,%rax,4), %esi
	testl	%esi, %esi
	cmovne	%ecx, %esi
	addl	$2, %edx
	cmpl	%edx, %r9d
	jl	.L74
	movslq	%edx, %rdx
	movl	(%r11,%rdx,4), %eax
	testl	%eax, %eax
	cmovne	%esi, %eax
.L7:
	addl	%eax, ans(%rip)
.L5:
	movl	24(%rsp), %eax
	leaq	fn(%rip), %rdx
	leaq	8+flag(%rip), %r14
	movl	$2, %r15d
	leaq	80(%rdx), %r8
	movdqa	.LC0(%rip), %xmm2
	movq	%r10, 16(%rsp)
	addl	$1, %eax
	movl	%eax, 28(%rsp)
	leaq	(%r10,%r10,4), %rax
	movq	%r8, %r10
	movq	%r14, %r8
	leaq	(%rdx,%rax,8), %rax
	movq	%r15, %r14
	movq	%rax, 8(%rsp)
.L72:
	movq	8(%rsp), %rax
	movl	(%rax,%r14,4), %eax
	cmpl	$1, %eax
	je	.L135
.L12:
	addq	$1, %r14
	addq	$4, %r8
	addq	$40, %r10
	cmpl	%r14d, %r9d
	jge	.L72
	movq	16(%rsp), %r10
.L6:
	movl	$0, (%r11,%r10,4)
	addq	$104, %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
	.p2align 4,,10
	.p2align 3
.L135:
	.cfi_restore_state
	movl	(%r8), %ebx
	testl	%ebx, %ebx
	jne	.L12
	movl	28(%rsp), %edi
	movl	%edi, (%r8)
	testl	%r9d, %r9d
	jle	.L13
	leal	-1(%r9), %edx
	cmpl	$2, %edx
	jbe	.L75
	movdqu	4+flag(%rip), %xmm1
	movl	%r9d, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	pcmpeqd	%xmm0, %xmm1
	pandn	.LC0(%rip), %xmm1
	cmpl	$1, %eax
	je	.L15
	movdqu	20+flag(%rip), %xmm6
	pcmpeqd	%xmm6, %xmm0
	pandn	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
.L15:
	movdqa	%xmm1, %xmm3
	movl	%r9d, %ecx
	psrldq	$8, %xmm3
	andl	$-4, %ecx
	movdqa	%xmm3, %xmm0
	leal	1(%rcx), %edx
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm3
	psrldq	$4, %xmm3
	movdqa	%xmm3, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm3, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%ecx, %r9d
	je	.L18
.L14:
	movslq	%edx, %rcx
	movl	(%r11,%rcx,4), %ecx
	testl	%ecx, %ecx
	cmovne	%eax, %ecx
	leal	1(%rdx), %eax
	cmpl	%eax, %r9d
	jl	.L20
	cltq
	movl	(%r11,%rax,4), %esi
	testl	%esi, %esi
	cmovne	%ecx, %esi
	addl	$2, %edx
	cmpl	%edx, %r9d
	jl	.L76
	movslq	%edx, %rdx
	movl	(%r11,%rdx,4), %eax
	testl	%eax, %eax
	cmovne	%esi, %eax
.L18:
	addl	%eax, ans(%rip)
.L16:
	movl	24(%rsp), %eax
	movq	%r8, 32(%rsp)
	leaq	80+fn(%rip), %rcx
	leaq	8+flag(%rip), %r13
	movq	%r14, 40(%rsp)
	movdqa	.LC0(%rip), %xmm3
	movl	$2, %r15d
	addl	$2, %eax
	movl	%eax, 48(%rsp)
.L70:
	movl	(%r10,%r15,4), %eax
	cmpl	$1, %eax
	je	.L136
.L23:
	addq	$1, %r15
	addq	$4, %r13
	addq	$40, %rcx
	cmpl	%r15d, %r9d
	jge	.L70
	movq	32(%rsp), %r8
	movq	40(%rsp), %r14
.L71:
	movl	$0, (%r8)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L136:
	movl	0(%r13), %r8d
	testl	%r8d, %r8d
	jne	.L23
	movl	48(%rsp), %ebx
	movl	%ebx, 0(%r13)
	testl	%r9d, %r9d
	jle	.L24
	leal	-1(%r9), %edx
	cmpl	$2, %edx
	jbe	.L77
	movdqu	4+flag(%rip), %xmm1
	pxor	%xmm0, %xmm0
	movl	%r9d, %eax
	shrl	$2, %eax
	pcmpeqd	%xmm0, %xmm1
	pandn	%xmm3, %xmm1
	cmpl	$1, %eax
	je	.L26
	movdqu	20+flag(%rip), %xmm7
	pcmpeqd	%xmm7, %xmm0
	pandn	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
.L26:
	movdqa	%xmm1, %xmm4
	movl	%r9d, %esi
	psrldq	$8, %xmm4
	andl	$-4, %esi
	movdqa	%xmm4, %xmm0
	leal	1(%rsi), %edx
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm4, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm4
	psrldq	$4, %xmm4
	movdqa	%xmm4, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm4, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%esi, %r9d
	je	.L29
.L25:
	movslq	%edx, %rsi
	movl	(%r11,%rsi,4), %esi
	testl	%esi, %esi
	cmovne	%eax, %esi
	leal	1(%rdx), %eax
	cmpl	%eax, %r9d
	jl	.L31
	cltq
	movl	(%r11,%rax,4), %edi
	testl	%edi, %edi
	cmovne	%esi, %edi
	addl	$2, %edx
	cmpl	%edx, %r9d
	jl	.L78
	movslq	%edx, %rdx
	movl	(%r11,%rdx,4), %eax
	testl	%eax, %eax
	cmovne	%edi, %eax
.L29:
	addl	%eax, ans(%rip)
.L27:
	movl	24(%rsp), %eax
	leaq	80+fn(%rip), %r8
	leaq	8+flag(%rip), %rbp
	movq	%r8, %r12
	leal	3(%rax), %ebx
	leal	4(%rax), %edi
	addl	$5, %eax
	movl	%edi, 56(%rsp)
	movl	%eax, 60(%rsp)
	movl	%ebx, 52(%rsp)
	movl	$2, %ebx
.L68:
	movl	(%rcx,%rbx,4), %eax
	cmpl	$1, %eax
	je	.L137
.L34:
	addq	$1, %rbx
	addq	$4, %rbp
	addq	$40, %r12
	cmpl	%ebx, %r9d
	jge	.L68
.L69:
	movl	$0, 0(%r13)
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L137:
	movl	0(%rbp), %edi
	testl	%edi, %edi
	jne	.L34
	movl	52(%rsp), %edi
	movl	%edi, 0(%rbp)
	testl	%r9d, %r9d
	jle	.L35
	leal	-1(%r9), %edx
	cmpl	$2, %edx
	jbe	.L79
	movdqu	4+flag(%rip), %xmm1
	pxor	%xmm0, %xmm0
	movl	%r9d, %eax
	shrl	$2, %eax
	pcmpeqd	%xmm0, %xmm1
	pandn	%xmm2, %xmm1
	cmpl	$1, %eax
	je	.L37
	movdqu	20+flag(%rip), %xmm7
	pcmpeqd	%xmm7, %xmm0
	pandn	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
.L37:
	movdqa	%xmm1, %xmm4
	movl	%r9d, %esi
	psrldq	$8, %xmm4
	andl	$-4, %esi
	movdqa	%xmm4, %xmm0
	leal	1(%rsi), %edx
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm4, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm4
	psrldq	$4, %xmm4
	movdqa	%xmm4, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm4, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%esi, %r9d
	je	.L40
.L36:
	movslq	%edx, %rsi
	movl	(%r11,%rsi,4), %esi
	testl	%esi, %esi
	cmovne	%eax, %esi
	leal	1(%rdx), %eax
	cmpl	%eax, %r9d
	jl	.L42
	cltq
	movl	(%r11,%rax,4), %edi
	testl	%edi, %edi
	cmovne	%esi, %edi
	addl	$2, %edx
	cmpl	%edx, %r9d
	jl	.L80
	movslq	%edx, %rdx
	movl	(%r11,%rdx,4), %eax
	testl	%eax, %eax
	cmovne	%edi, %eax
.L40:
	addl	%eax, ans(%rip)
.L38:
	movq	%r10, 64(%rsp)
	leaq	88+fn(%rip), %r8
	leaq	8+flag(%rip), %rdx
	movl	$2, %r14d
.L66:
	movl	(%r12,%r14,4), %eax
	cmpl	$1, %eax
	je	.L138
.L45:
	addq	$1, %r14
	addq	$4, %rdx
	addq	$40, %r8
	cmpl	%r14d, %r9d
	jge	.L66
	movq	64(%rsp), %r10
.L67:
	movl	$0, 0(%rbp)
	jmp	.L34
.L75:
	movl	$1, %edx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L138:
	movl	(%rdx), %esi
	testl	%esi, %esi
	jne	.L45
	movl	56(%rsp), %edi
	movl	%edi, (%rdx)
	testl	%r9d, %r9d
	jle	.L46
	leal	-1(%r9), %esi
	cmpl	$2, %esi
	jbe	.L81
	movdqu	4+flag(%rip), %xmm1
	pxor	%xmm0, %xmm0
	movl	%r9d, %eax
	shrl	$2, %eax
	pcmpeqd	%xmm0, %xmm1
	pandn	%xmm2, %xmm1
	cmpl	$1, %eax
	je	.L48
	movdqu	20+flag(%rip), %xmm7
	pcmpeqd	%xmm7, %xmm0
	pandn	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
.L48:
	movdqa	%xmm1, %xmm4
	movl	%r9d, %edi
	psrldq	$8, %xmm4
	andl	$-4, %edi
	movdqa	%xmm4, %xmm0
	leal	1(%rdi), %esi
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm4, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm4
	psrldq	$4, %xmm4
	movdqa	%xmm4, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm4, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%edi, %r9d
	je	.L51
.L47:
	movslq	%esi, %rdi
	movl	(%r11,%rdi,4), %edi
	testl	%edi, %edi
	cmovne	%eax, %edi
	leal	1(%rsi), %eax
	cmpl	%r9d, %eax
	jg	.L53
	cltq
	movl	(%r11,%rax,4), %r10d
	testl	%r10d, %r10d
	cmovne	%edi, %r10d
	addl	$2, %esi
	cmpl	%esi, %r9d
	jl	.L82
	movslq	%esi, %rsi
	movl	(%r11,%rsi,4), %eax
	testl	%eax, %eax
	cmovne	%r10d, %eax
.L51:
	addl	%eax, ans(%rip)
.L49:
	cmpl	$1, (%r8)
	je	.L139
.L57:
	cmpl	$2, %r9d
	jle	.L56
	cmpl	$1, 4(%r8)
	je	.L140
.L59:
	cmpl	$3, %r9d
	jle	.L56
	cmpl	$1, 8(%r8)
	je	.L141
.L60:
	cmpl	$4, %r9d
	jle	.L56
	cmpl	$1, 12(%r8)
	je	.L142
.L61:
	cmpl	$5, %r9d
	jle	.L56
	cmpl	$1, 16(%r8)
	je	.L143
.L62:
	cmpl	$6, %r9d
	jle	.L56
	cmpl	$1, 20(%r8)
	je	.L144
.L63:
	cmpl	$7, %r9d
	jle	.L56
	cmpl	$1, 24(%r8)
	je	.L145
.L64:
	cmpl	$8, %r9d
	jle	.L56
	cmpl	$1, 28(%r8)
	jne	.L56
	movl	36+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L56
	movl	60(%rsp), %esi
	movl	$9, %edi
	movq	%rcx, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%r8, 72(%rsp)
	call	route.part.0
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	leaq	flag(%rip), %r11
	movdqa	.LC0(%rip), %xmm2
	movl	n(%rip), %r9d
	movq	72(%rsp), %r8
	movdqa	%xmm2, %xmm3
	.p2align 4,,10
	.p2align 3
.L56:
	movl	$0, (%rdx)
	jmp	.L45
.L9:
	addl	%ecx, ans(%rip)
	cmpl	$1, %r9d
	jle	.L6
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	addl	$1, ans(%rip)
	jmp	.L6
.L20:
	addl	%ecx, ans(%rip)
	cmpl	$1, %r9d
	jle	.L71
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L73:
	movl	$1, %eax
	movl	$1, %edx
	jmp	.L3
.L74:
	movl	%esi, %eax
	jmp	.L7
.L13:
	addl	$1, ans(%rip)
	jmp	.L71
.L31:
	addl	%esi, ans(%rip)
	cmpl	$1, %r9d
	jle	.L69
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L78:
	movl	%edi, %eax
	jmp	.L29
.L35:
	addl	$1, ans(%rip)
	jmp	.L67
.L141:
	movl	16+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L60
	movl	60(%rsp), %esi
	movl	$4, %edi
	movq	%rcx, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%r8, 72(%rsp)
	call	route.part.0
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	leaq	flag(%rip), %r11
	movdqa	.LC0(%rip), %xmm2
	movl	n(%rip), %r9d
	movq	72(%rsp), %r8
	movdqa	%xmm2, %xmm3
	jmp	.L60
.L76:
	movl	%esi, %eax
	jmp	.L18
.L24:
	addl	$1, ans(%rip)
	jmp	.L69
.L139:
	movl	8+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L57
	movl	60(%rsp), %esi
	movl	$2, %edi
	movq	%rcx, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%r8, 72(%rsp)
	call	route.part.0
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	leaq	flag(%rip), %r11
	movdqa	.LC0(%rip), %xmm2
	movl	n(%rip), %r9d
	movq	72(%rsp), %r8
	movdqa	%xmm2, %xmm3
	jmp	.L57
.L42:
	addl	%esi, ans(%rip)
	cmpl	$1, %r9d
	jle	.L67
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L77:
	movl	$1, %edx
	jmp	.L25
.L140:
	movl	12+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L59
	movl	60(%rsp), %esi
	movl	$3, %edi
	movq	%rcx, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%r8, 72(%rsp)
	call	route.part.0
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	leaq	flag(%rip), %r11
	movdqa	.LC0(%rip), %xmm2
	movl	n(%rip), %r9d
	movq	72(%rsp), %r8
	movdqa	%xmm2, %xmm3
	jmp	.L59
.L53:
	addl	%edi, ans(%rip)
	cmpl	$1, %r9d
	jle	.L56
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L79:
	movl	$1, %edx
	jmp	.L36
.L142:
	movl	20+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L61
	movl	60(%rsp), %esi
	movl	$5, %edi
	movq	%rcx, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%r8, 72(%rsp)
	call	route.part.0
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	leaq	flag(%rip), %r11
	movdqa	.LC0(%rip), %xmm2
	movl	n(%rip), %r9d
	movq	72(%rsp), %r8
	movdqa	%xmm2, %xmm3
	jmp	.L61
.L80:
	movl	%edi, %eax
	jmp	.L40
.L46:
	addl	$1, ans(%rip)
	jmp	.L56
.L143:
	movl	24+flag(%rip), %r10d
	testl	%r10d, %r10d
	jne	.L62
	movl	60(%rsp), %esi
	movl	$6, %edi
	movq	%rcx, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%r8, 72(%rsp)
	call	route.part.0
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	leaq	flag(%rip), %r11
	movdqa	.LC0(%rip), %xmm2
	movl	n(%rip), %r9d
	movq	72(%rsp), %r8
	movdqa	%xmm2, %xmm3
	jmp	.L62
.L81:
	movl	$1, %esi
	jmp	.L47
.L144:
	movl	28+flag(%rip), %edi
	testl	%edi, %edi
	jne	.L63
	movl	60(%rsp), %esi
	movl	$7, %edi
	movq	%rcx, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%r8, 72(%rsp)
	call	route.part.0
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	leaq	flag(%rip), %r11
	movdqa	.LC0(%rip), %xmm2
	movl	n(%rip), %r9d
	movq	72(%rsp), %r8
	movdqa	%xmm2, %xmm3
	jmp	.L63
.L82:
	movl	%r10d, %eax
	jmp	.L51
.L145:
	movl	32+flag(%rip), %esi
	testl	%esi, %esi
	jne	.L64
	movl	60(%rsp), %esi
	movl	$8, %edi
	movq	%rcx, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%r8, 72(%rsp)
	call	route.part.0
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	leaq	flag(%rip), %r11
	movdqa	.LC0(%rip), %xmm2
	movl	n(%rip), %r9d
	movq	72(%rsp), %r8
	movdqa	%xmm2, %xmm3
	jmp	.L64
	.cfi_endproc
.LFE26:
	.size	route.part.0, .-route.part.0
	.p2align 4
	.globl	check
	.type	check, @function
check:
.LFB23:
	.cfi_startproc
	endbr64
	movl	n(%rip), %edx
	testl	%edx, %edx
	jle	.L154
	leal	-1(%rdx), %eax
	cmpl	$2, %eax
	jbe	.L155
	movdqu	4+flag(%rip), %xmm0
	movl	%edx, %eax
	pxor	%xmm1, %xmm1
	shrl	$2, %eax
	pcmpeqd	%xmm1, %xmm0
	pandn	.LC0(%rip), %xmm0
	cmpl	$1, %eax
	je	.L149
	movdqu	20+flag(%rip), %xmm3
	pcmpeqd	%xmm3, %xmm1
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
.L149:
	movdqa	%xmm0, %xmm2
	movl	%edx, %esi
	psrldq	$8, %xmm2
	andl	$-4, %esi
	movdqa	%xmm2, %xmm1
	leal	1(%rsi), %ecx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%esi, %edx
	je	.L167
.L148:
	leaq	flag(%rip), %r8
	movslq	%ecx, %rsi
	movl	(%r8,%rsi,4), %esi
	testl	%esi, %esi
	cmovne	%eax, %esi
	leal	1(%rcx), %eax
	cmpl	%edx, %eax
	jg	.L156
	cltq
	movl	(%r8,%rax,4), %edi
	testl	%edi, %edi
	cmovne	%esi, %edi
	addl	$2, %ecx
	cmpl	%ecx, %edx
	jl	.L157
	movslq	%ecx, %rcx
	movl	(%r8,%rcx,4), %eax
	testl	%eax, %eax
	cmovne	%edi, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L167:
	ret
	.p2align 4,,10
	.p2align 3
.L154:
	movl	$1, %eax
	ret
.L155:
	movl	$1, %ecx
	movl	$1, %eax
	jmp	.L148
.L156:
	movl	%esi, %eax
	ret
.L157:
	movl	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	check, .-check
	.p2align 4
	.globl	route
	.type	route, @function
route:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rdi
	leaq	fn(%rip), %r8
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	(%rdi,%rdi,4), %rax
	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
	movslq	%esi, %rbx
	leaq	(%rbx,%rax,2), %rax
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movl	(%r8,%rax,4), %eax
	cmpl	$1, %eax
	je	.L226
.L168:
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L226:
	.cfi_restore_state
	leaq	flag(%rip), %r15
	movl	(%r15,%rbx,4), %edi
	testl	%edi, %edi
	jne	.L168
	movl	%edx, (%r15,%rbx,4)
	movl	%edx, %r12d
	movl	n(%rip), %edx
	testl	%edx, %edx
	jle	.L170
	leal	-1(%rdx), %ecx
	cmpl	$2, %ecx
	jbe	.L202
	movdqu	4+flag(%rip), %xmm0
	movl	%edx, %eax
	pxor	%xmm1, %xmm1
	shrl	$2, %eax
	pcmpeqd	%xmm1, %xmm0
	pandn	.LC0(%rip), %xmm0
	cmpl	$1, %eax
	je	.L172
	movdqu	20+flag(%rip), %xmm3
	pcmpeqd	%xmm3, %xmm1
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
.L172:
	movdqa	%xmm0, %xmm2
	movl	%edx, %esi
	psrldq	$8, %xmm2
	andl	$-4, %esi
	movdqa	%xmm2, %xmm1
	leal	1(%rsi), %ecx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%esi, %edx
	je	.L175
.L171:
	movslq	%ecx, %rsi
	movl	(%r15,%rsi,4), %esi
	testl	%esi, %esi
	cmovne	%eax, %esi
	leal	1(%rcx), %eax
	cmpl	%eax, %edx
	jl	.L177
	cltq
	movl	(%r15,%rax,4), %edi
	testl	%edi, %edi
	cmovne	%esi, %edi
	addl	$2, %ecx
	cmpl	%ecx, %edx
	jl	.L203
	movslq	%ecx, %rcx
	movl	(%r15,%rcx,4), %eax
	testl	%eax, %eax
	cmovne	%edi, %eax
.L175:
	addl	%eax, ans(%rip)
.L173:
	leaq	(%rbx,%rbx,4), %rax
	leal	1(%r12), %r9d
	movdqa	.LC0(%rip), %xmm8
	movl	$2, %ebp
	leaq	8+flag(%rip), %r13
	leaq	88+fn(%rip), %r14
	leaq	(%r8,%rax,8), %rcx
.L201:
	movl	(%rcx,%rbp,4), %eax
	cmpl	$1, %eax
	je	.L227
.L180:
	addq	$1, %rbp
	addq	$4, %r13
	addq	$40, %r14
	cmpl	%ebp, %edx
	jge	.L201
.L174:
	movl	$0, (%r15,%rbx,4)
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L227:
	.cfi_restore_state
	movl	0(%r13), %esi
	testl	%esi, %esi
	jne	.L180
	movl	%r9d, 0(%r13)
	testl	%edx, %edx
	jle	.L181
	leal	-1(%rdx), %esi
	cmpl	$2, %esi
	jbe	.L204
	movdqu	4+flag(%rip), %xmm1
	pxor	%xmm0, %xmm0
	movl	%edx, %eax
	shrl	$2, %eax
	pcmpeqd	%xmm0, %xmm1
	pandn	%xmm8, %xmm1
	cmpl	$1, %eax
	je	.L183
	movdqu	20+flag(%rip), %xmm4
	pcmpeqd	%xmm4, %xmm0
	pandn	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
.L183:
	movdqa	%xmm1, %xmm2
	movl	%edx, %edi
	psrldq	$8, %xmm2
	andl	$-4, %edi
	movdqa	%xmm2, %xmm0
	leal	1(%rdi), %esi
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%edi, %edx
	je	.L186
.L182:
	movslq	%esi, %rdi
	movl	(%r15,%rdi,4), %edi
	testl	%edi, %edi
	cmovne	%eax, %edi
	leal	1(%rsi), %eax
	cmpl	%eax, %edx
	jl	.L188
	cltq
	movl	(%r15,%rax,4), %r8d
	testl	%r8d, %r8d
	cmovne	%edi, %r8d
	addl	$2, %esi
	cmpl	%esi, %edx
	jl	.L205
	movslq	%esi, %rsi
	movl	(%r15,%rsi,4), %eax
	testl	%eax, %eax
	cmovne	%r8d, %eax
.L186:
	addl	%eax, ans(%rip)
.L184:
	cmpl	$1, (%r14)
	leal	2(%r12), %esi
	je	.L228
.L192:
	cmpl	$2, %edx
	jle	.L191
	cmpl	$1, 4(%r14)
	je	.L229
.L194:
	cmpl	$3, %edx
	jle	.L191
	cmpl	$1, 8(%r14)
	je	.L230
.L195:
	cmpl	$4, %edx
	jle	.L191
	cmpl	$1, 12(%r14)
	je	.L231
.L196:
	cmpl	$5, %edx
	jle	.L191
	cmpl	$1, 16(%r14)
	je	.L232
.L197:
	cmpl	$6, %edx
	jle	.L191
	cmpl	$1, 20(%r14)
	je	.L233
.L198:
	cmpl	$7, %edx
	jle	.L191
	cmpl	$1, 24(%r14)
	je	.L234
.L199:
	cmpl	$8, %edx
	jle	.L191
	cmpl	$1, 28(%r14)
	jne	.L191
	movl	36+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L191
	movl	$9, %edi
	movq	%rcx, 16(%rsp)
	movl	%r9d, 12(%rsp)
	call	route.part.0
	movl	n(%rip), %edx
	movq	16(%rsp), %rcx
	movl	12(%rsp), %r9d
	.p2align 4,,10
	.p2align 3
.L191:
	movl	$0, 0(%r13)
	jmp	.L180
	.p2align 4,,10
	.p2align 3
.L229:
	movl	12+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L194
	movl	$3, %edi
	movq	%rcx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%esi, 12(%rsp)
	call	route.part.0
	movl	n(%rip), %edx
	movq	24(%rsp), %rcx
	movl	16(%rsp), %r9d
	movl	12(%rsp), %esi
	jmp	.L194
	.p2align 4,,10
	.p2align 3
.L228:
	movl	8+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L192
	movl	$2, %edi
	movq	%rcx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%esi, 12(%rsp)
	call	route.part.0
	movl	n(%rip), %edx
	movq	24(%rsp), %rcx
	movl	16(%rsp), %r9d
	movl	12(%rsp), %esi
	jmp	.L192
.L177:
	addl	%esi, ans(%rip)
	cmpl	$1, %edx
	jle	.L174
	jmp	.L173
	.p2align 4,,10
	.p2align 3
.L170:
	addl	$1, ans(%rip)
	jmp	.L174
	.p2align 4,,10
	.p2align 3
.L230:
	movl	16+flag(%rip), %eax
	testl	%eax, %eax
	jne	.L195
	movl	$4, %edi
	movq	%rcx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%esi, 12(%rsp)
	call	route.part.0
	movl	n(%rip), %edx
	movq	24(%rsp), %rcx
	movl	16(%rsp), %r9d
	movl	12(%rsp), %esi
	jmp	.L195
.L188:
	addl	%edi, ans(%rip)
	cmpl	$1, %edx
	jle	.L191
	jmp	.L184
	.p2align 4,,10
	.p2align 3
.L202:
	movl	$1, %ecx
	jmp	.L171
.L231:
	movl	20+flag(%rip), %r11d
	testl	%r11d, %r11d
	jne	.L196
	movl	$5, %edi
	movq	%rcx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%esi, 12(%rsp)
	call	route.part.0
	movl	n(%rip), %edx
	movq	24(%rsp), %rcx
	movl	16(%rsp), %r9d
	movl	12(%rsp), %esi
	jmp	.L196
.L203:
	movl	%edi, %eax
	jmp	.L175
.L181:
	addl	$1, ans(%rip)
	jmp	.L191
.L232:
	movl	24+flag(%rip), %r10d
	testl	%r10d, %r10d
	jne	.L197
	movl	$6, %edi
	movq	%rcx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%esi, 12(%rsp)
	call	route.part.0
	movl	n(%rip), %edx
	movq	24(%rsp), %rcx
	movl	16(%rsp), %r9d
	movl	12(%rsp), %esi
	jmp	.L197
.L204:
	movl	$1, %esi
	jmp	.L182
.L233:
	movl	28+flag(%rip), %r8d
	testl	%r8d, %r8d
	jne	.L198
	movl	$7, %edi
	movq	%rcx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%esi, 12(%rsp)
	call	route.part.0
	movl	n(%rip), %edx
	movq	24(%rsp), %rcx
	movl	16(%rsp), %r9d
	movl	12(%rsp), %esi
	jmp	.L198
.L205:
	movl	%r8d, %eax
	jmp	.L186
.L234:
	movl	32+flag(%rip), %edi
	testl	%edi, %edi
	jne	.L199
	movl	$8, %edi
	movq	%rcx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%esi, 12(%rsp)
	call	route.part.0
	movl	n(%rip), %edx
	movq	24(%rsp), %rcx
	movl	16(%rsp), %r9d
	movl	12(%rsp), %esi
	jmp	.L199
	.cfi_endproc
.LFE24:
	.size	route, .-route
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	n(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	movq	%rbx, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L239
	xorl	%r14d, %r14d
	leaq	20(%rsp), %r13
	leaq	16(%rsp), %rbp
	leaq	fn(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L236:
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	16(%rsp), %rax
	movslq	20(%rsp), %rdx
	addl	$1, %r14d
	leaq	(%rax,%rax,4), %rcx
	leaq	(%rdx,%rcx,2), %rcx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,2), %rax
	movl	$1, (%r12,%rcx,4)
	movl	$1, (%r12,%rax,4)
	cmpl	%r14d, 12(%rsp)
	jg	.L236
.L239:
	movl	n(%rip), %ebx
	leaq	flag(%rip), %r14
	movl	$2, 16(%rsp)
	movl	$2, %ebp
	leaq	fn(%rip), %r12
	leaq	4(%r14), %r13
	cmpl	$1, %ebx
	jle	.L238
	.p2align 4,,10
	.p2align 3
.L237:
	movl	$1, 4+flag(%rip)
	movslq	%ebp, %rax
	cmpl	$1, 40(%r12,%rax,4)
	je	.L250
.L240:
	movl	$1, 20(%rsp)
	testl	%ebx, %ebx
	jle	.L241
.L252:
	movslq	%ebx, %rdx
	xorl	%esi, %esi
	movq	%r13, %rdi
	addl	$1, %ebp
	salq	$2, %rdx
	call	memset@PLT
	leal	1(%rbx), %eax
	movl	%ebp, 16(%rsp)
	movl	%eax, 20(%rsp)
	cmpl	%ebp, %ebx
	jge	.L237
.L238:
	movl	ans(%rip), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L251
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L250:
	.cfi_restore_state
	movl	(%r14,%rax,4), %eax
	testl	%eax, %eax
	jne	.L240
	movl	%ebp, %edi
	movl	$2, %esi
	call	route.part.0
	movl	n(%rip), %ebx
	movl	16(%rsp), %ebp
	movl	$1, 20(%rsp)
	testl	%ebx, %ebx
	jg	.L252
	.p2align 4,,10
	.p2align 3
.L241:
	addl	$1, %ebp
	movl	%ebp, 16(%rsp)
	cmpl	%ebx, %ebp
	jle	.L237
	jmp	.L238
.L251:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	ans
	.bss
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	flag
	.align 32
	.type	flag, @object
	.size	flag, 40
flag:
	.zero	40
	.globl	fn
	.align 32
	.type	fn, @object
	.size	fn, 400
fn:
	.zero	400
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.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 fn[10][10]={};
int flag[10]={};
int n;
int ans=0;
 
int check(int num){
    int flaga=1;
    for(int i=1;i<=n;i++){
        if(flag[i]==0) flaga=0;
    }
    return flaga;
}
 
void route(int j,int i,int num){
    if (fn[j][i]==1&&flag[i]==0){
        flag[i]=num;
        int a=check(num);
        ans+=a;
        for (int k=2;k<=n;k++){
            route(i,k,num+1);
        }
        flag[i]=0;
    }
}
 
int main(){
    int m,i,j;
    scanf("%d %d",&n,&m);
    for (int k=0;k<m;k++){
        scanf("%d %d",&i,&j);
        fn[i][j]=1;
        fn[j][i]=1;
    }
    for (i=2;i<=n;i++){
        flag[1]=1;
        route(1,i,2);
        for (j=1;j<=n;j++)flag[j]=0;
    }
    printf("%d\n",ans);
}
7 4
1 3
2 7
3 4
4 5
4 6
5 6
6 7
 7 7
1 3
2 7
3 4
4 5
4 1
5 6
6 7
 7 7
1 3
2 7
3 4
4 5
4 6
4 6
6 7
 7 4
1 4
2 7
3 4
4 5
4 6
5 6
6 7
 7 7
1 5
2 7
3 4
4 5
4 6
4 6
6 7
 7 4
1 5
2 7
3 4
4 5
4 6
5 6
6 7
 7 4
1 5
2 7
3 4
4 5
4 12
5 6
6 7
 7 4
1 5
2 7
3 4
4 5
4 12
5 6
0 7
 7 4
1 3
2 7
3 4
5 5
4 6
5 6
6 7
 7 4
1 4
3 7
3 4
4 5
4 6
5 6
6 7

0
 1
 0
 0
 0
 0
 0
 0
 0
 0

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

```c
#include <stdio.h>
int fn[10][10]={};
int flag[10]={};
int n;
int ans=0;
 
int check(int num){
    int flaga=1;
    for(int i=1;i<=n;i++){
        if(flag[i]==0) flaga=0;
    }
    return flaga;
}
 
void route(int j,int i,int num){
    if (fn[j][i]==1&&flag[i]==0){
        flag[i]=num;
        int a=check(num);
        ans+=a;
        for (int k=2;k<=n;k++){
            route(i,k,num+1);
        }
        flag[i]=0;
    }
}
 
int main(){
    int m,i,j;
    scanf("%d %d",&n,&m);
    for (int k=0;k<m;k++){
        scanf("%d %d",&i,&j);
        fn[i][j]=1;
        fn[j][i]=1;
    }
    for (i=2;i<=n;i++){
        flag[1]=1;
        route(1,i,2);
        for (j=1;j<=n;j++)flag[j]=0;
    }
    printf("%d\n",ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	fn
	.bss
	.align 32
	.type	fn, @object
	.size	fn, 400
fn:
	.zero	400
	.globl	flag
	.align 32
	.type	flag, @object
	.size	flag, 40
flag:
	.zero	40
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.text
	.globl	check
	.type	check, @function
check:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$1, -8(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L2
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L3
	movl	$0, -8(%rbp)
.L3:
	addl	$1, -4(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L4
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	check, .-check
	.globl	route
	.type	route, @function
route:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	fn(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L10
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L10
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	flag(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	check
	movl	%eax, -4(%rbp)
	movl	ans(%rip), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, ans(%rip)
	movl	$2, -8(%rbp)
	jmp	.L8
.L9:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %ecx
	movl	-24(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	route
	addl	$1, -8(%rbp)
.L8:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L9
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	$0, (%rdx,%rax)
.L10:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	route, .-route
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %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, -12(%rbp)
	jmp	.L12
.L13:
	leaq	-16(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	fn(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-16(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	fn(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L12:
	movl	-24(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	movl	$2, -20(%rbp)
	jmp	.L14
.L17:
	movl	$1, 4+flag(%rip)
	movl	-20(%rbp), %eax
	movl	$2, %edx
	movl	%eax, %esi
	movl	$1, %edi
	call	route
	movl	$1, -16(%rbp)
	jmp	.L15
.L16:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-16(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -16(%rbp)
.L15:
	movl	-16(%rbp), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L16
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
.L14:
	movl	-20(%rbp), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L17
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	fn
	.bss
	.align 32
	.type	fn, @object
	.size	fn, 400
fn:
	.zero	400
	.globl	flag
	.align 32
	.type	flag, @object
	.size	flag, 40
flag:
	.zero	40
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.text
	.globl	check
	.type	check, @function
check:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$1, -8(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L2
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L3
	movl	$0, -8(%rbp)
.L3:
	addl	$1, -4(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L4
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	check, .-check
	.globl	route
	.type	route, @function
route:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	fn(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L10
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L10
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	flag(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	check
	movl	%eax, -4(%rbp)
	movl	ans(%rip), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, ans(%rip)
	movl	$2, -8(%rbp)
	jmp	.L8
.L9:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %ecx
	movl	-24(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	route
	addl	$1, -8(%rbp)
.L8:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L9
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	$0, (%rdx,%rax)
.L10:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	route, .-route
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %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, -12(%rbp)
	jmp	.L12
.L13:
	leaq	-16(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	fn(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-16(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	fn(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L12:
	movl	-24(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	movl	$2, -20(%rbp)
	jmp	.L14
.L17:
	movl	$1, 4+flag(%rip)
	movl	-20(%rbp), %eax
	movl	$2, %edx
	movl	%eax, %esi
	movl	$1, %edi
	call	route
	movl	$1, -16(%rbp)
	jmp	.L15
.L16:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-16(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -16(%rbp)
.L15:
	movl	-16(%rbp), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L16
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
.L14:
	movl	-20(%rbp), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L17
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
