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

```c
/* AtCoder Regular Contest 078. Problem D, by Abreto<m@abreto.net>. */
#include <stdio.h>

#define MAXN    100001

struct
{
    int id;
    int next;
}node[MAXN<<2];
int nnodes;
int front[MAXN];
void add_edge(int u, int v)
{
    int newnode = ++nnodes;
    node[newnode].id = v;
    node[newnode].next = front[u];
    front[u] = newnode;
}

int N;
int vis[MAXN];
int par[MAXN];
int nxt[MAXN];
int chd[MAXN];
int nb, nw;

int dfs2N(int u)
{
    int v = front[u];
    vis[u] = 1;
    if(u == N) return 1;
    while(v)
    {
        int w = node[v].id;
        if(!vis[w])
        {
            if(dfs2N(w))
            {
                u[nxt] = w;
                w[par] = u;
                return 1;
            }
        }
        v = node[v].next;
    }
    return 0;
}

void find_path(void)
{
    int i = 0;
    dfs2N(1);
    for(i = 1;i <= N;++i)
        vis[i] = 0;
    for(i = nxt[1];i != N;i = nxt[i])
        vis[i] = 1;
    vis[1] = vis[N] = 1;
}

int countchd(int u)
{
    int  v = front[u];
    int cnt = 1;
    vis[u] = 1;
    while(v)
    {
        int w = node[v].id;
        if(!vis[w]) cnt += countchd(w);
        v = node[v].next;
    }
    return cnt;
}

void travel_path(void)
{
    int i = 0;
    int u = 1[nxt], v = N[par];
    nb = countchd(1); nw = countchd(N);
    while(u != v && u != v[nxt])
    {
        nb += countchd(u);
        nw += countchd(v);
        u = u[nxt]; v = v[par];
    }
    if(u == v) nb += countchd(u);
}

int main(void)
{
    int i = 0;
    int ai = 0, bi = 0;

    scanf("%d", &N);
    for(i = 1;i < N;++i)
    {
        scanf("%d%d", &ai, &bi);
        add_edge(ai, bi);
        add_edge(bi, ai);
    }
    find_path();
    travel_path();
    printf("%s\n", (nb>nw)?"Fennec":"Snuke");
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	node
	.bss
	.align 32
	.type	node, @object
	.size	node, 3200032
node:
	.zero	3200032
	.globl	nnodes
	.align 4
	.type	nnodes, @object
	.size	nnodes, 4
nnodes:
	.zero	4
	.globl	front
	.align 32
	.type	front, @object
	.size	front, 400004
front:
	.zero	400004
	.text
	.globl	add_edge
	.type	add_edge, @function
add_edge:
.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	%esi, -24(%rbp)
	movl	nnodes(%rip), %eax
	addl	$1, %eax
	movl	%eax, nnodes(%rip)
	movl	nnodes(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	node(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	front(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+node(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	front(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	add_edge, .-add_edge
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	vis
	.align 32
	.type	vis, @object
	.size	vis, 400004
vis:
	.zero	400004
	.globl	par
	.align 32
	.type	par, @object
	.size	par, 400004
par:
	.zero	400004
	.globl	nxt
	.align 32
	.type	nxt, @object
	.size	nxt, 400004
nxt:
	.zero	400004
	.globl	chd
	.align 32
	.type	chd, @object
	.size	chd, 400004
chd:
	.zero	400004
	.globl	nb
	.align 4
	.type	nb, @object
	.size	nb, 4
nb:
	.zero	4
	.globl	nw
	.align 4
	.type	nw, @object
	.size	nw, 4
nw:
	.zero	4
	.text
	.globl	dfs2N
	.type	dfs2N, @function
dfs2N:
.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	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	front(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L5
	movl	$1, %eax
	jmp	.L4
.L7:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	node(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L6
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	dfs2N
	testl	%eax, %eax
	je	.L6
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	nxt(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	par(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$1, %eax
	jmp	.L4
.L6:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+node(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
.L5:
	cmpl	$0, -8(%rbp)
	jne	.L7
	movl	$0, %eax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	dfs2N, .-dfs2N
	.globl	find_path
	.type	find_path, @function
find_path:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -4(%rbp)
	movl	$1, %edi
	call	dfs2N
	movl	$1, -4(%rbp)
	jmp	.L9
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L9:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L10
	movl	4+nxt(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L11
.L12:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	nxt(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L12
	movl	N(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	vis(%rip), %rdx
	movl	$1, (%rcx,%rdx)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, 4+vis(%rip)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	find_path, .-find_path
	.globl	countchd
	.type	countchd, @function
countchd:
.LFB3:
	.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	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	front(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	$1, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L14
.L16:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	node(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L15
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	countchd
	addl	%eax, -8(%rbp)
.L15:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+node(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
.L14:
	cmpl	$0, -12(%rbp)
	jne	.L16
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	countchd, .-countchd
	.globl	travel_path
	.type	travel_path, @function
travel_path:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -4(%rbp)
	movl	4+nxt(%rip), %eax
	movl	%eax, -12(%rbp)
	movl	N(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	par(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	$1, %edi
	call	countchd
	movl	%eax, nb(%rip)
	movl	N(%rip), %eax
	movl	%eax, %edi
	call	countchd
	movl	%eax, nw(%rip)
	jmp	.L19
.L21:
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	countchd
	movl	nb(%rip), %edx
	addl	%edx, %eax
	movl	%eax, nb(%rip)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	countchd
	movl	nw(%rip), %edx
	addl	%edx, %eax
	movl	%eax, nw(%rip)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	nxt(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	par(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
.L19:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	je	.L20
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	nxt(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L21
.L20:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jne	.L23
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	countchd
	movl	nb(%rip), %edx
	addl	%edx, %eax
	movl	%eax, nb(%rip)
.L23:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	travel_path, .-travel_path
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"Fennec"
.LC3:
	.string	"Snuke"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.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
	movl	$0, -12(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -12(%rbp)
	jmp	.L25
.L26:
	leaq	-16(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	add_edge
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	add_edge
	addl	$1, -12(%rbp)
.L25:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L26
	call	find_path
	call	travel_path
	movl	nb(%rip), %edx
	movl	nw(%rip), %eax
	cmpl	%eax, %edx
	jle	.L27
	leaq	.LC2(%rip), %rax
	jmp	.L28
.L27:
	leaq	.LC3(%rip), %rax
.L28:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.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	add_edge
	.type	add_edge, @function
add_edge:
.LFB23:
	.cfi_startproc
	endbr64
	movl	nnodes(%rip), %eax
	leaq	front(%rip), %rdx
	movslq	%edi, %rdi
	movd	%esi, %xmm0
	movd	(%rdx,%rdi,4), %xmm1
	leaq	node(%rip), %rcx
	addl	$1, %eax
	movslq	%eax, %r8
	punpckldq	%xmm1, %xmm0
	movl	%eax, nnodes(%rip)
	movq	%xmm0, (%rcx,%r8,8)
	movl	%eax, (%rdx,%rdi,4)
	ret
	.cfi_endproc
.LFE23:
	.size	add_edge, .-add_edge
	.p2align 4
	.globl	dfs2N
	.type	dfs2N, @function
dfs2N:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rax
	leaq	front(%rip), %rsi
	leaq	vis(%rip), %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
	movq	%rax, %rbx
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	cmpl	%ebx, N(%rip)
	movl	(%rsi,%rax,4), %r11d
	movl	$1, (%r10,%rax,4)
	movl	%eax, 148(%rsp)
	movq	%rax, 152(%rsp)
	movl	$1, %eax
	je	.L3
	leaq	node(%rip), %rbp
	testl	%r11d, %r11d
	jne	.L5
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L6:
	movq	80(%rsp), %rax
	movl	4(%rbp,%rax,8), %r11d
	testl	%r11d, %r11d
	je	.L31
.L5:
	movslq	%r11d, %rax
	movq	%rax, 80(%rsp)
	movslq	0(%rbp,%rax,8), %rax
	movl	(%r10,%rax,4), %r14d
	movl	%eax, 92(%rsp)
	movq	%rax, 96(%rsp)
	testl	%r14d, %r14d
	jne	.L6
	leaq	front(%rip), %rsi
	movl	$1, (%r10,%rax,4)
	movl	(%rsi,%rax,4), %r11d
	movl	92(%rsp), %eax
	cmpl	N(%rip), %eax
	je	.L89
	testl	%r11d, %r11d
	jne	.L30
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	movq	64(%rsp), %rax
	movl	4(%rbp,%rax,8), %r11d
	testl	%r11d, %r11d
	je	.L6
.L30:
	movslq	%r11d, %rax
	movq	%rax, 64(%rsp)
	movslq	0(%rbp,%rax,8), %rax
	movl	(%r10,%rax,4), %r13d
	movl	%eax, 88(%rsp)
	movq	%rax, 72(%rsp)
	testl	%r13d, %r13d
	jne	.L8
	leaq	front(%rip), %rbx
	movl	$1, (%r10,%rax,4)
	movl	(%rbx,%rax,4), %r11d
	movl	88(%rsp), %eax
	cmpl	N(%rip), %eax
	je	.L90
	testl	%r11d, %r11d
	jne	.L29
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L10:
	movq	40(%rsp), %rax
	movl	4(%rbp,%rax,8), %r11d
	testl	%r11d, %r11d
	je	.L8
.L29:
	movslq	%r11d, %rax
	movq	%rax, 40(%rsp)
	movslq	0(%rbp,%rax,8), %rax
	movl	(%r10,%rax,4), %r12d
	movl	%eax, 52(%rsp)
	movq	%rax, 56(%rsp)
	testl	%r12d, %r12d
	jne	.L10
	leaq	front(%rip), %rbx
	movl	$1, (%r10,%rax,4)
	movl	(%rbx,%rax,4), %r11d
	movl	52(%rsp), %eax
	cmpl	N(%rip), %eax
	je	.L91
	testl	%r11d, %r11d
	jne	.L28
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L12:
	movq	24(%rsp), %rax
	movl	4(%rbp,%rax,8), %r11d
	testl	%r11d, %r11d
	je	.L10
.L28:
	movslq	%r11d, %rax
	movq	%rax, 24(%rsp)
	movslq	0(%rbp,%rax,8), %rax
	movl	(%r10,%rax,4), %ebx
	movl	%eax, 48(%rsp)
	movq	%rax, 32(%rsp)
	testl	%ebx, %ebx
	jne	.L12
	leaq	front(%rip), %rsi
	movl	$1, (%r10,%rax,4)
	movl	(%rsi,%rax,4), %r11d
	movl	48(%rsp), %eax
	cmpl	N(%rip), %eax
	je	.L92
	testl	%r11d, %r11d
	jne	.L27
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L14:
	movq	(%rsp), %rax
	movl	4(%rbp,%rax,8), %r11d
	testl	%r11d, %r11d
	je	.L12
.L27:
	movslq	%r11d, %rax
	movq	%rax, (%rsp)
	movslq	0(%rbp,%rax,8), %rax
	movl	(%r10,%rax,4), %r11d
	movl	%eax, 12(%rsp)
	movq	%rax, 16(%rsp)
	testl	%r11d, %r11d
	jne	.L14
	leaq	front(%rip), %rsi
	movl	$1, (%r10,%rax,4)
	movl	(%rsi,%rax,4), %ecx
	movl	12(%rsp), %eax
	cmpl	N(%rip), %eax
	je	.L93
	testl	%ecx, %ecx
	jne	.L26
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L16:
	movl	4(%rbp,%r14,8), %ecx
	testl	%ecx, %ecx
	je	.L14
.L26:
	movslq	%ecx, %r14
	movslq	0(%rbp,%r14,8), %r8
	movl	(%r10,%r8,4), %r9d
	movq	%r8, %r11
	testl	%r9d, %r9d
	jne	.L16
	leaq	front(%rip), %rax
	cmpl	N(%rip), %r8d
	movl	$1, (%r10,%r8,4)
	movl	(%rax,%r8,4), %eax
	je	.L94
	testl	%eax, %eax
	jne	.L25
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L18:
	movl	4(%rbp,%rbx,8), %eax
	testl	%eax, %eax
	je	.L16
.L25:
	movslq	%eax, %rbx
	movslq	0(%rbp,%rbx,8), %rsi
	movl	(%r10,%rsi,4), %edi
	movq	%rsi, %r9
	testl	%edi, %edi
	jne	.L18
	leaq	front(%rip), %rax
	cmpl	N(%rip), %esi
	movl	$1, (%r10,%rsi,4)
	movslq	(%rax,%rsi,4), %rdx
	je	.L95
	testl	%edx, %edx
	jne	.L24
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L20:
	movslq	4(%rbp,%rdx,8), %rdx
	testl	%edx, %edx
	je	.L18
.L24:
	movslq	0(%rbp,%rdx,8), %r15
	movl	(%r10,%r15,4), %ecx
	movq	%r15, %r12
	testl	%ecx, %ecx
	jne	.L20
	leaq	front(%rip), %rax
	cmpl	N(%rip), %r15d
	movl	$1, (%r10,%r15,4)
	movl	(%rax,%r15,4), %eax
	je	.L96
	testl	%eax, %eax
	jne	.L23
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L22:
	movl	4(%rbp,%r13,8), %eax
	testl	%eax, %eax
	je	.L20
.L23:
	movslq	%eax, %r13
	movslq	0(%rbp,%r13,8), %rcx
	movl	(%r10,%rcx,4), %eax
	movq	%rcx, %rdi
	testl	%eax, %eax
	jne	.L22
	movq	%rcx, 136(%rsp)
	movq	%rdx, 128(%rsp)
	movq	%rsi, 120(%rsp)
	movq	%r8, 112(%rsp)
	movl	%r9d, 144(%rsp)
	movl	%r11d, 108(%rsp)
	movl	%ecx, 104(%rsp)
	call	dfs2N
	movl	104(%rsp), %edi
	movl	108(%rsp), %r11d
	leaq	vis(%rip), %r10
	testl	%eax, %eax
	movq	112(%rsp), %r8
	movl	144(%rsp), %r9d
	movq	120(%rsp), %rsi
	movq	128(%rsp), %rdx
	movq	136(%rsp), %rcx
	je	.L22
	movq	%rcx, %r14
	leaq	nxt(%rip), %rax
	movq	%r8, %rbx
	movl	%r12d, %edx
	leaq	par(%rip), %rcx
	movl	%edi, (%rax,%r15,4)
	movl	%r11d, %r8d
	movq	%rsi, %r11
	movl	%r12d, (%rcx,%r14,4)
.L21:
	movl	%edx, (%rax,%r11,4)
	movl	%r9d, (%rcx,%r15,4)
.L19:
	movl	%r9d, (%rax,%rbx,4)
	movl	%r8d, (%rcx,%r11,4)
.L17:
	movq	16(%rsp), %rsi
	movl	%r8d, (%rax,%rsi,4)
	movl	12(%rsp), %esi
	movl	%esi, (%rcx,%rbx,4)
.L15:
	movq	32(%rsp), %rsi
	movl	12(%rsp), %ebx
	movl	%ebx, (%rax,%rsi,4)
	movq	16(%rsp), %rsi
	movl	48(%rsp), %ebx
	movl	%ebx, (%rcx,%rsi,4)
.L13:
	movq	56(%rsp), %rsi
	movl	48(%rsp), %ebx
	movl	%ebx, (%rax,%rsi,4)
	movq	32(%rsp), %rsi
	movl	52(%rsp), %ebx
	movl	%ebx, (%rcx,%rsi,4)
.L11:
	movq	72(%rsp), %rsi
	movl	52(%rsp), %ebx
	movl	%ebx, (%rax,%rsi,4)
	movq	56(%rsp), %rsi
	movl	88(%rsp), %ebx
	movl	%ebx, (%rcx,%rsi,4)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L96:
	movq	%r8, %rbx
	movl	%r15d, %edx
	movl	%r11d, %r8d
	movq	%rsi, %r11
	leaq	nxt(%rip), %rax
	leaq	par(%rip), %rcx
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L95:
	movq	%r8, %rbx
	leaq	nxt(%rip), %rax
	movl	%r11d, %r8d
	movq	%rsi, %r11
	leaq	par(%rip), %rcx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L94:
	movq	%r8, %rbx
	leaq	nxt(%rip), %rax
	leaq	par(%rip), %rcx
	jmp	.L17
.L93:
	leaq	nxt(%rip), %rax
	leaq	par(%rip), %rcx
	jmp	.L15
.L92:
	leaq	nxt(%rip), %rax
	leaq	par(%rip), %rcx
	jmp	.L13
.L31:
	xorl	%eax, %eax
.L3:
	addq	$168, %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
.L91:
	.cfi_restore_state
	leaq	nxt(%rip), %rax
	leaq	par(%rip), %rcx
	jmp	.L11
.L90:
	leaq	nxt(%rip), %rax
	leaq	par(%rip), %rcx
.L9:
	movq	96(%rsp), %rsi
	movl	88(%rsp), %ebx
	movl	%ebx, (%rax,%rsi,4)
	movq	72(%rsp), %rsi
	movl	92(%rsp), %ebx
	movl	%ebx, (%rcx,%rsi,4)
	jmp	.L7
.L89:
	leaq	nxt(%rip), %rax
	leaq	par(%rip), %rcx
.L7:
	movq	152(%rsp), %rsi
	movl	92(%rsp), %ebx
	movl	%ebx, (%rax,%rsi,4)
	movq	96(%rsp), %rax
	movl	148(%rsp), %esi
	movl	%esi, (%rcx,%rax,4)
	movl	$1, %eax
	jmp	.L3
	.cfi_endproc
.LFE24:
	.size	dfs2N, .-dfs2N
	.p2align 4
	.globl	find_path
	.type	find_path, @function
find_path:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	4+front(%rip), %eax
	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
	movl	N(%rip), %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	$1, 4+vis(%rip)
	cmpl	$1, %ebp
	je	.L98
	leaq	node(%rip), %r13
	leaq	vis(%rip), %r12
	testl	%eax, %eax
	jne	.L99
	jmp	.L117
	.p2align 4,,10
	.p2align 3
.L101:
	movl	4(%r13,%rbp,8), %eax
	testl	%eax, %eax
	je	.L118
.L99:
	movslq	%eax, %rbp
	movslq	0(%r13,%rbp,8), %r14
	movl	(%r12,%r14,4), %eax
	movq	%r14, %rbx
	testl	%eax, %eax
	jne	.L101
	movl	%r14d, %edi
	call	dfs2N
	testl	%eax, %eax
	je	.L101
	leaq	par(%rip), %rax
	movl	%r14d, 4+nxt(%rip)
	movl	N(%rip), %ebp
	movl	$1, (%rax,%r14,4)
	jmp	.L100
	.p2align 4,,10
	.p2align 3
.L118:
	movl	N(%rip), %ebp
.L117:
	movslq	4+nxt(%rip), %rbx
.L100:
	movslq	%ebp, %r13
	testl	%ebp, %ebp
	jle	.L103
.L102:
	movslq	%ebp, %r13
	testl	%ebp, %ebp
	movl	$4, %eax
	leaq	0(,%r13,4), %rdx
	leaq	4+vis(%rip), %rdi
	cmovle	%rax, %rdx
	xorl	%esi, %esi
	call	memset@PLT
.L103:
	leaq	nxt(%rip), %rax
	cmpl	%ebx, %ebp
	je	.L105
	.p2align 4,,10
	.p2align 3
.L104:
	movl	$1, (%r12,%rbx,4)
	movslq	(%rax,%rbx,4), %rbx
	cmpl	%ebx, %ebp
	jne	.L104
.L105:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	movl	$1, (%r12,%r13,4)
	movl	$1, 4+vis(%rip)
	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
.L98:
	.cfi_restore_state
	movslq	4+nxt(%rip), %rbx
	leaq	vis(%rip), %r12
	jmp	.L102
	.cfi_endproc
.LFE25:
	.size	find_path, .-find_path
	.p2align 4
	.globl	countchd
	.type	countchd, @function
countchd:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rdi
	leaq	front(%rip), %r10
	leaq	vis(%rip), %r9
	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	$88, %rsp
	.cfi_def_cfa_offset 144
	movl	(%r10,%rdi,4), %esi
	movl	$1, (%r9,%rdi,4)
	movl	$1, 56(%rsp)
	testl	%esi, %esi
	je	.L119
	leaq	node(%rip), %r11
.L147:
	movslq	%esi, %r8
	movslq	(%r11,%r8,8), %rax
	movl	(%r9,%rax,4), %edx
	testl	%edx, %edx
	je	.L178
.L121:
	movl	4(%r11,%r8,8), %esi
	testl	%esi, %esi
	jne	.L147
.L119:
	movl	56(%rsp), %eax
	addq	$88, %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
.L178:
	.cfi_restore_state
	movl	(%r10,%rax,4), %ecx
	movl	$1, (%r9,%rax,4)
	movl	$1, 20(%rsp)
	testl	%ecx, %ecx
	je	.L122
	movq	%r8, 40(%rsp)
.L146:
	movslq	%ecx, %r8
	movslq	(%r11,%r8,8), %rax
	movl	(%r9,%rax,4), %r15d
	testl	%r15d, %r15d
	je	.L179
.L123:
	movl	4(%r11,%r8,8), %ecx
	testl	%ecx, %ecx
	jne	.L146
	movq	40(%rsp), %r8
.L122:
	movl	20(%rsp), %edi
	addl	%edi, 56(%rsp)
	jmp	.L121
	.p2align 4,,10
	.p2align 3
.L179:
	movl	(%r10,%rax,4), %edx
	movl	$1, (%r9,%rax,4)
	movl	$1, 16(%rsp)
	testl	%edx, %edx
	je	.L124
	movq	%r8, 32(%rsp)
.L145:
	movslq	%edx, %r8
	movslq	(%r11,%r8,8), %rax
	movl	(%r9,%rax,4), %r14d
	testl	%r14d, %r14d
	je	.L180
.L125:
	movl	4(%r11,%r8,8), %edx
	testl	%edx, %edx
	jne	.L145
	movq	32(%rsp), %r8
.L124:
	movl	16(%rsp), %edi
	addl	%edi, 20(%rsp)
	jmp	.L123
	.p2align 4,,10
	.p2align 3
.L180:
	movslq	(%r10,%rax,4), %r15
	movl	$1, (%r9,%rax,4)
	movl	$1, 12(%rsp)
	testl	%r15d, %r15d
	je	.L126
	movq	%r8, 24(%rsp)
.L144:
	movslq	(%r11,%r15,8), %rax
	movl	(%r9,%rax,4), %r13d
	testl	%r13d, %r13d
	je	.L181
.L127:
	movslq	4(%r11,%r15,8), %r15
	testl	%r15d, %r15d
	jne	.L144
	movq	24(%rsp), %r8
.L126:
	movl	12(%rsp), %edi
	addl	%edi, 16(%rsp)
	jmp	.L125
	.p2align 4,,10
	.p2align 3
.L181:
	movslq	(%r10,%rax,4), %r14
	movl	$1, (%r9,%rax,4)
	movl	$1, 8(%rsp)
	testl	%r14d, %r14d
	je	.L128
	movq	%r15, %r8
.L143:
	movslq	(%r11,%r14,8), %rax
	movl	(%r9,%rax,4), %r12d
	testl	%r12d, %r12d
	je	.L182
.L129:
	movslq	4(%r11,%r14,8), %r14
	testl	%r14d, %r14d
	jne	.L143
	movq	%r8, %r15
.L128:
	movl	8(%rsp), %edi
	addl	%edi, 12(%rsp)
	jmp	.L127
	.p2align 4,,10
	.p2align 3
.L182:
	movslq	(%r10,%rax,4), %r13
	movl	$1, (%r9,%rax,4)
	movl	$1, %ecx
	testl	%r13d, %r13d
	je	.L130
	movq	%r14, %rdx
.L142:
	movslq	(%r11,%r13,8), %rax
	movl	(%r9,%rax,4), %ebp
	testl	%ebp, %ebp
	je	.L183
.L131:
	movslq	4(%r11,%r13,8), %r13
	testl	%r13d, %r13d
	jne	.L142
	movq	%rdx, %r14
.L130:
	addl	%ecx, 8(%rsp)
	jmp	.L129
	.p2align 4,,10
	.p2align 3
.L183:
	movslq	(%r10,%rax,4), %rbp
	movl	$1, (%r9,%rax,4)
	movl	$1, %r15d
	testl	%ebp, %ebp
	je	.L132
.L141:
	movslq	(%r11,%rbp,8), %rax
	movl	(%r9,%rax,4), %ebx
	testl	%ebx, %ebx
	je	.L184
.L133:
	movslq	4(%r11,%rbp,8), %rbp
	testl	%ebp, %ebp
	jne	.L141
.L132:
	addl	%r15d, %ecx
	jmp	.L131
	.p2align 4,,10
	.p2align 3
.L184:
	movslq	(%r10,%rax,4), %rbx
	movl	$1, (%r9,%rax,4)
	movl	$1, %r12d
	testl	%ebx, %ebx
	je	.L134
.L140:
	movslq	(%r11,%rbx,8), %rsi
	movl	(%r9,%rsi,4), %edi
	testl	%edi, %edi
	je	.L185
.L135:
	movslq	4(%r11,%rbx,8), %rbx
	testl	%ebx, %ebx
	jne	.L140
.L134:
	addl	%r12d, %r15d
	jmp	.L133
	.p2align 4,,10
	.p2align 3
.L185:
	movl	(%r10,%rsi,4), %eax
	movl	$1, (%r9,%rsi,4)
	movl	$1, %r14d
	testl	%eax, %eax
	je	.L136
.L139:
	movslq	%eax, %rsi
	movslq	(%r11,%rsi,8), %rax
	movq	%rax, %rdi
	movl	(%r9,%rax,4), %eax
	testl	%eax, %eax
	je	.L186
	movl	4(%r11,%rsi,8), %eax
	testl	%eax, %eax
	jne	.L139
.L136:
	addl	%r14d, %r12d
	jmp	.L135
	.p2align 4,,10
	.p2align 3
.L186:
	movq	%rdx, 72(%rsp)
	movq	%r8, 64(%rsp)
	movl	%ecx, 60(%rsp)
	movq	%rsi, 48(%rsp)
	call	countchd
	movq	48(%rsp), %rsi
	movl	60(%rsp), %ecx
	leaq	node(%rip), %r11
	addl	%eax, %r14d
	movq	64(%rsp), %r8
	movq	72(%rsp), %rdx
	leaq	front(%rip), %r10
	movl	4(%r11,%rsi,8), %eax
	leaq	vis(%rip), %r9
	testl	%eax, %eax
	jne	.L139
	addl	%r14d, %r12d
	jmp	.L135
	.cfi_endproc
.LFE26:
	.size	countchd, .-countchd
	.p2align 4
	.globl	travel_path
	.type	travel_path, @function
travel_path:
.LFB27:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	par(%rip), %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	vis(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	$1, %r13d
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	movslq	N(%rip), %rcx
	movl	$1, 4+vis(%rip)
	movslq	4+nxt(%rip), %rbp
	movl	(%rax,%rcx,4), %ebx
	movl	4+front(%rip), %eax
	testl	%eax, %eax
	je	.L188
	leaq	node(%rip), %r15
	leaq	vis(%rip), %r14
.L192:
	movslq	%eax, %r12
	movslq	(%r15,%r12,8), %rax
	movl	(%r14,%rax,4), %r8d
	movq	%rax, %rdi
	testl	%r8d, %r8d
	je	.L240
	movl	4(%r15,%r12,8), %eax
	testl	%eax, %eax
	jne	.L192
.L191:
	movslq	N(%rip), %rcx
.L188:
	leaq	front(%rip), %rax
	movl	$1, (%r14,%rcx,4)
	movl	(%rax,%rcx,4), %eax
	movl	%r13d, nb(%rip)
	movl	$1, %ecx
	testl	%eax, %eax
	je	.L193
	leaq	node(%rip), %r15
.L196:
	movslq	%eax, %r13
	movslq	(%r15,%r13,8), %rax
	movl	(%r14,%rax,4), %esi
	movq	%rax, %rdi
	testl	%esi, %esi
	je	.L241
	movl	4(%r15,%r13,8), %eax
	testl	%eax, %eax
	jne	.L196
.L193:
	movl	%ecx, nw(%rip)
	leaq	node(%rip), %r15
	cmpl	%ebx, %ebp
	je	.L198
	.p2align 4,,10
	.p2align 3
.L197:
	movslq	%ebx, %r13
	leaq	nxt(%rip), %rax
	cmpl	%ebp, (%rax,%r13,4)
	je	.L187
	leaq	front(%rip), %rax
	movl	$1, (%r14,%rbp,4)
	movl	$1, %r12d
	movl	(%rax,%rbp,4), %eax
	testl	%eax, %eax
	je	.L199
.L202:
	movslq	%eax, %rbx
	movslq	(%r15,%rbx,8), %rax
	movl	(%r14,%rax,4), %ecx
	movq	%rax, %rdi
	testl	%ecx, %ecx
	je	.L242
	movl	4(%r15,%rbx,8), %eax
	testl	%eax, %eax
	jne	.L202
.L199:
	leaq	front(%rip), %rax
	addl	%r12d, nb(%rip)
	movl	$1, %r12d
	movl	(%rax,%r13,4), %eax
	movl	$1, (%r14,%r13,4)
	testl	%eax, %eax
	je	.L203
.L206:
	movslq	%eax, %rbx
	movslq	(%r15,%rbx,8), %rax
	movl	(%r14,%rax,4), %edx
	movq	%rax, %rdi
	testl	%edx, %edx
	je	.L243
	movl	4(%r15,%rbx,8), %eax
	testl	%eax, %eax
	jne	.L206
.L203:
	leaq	nxt(%rip), %rax
	addl	%r12d, nw(%rip)
	movslq	(%rax,%rbp,4), %rbp
	leaq	par(%rip), %rax
	movl	(%rax,%r13,4), %ebx
	cmpl	%ebx, %ebp
	jne	.L197
.L198:
	movslq	%ebx, %rcx
	leaq	front(%rip), %rax
	movl	$1, %ebp
	movl	(%rax,%rcx,4), %eax
	movl	$1, (%r14,%rcx,4)
	leaq	node(%rip), %r15
	testl	%eax, %eax
	je	.L211
.L212:
	movslq	%eax, %rbx
	movslq	(%r15,%rbx,8), %rax
	movq	%rax, %rdi
	movl	(%r14,%rax,4), %eax
	testl	%eax, %eax
	je	.L244
	movl	4(%r15,%rbx,8), %eax
	testl	%eax, %eax
	jne	.L212
.L211:
	addl	%ebp, nb(%rip)
.L187:
	addq	$24, %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
.L243:
	.cfi_restore_state
	call	countchd
	addl	%eax, %r12d
	movl	4(%r15,%rbx,8), %eax
	testl	%eax, %eax
	jne	.L206
	jmp	.L203
	.p2align 4,,10
	.p2align 3
.L242:
	call	countchd
	addl	%eax, %r12d
	movl	4(%r15,%rbx,8), %eax
	testl	%eax, %eax
	jne	.L202
	jmp	.L199
	.p2align 4,,10
	.p2align 3
.L240:
	call	countchd
	addl	%eax, %r13d
	movl	4(%r15,%r12,8), %eax
	testl	%eax, %eax
	jne	.L192
	jmp	.L191
	.p2align 4,,10
	.p2align 3
.L241:
	movl	%ecx, 12(%rsp)
	call	countchd
	movl	12(%rsp), %ecx
	addl	%eax, %ecx
	movl	4(%r15,%r13,8), %eax
	testl	%eax, %eax
	jne	.L196
	jmp	.L193
.L244:
	call	countchd
	addl	%eax, %ebp
	movl	4(%r15,%rbx,8), %eax
	testl	%eax, %eax
	jne	.L212
	jmp	.L211
	.cfi_endproc
.LFE27:
	.size	travel_path, .-travel_path
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Fennec"
.LC1:
	.string	"Snuke"
.LC2:
	.string	"%d"
.LC3:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB28:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	N(%rip), %rsi
	leaq	.LC2(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movl	$0, (%rsp)
	movl	$0, 4(%rsp)
	call	__isoc99_scanf@PLT
	cmpl	$1, N(%rip)
	jle	.L246
	movl	$1, %r15d
	leaq	4(%rsp), %r13
	movq	%rsp, %r12
	leaq	.LC3(%rip), %rbp
	leaq	front(%rip), %r14
	leaq	node(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L247:
	movq	%r13, %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	nnodes(%rip), %eax
	movslq	(%rsp), %rcx
	addl	$1, %r15d
	movd	(%rsp), %xmm1
	movd	4(%rsp), %xmm0
	leal	1(%rax), %edx
	movl	(%r14,%rcx,4), %esi
	addl	$2, %eax
	cmpl	%r15d, N(%rip)
	movl	%edx, (%r14,%rcx,4)
	movslq	4(%rsp), %rcx
	movslq	%edx, %rdx
	movd	%esi, %xmm3
	movl	%eax, nnodes(%rip)
	movd	(%r14,%rcx,4), %xmm2
	punpckldq	%xmm3, %xmm0
	movl	%eax, (%r14,%rcx,4)
	punpckldq	%xmm2, %xmm1
	punpcklqdq	%xmm1, %xmm0
	movups	%xmm0, (%rbx,%rdx,8)
	jg	.L247
.L246:
	call	find_path
	call	travel_path
	movl	nw(%rip), %eax
	leaq	.LC0(%rip), %rdi
	cmpl	%eax, nb(%rip)
	leaq	.LC1(%rip), %rax
	cmovle	%rax, %rdi
	call	puts@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L253
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L253:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE28:
	.size	main, .-main
	.globl	nw
	.bss
	.align 4
	.type	nw, @object
	.size	nw, 4
nw:
	.zero	4
	.globl	nb
	.align 4
	.type	nb, @object
	.size	nb, 4
nb:
	.zero	4
	.globl	chd
	.align 32
	.type	chd, @object
	.size	chd, 400004
chd:
	.zero	400004
	.globl	nxt
	.align 32
	.type	nxt, @object
	.size	nxt, 400004
nxt:
	.zero	400004
	.globl	par
	.align 32
	.type	par, @object
	.size	par, 400004
par:
	.zero	400004
	.globl	vis
	.align 32
	.type	vis, @object
	.size	vis, 400004
vis:
	.zero	400004
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	front
	.align 32
	.type	front, @object
	.size	front, 400004
front:
	.zero	400004
	.globl	nnodes
	.align 4
	.type	nnodes, @object
	.size	nnodes, 4
nnodes:
	.zero	4
	.globl	node
	.align 32
	.type	node, @object
	.size	node, 3200032
node:
	.zero	3200032
	.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	add_edge
	.type	add_edge, @function
add_edge:
.LFB23:
	.cfi_startproc
	endbr64
	movl	nnodes(%rip), %eax
	leaq	front(%rip), %rdx
	movslq	%edi, %rdi
	movd	%esi, %xmm0
	movd	(%rdx,%rdi,4), %xmm1
	leaq	node(%rip), %rcx
	addl	$1, %eax
	movslq	%eax, %r8
	punpckldq	%xmm1, %xmm0
	movl	%eax, nnodes(%rip)
	movq	%xmm0, (%rcx,%r8,8)
	movl	%eax, (%rdx,%rdi,4)
	ret
	.cfi_endproc
.LFE23:
	.size	add_edge, .-add_edge
	.p2align 4
	.globl	dfs2N
	.type	dfs2N, @function
dfs2N:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rax
	leaq	front(%rip), %rsi
	leaq	vis(%rip), %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
	movq	%rax, %rbx
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	cmpl	%ebx, N(%rip)
	movl	(%rsi,%rax,4), %r11d
	movl	$1, (%r10,%rax,4)
	movl	%eax, 148(%rsp)
	movq	%rax, 152(%rsp)
	movl	$1, %eax
	je	.L3
	leaq	node(%rip), %rbp
	testl	%r11d, %r11d
	jne	.L5
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L6:
	movq	80(%rsp), %rax
	movl	4(%rbp,%rax,8), %r11d
	testl	%r11d, %r11d
	je	.L31
.L5:
	movslq	%r11d, %rax
	movq	%rax, 80(%rsp)
	movslq	0(%rbp,%rax,8), %rax
	movl	(%r10,%rax,4), %r14d
	movl	%eax, 92(%rsp)
	movq	%rax, 96(%rsp)
	testl	%r14d, %r14d
	jne	.L6
	leaq	front(%rip), %rsi
	movl	$1, (%r10,%rax,4)
	movl	(%rsi,%rax,4), %r11d
	movl	92(%rsp), %eax
	cmpl	N(%rip), %eax
	je	.L89
	testl	%r11d, %r11d
	jne	.L30
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	movq	64(%rsp), %rax
	movl	4(%rbp,%rax,8), %r11d
	testl	%r11d, %r11d
	je	.L6
.L30:
	movslq	%r11d, %rax
	movq	%rax, 64(%rsp)
	movslq	0(%rbp,%rax,8), %rax
	movl	(%r10,%rax,4), %r13d
	movl	%eax, 88(%rsp)
	movq	%rax, 72(%rsp)
	testl	%r13d, %r13d
	jne	.L8
	leaq	front(%rip), %rbx
	movl	$1, (%r10,%rax,4)
	movl	(%rbx,%rax,4), %r11d
	movl	88(%rsp), %eax
	cmpl	N(%rip), %eax
	je	.L90
	testl	%r11d, %r11d
	jne	.L29
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L10:
	movq	40(%rsp), %rax
	movl	4(%rbp,%rax,8), %r11d
	testl	%r11d, %r11d
	je	.L8
.L29:
	movslq	%r11d, %rax
	movq	%rax, 40(%rsp)
	movslq	0(%rbp,%rax,8), %rax
	movl	(%r10,%rax,4), %r12d
	movl	%eax, 52(%rsp)
	movq	%rax, 56(%rsp)
	testl	%r12d, %r12d
	jne	.L10
	leaq	front(%rip), %rbx
	movl	$1, (%r10,%rax,4)
	movl	(%rbx,%rax,4), %r11d
	movl	52(%rsp), %eax
	cmpl	N(%rip), %eax
	je	.L91
	testl	%r11d, %r11d
	jne	.L28
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L12:
	movq	24(%rsp), %rax
	movl	4(%rbp,%rax,8), %r11d
	testl	%r11d, %r11d
	je	.L10
.L28:
	movslq	%r11d, %rax
	movq	%rax, 24(%rsp)
	movslq	0(%rbp,%rax,8), %rax
	movl	(%r10,%rax,4), %ebx
	movl	%eax, 48(%rsp)
	movq	%rax, 32(%rsp)
	testl	%ebx, %ebx
	jne	.L12
	leaq	front(%rip), %rsi
	movl	$1, (%r10,%rax,4)
	movl	(%rsi,%rax,4), %r11d
	movl	48(%rsp), %eax
	cmpl	N(%rip), %eax
	je	.L92
	testl	%r11d, %r11d
	jne	.L27
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L14:
	movq	(%rsp), %rax
	movl	4(%rbp,%rax,8), %r11d
	testl	%r11d, %r11d
	je	.L12
.L27:
	movslq	%r11d, %rax
	movq	%rax, (%rsp)
	movslq	0(%rbp,%rax,8), %rax
	movl	(%r10,%rax,4), %r11d
	movl	%eax, 12(%rsp)
	movq	%rax, 16(%rsp)
	testl	%r11d, %r11d
	jne	.L14
	leaq	front(%rip), %rsi
	movl	$1, (%r10,%rax,4)
	movl	(%rsi,%rax,4), %ecx
	movl	12(%rsp), %eax
	cmpl	N(%rip), %eax
	je	.L93
	testl	%ecx, %ecx
	jne	.L26
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L16:
	movl	4(%rbp,%r14,8), %ecx
	testl	%ecx, %ecx
	je	.L14
.L26:
	movslq	%ecx, %r14
	movslq	0(%rbp,%r14,8), %r8
	movl	(%r10,%r8,4), %r9d
	movq	%r8, %r11
	testl	%r9d, %r9d
	jne	.L16
	leaq	front(%rip), %rax
	cmpl	N(%rip), %r8d
	movl	$1, (%r10,%r8,4)
	movl	(%rax,%r8,4), %eax
	je	.L94
	testl	%eax, %eax
	jne	.L25
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L18:
	movl	4(%rbp,%rbx,8), %eax
	testl	%eax, %eax
	je	.L16
.L25:
	movslq	%eax, %rbx
	movslq	0(%rbp,%rbx,8), %rsi
	movl	(%r10,%rsi,4), %edi
	movq	%rsi, %r9
	testl	%edi, %edi
	jne	.L18
	leaq	front(%rip), %rax
	cmpl	N(%rip), %esi
	movl	$1, (%r10,%rsi,4)
	movslq	(%rax,%rsi,4), %rdx
	je	.L95
	testl	%edx, %edx
	jne	.L24
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L20:
	movslq	4(%rbp,%rdx,8), %rdx
	testl	%edx, %edx
	je	.L18
.L24:
	movslq	0(%rbp,%rdx,8), %r15
	movl	(%r10,%r15,4), %ecx
	movq	%r15, %r12
	testl	%ecx, %ecx
	jne	.L20
	leaq	front(%rip), %rax
	cmpl	N(%rip), %r15d
	movl	$1, (%r10,%r15,4)
	movl	(%rax,%r15,4), %eax
	je	.L96
	testl	%eax, %eax
	jne	.L23
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L22:
	movl	4(%rbp,%r13,8), %eax
	testl	%eax, %eax
	je	.L20
.L23:
	movslq	%eax, %r13
	movslq	0(%rbp,%r13,8), %rcx
	movl	(%r10,%rcx,4), %eax
	movq	%rcx, %rdi
	testl	%eax, %eax
	jne	.L22
	movq	%rcx, 136(%rsp)
	movq	%rdx, 128(%rsp)
	movq	%rsi, 120(%rsp)
	movq	%r8, 112(%rsp)
	movl	%r9d, 144(%rsp)
	movl	%r11d, 108(%rsp)
	movl	%ecx, 104(%rsp)
	call	dfs2N
	movl	104(%rsp), %edi
	movl	108(%rsp), %r11d
	leaq	vis(%rip), %r10
	testl	%eax, %eax
	movq	112(%rsp), %r8
	movl	144(%rsp), %r9d
	movq	120(%rsp), %rsi
	movq	128(%rsp), %rdx
	movq	136(%rsp), %rcx
	je	.L22
	movq	%rcx, %r14
	leaq	nxt(%rip), %rax
	movq	%r8, %rbx
	movl	%r12d, %edx
	leaq	par(%rip), %rcx
	movl	%edi, (%rax,%r15,4)
	movl	%r11d, %r8d
	movq	%rsi, %r11
	movl	%r12d, (%rcx,%r14,4)
.L21:
	movl	%edx, (%rax,%r11,4)
	movl	%r9d, (%rcx,%r15,4)
.L19:
	movl	%r9d, (%rax,%rbx,4)
	movl	%r8d, (%rcx,%r11,4)
.L17:
	movq	16(%rsp), %rsi
	movl	%r8d, (%rax,%rsi,4)
	movl	12(%rsp), %esi
	movl	%esi, (%rcx,%rbx,4)
.L15:
	movq	32(%rsp), %rsi
	movl	12(%rsp), %ebx
	movl	%ebx, (%rax,%rsi,4)
	movq	16(%rsp), %rsi
	movl	48(%rsp), %ebx
	movl	%ebx, (%rcx,%rsi,4)
.L13:
	movq	56(%rsp), %rsi
	movl	48(%rsp), %ebx
	movl	%ebx, (%rax,%rsi,4)
	movq	32(%rsp), %rsi
	movl	52(%rsp), %ebx
	movl	%ebx, (%rcx,%rsi,4)
.L11:
	movq	72(%rsp), %rsi
	movl	52(%rsp), %ebx
	movl	%ebx, (%rax,%rsi,4)
	movq	56(%rsp), %rsi
	movl	88(%rsp), %ebx
	movl	%ebx, (%rcx,%rsi,4)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L96:
	movq	%r8, %rbx
	movl	%r15d, %edx
	movl	%r11d, %r8d
	movq	%rsi, %r11
	leaq	nxt(%rip), %rax
	leaq	par(%rip), %rcx
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L95:
	movq	%r8, %rbx
	leaq	nxt(%rip), %rax
	movl	%r11d, %r8d
	movq	%rsi, %r11
	leaq	par(%rip), %rcx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L94:
	movq	%r8, %rbx
	leaq	nxt(%rip), %rax
	leaq	par(%rip), %rcx
	jmp	.L17
.L93:
	leaq	nxt(%rip), %rax
	leaq	par(%rip), %rcx
	jmp	.L15
.L92:
	leaq	nxt(%rip), %rax
	leaq	par(%rip), %rcx
	jmp	.L13
.L31:
	xorl	%eax, %eax
.L3:
	addq	$168, %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
.L91:
	.cfi_restore_state
	leaq	nxt(%rip), %rax
	leaq	par(%rip), %rcx
	jmp	.L11
.L90:
	leaq	nxt(%rip), %rax
	leaq	par(%rip), %rcx
.L9:
	movq	96(%rsp), %rsi
	movl	88(%rsp), %ebx
	movl	%ebx, (%rax,%rsi,4)
	movq	72(%rsp), %rsi
	movl	92(%rsp), %ebx
	movl	%ebx, (%rcx,%rsi,4)
	jmp	.L7
.L89:
	leaq	nxt(%rip), %rax
	leaq	par(%rip), %rcx
.L7:
	movq	152(%rsp), %rsi
	movl	92(%rsp), %ebx
	movl	%ebx, (%rax,%rsi,4)
	movq	96(%rsp), %rax
	movl	148(%rsp), %esi
	movl	%esi, (%rcx,%rax,4)
	movl	$1, %eax
	jmp	.L3
	.cfi_endproc
.LFE24:
	.size	dfs2N, .-dfs2N
	.p2align 4
	.globl	find_path
	.type	find_path, @function
find_path:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	4+front(%rip), %eax
	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
	movl	N(%rip), %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	$1, 4+vis(%rip)
	cmpl	$1, %ebp
	je	.L98
	leaq	node(%rip), %r13
	leaq	vis(%rip), %r12
	testl	%eax, %eax
	jne	.L99
	jmp	.L117
	.p2align 4,,10
	.p2align 3
.L101:
	movl	4(%r13,%rbp,8), %eax
	testl	%eax, %eax
	je	.L118
.L99:
	movslq	%eax, %rbp
	movslq	0(%r13,%rbp,8), %r14
	movl	(%r12,%r14,4), %eax
	movq	%r14, %rbx
	testl	%eax, %eax
	jne	.L101
	movl	%r14d, %edi
	call	dfs2N
	testl	%eax, %eax
	je	.L101
	leaq	par(%rip), %rax
	movl	%r14d, 4+nxt(%rip)
	movl	N(%rip), %ebp
	movl	$1, (%rax,%r14,4)
	jmp	.L100
	.p2align 4,,10
	.p2align 3
.L118:
	movl	N(%rip), %ebp
.L117:
	movslq	4+nxt(%rip), %rbx
.L100:
	movslq	%ebp, %r13
	testl	%ebp, %ebp
	jle	.L103
.L102:
	movslq	%ebp, %r13
	testl	%ebp, %ebp
	movl	$4, %eax
	leaq	0(,%r13,4), %rdx
	leaq	4+vis(%rip), %rdi
	cmovle	%rax, %rdx
	xorl	%esi, %esi
	call	memset@PLT
.L103:
	leaq	nxt(%rip), %rax
	cmpl	%ebx, %ebp
	je	.L105
	.p2align 4,,10
	.p2align 3
.L104:
	movl	$1, (%r12,%rbx,4)
	movslq	(%rax,%rbx,4), %rbx
	cmpl	%ebx, %ebp
	jne	.L104
.L105:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	movl	$1, (%r12,%r13,4)
	movl	$1, 4+vis(%rip)
	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
.L98:
	.cfi_restore_state
	movslq	4+nxt(%rip), %rbx
	leaq	vis(%rip), %r12
	jmp	.L102
	.cfi_endproc
.LFE25:
	.size	find_path, .-find_path
	.p2align 4
	.globl	countchd
	.type	countchd, @function
countchd:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rdi
	leaq	front(%rip), %r10
	leaq	vis(%rip), %r9
	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	$88, %rsp
	.cfi_def_cfa_offset 144
	movl	(%r10,%rdi,4), %esi
	movl	$1, (%r9,%rdi,4)
	movl	$1, 56(%rsp)
	testl	%esi, %esi
	je	.L119
	leaq	node(%rip), %r11
.L147:
	movslq	%esi, %r8
	movslq	(%r11,%r8,8), %rax
	movl	(%r9,%rax,4), %edx
	testl	%edx, %edx
	je	.L178
.L121:
	movl	4(%r11,%r8,8), %esi
	testl	%esi, %esi
	jne	.L147
.L119:
	movl	56(%rsp), %eax
	addq	$88, %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
.L178:
	.cfi_restore_state
	movl	(%r10,%rax,4), %ecx
	movl	$1, (%r9,%rax,4)
	movl	$1, 20(%rsp)
	testl	%ecx, %ecx
	je	.L122
	movq	%r8, 40(%rsp)
.L146:
	movslq	%ecx, %r8
	movslq	(%r11,%r8,8), %rax
	movl	(%r9,%rax,4), %r15d
	testl	%r15d, %r15d
	je	.L179
.L123:
	movl	4(%r11,%r8,8), %ecx
	testl	%ecx, %ecx
	jne	.L146
	movq	40(%rsp), %r8
.L122:
	movl	20(%rsp), %edi
	addl	%edi, 56(%rsp)
	jmp	.L121
	.p2align 4,,10
	.p2align 3
.L179:
	movl	(%r10,%rax,4), %edx
	movl	$1, (%r9,%rax,4)
	movl	$1, 16(%rsp)
	testl	%edx, %edx
	je	.L124
	movq	%r8, 32(%rsp)
.L145:
	movslq	%edx, %r8
	movslq	(%r11,%r8,8), %rax
	movl	(%r9,%rax,4), %r14d
	testl	%r14d, %r14d
	je	.L180
.L125:
	movl	4(%r11,%r8,8), %edx
	testl	%edx, %edx
	jne	.L145
	movq	32(%rsp), %r8
.L124:
	movl	16(%rsp), %edi
	addl	%edi, 20(%rsp)
	jmp	.L123
	.p2align 4,,10
	.p2align 3
.L180:
	movslq	(%r10,%rax,4), %r15
	movl	$1, (%r9,%rax,4)
	movl	$1, 12(%rsp)
	testl	%r15d, %r15d
	je	.L126
	movq	%r8, 24(%rsp)
.L144:
	movslq	(%r11,%r15,8), %rax
	movl	(%r9,%rax,4), %r13d
	testl	%r13d, %r13d
	je	.L181
.L127:
	movslq	4(%r11,%r15,8), %r15
	testl	%r15d, %r15d
	jne	.L144
	movq	24(%rsp), %r8
.L126:
	movl	12(%rsp), %edi
	addl	%edi, 16(%rsp)
	jmp	.L125
	.p2align 4,,10
	.p2align 3
.L181:
	movslq	(%r10,%rax,4), %r14
	movl	$1, (%r9,%rax,4)
	movl	$1, 8(%rsp)
	testl	%r14d, %r14d
	je	.L128
	movq	%r15, %r8
.L143:
	movslq	(%r11,%r14,8), %rax
	movl	(%r9,%rax,4), %r12d
	testl	%r12d, %r12d
	je	.L182
.L129:
	movslq	4(%r11,%r14,8), %r14
	testl	%r14d, %r14d
	jne	.L143
	movq	%r8, %r15
.L128:
	movl	8(%rsp), %edi
	addl	%edi, 12(%rsp)
	jmp	.L127
	.p2align 4,,10
	.p2align 3
.L182:
	movslq	(%r10,%rax,4), %r13
	movl	$1, (%r9,%rax,4)
	movl	$1, %ecx
	testl	%r13d, %r13d
	je	.L130
	movq	%r14, %rdx
.L142:
	movslq	(%r11,%r13,8), %rax
	movl	(%r9,%rax,4), %ebp
	testl	%ebp, %ebp
	je	.L183
.L131:
	movslq	4(%r11,%r13,8), %r13
	testl	%r13d, %r13d
	jne	.L142
	movq	%rdx, %r14
.L130:
	addl	%ecx, 8(%rsp)
	jmp	.L129
	.p2align 4,,10
	.p2align 3
.L183:
	movslq	(%r10,%rax,4), %rbp
	movl	$1, (%r9,%rax,4)
	movl	$1, %r15d
	testl	%ebp, %ebp
	je	.L132
.L141:
	movslq	(%r11,%rbp,8), %rax
	movl	(%r9,%rax,4), %ebx
	testl	%ebx, %ebx
	je	.L184
.L133:
	movslq	4(%r11,%rbp,8), %rbp
	testl	%ebp, %ebp
	jne	.L141
.L132:
	addl	%r15d, %ecx
	jmp	.L131
	.p2align 4,,10
	.p2align 3
.L184:
	movslq	(%r10,%rax,4), %rbx
	movl	$1, (%r9,%rax,4)
	movl	$1, %r12d
	testl	%ebx, %ebx
	je	.L134
.L140:
	movslq	(%r11,%rbx,8), %rsi
	movl	(%r9,%rsi,4), %edi
	testl	%edi, %edi
	je	.L185
.L135:
	movslq	4(%r11,%rbx,8), %rbx
	testl	%ebx, %ebx
	jne	.L140
.L134:
	addl	%r12d, %r15d
	jmp	.L133
	.p2align 4,,10
	.p2align 3
.L185:
	movl	(%r10,%rsi,4), %eax
	movl	$1, (%r9,%rsi,4)
	movl	$1, %r14d
	testl	%eax, %eax
	je	.L136
.L139:
	movslq	%eax, %rsi
	movslq	(%r11,%rsi,8), %rax
	movq	%rax, %rdi
	movl	(%r9,%rax,4), %eax
	testl	%eax, %eax
	je	.L186
	movl	4(%r11,%rsi,8), %eax
	testl	%eax, %eax
	jne	.L139
.L136:
	addl	%r14d, %r12d
	jmp	.L135
	.p2align 4,,10
	.p2align 3
.L186:
	movq	%rdx, 72(%rsp)
	movq	%r8, 64(%rsp)
	movl	%ecx, 60(%rsp)
	movq	%rsi, 48(%rsp)
	call	countchd
	movq	48(%rsp), %rsi
	movl	60(%rsp), %ecx
	leaq	node(%rip), %r11
	addl	%eax, %r14d
	movq	64(%rsp), %r8
	movq	72(%rsp), %rdx
	leaq	front(%rip), %r10
	movl	4(%r11,%rsi,8), %eax
	leaq	vis(%rip), %r9
	testl	%eax, %eax
	jne	.L139
	addl	%r14d, %r12d
	jmp	.L135
	.cfi_endproc
.LFE26:
	.size	countchd, .-countchd
	.p2align 4
	.globl	travel_path
	.type	travel_path, @function
travel_path:
.LFB27:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	par(%rip), %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	vis(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	$1, %r13d
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	movslq	N(%rip), %rcx
	movl	$1, 4+vis(%rip)
	movslq	4+nxt(%rip), %rbp
	movl	(%rax,%rcx,4), %ebx
	movl	4+front(%rip), %eax
	testl	%eax, %eax
	je	.L188
	leaq	node(%rip), %r15
	leaq	vis(%rip), %r14
.L192:
	movslq	%eax, %r12
	movslq	(%r15,%r12,8), %rax
	movl	(%r14,%rax,4), %r8d
	movq	%rax, %rdi
	testl	%r8d, %r8d
	je	.L240
	movl	4(%r15,%r12,8), %eax
	testl	%eax, %eax
	jne	.L192
.L191:
	movslq	N(%rip), %rcx
.L188:
	leaq	front(%rip), %rax
	movl	$1, (%r14,%rcx,4)
	movl	(%rax,%rcx,4), %eax
	movl	%r13d, nb(%rip)
	movl	$1, %ecx
	testl	%eax, %eax
	je	.L193
	leaq	node(%rip), %r15
.L196:
	movslq	%eax, %r13
	movslq	(%r15,%r13,8), %rax
	movl	(%r14,%rax,4), %esi
	movq	%rax, %rdi
	testl	%esi, %esi
	je	.L241
	movl	4(%r15,%r13,8), %eax
	testl	%eax, %eax
	jne	.L196
.L193:
	movl	%ecx, nw(%rip)
	leaq	node(%rip), %r15
	cmpl	%ebx, %ebp
	je	.L198
	.p2align 4,,10
	.p2align 3
.L197:
	movslq	%ebx, %r13
	leaq	nxt(%rip), %rax
	cmpl	%ebp, (%rax,%r13,4)
	je	.L187
	leaq	front(%rip), %rax
	movl	$1, (%r14,%rbp,4)
	movl	$1, %r12d
	movl	(%rax,%rbp,4), %eax
	testl	%eax, %eax
	je	.L199
.L202:
	movslq	%eax, %rbx
	movslq	(%r15,%rbx,8), %rax
	movl	(%r14,%rax,4), %ecx
	movq	%rax, %rdi
	testl	%ecx, %ecx
	je	.L242
	movl	4(%r15,%rbx,8), %eax
	testl	%eax, %eax
	jne	.L202
.L199:
	leaq	front(%rip), %rax
	addl	%r12d, nb(%rip)
	movl	$1, %r12d
	movl	(%rax,%r13,4), %eax
	movl	$1, (%r14,%r13,4)
	testl	%eax, %eax
	je	.L203
.L206:
	movslq	%eax, %rbx
	movslq	(%r15,%rbx,8), %rax
	movl	(%r14,%rax,4), %edx
	movq	%rax, %rdi
	testl	%edx, %edx
	je	.L243
	movl	4(%r15,%rbx,8), %eax
	testl	%eax, %eax
	jne	.L206
.L203:
	leaq	nxt(%rip), %rax
	addl	%r12d, nw(%rip)
	movslq	(%rax,%rbp,4), %rbp
	leaq	par(%rip), %rax
	movl	(%rax,%r13,4), %ebx
	cmpl	%ebx, %ebp
	jne	.L197
.L198:
	movslq	%ebx, %rcx
	leaq	front(%rip), %rax
	movl	$1, %ebp
	movl	(%rax,%rcx,4), %eax
	movl	$1, (%r14,%rcx,4)
	leaq	node(%rip), %r15
	testl	%eax, %eax
	je	.L211
.L212:
	movslq	%eax, %rbx
	movslq	(%r15,%rbx,8), %rax
	movq	%rax, %rdi
	movl	(%r14,%rax,4), %eax
	testl	%eax, %eax
	je	.L244
	movl	4(%r15,%rbx,8), %eax
	testl	%eax, %eax
	jne	.L212
.L211:
	addl	%ebp, nb(%rip)
.L187:
	addq	$24, %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
.L243:
	.cfi_restore_state
	call	countchd
	addl	%eax, %r12d
	movl	4(%r15,%rbx,8), %eax
	testl	%eax, %eax
	jne	.L206
	jmp	.L203
	.p2align 4,,10
	.p2align 3
.L242:
	call	countchd
	addl	%eax, %r12d
	movl	4(%r15,%rbx,8), %eax
	testl	%eax, %eax
	jne	.L202
	jmp	.L199
	.p2align 4,,10
	.p2align 3
.L240:
	call	countchd
	addl	%eax, %r13d
	movl	4(%r15,%r12,8), %eax
	testl	%eax, %eax
	jne	.L192
	jmp	.L191
	.p2align 4,,10
	.p2align 3
.L241:
	movl	%ecx, 12(%rsp)
	call	countchd
	movl	12(%rsp), %ecx
	addl	%eax, %ecx
	movl	4(%r15,%r13,8), %eax
	testl	%eax, %eax
	jne	.L196
	jmp	.L193
.L244:
	call	countchd
	addl	%eax, %ebp
	movl	4(%r15,%rbx,8), %eax
	testl	%eax, %eax
	jne	.L212
	jmp	.L211
	.cfi_endproc
.LFE27:
	.size	travel_path, .-travel_path
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Fennec"
.LC1:
	.string	"Snuke"
.LC2:
	.string	"%d"
.LC3:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB28:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	N(%rip), %rsi
	leaq	.LC2(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movl	$0, (%rsp)
	movl	$0, 4(%rsp)
	call	__isoc99_scanf@PLT
	cmpl	$1, N(%rip)
	jle	.L246
	movl	$1, %r15d
	leaq	4(%rsp), %r13
	movq	%rsp, %r12
	leaq	.LC3(%rip), %rbp
	leaq	front(%rip), %r14
	leaq	node(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L247:
	movq	%r13, %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	nnodes(%rip), %eax
	movslq	(%rsp), %rcx
	addl	$1, %r15d
	movd	(%rsp), %xmm1
	movd	4(%rsp), %xmm0
	leal	1(%rax), %edx
	movl	(%r14,%rcx,4), %esi
	addl	$2, %eax
	cmpl	%r15d, N(%rip)
	movl	%edx, (%r14,%rcx,4)
	movslq	4(%rsp), %rcx
	movslq	%edx, %rdx
	movd	%esi, %xmm3
	movl	%eax, nnodes(%rip)
	movd	(%r14,%rcx,4), %xmm2
	punpckldq	%xmm3, %xmm0
	movl	%eax, (%r14,%rcx,4)
	punpckldq	%xmm2, %xmm1
	punpcklqdq	%xmm1, %xmm0
	movups	%xmm0, (%rbx,%rdx,8)
	jg	.L247
.L246:
	call	find_path
	call	travel_path
	movl	nw(%rip), %eax
	leaq	.LC0(%rip), %rdi
	cmpl	%eax, nb(%rip)
	leaq	.LC1(%rip), %rax
	cmovle	%rax, %rdi
	call	puts@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L253
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L253:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE28:
	.size	main, .-main
	.globl	nw
	.bss
	.align 4
	.type	nw, @object
	.size	nw, 4
nw:
	.zero	4
	.globl	nb
	.align 4
	.type	nb, @object
	.size	nb, 4
nb:
	.zero	4
	.globl	chd
	.align 32
	.type	chd, @object
	.size	chd, 400004
chd:
	.zero	400004
	.globl	nxt
	.align 32
	.type	nxt, @object
	.size	nxt, 400004
nxt:
	.zero	400004
	.globl	par
	.align 32
	.type	par, @object
	.size	par, 400004
par:
	.zero	400004
	.globl	vis
	.align 32
	.type	vis, @object
	.size	vis, 400004
vis:
	.zero	400004
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	front
	.align 32
	.type	front, @object
	.size	front, 400004
front:
	.zero	400004
	.globl	nnodes
	.align 4
	.type	nnodes, @object
	.size	nnodes, 4
nnodes:
	.zero	4
	.globl	node
	.align 32
	.type	node, @object
	.size	node, 3200032
node:
	.zero	3200032
	.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:

/* AtCoder Regular Contest 078. Problem D, by Abreto<m@abreto.net>. */
#include <stdio.h>

#define MAXN    100001

struct
{
    int id;
    int next;
}node[MAXN<<2];
int nnodes;
int front[MAXN];
void add_edge(int u, int v)
{
    int newnode = ++nnodes;
    node[newnode].id = v;
    node[newnode].next = front[u];
    front[u] = newnode;
}

int N;
int vis[MAXN];
int par[MAXN];
int nxt[MAXN];
int chd[MAXN];
int nb, nw;

int dfs2N(int u)
{
    int v = front[u];
    vis[u] = 1;
    if(u == N) return 1;
    while(v)
    {
        int w = node[v].id;
        if(!vis[w])
        {
            if(dfs2N(w))
            {
                u[nxt] = w;
                w[par] = u;
                return 1;
            }
        }
        v = node[v].next;
    }
    return 0;
}

void find_path(void)
{
    int i = 0;
    dfs2N(1);
    for(i = 1;i <= N;++i)
        vis[i] = 0;
    for(i = nxt[1];i != N;i = nxt[i])
        vis[i] = 1;
    vis[1] = vis[N] = 1;
}

int countchd(int u)
{
    int  v = front[u];
    int cnt = 1;
    vis[u] = 1;
    while(v)
    {
        int w = node[v].id;
        if(!vis[w]) cnt += countchd(w);
        v = node[v].next;
    }
    return cnt;
}

void travel_path(void)
{
    int i = 0;
    int u = 1[nxt], v = N[par];
    nb = countchd(1); nw = countchd(N);
    while(u != v && u != v[nxt])
    {
        nb += countchd(u);
        nw += countchd(v);
        u = u[nxt]; v = v[par];
    }
    if(u == v) nb += countchd(u);
}

int main(void)
{
    int i = 0;
    int ai = 0, bi = 0;

    scanf("%d", &N);
    for(i = 1;i < N;++i)
    {
        scanf("%d%d", &ai, &bi);
        add_edge(ai, bi);
        add_edge(bi, ai);
    }
    find_path();
    travel_path();
    printf("%s\n", (nb>nw)?"Fennec":"Snuke");
    return 0;
}

7
3 6
1 2
3 1
7 4
5 7
1 4

Fennec

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

```c
/* AtCoder Regular Contest 078. Problem D, by Abreto<m@abreto.net>. */
#include <stdio.h>

#define MAXN    100001

struct
{
    int id;
    int next;
}node[MAXN<<2];
int nnodes;
int front[MAXN];
void add_edge(int u, int v)
{
    int newnode = ++nnodes;
    node[newnode].id = v;
    node[newnode].next = front[u];
    front[u] = newnode;
}

int N;
int vis[MAXN];
int par[MAXN];
int nxt[MAXN];
int chd[MAXN];
int nb, nw;

int dfs2N(int u)
{
    int v = front[u];
    vis[u] = 1;
    if(u == N) return 1;
    while(v)
    {
        int w = node[v].id;
        if(!vis[w])
        {
            if(dfs2N(w))
            {
                u[nxt] = w;
                w[par] = u;
                return 1;
            }
        }
        v = node[v].next;
    }
    return 0;
}

void find_path(void)
{
    int i = 0;
    dfs2N(1);
    for(i = 1;i <= N;++i)
        vis[i] = 0;
    for(i = nxt[1];i != N;i = nxt[i])
        vis[i] = 1;
    vis[1] = vis[N] = 1;
}

int countchd(int u)
{
    int  v = front[u];
    int cnt = 1;
    vis[u] = 1;
    while(v)
    {
        int w = node[v].id;
        if(!vis[w]) cnt += countchd(w);
        v = node[v].next;
    }
    return cnt;
}

void travel_path(void)
{
    int i = 0;
    int u = 1[nxt], v = N[par];
    nb = countchd(1); nw = countchd(N);
    while(u != v && u != v[nxt])
    {
        nb += countchd(u);
        nw += countchd(v);
        u = u[nxt]; v = v[par];
    }
    if(u == v) nb += countchd(u);
}

int main(void)
{
    int i = 0;
    int ai = 0, bi = 0;

    scanf("%d", &N);
    for(i = 1;i < N;++i)
    {
        scanf("%d%d", &ai, &bi);
        add_edge(ai, bi);
        add_edge(bi, ai);
    }
    find_path();
    travel_path();
    printf("%s\n", (nb>nw)?"Fennec":"Snuke");
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	node
	.bss
	.align 32
	.type	node, @object
	.size	node, 3200032
node:
	.zero	3200032
	.globl	nnodes
	.align 4
	.type	nnodes, @object
	.size	nnodes, 4
nnodes:
	.zero	4
	.globl	front
	.align 32
	.type	front, @object
	.size	front, 400004
front:
	.zero	400004
	.text
	.globl	add_edge
	.type	add_edge, @function
add_edge:
.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	%esi, -24(%rbp)
	movl	nnodes(%rip), %eax
	addl	$1, %eax
	movl	%eax, nnodes(%rip)
	movl	nnodes(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	node(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	front(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+node(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	front(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	add_edge, .-add_edge
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	vis
	.align 32
	.type	vis, @object
	.size	vis, 400004
vis:
	.zero	400004
	.globl	par
	.align 32
	.type	par, @object
	.size	par, 400004
par:
	.zero	400004
	.globl	nxt
	.align 32
	.type	nxt, @object
	.size	nxt, 400004
nxt:
	.zero	400004
	.globl	chd
	.align 32
	.type	chd, @object
	.size	chd, 400004
chd:
	.zero	400004
	.globl	nb
	.align 4
	.type	nb, @object
	.size	nb, 4
nb:
	.zero	4
	.globl	nw
	.align 4
	.type	nw, @object
	.size	nw, 4
nw:
	.zero	4
	.text
	.globl	dfs2N
	.type	dfs2N, @function
dfs2N:
.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	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	front(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L5
	movl	$1, %eax
	jmp	.L4
.L7:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	node(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L6
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	dfs2N
	testl	%eax, %eax
	je	.L6
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	nxt(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	par(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$1, %eax
	jmp	.L4
.L6:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+node(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
.L5:
	cmpl	$0, -8(%rbp)
	jne	.L7
	movl	$0, %eax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	dfs2N, .-dfs2N
	.globl	find_path
	.type	find_path, @function
find_path:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -4(%rbp)
	movl	$1, %edi
	call	dfs2N
	movl	$1, -4(%rbp)
	jmp	.L9
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L9:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L10
	movl	4+nxt(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L11
.L12:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	nxt(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L12
	movl	N(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	vis(%rip), %rdx
	movl	$1, (%rcx,%rdx)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, 4+vis(%rip)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	find_path, .-find_path
	.globl	countchd
	.type	countchd, @function
countchd:
.LFB3:
	.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	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	front(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	$1, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L14
.L16:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	node(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L15
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	countchd
	addl	%eax, -8(%rbp)
.L15:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+node(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
.L14:
	cmpl	$0, -12(%rbp)
	jne	.L16
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	countchd, .-countchd
	.globl	travel_path
	.type	travel_path, @function
travel_path:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -4(%rbp)
	movl	4+nxt(%rip), %eax
	movl	%eax, -12(%rbp)
	movl	N(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	par(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	$1, %edi
	call	countchd
	movl	%eax, nb(%rip)
	movl	N(%rip), %eax
	movl	%eax, %edi
	call	countchd
	movl	%eax, nw(%rip)
	jmp	.L19
.L21:
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	countchd
	movl	nb(%rip), %edx
	addl	%edx, %eax
	movl	%eax, nb(%rip)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	countchd
	movl	nw(%rip), %edx
	addl	%edx, %eax
	movl	%eax, nw(%rip)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	nxt(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	par(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
.L19:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	je	.L20
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	nxt(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L21
.L20:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jne	.L23
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	countchd
	movl	nb(%rip), %edx
	addl	%edx, %eax
	movl	%eax, nb(%rip)
.L23:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	travel_path, .-travel_path
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"Fennec"
.LC3:
	.string	"Snuke"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.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
	movl	$0, -12(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -12(%rbp)
	jmp	.L25
.L26:
	leaq	-16(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	add_edge
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	add_edge
	addl	$1, -12(%rbp)
.L25:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L26
	call	find_path
	call	travel_path
	movl	nb(%rip), %edx
	movl	nw(%rip), %eax
	cmpl	%eax, %edx
	jle	.L27
	leaq	.LC2(%rip), %rax
	jmp	.L28
.L27:
	leaq	.LC3(%rip), %rax
.L28:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.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	node
	.bss
	.align 32
	.type	node, @object
	.size	node, 3200032
node:
	.zero	3200032
	.globl	nnodes
	.align 4
	.type	nnodes, @object
	.size	nnodes, 4
nnodes:
	.zero	4
	.globl	front
	.align 32
	.type	front, @object
	.size	front, 400004
front:
	.zero	400004
	.text
	.globl	add_edge
	.type	add_edge, @function
add_edge:
.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	%esi, -24(%rbp)
	movl	nnodes(%rip), %eax
	addl	$1, %eax
	movl	%eax, nnodes(%rip)
	movl	nnodes(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	node(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	front(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+node(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	front(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	add_edge, .-add_edge
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	vis
	.align 32
	.type	vis, @object
	.size	vis, 400004
vis:
	.zero	400004
	.globl	par
	.align 32
	.type	par, @object
	.size	par, 400004
par:
	.zero	400004
	.globl	nxt
	.align 32
	.type	nxt, @object
	.size	nxt, 400004
nxt:
	.zero	400004
	.globl	chd
	.align 32
	.type	chd, @object
	.size	chd, 400004
chd:
	.zero	400004
	.globl	nb
	.align 4
	.type	nb, @object
	.size	nb, 4
nb:
	.zero	4
	.globl	nw
	.align 4
	.type	nw, @object
	.size	nw, 4
nw:
	.zero	4
	.text
	.globl	dfs2N
	.type	dfs2N, @function
dfs2N:
.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	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	front(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L5
	movl	$1, %eax
	jmp	.L4
.L7:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	node(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L6
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	dfs2N
	testl	%eax, %eax
	je	.L6
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	nxt(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	par(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$1, %eax
	jmp	.L4
.L6:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+node(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
.L5:
	cmpl	$0, -8(%rbp)
	jne	.L7
	movl	$0, %eax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	dfs2N, .-dfs2N
	.globl	find_path
	.type	find_path, @function
find_path:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -4(%rbp)
	movl	$1, %edi
	call	dfs2N
	movl	$1, -4(%rbp)
	jmp	.L9
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L9:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L10
	movl	4+nxt(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L11
.L12:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	nxt(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L12
	movl	N(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	vis(%rip), %rdx
	movl	$1, (%rcx,%rdx)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, 4+vis(%rip)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	find_path, .-find_path
	.globl	countchd
	.type	countchd, @function
countchd:
.LFB3:
	.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	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	front(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	$1, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L14
.L16:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	node(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	vis(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L15
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	countchd
	addl	%eax, -8(%rbp)
.L15:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+node(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
.L14:
	cmpl	$0, -12(%rbp)
	jne	.L16
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	countchd, .-countchd
	.globl	travel_path
	.type	travel_path, @function
travel_path:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -4(%rbp)
	movl	4+nxt(%rip), %eax
	movl	%eax, -12(%rbp)
	movl	N(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	par(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	$1, %edi
	call	countchd
	movl	%eax, nb(%rip)
	movl	N(%rip), %eax
	movl	%eax, %edi
	call	countchd
	movl	%eax, nw(%rip)
	jmp	.L19
.L21:
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	countchd
	movl	nb(%rip), %edx
	addl	%edx, %eax
	movl	%eax, nb(%rip)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	countchd
	movl	nw(%rip), %edx
	addl	%edx, %eax
	movl	%eax, nw(%rip)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	nxt(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	par(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
.L19:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	je	.L20
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	nxt(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L21
.L20:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jne	.L23
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	countchd
	movl	nb(%rip), %edx
	addl	%edx, %eax
	movl	%eax, nb(%rip)
.L23:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	travel_path, .-travel_path
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"Fennec"
.LC3:
	.string	"Snuke"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.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
	movl	$0, -12(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -12(%rbp)
	jmp	.L25
.L26:
	leaq	-16(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	add_edge
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	add_edge
	addl	$1, -12(%rbp)
.L25:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L26
	call	find_path
	call	travel_path
	movl	nb(%rip), %edx
	movl	nw(%rip), %eax
	cmpl	%eax, %edx
	jle	.L27
	leaq	.LC2(%rip), %rax
	jmp	.L28
.L27:
	leaq	.LC3(%rip), %rax
.L28:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.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:
