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

```c
#include <stdio.h>
#include <stdlib.h>
 
int puz[3][3];
int tmp[3][3];
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};
 
void empty(int *,int *);
int dfs(int,int,int,int,const int);
int cal();
void swap(int *,int *);
 
 
int main() {
    int i,j,ans,x,y,l;
     
    //puzzle input
    for(i=0; i<3; i++) {
        for(j=0; j<3; j++) scanf("%d",&puz[i][j]);
    }
     
     
    empty(&x,&y);
    for(l=0; l<100; l++) {
        //copy
        for(i=0; i<3; i++) {
            for(j=0; j<3; j++) tmp[i][j] = puz[i][j];
        }
         
        //dfs
        ans = dfs(x,y,-1,0,l);
        if(ans!=-1) {
            printf("%d\n",ans);
            break;
        }
         
        //copy
        for(i=0; i<3; i++) {
            for(j=0; j<3; j++) puz[i][j] = tmp[i][j];
        }
         
        //error
        ans = -1;
        if(l==99) printf("%d\n",ans);
    }
     
    //ans output
    //printf("%d\n",ans);
     
    return 0;
}
 
 
void empty(int *x,int *y) {
    int i,j;
    for(i=0; i<3; i++) {
        for(j=0; j<3; j++) {
            if(!puz[i][j]) {
                *x = j;
                *y = i;
                return;
            }
        }
    }
}
 
 
void swap(int *a,int *b) {
    int tmp;
     
    tmp = *a;
    *a = *b;
    *b = tmp;
}
 
 
int cal() {
    int i,a,sum=0;
     
    for(i=0; i<9; i++) {
        a = puz[i/3][i%3];
        if(a) {
            a--;
            sum += abs(i/3 - a/3) + abs(i%3 - a%3);
        }
    }
     
    return sum;
}
 
 
int dfs(int x,int y,int p,int dep,const int lim) {
    int i,h,nx,ny,res;
     
    h = cal();
    if(h==0) return dep;
    if(dep+h>lim) return -1;
     
    for(i=0; i<4; i++) {
        nx = x+dx[i];
        ny = y+dy[i];
         
        if(~p && i==(p+2)%4) continue;
        if(!(0<=nx && nx<3 && 0<=ny && ny<3)) continue;
         
        swap(&puz[y][x],&puz[ny][nx]);
        res = dfs(nx,ny,i,dep+1,lim);
        if(~res) return res;
         
        swap(&puz[y][x],&puz[ny][nx]);
    }
     
    return -1;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	puz
	.bss
	.align 32
	.type	puz, @object
	.size	puz, 36
puz:
	.zero	36
	.globl	tmp
	.align 32
	.type	tmp, @object
	.size	tmp, 36
tmp:
	.zero	36
	.globl	dx
	.data
	.align 16
	.type	dx, @object
	.size	dx, 16
dx:
	.long	0
	.long	1
	.long	0
	.long	-1
	.globl	dy
	.align 16
	.type	dy, @object
	.size	dy, 16
dy:
	.long	1
	.long	0
	.long	-1
	.long	0
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -24(%rbp)
	jmp	.L2
.L5:
	movl	$0, -20(%rbp)
	jmp	.L3
.L4:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -20(%rbp)
.L3:
	cmpl	$2, -20(%rbp)
	jle	.L4
	addl	$1, -24(%rbp)
.L2:
	cmpl	$2, -24(%rbp)
	jle	.L5
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	empty
	movl	$0, -16(%rbp)
	jmp	.L6
.L18:
	movl	$0, -24(%rbp)
	jmp	.L7
.L10:
	movl	$0, -20(%rbp)
	jmp	.L8
.L9:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	tmp(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -20(%rbp)
.L8:
	cmpl	$2, -20(%rbp)
	jle	.L9
	addl	$1, -24(%rbp)
.L7:
	cmpl	$2, -24(%rbp)
	jle	.L10
	movl	-28(%rbp), %esi
	movl	-32(%rbp), %eax
	movl	-16(%rbp), %edx
	movl	%edx, %r8d
	movl	$0, %ecx
	movl	$-1, %edx
	movl	%eax, %edi
	call	dfs
	movl	%eax, -12(%rbp)
	cmpl	$-1, -12(%rbp)
	je	.L11
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L11:
	movl	$0, -24(%rbp)
	jmp	.L13
.L16:
	movl	$0, -20(%rbp)
	jmp	.L14
.L15:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tmp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	puz(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -20(%rbp)
.L14:
	cmpl	$2, -20(%rbp)
	jle	.L15
	addl	$1, -24(%rbp)
.L13:
	cmpl	$2, -24(%rbp)
	jle	.L16
	movl	$-1, -12(%rbp)
	cmpl	$99, -16(%rbp)
	jne	.L17
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	addl	$1, -16(%rbp)
.L6:
	cmpl	$99, -16(%rbp)
	jle	.L18
.L12:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	empty
	.type	empty, @function
empty:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L22
.L27:
	movl	$0, -4(%rbp)
	jmp	.L23
.L26:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L24
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-8(%rbp), %edx
	movl	%edx, (%rax)
	jmp	.L21
.L24:
	addl	$1, -4(%rbp)
.L23:
	cmpl	$2, -4(%rbp)
	jle	.L26
	addl	$1, -8(%rbp)
.L22:
	cmpl	$2, -8(%rbp)
	jle	.L27
.L21:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	empty, .-empty
	.globl	swap
	.type	swap, @function
swap:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	swap, .-swap
	.globl	cal
	.type	cal, @function
cal:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L30
.L32:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%edx, %esi
	subl	%eax, %esi
	movl	-12(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movslq	%eax, %rcx
	movslq	%esi, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	je	.L31
	subl	$1, -4(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	subl	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %edi
	movl	-12(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rcx
	imulq	$1431655766, %rcx, %rcx
	shrq	$32, %rcx
	movl	%edx, %r8d
	sarl	$31, %r8d
	movl	%ecx, %esi
	subl	%r8d, %esi
	movl	%esi, %ecx
	addl	%ecx, %ecx
	addl	%esi, %ecx
	movl	%edx, %esi
	subl	%ecx, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%edi, %eax
	addl	%eax, -8(%rbp)
.L31:
	addl	$1, -12(%rbp)
.L30:
	cmpl	$8, -12(%rbp)
	jle	.L32
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	cal, .-cal
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	%edx, -44(%rbp)
	movl	%ecx, -48(%rbp)
	movl	%r8d, -52(%rbp)
	movl	$0, %eax
	call	cal
	movl	%eax, -16(%rbp)
	cmpl	$0, -16(%rbp)
	jne	.L35
	movl	-48(%rbp), %eax
	jmp	.L36
.L35:
	movl	-48(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -52(%rbp)
	jge	.L37
	movl	$-1, %eax
	jmp	.L36
.L37:
	movl	$0, -20(%rbp)
	jmp	.L38
.L44:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dx(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dy(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	cmpl	$-1, -44(%rbp)
	je	.L39
	movl	-44(%rbp), %eax
	addl	$2, %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	cmpl	%eax, -20(%rbp)
	je	.L45
.L39:
	cmpl	$0, -12(%rbp)
	js	.L46
	cmpl	$2, -12(%rbp)
	jg	.L46
	cmpl	$0, -8(%rbp)
	js	.L46
	cmpl	$2, -8(%rbp)
	jg	.L46
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	movslq	%eax, %rsi
	movl	-40(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	puz(%rip), %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
	movl	-48(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-52(%rbp), %edi
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %esi
	movl	-12(%rbp), %eax
	movl	%edi, %r8d
	movl	%eax, %edi
	call	dfs
	movl	%eax, -4(%rbp)
	cmpl	$-1, -4(%rbp)
	je	.L43
	movl	-4(%rbp), %eax
	jmp	.L36
.L43:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	movslq	%eax, %rsi
	movl	-40(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	puz(%rip), %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
	jmp	.L40
.L45:
	nop
	jmp	.L40
.L46:
	nop
.L40:
	addl	$1, -20(%rbp)
.L38:
	cmpl	$3, -20(%rbp)
	jle	.L44
	movl	$-1, %eax
.L36:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	dfs, .-dfs
	.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	dfs.part.0, @function
dfs.part.0:
.LFB44:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leal	2(%rdx), %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%edi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	puz(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movl	%edx, 8(%rsp)
	cltd
	shrl	$30, %edx
	movl	%esi, 4(%rsp)
	addl	%edx, %eax
	movl	%ecx, 40(%rsp)
	andl	$3, %eax
	movl	%r8d, 44(%rsp)
	subl	%edx, %eax
	movl	%eax, 12(%rsp)
	movslq	%esi, %rax
	leaq	(%rax,%rax,2), %rax
	movq	%rax, 16(%rsp)
.L16:
	leaq	dx(%rip), %rax
	movl	4(%rsp), %esi
	movl	%ebx, %r9d
	movl	(%rax,%rbx,4), %edi
	leaq	dy(%rip), %rax
	addl	(%rax,%rbx,4), %esi
	addl	%r14d, %edi
	cmpl	$-1, 8(%rsp)
	je	.L2
	cmpl	%ebx, 12(%rsp)
	je	.L3
.L2:
	cmpl	$2, %edi
	ja	.L3
	cmpl	$2, %esi
	ja	.L3
	movq	16(%rsp), %rdx
	movslq	%r14d, %rax
	movslq	%esi, %r12
	movq	%rax, 32(%rsp)
	addq	%rax, %rdx
	movslq	%edi, %rax
	movq	%rax, %rcx
	movq	%rax, 24(%rsp)
	leaq	(%r12,%r12,2), %rax
	movl	0(%rbp,%rdx,4), %r10d
	addq	%rcx, %rax
	movl	0(%rbp,%rax,4), %ecx
	movl	%ecx, 0(%rbp,%rdx,4)
	movl	%r10d, 0(%rbp,%rax,4)
	movl	40(%rsp), %eax
	leal	1(%rax), %ecx
	movl	0(%rbp), %eax
	testl	%eax, %eax
	je	.L4
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	%eax, %r11d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r11d
	movl	%r11d, %r8d
	shrq	$32, %rdx
	subl	%edx, %r8d
	movl	%r8d, %r13d
	negl	%r13d
	cmovns	%r13d, %r8d
	subl	%r11d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	leal	(%r8,%rdx), %eax
.L4:
	movl	4+puz(%rip), %edx
	testl	%edx, %edx
	je	.L5
	subl	$1, %edx
	movslq	%edx, %r11
	movl	%edx, %r8d
	imulq	$1431655766, %r11, %r11
	sarl	$31, %r8d
	shrq	$32, %r11
	movl	%r11d, %r13d
	subl	%r8d, %r13d
	leal	0(%r13,%r13,2), %r13d
	subl	%edx, %r13d
	leal	1(%r13), %edx
	movl	%edx, %r13d
	negl	%r13d
	cmovns	%r13d, %edx
	subl	%r11d, %r8d
	movl	%r8d, %r11d
	negl	%r11d
	cmovs	%r8d, %r11d
	addl	%r11d, %edx
	addl	%edx, %eax
.L5:
	movl	8+puz(%rip), %r8d
	testl	%r8d, %r8d
	je	.L6
	subl	$1, %r8d
	movslq	%r8d, %rdx
	movl	%r8d, %r13d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r13d
	movl	%r13d, %r11d
	shrq	$32, %rdx
	subl	%edx, %r11d
	movl	%r11d, %r15d
	negl	%r15d
	cmovns	%r15d, %r11d
	subl	%r13d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%r8d, %edx
	leal	2(%r11,%rdx), %edx
	addl	%edx, %eax
.L6:
	movl	12+puz(%rip), %edx
	testl	%edx, %edx
	je	.L7
	subl	$1, %edx
	movslq	%edx, %r11
	movl	%edx, %r13d
	imulq	$1431655766, %r11, %r11
	sarl	$31, %r13d
	movl	%r13d, %r8d
	shrq	$32, %r11
	subl	%r11d, %r8d
	addl	$1, %r8d
	movl	%r8d, %r15d
	negl	%r15d
	cmovns	%r15d, %r8d
	subl	%r13d, %r11d
	leal	(%r11,%r11,2), %r11d
	subl	%r11d, %edx
	movl	%edx, %r11d
	negl	%r11d
	cmovs	%edx, %r11d
	addl	%r11d, %r8d
	addl	%r8d, %eax
.L7:
	movl	16+puz(%rip), %r11d
	testl	%r11d, %r11d
	je	.L8
	subl	$1, %r11d
	movslq	%r11d, %r8
	movl	%r11d, %r13d
	imulq	$1431655766, %r8, %r8
	sarl	$31, %r13d
	movl	%r13d, %edx
	shrq	$32, %r8
	subl	%r8d, %edx
	addl	$1, %edx
	movl	%edx, %r15d
	negl	%r15d
	cmovns	%r15d, %edx
	subl	%r13d, %r8d
	leal	(%r8,%r8,2), %r8d
	subl	%r11d, %r8d
	leal	1(%r8), %r11d
	movl	%r11d, %r8d
	negl	%r8d
	cmovs	%r11d, %r8d
	addl	%r8d, %edx
	addl	%edx, %eax
.L8:
	movl	20+puz(%rip), %r8d
	testl	%r8d, %r8d
	je	.L9
	subl	$1, %r8d
	movslq	%r8d, %rdx
	movl	%r8d, %r13d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r13d
	movl	%r13d, %r11d
	shrq	$32, %rdx
	subl	%edx, %r11d
	addl	$1, %r11d
	movl	%r11d, %r15d
	negl	%r15d
	cmovns	%r15d, %r11d
	subl	%r13d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%r8d, %edx
	leal	2(%r11,%rdx), %edx
	addl	%edx, %eax
.L9:
	movl	24+puz(%rip), %edx
	testl	%edx, %edx
	je	.L10
	subl	$1, %edx
	movslq	%edx, %r11
	movl	%edx, %r13d
	imulq	$1431655766, %r11, %r11
	sarl	$31, %r13d
	movl	%r13d, %r8d
	shrq	$32, %r11
	subl	%r11d, %r8d
	addl	$2, %r8d
	movl	%r8d, %r15d
	negl	%r15d
	cmovns	%r15d, %r8d
	subl	%r13d, %r11d
	leal	(%r11,%r11,2), %r11d
	subl	%r11d, %edx
	movl	%edx, %r11d
	negl	%r11d
	cmovs	%edx, %r11d
	addl	%r11d, %r8d
	addl	%r8d, %eax
.L10:
	movl	28+puz(%rip), %r11d
	testl	%r11d, %r11d
	je	.L11
	subl	$1, %r11d
	movslq	%r11d, %r8
	movl	%r11d, %r13d
	imulq	$1431655766, %r8, %r8
	sarl	$31, %r13d
	movl	%r13d, %edx
	shrq	$32, %r8
	subl	%r8d, %edx
	addl	$2, %edx
	movl	%edx, %r15d
	negl	%r15d
	cmovns	%r15d, %edx
	subl	%r13d, %r8d
	leal	(%r8,%r8,2), %r8d
	subl	%r11d, %r8d
	leal	1(%r8), %r11d
	movl	%r11d, %r8d
	negl	%r8d
	cmovs	%r11d, %r8d
	addl	%r8d, %edx
	addl	%edx, %eax
.L11:
	movl	32+puz(%rip), %r8d
	testl	%r8d, %r8d
	je	.L12
	subl	$1, %r8d
	movslq	%r8d, %rdx
	movl	%r8d, %r13d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r13d
	movl	%r13d, %r11d
	shrq	$32, %rdx
	subl	%edx, %r11d
	addl	$2, %r11d
	movl	%r11d, %r15d
	negl	%r15d
	cmovns	%r15d, %r11d
	subl	%r13d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%r8d, %edx
	leal	2(%r11,%rdx), %edx
	addl	%edx, %eax
.L12:
	testl	%eax, %eax
	je	.L13
	movl	44(%rsp), %r8d
	addl	%ecx, %eax
	cmpl	%eax, %r8d
	jl	.L14
	movl	%r9d, %edx
	call	dfs.part.0
	movl	%eax, %ecx
.L13:
	cmpl	$-1, %ecx
	jne	.L51
	leaq	(%r12,%r12,2), %rax
	addq	24(%rsp), %rax
	movl	0(%rbp,%rax,4), %r10d
.L14:
	movq	32(%rsp), %rax
	addq	16(%rsp), %rax
	movl	0(%rbp,%rax,4), %edx
	movl	%r10d, 0(%rbp,%rax,4)
	leaq	(%r12,%r12,2), %rax
	addq	24(%rsp), %rax
	movl	%edx, 0(%rbp,%rax,4)
.L3:
	addq	$1, %rbx
	cmpq	$4, %rbx
	jne	.L16
	movl	$-1, %r13d
.L1:
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r13d, %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
	.p2align 4,,10
	.p2align 3
.L51:
	.cfi_restore_state
	movl	%ecx, %r13d
	jmp	.L1
	.cfi_endproc
.LFE44:
	.size	dfs.part.0, .-dfs.part.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	puz(%rip), %rbx
	leaq	36(%rbx), %r12
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L55:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	4(%rbx), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	8(%rbx), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	addq	$12, %rbx
	cmpq	%rbx, %r12
	jne	.L55
	movl	puz(%rip), %eax
	testl	%eax, %eax
	je	.L79
	movl	4+puz(%rip), %ecx
	movl	8+puz(%rip), %edx
	movl	%ecx, 8(%rsp)
	testl	%ecx, %ecx
	je	.L57
	movl	%edx, 8(%rsp)
	testl	%edx, %edx
	je	.L58
	movl	12+puz(%rip), %r11d
	testl	%r11d, %r11d
	je	.L80
	movl	16+puz(%rip), %r10d
	testl	%r10d, %r10d
	je	.L81
	movl	20+puz(%rip), %r9d
	testl	%r9d, %r9d
	je	.L82
	movl	24+puz(%rip), %r8d
	testl	%r8d, %r8d
	je	.L122
	movl	28+puz(%rip), %edi
	testl	%edi, %edi
	je	.L123
	movl	32+puz(%rip), %esi
	testl	%esi, %esi
	je	.L124
.L60:
	movd	%edx, %xmm1
	movd	%eax, %xmm0
	movd	%ecx, %xmm4
	xorl	%ebp, %ebp
	movd	12+puz(%rip), %xmm3
	punpckldq	%xmm4, %xmm0
	movd	24+puz(%rip), %xmm2
	leaq	tmp(%rip), %rbx
	movd	28+puz(%rip), %xmm5
	movd	20+puz(%rip), %xmm6
	movl	$1, %r15d
	punpckldq	%xmm3, %xmm1
	movl	32+puz(%rip), %r11d
	punpcklqdq	%xmm1, %xmm0
	movd	16+puz(%rip), %xmm1
	punpckldq	%xmm5, %xmm2
	punpckldq	%xmm6, %xmm1
	punpcklqdq	%xmm2, %xmm1
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L126:
	cmpl	%r12d, %ebp
	jl	.L75
	movl	8(%rsp), %esi
	movl	12(%rsp), %edi
	movl	%ebp, %r8d
	xorl	%ecx, %ecx
	movl	$-1, %edx
	call	dfs.part.0
	movl	%eax, %r12d
	cmpl	$-1, %eax
	jne	.L71
.L75:
	movdqa	(%rbx), %xmm0
	movdqa	16+tmp(%rip), %xmm1
	leaq	puz(%rip), %rax
	movl	32+tmp(%rip), %r11d
	movaps	%xmm0, (%rax)
	movl	%r11d, 32+puz(%rip)
	movaps	%xmm1, 16+puz(%rip)
	cmpl	$99, %ebp
	je	.L125
	addl	$1, %ebp
.L62:
	pshufd	$255, %xmm1, %xmm2
	movd	%xmm0, %r12d
	movd	%xmm1, %r8d
	movaps	%xmm0, (%rbx)
	movd	%xmm2, %ecx
	movdqa	%xmm1, %xmm2
	movl	%r11d, 32+tmp(%rip)
	punpckhdq	%xmm1, %xmm2
	movaps	%xmm1, 16+tmp(%rip)
	movd	%xmm2, %r14d
	pshufd	$85, %xmm1, %xmm2
	movd	%xmm2, %r9d
	pshufd	$255, %xmm0, %xmm2
	movd	%xmm2, %edx
	movdqa	%xmm0, %xmm2
	punpckhdq	%xmm0, %xmm2
	movd	%xmm2, %edi
	pshufd	$85, %xmm0, %xmm2
	movd	%xmm2, %esi
	testl	%r12d, %r12d
	je	.L78
	subl	$1, %r12d
	movslq	%r12d, %r10
	movl	%r12d, %r13d
	imulq	$1431655766, %r10, %r10
	sarl	$31, %r13d
	movl	%r13d, %eax
	shrq	$32, %r10
	movq	%r10, (%rsp)
	subl	(%rsp), %eax
	movl	%eax, %r10d
	negl	%r10d
	cmovns	%r10d, %eax
	movl	(%rsp), %r10d
	subl	%r13d, %r10d
	leal	(%r10,%r10,2), %r10d
	subl	%r10d, %r12d
	movl	%r12d, %r10d
	negl	%r10d
	cmovs	%r12d, %r10d
	leal	(%rax,%r10), %r12d
.L78:
	testl	%esi, %esi
	je	.L63
	subl	$1, %esi
	movslq	%esi, %r10
	movl	%esi, %eax
	imulq	$1431655766, %r10, %r10
	sarl	$31, %eax
	shrq	$32, %r10
	movl	%r10d, %r13d
	subl	%eax, %r13d
	leal	0(%r13,%r13,2), %r13d
	subl	%r13d, %esi
	movl	%r15d, %r13d
	subl	%esi, %r13d
	movl	%r13d, %esi
	negl	%esi
	cmovs	%r13d, %esi
	subl	%r10d, %eax
	movl	%eax, %r10d
	negl	%r10d
	cmovs	%eax, %r10d
	addl	%r10d, %esi
	addl	%esi, %r12d
.L63:
	testl	%edi, %edi
	je	.L64
	subl	$1, %edi
	movslq	%edi, %rax
	movl	%edi, %r10d
	imulq	$1431655766, %rax, %rax
	sarl	$31, %r10d
	movl	%r10d, %esi
	shrq	$32, %rax
	subl	%eax, %esi
	movl	%esi, %r13d
	negl	%r13d
	cmovns	%r13d, %esi
	subl	%r10d, %eax
	leal	(%rax,%rax,2), %eax
	subl	%edi, %eax
	leal	2(%rsi,%rax), %eax
	addl	%eax, %r12d
.L64:
	testl	%edx, %edx
	je	.L65
	subl	$1, %edx
	movslq	%edx, %rsi
	movl	%edx, %edi
	imulq	$1431655766, %rsi, %rsi
	sarl	$31, %edi
	movl	%edi, %eax
	shrq	$32, %rsi
	subl	%esi, %eax
	addl	$1, %eax
	movl	%eax, %r10d
	negl	%r10d
	cmovns	%r10d, %eax
	subl	%edi, %esi
	leal	(%rsi,%rsi,2), %esi
	subl	%esi, %edx
	movl	%edx, %esi
	negl	%esi
	cmovns	%esi, %edx
	addl	%edx, %eax
	addl	%eax, %r12d
.L65:
	testl	%r8d, %r8d
	je	.L66
	subl	$1, %r8d
	movslq	%r8d, %rax
	movl	%r8d, %esi
	imulq	$1431655766, %rax, %rax
	sarl	$31, %esi
	movl	%esi, %edi
	shrq	$32, %rax
	subl	%eax, %edi
	addl	$1, %edi
	movl	%edi, %edx
	negl	%edx
	cmovs	%edi, %edx
	subl	%esi, %eax
	movl	%r15d, %esi
	leal	(%rax,%rax,2), %eax
	subl	%eax, %r8d
	subl	%r8d, %esi
	movl	%esi, %eax
	negl	%eax
	cmovs	%esi, %eax
	addl	%eax, %edx
	addl	%edx, %r12d
.L66:
	testl	%r9d, %r9d
	je	.L67
	subl	$1, %r9d
	movslq	%r9d, %rax
	movl	%r9d, %esi
	imulq	$1431655766, %rax, %rax
	sarl	$31, %esi
	movl	%esi, %edx
	shrq	$32, %rax
	subl	%eax, %edx
	addl	$1, %edx
	movl	%edx, %edi
	negl	%edi
	cmovns	%edi, %edx
	subl	%esi, %eax
	leal	(%rax,%rax,2), %eax
	subl	%r9d, %eax
	leal	2(%rdx,%rax), %eax
	addl	%eax, %r12d
.L67:
	testl	%r14d, %r14d
	je	.L68
	leal	-1(%r14), %esi
	movslq	%esi, %rax
	movl	%esi, %r8d
	imulq	$1431655766, %rax, %rax
	sarl	$31, %r8d
	movl	%r8d, %edx
	shrq	$32, %rax
	subl	%eax, %edx
	addl	$2, %edx
	movl	%edx, %edi
	negl	%edi
	cmovs	%edx, %edi
	subl	%r8d, %eax
	leal	(%rax,%rax,2), %edx
	movl	%esi, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	leal	(%rdi,%rdx), %eax
	addl	%eax, %r12d
.L68:
	testl	%ecx, %ecx
	je	.L69
	subl	$1, %ecx
	movslq	%ecx, %rax
	movl	%ecx, %esi
	imulq	$1431655766, %rax, %rax
	sarl	$31, %esi
	movl	%esi, %edx
	shrq	$32, %rax
	subl	%eax, %edx
	addl	$2, %edx
	movl	%edx, %edi
	negl	%edi
	cmovs	%edx, %edi
	subl	%esi, %eax
	movl	%r15d, %esi
	leal	(%rax,%rax,2), %eax
	subl	%eax, %ecx
	subl	%ecx, %esi
	movl	%esi, %edx
	negl	%edx
	cmovs	%esi, %edx
	leal	(%rdi,%rdx), %eax
	addl	%eax, %r12d
.L69:
	testl	%r11d, %r11d
	je	.L70
	subl	$1, %r11d
	movslq	%r11d, %rax
	movl	%r11d, %esi
	imulq	$1431655766, %rax, %rax
	sarl	$31, %esi
	movl	%esi, %edx
	shrq	$32, %rax
	subl	%eax, %edx
	addl	$2, %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	subl	%esi, %eax
	leal	(%rax,%rax,2), %eax
	subl	%r11d, %eax
	leal	2(%rdx,%rax), %eax
	addl	%eax, %r12d
.L70:
	testl	%r12d, %r12d
	jne	.L126
.L71:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L76:
	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
.L125:
	.cfi_restore_state
	movl	$-1, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L76
.L81:
	movl	$1, 8(%rsp)
.L57:
	movl	$1, 12(%rsp)
	jmp	.L60
.L82:
	movl	$1, 8(%rsp)
.L58:
	movl	$2, 12(%rsp)
	jmp	.L60
.L79:
	movl	$0, 8(%rsp)
	movl	4+puz(%rip), %ecx
	movl	8+puz(%rip), %edx
.L56:
	movl	$0, 12(%rsp)
	jmp	.L60
.L80:
	movl	$1, 8(%rsp)
	jmp	.L56
.L122:
	movl	$2, 8(%rsp)
	jmp	.L56
.L124:
	movl	$2, 8(%rsp)
	jmp	.L58
.L123:
	movl	$2, 8(%rsp)
	jmp	.L57
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	empty
	.type	empty, @function
empty:
.LFB40:
	.cfi_startproc
	endbr64
	movl	puz(%rip), %eax
	testl	%eax, %eax
	je	.L128
	movl	4+puz(%rip), %eax
	testl	%eax, %eax
	je	.L129
	movl	8+puz(%rip), %eax
	testl	%eax, %eax
	je	.L130
	movl	12+puz(%rip), %r10d
	testl	%r10d, %r10d
	je	.L135
	movl	16+puz(%rip), %r9d
	testl	%r9d, %r9d
	je	.L136
	movl	20+puz(%rip), %r8d
	testl	%r8d, %r8d
	je	.L137
	movl	24+puz(%rip), %ecx
	movl	$2, %eax
	testl	%ecx, %ecx
	je	.L128
	movl	28+puz(%rip), %edx
	movl	$2, %eax
	testl	%edx, %edx
	je	.L129
	movl	32+puz(%rip), %eax
	testl	%eax, %eax
	je	.L147
	ret
.L135:
	movl	$1, %eax
.L128:
	xorl	%edx, %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
.L136:
	movl	$1, %eax
.L129:
	movl	$1, %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
.L137:
	movl	$1, %eax
.L130:
	movl	$2, %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
.L147:
	movl	$2, %eax
	jmp	.L130
	.cfi_endproc
.LFE40:
	.size	empty, .-empty
	.p2align 4
	.globl	swap
	.type	swap, @function
swap:
.LFB41:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE41:
	.size	swap, .-swap
	.p2align 4
	.globl	cal
	.type	cal, @function
cal:
.LFB42:
	.cfi_startproc
	endbr64
	movl	puz(%rip), %eax
	testl	%eax, %eax
	je	.L150
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	%eax, %edi
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %edi
	movl	%edi, %esi
	shrq	$32, %rdx
	subl	%edx, %esi
	movl	%esi, %ecx
	negl	%ecx
	cmovs	%esi, %ecx
	subl	%edi, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%ecx, %eax
.L150:
	movl	4+puz(%rip), %edx
	testl	%edx, %edx
	je	.L151
	subl	$1, %edx
	movslq	%edx, %rsi
	movl	%edx, %ecx
	imulq	$1431655766, %rsi, %rsi
	sarl	$31, %ecx
	shrq	$32, %rsi
	movl	%esi, %edi
	subl	%ecx, %edi
	leal	(%rdi,%rdi,2), %edi
	subl	%edx, %edi
	addl	$1, %edi
	movl	%edi, %edx
	negl	%edx
	cmovns	%edx, %edi
	subl	%esi, %ecx
	movl	%ecx, %edx
	negl	%ecx
	cmovns	%ecx, %edx
	addl	%edi, %edx
	addl	%edx, %eax
.L151:
	movl	8+puz(%rip), %edx
	testl	%edx, %edx
	je	.L152
	leal	-1(%rdx), %ecx
	movslq	%ecx, %rdx
	movl	%ecx, %r8d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r8d
	movl	%r8d, %edi
	shrq	$32, %rdx
	subl	%edx, %edi
	movl	%edi, %esi
	negl	%esi
	cmovs	%edi, %esi
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%ecx, %edx
	leal	2(%rsi,%rdx), %edx
	addl	%edx, %eax
.L152:
	movl	12+puz(%rip), %edx
	testl	%edx, %edx
	je	.L153
	subl	$1, %edx
	movslq	%edx, %rcx
	movl	%edx, %r8d
	imulq	$1431655766, %rcx, %rcx
	sarl	$31, %r8d
	movl	%r8d, %edi
	shrq	$32, %rcx
	subl	%ecx, %edi
	addl	$1, %edi
	movl	%edi, %esi
	negl	%esi
	cmovs	%edi, %esi
	subl	%r8d, %ecx
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	addl	%esi, %edx
	addl	%edx, %eax
.L153:
	movl	16+puz(%rip), %edx
	testl	%edx, %edx
	je	.L154
	leal	-1(%rdx), %ecx
	movslq	%ecx, %rdx
	movl	%ecx, %r8d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r8d
	movl	%r8d, %edi
	shrq	$32, %rdx
	subl	%edx, %edi
	addl	$1, %edi
	movl	%edi, %esi
	negl	%esi
	cmovs	%edi, %esi
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%ecx, %edx
	leal	1(%rdx), %ecx
	movl	%ecx, %edx
	negl	%edx
	cmovs	%ecx, %edx
	addl	%esi, %edx
	addl	%edx, %eax
.L154:
	movl	20+puz(%rip), %edx
	testl	%edx, %edx
	je	.L155
	leal	-1(%rdx), %ecx
	movslq	%ecx, %rdx
	movl	%ecx, %r8d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r8d
	movl	%r8d, %esi
	shrq	$32, %rdx
	subl	%edx, %esi
	addl	$1, %esi
	movl	%esi, %edi
	negl	%edi
	cmovns	%edi, %esi
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%ecx, %edx
	leal	2(%rsi,%rdx), %edx
	addl	%edx, %eax
.L155:
	movl	24+puz(%rip), %edx
	testl	%edx, %edx
	je	.L156
	subl	$1, %edx
	movslq	%edx, %rcx
	movl	%edx, %r8d
	imulq	$1431655766, %rcx, %rcx
	sarl	$31, %r8d
	movl	%r8d, %edi
	shrq	$32, %rcx
	subl	%ecx, %edi
	addl	$2, %edi
	movl	%edi, %esi
	negl	%esi
	cmovs	%edi, %esi
	subl	%r8d, %ecx
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	addl	%esi, %edx
	addl	%edx, %eax
.L156:
	movl	28+puz(%rip), %edx
	testl	%edx, %edx
	je	.L157
	leal	-1(%rdx), %ecx
	movslq	%ecx, %rdx
	movl	%ecx, %r8d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r8d
	movl	%r8d, %edi
	shrq	$32, %rdx
	subl	%edx, %edi
	addl	$2, %edi
	movl	%edi, %esi
	negl	%esi
	cmovs	%edi, %esi
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%ecx, %edx
	leal	1(%rdx), %ecx
	movl	%ecx, %edx
	negl	%edx
	cmovs	%ecx, %edx
	addl	%esi, %edx
	addl	%edx, %eax
.L157:
	movl	32+puz(%rip), %edx
	testl	%edx, %edx
	je	.L149
	leal	-1(%rdx), %ecx
	movslq	%ecx, %rdx
	movl	%ecx, %r8d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r8d
	movl	%r8d, %esi
	shrq	$32, %rdx
	subl	%edx, %esi
	addl	$2, %esi
	movl	%esi, %edi
	negl	%edi
	cmovns	%edi, %esi
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%ecx, %edx
	leal	2(%rsi,%rdx), %edx
	addl	%edx, %eax
.L149:
	ret
	.cfi_endproc
.LFE42:
	.size	cal, .-cal
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB43:
	.cfi_startproc
	endbr64
	movl	%edx, %r9d
	movl	puz(%rip), %edx
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	testl	%edx, %edx
	je	.L187
	subl	$1, %edx
	movslq	%edx, %rax
	movl	%edx, %ebx
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ebx
	movl	%ebx, %r11d
	shrq	$32, %rax
	subl	%eax, %r11d
	movl	%r11d, %r10d
	negl	%r10d
	cmovs	%r11d, %r10d
	subl	%ebx, %eax
	leal	(%rax,%rax,2), %eax
	subl	%eax, %edx
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	leal	(%r10,%rax), %edx
.L187:
	movl	4+puz(%rip), %eax
	testl	%eax, %eax
	je	.L188
	subl	$1, %eax
	movslq	%eax, %r11
	movl	%eax, %r10d
	imulq	$1431655766, %r11, %r11
	sarl	$31, %r10d
	shrq	$32, %r11
	movl	%r11d, %ebx
	subl	%r10d, %ebx
	leal	(%rbx,%rbx,2), %ebx
	subl	%eax, %ebx
	addl	$1, %ebx
	movl	%ebx, %eax
	negl	%eax
	cmovns	%eax, %ebx
	movl	%r10d, %eax
	subl	%r11d, %eax
	movl	%eax, %r10d
	negl	%r10d
	cmovns	%r10d, %eax
	addl	%ebx, %eax
	addl	%eax, %edx
.L188:
	movl	8+puz(%rip), %eax
	testl	%eax, %eax
	je	.L189
	leal	-1(%rax), %r10d
	movslq	%r10d, %rax
	movl	%r10d, %ebp
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ebp
	movl	%ebp, %ebx
	shrq	$32, %rax
	subl	%eax, %ebx
	movl	%ebx, %r11d
	negl	%r11d
	cmovs	%ebx, %r11d
	subl	%ebp, %eax
	leal	(%rax,%rax,2), %eax
	subl	%r10d, %eax
	leal	2(%r11,%rax), %eax
	addl	%eax, %edx
.L189:
	movl	12+puz(%rip), %eax
	testl	%eax, %eax
	je	.L190
	leal	-1(%rax), %ebx
	movslq	%ebx, %rax
	movl	%ebx, %ebp
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ebp
	movl	%ebp, %r11d
	shrq	$32, %rax
	subl	%eax, %r11d
	addl	$1, %r11d
	movl	%r11d, %r10d
	negl	%r10d
	cmovs	%r11d, %r10d
	subl	%ebp, %eax
	leal	(%rax,%rax,2), %r11d
	movl	%ebx, %eax
	subl	%r11d, %eax
	movl	%eax, %r11d
	negl	%r11d
	cmovns	%r11d, %eax
	addl	%r10d, %eax
	addl	%eax, %edx
.L190:
	movl	16+puz(%rip), %eax
	testl	%eax, %eax
	je	.L191
	leal	-1(%rax), %r11d
	movslq	%r11d, %rax
	movl	%r11d, %ebp
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ebp
	movl	%ebp, %r10d
	shrq	$32, %rax
	subl	%eax, %r10d
	addl	$1, %r10d
	movl	%r10d, %ebx
	negl	%ebx
	cmovs	%r10d, %ebx
	subl	%ebp, %eax
	leal	(%rax,%rax,2), %r10d
	subl	%r11d, %r10d
	leal	1(%r10), %r11d
	movl	%r11d, %r10d
	negl	%r10d
	cmovs	%r11d, %r10d
	leal	(%rbx,%r10), %eax
	addl	%eax, %edx
.L191:
	movl	20+puz(%rip), %eax
	testl	%eax, %eax
	je	.L192
	leal	-1(%rax), %r11d
	movslq	%r11d, %rax
	movl	%r11d, %ebp
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ebp
	movl	%ebp, %r10d
	shrq	$32, %rax
	subl	%eax, %r10d
	addl	$1, %r10d
	movl	%r10d, %ebx
	negl	%ebx
	cmovns	%ebx, %r10d
	subl	%ebp, %eax
	leal	(%rax,%rax,2), %eax
	subl	%r11d, %eax
	leal	2(%r10,%rax), %eax
	addl	%eax, %edx
.L192:
	movl	24+puz(%rip), %eax
	testl	%eax, %eax
	je	.L193
	leal	-1(%rax), %ebx
	movslq	%ebx, %rax
	movl	%ebx, %ebp
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ebp
	movl	%ebp, %r11d
	shrq	$32, %rax
	subl	%eax, %r11d
	addl	$2, %r11d
	movl	%r11d, %r10d
	negl	%r10d
	cmovs	%r11d, %r10d
	subl	%ebp, %eax
	leal	(%rax,%rax,2), %r11d
	movl	%ebx, %eax
	subl	%r11d, %eax
	movl	%eax, %r11d
	negl	%r11d
	cmovns	%r11d, %eax
	addl	%r10d, %eax
	addl	%eax, %edx
.L193:
	movl	28+puz(%rip), %eax
	testl	%eax, %eax
	je	.L194
	leal	-1(%rax), %r11d
	movslq	%r11d, %rax
	movl	%r11d, %ebp
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ebp
	movl	%ebp, %r10d
	shrq	$32, %rax
	subl	%eax, %r10d
	addl	$2, %r10d
	movl	%r10d, %ebx
	negl	%ebx
	cmovs	%r10d, %ebx
	subl	%ebp, %eax
	leal	(%rax,%rax,2), %r10d
	subl	%r11d, %r10d
	leal	1(%r10), %r11d
	movl	%r11d, %r10d
	negl	%r10d
	cmovs	%r11d, %r10d
	leal	(%rbx,%r10), %eax
	addl	%eax, %edx
.L194:
	movl	32+puz(%rip), %eax
	testl	%eax, %eax
	jne	.L227
	testl	%edx, %edx
	je	.L197
.L228:
	addl	%ecx, %edx
	cmpl	%r8d, %edx
	jg	.L198
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	movl	%r9d, %edx
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	dfs.part.0
	.p2align 4,,10
	.p2align 3
.L227:
	.cfi_restore_state
	leal	-1(%rax), %r11d
	movslq	%r11d, %rax
	movl	%r11d, %ebp
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ebp
	movl	%ebp, %r10d
	shrq	$32, %rax
	subl	%eax, %r10d
	addl	$2, %r10d
	movl	%r10d, %ebx
	negl	%ebx
	cmovns	%ebx, %r10d
	subl	%ebp, %eax
	leal	(%rax,%rax,2), %eax
	subl	%r11d, %eax
	leal	2(%r10,%rax), %eax
	addl	%eax, %edx
	testl	%edx, %edx
	jne	.L228
.L197:
	movl	%ecx, %eax
.L186:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L198:
	.cfi_restore_state
	movl	$-1, %eax
	jmp	.L186
	.cfi_endproc
.LFE43:
	.size	dfs, .-dfs
	.globl	dy
	.data
	.align 16
	.type	dy, @object
	.size	dy, 16
dy:
	.long	1
	.long	0
	.long	-1
	.long	0
	.globl	dx
	.align 16
	.type	dx, @object
	.size	dx, 16
dx:
	.long	0
	.long	1
	.long	0
	.long	-1
	.globl	tmp
	.bss
	.align 32
	.type	tmp, @object
	.size	tmp, 36
tmp:
	.zero	36
	.globl	puz
	.align 32
	.type	puz, @object
	.size	puz, 36
puz:
	.zero	36
	.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	dfs.part.0, @function
dfs.part.0:
.LFB44:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leal	2(%rdx), %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%edi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	puz(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movl	%edx, 8(%rsp)
	cltd
	shrl	$30, %edx
	movl	%esi, 4(%rsp)
	addl	%edx, %eax
	movl	%ecx, 40(%rsp)
	andl	$3, %eax
	movl	%r8d, 44(%rsp)
	subl	%edx, %eax
	movl	%eax, 12(%rsp)
	movslq	%esi, %rax
	leaq	(%rax,%rax,2), %rax
	movq	%rax, 16(%rsp)
.L16:
	leaq	dx(%rip), %rax
	movl	4(%rsp), %esi
	movl	%ebx, %r9d
	movl	(%rax,%rbx,4), %edi
	leaq	dy(%rip), %rax
	addl	(%rax,%rbx,4), %esi
	addl	%r14d, %edi
	cmpl	$-1, 8(%rsp)
	je	.L2
	cmpl	%ebx, 12(%rsp)
	je	.L3
.L2:
	cmpl	$2, %edi
	ja	.L3
	cmpl	$2, %esi
	ja	.L3
	movq	16(%rsp), %rdx
	movslq	%r14d, %rax
	movslq	%esi, %r12
	movq	%rax, 32(%rsp)
	addq	%rax, %rdx
	movslq	%edi, %rax
	movq	%rax, %rcx
	movq	%rax, 24(%rsp)
	leaq	(%r12,%r12,2), %rax
	movl	0(%rbp,%rdx,4), %r10d
	addq	%rcx, %rax
	movl	0(%rbp,%rax,4), %ecx
	movl	%ecx, 0(%rbp,%rdx,4)
	movl	%r10d, 0(%rbp,%rax,4)
	movl	40(%rsp), %eax
	leal	1(%rax), %ecx
	movl	0(%rbp), %eax
	testl	%eax, %eax
	je	.L4
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	%eax, %r11d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r11d
	movl	%r11d, %r8d
	shrq	$32, %rdx
	subl	%edx, %r8d
	movl	%r8d, %r13d
	negl	%r13d
	cmovns	%r13d, %r8d
	subl	%r11d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	leal	(%r8,%rdx), %eax
.L4:
	movl	4+puz(%rip), %edx
	testl	%edx, %edx
	je	.L5
	subl	$1, %edx
	movslq	%edx, %r11
	movl	%edx, %r8d
	imulq	$1431655766, %r11, %r11
	sarl	$31, %r8d
	shrq	$32, %r11
	movl	%r11d, %r13d
	subl	%r8d, %r13d
	leal	0(%r13,%r13,2), %r13d
	subl	%edx, %r13d
	leal	1(%r13), %edx
	movl	%edx, %r13d
	negl	%r13d
	cmovns	%r13d, %edx
	subl	%r11d, %r8d
	movl	%r8d, %r11d
	negl	%r11d
	cmovs	%r8d, %r11d
	addl	%r11d, %edx
	addl	%edx, %eax
.L5:
	movl	8+puz(%rip), %r8d
	testl	%r8d, %r8d
	je	.L6
	subl	$1, %r8d
	movslq	%r8d, %rdx
	movl	%r8d, %r13d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r13d
	movl	%r13d, %r11d
	shrq	$32, %rdx
	subl	%edx, %r11d
	movl	%r11d, %r15d
	negl	%r15d
	cmovns	%r15d, %r11d
	subl	%r13d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%r8d, %edx
	leal	2(%r11,%rdx), %edx
	addl	%edx, %eax
.L6:
	movl	12+puz(%rip), %edx
	testl	%edx, %edx
	je	.L7
	subl	$1, %edx
	movslq	%edx, %r11
	movl	%edx, %r13d
	imulq	$1431655766, %r11, %r11
	sarl	$31, %r13d
	movl	%r13d, %r8d
	shrq	$32, %r11
	subl	%r11d, %r8d
	addl	$1, %r8d
	movl	%r8d, %r15d
	negl	%r15d
	cmovns	%r15d, %r8d
	subl	%r13d, %r11d
	leal	(%r11,%r11,2), %r11d
	subl	%r11d, %edx
	movl	%edx, %r11d
	negl	%r11d
	cmovs	%edx, %r11d
	addl	%r11d, %r8d
	addl	%r8d, %eax
.L7:
	movl	16+puz(%rip), %r11d
	testl	%r11d, %r11d
	je	.L8
	subl	$1, %r11d
	movslq	%r11d, %r8
	movl	%r11d, %r13d
	imulq	$1431655766, %r8, %r8
	sarl	$31, %r13d
	movl	%r13d, %edx
	shrq	$32, %r8
	subl	%r8d, %edx
	addl	$1, %edx
	movl	%edx, %r15d
	negl	%r15d
	cmovns	%r15d, %edx
	subl	%r13d, %r8d
	leal	(%r8,%r8,2), %r8d
	subl	%r11d, %r8d
	leal	1(%r8), %r11d
	movl	%r11d, %r8d
	negl	%r8d
	cmovs	%r11d, %r8d
	addl	%r8d, %edx
	addl	%edx, %eax
.L8:
	movl	20+puz(%rip), %r8d
	testl	%r8d, %r8d
	je	.L9
	subl	$1, %r8d
	movslq	%r8d, %rdx
	movl	%r8d, %r13d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r13d
	movl	%r13d, %r11d
	shrq	$32, %rdx
	subl	%edx, %r11d
	addl	$1, %r11d
	movl	%r11d, %r15d
	negl	%r15d
	cmovns	%r15d, %r11d
	subl	%r13d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%r8d, %edx
	leal	2(%r11,%rdx), %edx
	addl	%edx, %eax
.L9:
	movl	24+puz(%rip), %edx
	testl	%edx, %edx
	je	.L10
	subl	$1, %edx
	movslq	%edx, %r11
	movl	%edx, %r13d
	imulq	$1431655766, %r11, %r11
	sarl	$31, %r13d
	movl	%r13d, %r8d
	shrq	$32, %r11
	subl	%r11d, %r8d
	addl	$2, %r8d
	movl	%r8d, %r15d
	negl	%r15d
	cmovns	%r15d, %r8d
	subl	%r13d, %r11d
	leal	(%r11,%r11,2), %r11d
	subl	%r11d, %edx
	movl	%edx, %r11d
	negl	%r11d
	cmovs	%edx, %r11d
	addl	%r11d, %r8d
	addl	%r8d, %eax
.L10:
	movl	28+puz(%rip), %r11d
	testl	%r11d, %r11d
	je	.L11
	subl	$1, %r11d
	movslq	%r11d, %r8
	movl	%r11d, %r13d
	imulq	$1431655766, %r8, %r8
	sarl	$31, %r13d
	movl	%r13d, %edx
	shrq	$32, %r8
	subl	%r8d, %edx
	addl	$2, %edx
	movl	%edx, %r15d
	negl	%r15d
	cmovns	%r15d, %edx
	subl	%r13d, %r8d
	leal	(%r8,%r8,2), %r8d
	subl	%r11d, %r8d
	leal	1(%r8), %r11d
	movl	%r11d, %r8d
	negl	%r8d
	cmovs	%r11d, %r8d
	addl	%r8d, %edx
	addl	%edx, %eax
.L11:
	movl	32+puz(%rip), %r8d
	testl	%r8d, %r8d
	je	.L12
	subl	$1, %r8d
	movslq	%r8d, %rdx
	movl	%r8d, %r13d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r13d
	movl	%r13d, %r11d
	shrq	$32, %rdx
	subl	%edx, %r11d
	addl	$2, %r11d
	movl	%r11d, %r15d
	negl	%r15d
	cmovns	%r15d, %r11d
	subl	%r13d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%r8d, %edx
	leal	2(%r11,%rdx), %edx
	addl	%edx, %eax
.L12:
	testl	%eax, %eax
	je	.L13
	movl	44(%rsp), %r8d
	addl	%ecx, %eax
	cmpl	%eax, %r8d
	jl	.L14
	movl	%r9d, %edx
	call	dfs.part.0
	movl	%eax, %ecx
.L13:
	cmpl	$-1, %ecx
	jne	.L51
	leaq	(%r12,%r12,2), %rax
	addq	24(%rsp), %rax
	movl	0(%rbp,%rax,4), %r10d
.L14:
	movq	32(%rsp), %rax
	addq	16(%rsp), %rax
	movl	0(%rbp,%rax,4), %edx
	movl	%r10d, 0(%rbp,%rax,4)
	leaq	(%r12,%r12,2), %rax
	addq	24(%rsp), %rax
	movl	%edx, 0(%rbp,%rax,4)
.L3:
	addq	$1, %rbx
	cmpq	$4, %rbx
	jne	.L16
	movl	$-1, %r13d
.L1:
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r13d, %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
	.p2align 4,,10
	.p2align 3
.L51:
	.cfi_restore_state
	movl	%ecx, %r13d
	jmp	.L1
	.cfi_endproc
.LFE44:
	.size	dfs.part.0, .-dfs.part.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	puz(%rip), %rbx
	leaq	36(%rbx), %r12
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L55:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	4(%rbx), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	8(%rbx), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	addq	$12, %rbx
	cmpq	%rbx, %r12
	jne	.L55
	movl	puz(%rip), %eax
	testl	%eax, %eax
	je	.L79
	movl	4+puz(%rip), %ecx
	movl	8+puz(%rip), %edx
	movl	%ecx, 8(%rsp)
	testl	%ecx, %ecx
	je	.L57
	movl	%edx, 8(%rsp)
	testl	%edx, %edx
	je	.L58
	movl	12+puz(%rip), %r11d
	testl	%r11d, %r11d
	je	.L80
	movl	16+puz(%rip), %r10d
	testl	%r10d, %r10d
	je	.L81
	movl	20+puz(%rip), %r9d
	testl	%r9d, %r9d
	je	.L82
	movl	24+puz(%rip), %r8d
	testl	%r8d, %r8d
	je	.L122
	movl	28+puz(%rip), %edi
	testl	%edi, %edi
	je	.L123
	movl	32+puz(%rip), %esi
	testl	%esi, %esi
	je	.L124
.L60:
	movd	%edx, %xmm1
	movd	%eax, %xmm0
	movd	%ecx, %xmm4
	xorl	%ebp, %ebp
	movd	12+puz(%rip), %xmm3
	punpckldq	%xmm4, %xmm0
	movd	24+puz(%rip), %xmm2
	leaq	tmp(%rip), %rbx
	movd	28+puz(%rip), %xmm5
	movd	20+puz(%rip), %xmm6
	movl	$1, %r15d
	punpckldq	%xmm3, %xmm1
	movl	32+puz(%rip), %r11d
	punpcklqdq	%xmm1, %xmm0
	movd	16+puz(%rip), %xmm1
	punpckldq	%xmm5, %xmm2
	punpckldq	%xmm6, %xmm1
	punpcklqdq	%xmm2, %xmm1
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L126:
	cmpl	%r12d, %ebp
	jl	.L75
	movl	8(%rsp), %esi
	movl	12(%rsp), %edi
	movl	%ebp, %r8d
	xorl	%ecx, %ecx
	movl	$-1, %edx
	call	dfs.part.0
	movl	%eax, %r12d
	cmpl	$-1, %eax
	jne	.L71
.L75:
	movdqa	(%rbx), %xmm0
	movdqa	16+tmp(%rip), %xmm1
	leaq	puz(%rip), %rax
	movl	32+tmp(%rip), %r11d
	movaps	%xmm0, (%rax)
	movl	%r11d, 32+puz(%rip)
	movaps	%xmm1, 16+puz(%rip)
	cmpl	$99, %ebp
	je	.L125
	addl	$1, %ebp
.L62:
	pshufd	$255, %xmm1, %xmm2
	movd	%xmm0, %r12d
	movd	%xmm1, %r8d
	movaps	%xmm0, (%rbx)
	movd	%xmm2, %ecx
	movdqa	%xmm1, %xmm2
	movl	%r11d, 32+tmp(%rip)
	punpckhdq	%xmm1, %xmm2
	movaps	%xmm1, 16+tmp(%rip)
	movd	%xmm2, %r14d
	pshufd	$85, %xmm1, %xmm2
	movd	%xmm2, %r9d
	pshufd	$255, %xmm0, %xmm2
	movd	%xmm2, %edx
	movdqa	%xmm0, %xmm2
	punpckhdq	%xmm0, %xmm2
	movd	%xmm2, %edi
	pshufd	$85, %xmm0, %xmm2
	movd	%xmm2, %esi
	testl	%r12d, %r12d
	je	.L78
	subl	$1, %r12d
	movslq	%r12d, %r10
	movl	%r12d, %r13d
	imulq	$1431655766, %r10, %r10
	sarl	$31, %r13d
	movl	%r13d, %eax
	shrq	$32, %r10
	movq	%r10, (%rsp)
	subl	(%rsp), %eax
	movl	%eax, %r10d
	negl	%r10d
	cmovns	%r10d, %eax
	movl	(%rsp), %r10d
	subl	%r13d, %r10d
	leal	(%r10,%r10,2), %r10d
	subl	%r10d, %r12d
	movl	%r12d, %r10d
	negl	%r10d
	cmovs	%r12d, %r10d
	leal	(%rax,%r10), %r12d
.L78:
	testl	%esi, %esi
	je	.L63
	subl	$1, %esi
	movslq	%esi, %r10
	movl	%esi, %eax
	imulq	$1431655766, %r10, %r10
	sarl	$31, %eax
	shrq	$32, %r10
	movl	%r10d, %r13d
	subl	%eax, %r13d
	leal	0(%r13,%r13,2), %r13d
	subl	%r13d, %esi
	movl	%r15d, %r13d
	subl	%esi, %r13d
	movl	%r13d, %esi
	negl	%esi
	cmovs	%r13d, %esi
	subl	%r10d, %eax
	movl	%eax, %r10d
	negl	%r10d
	cmovs	%eax, %r10d
	addl	%r10d, %esi
	addl	%esi, %r12d
.L63:
	testl	%edi, %edi
	je	.L64
	subl	$1, %edi
	movslq	%edi, %rax
	movl	%edi, %r10d
	imulq	$1431655766, %rax, %rax
	sarl	$31, %r10d
	movl	%r10d, %esi
	shrq	$32, %rax
	subl	%eax, %esi
	movl	%esi, %r13d
	negl	%r13d
	cmovns	%r13d, %esi
	subl	%r10d, %eax
	leal	(%rax,%rax,2), %eax
	subl	%edi, %eax
	leal	2(%rsi,%rax), %eax
	addl	%eax, %r12d
.L64:
	testl	%edx, %edx
	je	.L65
	subl	$1, %edx
	movslq	%edx, %rsi
	movl	%edx, %edi
	imulq	$1431655766, %rsi, %rsi
	sarl	$31, %edi
	movl	%edi, %eax
	shrq	$32, %rsi
	subl	%esi, %eax
	addl	$1, %eax
	movl	%eax, %r10d
	negl	%r10d
	cmovns	%r10d, %eax
	subl	%edi, %esi
	leal	(%rsi,%rsi,2), %esi
	subl	%esi, %edx
	movl	%edx, %esi
	negl	%esi
	cmovns	%esi, %edx
	addl	%edx, %eax
	addl	%eax, %r12d
.L65:
	testl	%r8d, %r8d
	je	.L66
	subl	$1, %r8d
	movslq	%r8d, %rax
	movl	%r8d, %esi
	imulq	$1431655766, %rax, %rax
	sarl	$31, %esi
	movl	%esi, %edi
	shrq	$32, %rax
	subl	%eax, %edi
	addl	$1, %edi
	movl	%edi, %edx
	negl	%edx
	cmovs	%edi, %edx
	subl	%esi, %eax
	movl	%r15d, %esi
	leal	(%rax,%rax,2), %eax
	subl	%eax, %r8d
	subl	%r8d, %esi
	movl	%esi, %eax
	negl	%eax
	cmovs	%esi, %eax
	addl	%eax, %edx
	addl	%edx, %r12d
.L66:
	testl	%r9d, %r9d
	je	.L67
	subl	$1, %r9d
	movslq	%r9d, %rax
	movl	%r9d, %esi
	imulq	$1431655766, %rax, %rax
	sarl	$31, %esi
	movl	%esi, %edx
	shrq	$32, %rax
	subl	%eax, %edx
	addl	$1, %edx
	movl	%edx, %edi
	negl	%edi
	cmovns	%edi, %edx
	subl	%esi, %eax
	leal	(%rax,%rax,2), %eax
	subl	%r9d, %eax
	leal	2(%rdx,%rax), %eax
	addl	%eax, %r12d
.L67:
	testl	%r14d, %r14d
	je	.L68
	leal	-1(%r14), %esi
	movslq	%esi, %rax
	movl	%esi, %r8d
	imulq	$1431655766, %rax, %rax
	sarl	$31, %r8d
	movl	%r8d, %edx
	shrq	$32, %rax
	subl	%eax, %edx
	addl	$2, %edx
	movl	%edx, %edi
	negl	%edi
	cmovs	%edx, %edi
	subl	%r8d, %eax
	leal	(%rax,%rax,2), %edx
	movl	%esi, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	leal	(%rdi,%rdx), %eax
	addl	%eax, %r12d
.L68:
	testl	%ecx, %ecx
	je	.L69
	subl	$1, %ecx
	movslq	%ecx, %rax
	movl	%ecx, %esi
	imulq	$1431655766, %rax, %rax
	sarl	$31, %esi
	movl	%esi, %edx
	shrq	$32, %rax
	subl	%eax, %edx
	addl	$2, %edx
	movl	%edx, %edi
	negl	%edi
	cmovs	%edx, %edi
	subl	%esi, %eax
	movl	%r15d, %esi
	leal	(%rax,%rax,2), %eax
	subl	%eax, %ecx
	subl	%ecx, %esi
	movl	%esi, %edx
	negl	%edx
	cmovs	%esi, %edx
	leal	(%rdi,%rdx), %eax
	addl	%eax, %r12d
.L69:
	testl	%r11d, %r11d
	je	.L70
	subl	$1, %r11d
	movslq	%r11d, %rax
	movl	%r11d, %esi
	imulq	$1431655766, %rax, %rax
	sarl	$31, %esi
	movl	%esi, %edx
	shrq	$32, %rax
	subl	%eax, %edx
	addl	$2, %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	subl	%esi, %eax
	leal	(%rax,%rax,2), %eax
	subl	%r11d, %eax
	leal	2(%rdx,%rax), %eax
	addl	%eax, %r12d
.L70:
	testl	%r12d, %r12d
	jne	.L126
.L71:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L76:
	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
.L125:
	.cfi_restore_state
	movl	$-1, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L76
.L81:
	movl	$1, 8(%rsp)
.L57:
	movl	$1, 12(%rsp)
	jmp	.L60
.L82:
	movl	$1, 8(%rsp)
.L58:
	movl	$2, 12(%rsp)
	jmp	.L60
.L79:
	movl	$0, 8(%rsp)
	movl	4+puz(%rip), %ecx
	movl	8+puz(%rip), %edx
.L56:
	movl	$0, 12(%rsp)
	jmp	.L60
.L80:
	movl	$1, 8(%rsp)
	jmp	.L56
.L122:
	movl	$2, 8(%rsp)
	jmp	.L56
.L124:
	movl	$2, 8(%rsp)
	jmp	.L58
.L123:
	movl	$2, 8(%rsp)
	jmp	.L57
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	empty
	.type	empty, @function
empty:
.LFB40:
	.cfi_startproc
	endbr64
	movl	puz(%rip), %eax
	testl	%eax, %eax
	je	.L128
	movl	4+puz(%rip), %eax
	testl	%eax, %eax
	je	.L129
	movl	8+puz(%rip), %eax
	testl	%eax, %eax
	je	.L130
	movl	12+puz(%rip), %r10d
	testl	%r10d, %r10d
	je	.L135
	movl	16+puz(%rip), %r9d
	testl	%r9d, %r9d
	je	.L136
	movl	20+puz(%rip), %r8d
	testl	%r8d, %r8d
	je	.L137
	movl	24+puz(%rip), %ecx
	movl	$2, %eax
	testl	%ecx, %ecx
	je	.L128
	movl	28+puz(%rip), %edx
	movl	$2, %eax
	testl	%edx, %edx
	je	.L129
	movl	32+puz(%rip), %eax
	testl	%eax, %eax
	je	.L147
	ret
.L135:
	movl	$1, %eax
.L128:
	xorl	%edx, %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
.L136:
	movl	$1, %eax
.L129:
	movl	$1, %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
.L137:
	movl	$1, %eax
.L130:
	movl	$2, %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
.L147:
	movl	$2, %eax
	jmp	.L130
	.cfi_endproc
.LFE40:
	.size	empty, .-empty
	.p2align 4
	.globl	swap
	.type	swap, @function
swap:
.LFB41:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE41:
	.size	swap, .-swap
	.p2align 4
	.globl	cal
	.type	cal, @function
cal:
.LFB42:
	.cfi_startproc
	endbr64
	movl	puz(%rip), %eax
	testl	%eax, %eax
	je	.L150
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	%eax, %edi
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %edi
	movl	%edi, %esi
	shrq	$32, %rdx
	subl	%edx, %esi
	movl	%esi, %ecx
	negl	%ecx
	cmovs	%esi, %ecx
	subl	%edi, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%ecx, %eax
.L150:
	movl	4+puz(%rip), %edx
	testl	%edx, %edx
	je	.L151
	subl	$1, %edx
	movslq	%edx, %rsi
	movl	%edx, %ecx
	imulq	$1431655766, %rsi, %rsi
	sarl	$31, %ecx
	shrq	$32, %rsi
	movl	%esi, %edi
	subl	%ecx, %edi
	leal	(%rdi,%rdi,2), %edi
	subl	%edx, %edi
	addl	$1, %edi
	movl	%edi, %edx
	negl	%edx
	cmovns	%edx, %edi
	subl	%esi, %ecx
	movl	%ecx, %edx
	negl	%ecx
	cmovns	%ecx, %edx
	addl	%edi, %edx
	addl	%edx, %eax
.L151:
	movl	8+puz(%rip), %edx
	testl	%edx, %edx
	je	.L152
	leal	-1(%rdx), %ecx
	movslq	%ecx, %rdx
	movl	%ecx, %r8d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r8d
	movl	%r8d, %edi
	shrq	$32, %rdx
	subl	%edx, %edi
	movl	%edi, %esi
	negl	%esi
	cmovs	%edi, %esi
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%ecx, %edx
	leal	2(%rsi,%rdx), %edx
	addl	%edx, %eax
.L152:
	movl	12+puz(%rip), %edx
	testl	%edx, %edx
	je	.L153
	subl	$1, %edx
	movslq	%edx, %rcx
	movl	%edx, %r8d
	imulq	$1431655766, %rcx, %rcx
	sarl	$31, %r8d
	movl	%r8d, %edi
	shrq	$32, %rcx
	subl	%ecx, %edi
	addl	$1, %edi
	movl	%edi, %esi
	negl	%esi
	cmovs	%edi, %esi
	subl	%r8d, %ecx
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	addl	%esi, %edx
	addl	%edx, %eax
.L153:
	movl	16+puz(%rip), %edx
	testl	%edx, %edx
	je	.L154
	leal	-1(%rdx), %ecx
	movslq	%ecx, %rdx
	movl	%ecx, %r8d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r8d
	movl	%r8d, %edi
	shrq	$32, %rdx
	subl	%edx, %edi
	addl	$1, %edi
	movl	%edi, %esi
	negl	%esi
	cmovs	%edi, %esi
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%ecx, %edx
	leal	1(%rdx), %ecx
	movl	%ecx, %edx
	negl	%edx
	cmovs	%ecx, %edx
	addl	%esi, %edx
	addl	%edx, %eax
.L154:
	movl	20+puz(%rip), %edx
	testl	%edx, %edx
	je	.L155
	leal	-1(%rdx), %ecx
	movslq	%ecx, %rdx
	movl	%ecx, %r8d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r8d
	movl	%r8d, %esi
	shrq	$32, %rdx
	subl	%edx, %esi
	addl	$1, %esi
	movl	%esi, %edi
	negl	%edi
	cmovns	%edi, %esi
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%ecx, %edx
	leal	2(%rsi,%rdx), %edx
	addl	%edx, %eax
.L155:
	movl	24+puz(%rip), %edx
	testl	%edx, %edx
	je	.L156
	subl	$1, %edx
	movslq	%edx, %rcx
	movl	%edx, %r8d
	imulq	$1431655766, %rcx, %rcx
	sarl	$31, %r8d
	movl	%r8d, %edi
	shrq	$32, %rcx
	subl	%ecx, %edi
	addl	$2, %edi
	movl	%edi, %esi
	negl	%esi
	cmovs	%edi, %esi
	subl	%r8d, %ecx
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	addl	%esi, %edx
	addl	%edx, %eax
.L156:
	movl	28+puz(%rip), %edx
	testl	%edx, %edx
	je	.L157
	leal	-1(%rdx), %ecx
	movslq	%ecx, %rdx
	movl	%ecx, %r8d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r8d
	movl	%r8d, %edi
	shrq	$32, %rdx
	subl	%edx, %edi
	addl	$2, %edi
	movl	%edi, %esi
	negl	%esi
	cmovs	%edi, %esi
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%ecx, %edx
	leal	1(%rdx), %ecx
	movl	%ecx, %edx
	negl	%edx
	cmovs	%ecx, %edx
	addl	%esi, %edx
	addl	%edx, %eax
.L157:
	movl	32+puz(%rip), %edx
	testl	%edx, %edx
	je	.L149
	leal	-1(%rdx), %ecx
	movslq	%ecx, %rdx
	movl	%ecx, %r8d
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %r8d
	movl	%r8d, %esi
	shrq	$32, %rdx
	subl	%edx, %esi
	addl	$2, %esi
	movl	%esi, %edi
	negl	%edi
	cmovns	%edi, %esi
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%ecx, %edx
	leal	2(%rsi,%rdx), %edx
	addl	%edx, %eax
.L149:
	ret
	.cfi_endproc
.LFE42:
	.size	cal, .-cal
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB43:
	.cfi_startproc
	endbr64
	movl	%edx, %r9d
	movl	puz(%rip), %edx
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	testl	%edx, %edx
	je	.L187
	subl	$1, %edx
	movslq	%edx, %rax
	movl	%edx, %ebx
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ebx
	movl	%ebx, %r11d
	shrq	$32, %rax
	subl	%eax, %r11d
	movl	%r11d, %r10d
	negl	%r10d
	cmovs	%r11d, %r10d
	subl	%ebx, %eax
	leal	(%rax,%rax,2), %eax
	subl	%eax, %edx
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	leal	(%r10,%rax), %edx
.L187:
	movl	4+puz(%rip), %eax
	testl	%eax, %eax
	je	.L188
	subl	$1, %eax
	movslq	%eax, %r11
	movl	%eax, %r10d
	imulq	$1431655766, %r11, %r11
	sarl	$31, %r10d
	shrq	$32, %r11
	movl	%r11d, %ebx
	subl	%r10d, %ebx
	leal	(%rbx,%rbx,2), %ebx
	subl	%eax, %ebx
	addl	$1, %ebx
	movl	%ebx, %eax
	negl	%eax
	cmovns	%eax, %ebx
	movl	%r10d, %eax
	subl	%r11d, %eax
	movl	%eax, %r10d
	negl	%r10d
	cmovns	%r10d, %eax
	addl	%ebx, %eax
	addl	%eax, %edx
.L188:
	movl	8+puz(%rip), %eax
	testl	%eax, %eax
	je	.L189
	leal	-1(%rax), %r10d
	movslq	%r10d, %rax
	movl	%r10d, %ebp
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ebp
	movl	%ebp, %ebx
	shrq	$32, %rax
	subl	%eax, %ebx
	movl	%ebx, %r11d
	negl	%r11d
	cmovs	%ebx, %r11d
	subl	%ebp, %eax
	leal	(%rax,%rax,2), %eax
	subl	%r10d, %eax
	leal	2(%r11,%rax), %eax
	addl	%eax, %edx
.L189:
	movl	12+puz(%rip), %eax
	testl	%eax, %eax
	je	.L190
	leal	-1(%rax), %ebx
	movslq	%ebx, %rax
	movl	%ebx, %ebp
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ebp
	movl	%ebp, %r11d
	shrq	$32, %rax
	subl	%eax, %r11d
	addl	$1, %r11d
	movl	%r11d, %r10d
	negl	%r10d
	cmovs	%r11d, %r10d
	subl	%ebp, %eax
	leal	(%rax,%rax,2), %r11d
	movl	%ebx, %eax
	subl	%r11d, %eax
	movl	%eax, %r11d
	negl	%r11d
	cmovns	%r11d, %eax
	addl	%r10d, %eax
	addl	%eax, %edx
.L190:
	movl	16+puz(%rip), %eax
	testl	%eax, %eax
	je	.L191
	leal	-1(%rax), %r11d
	movslq	%r11d, %rax
	movl	%r11d, %ebp
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ebp
	movl	%ebp, %r10d
	shrq	$32, %rax
	subl	%eax, %r10d
	addl	$1, %r10d
	movl	%r10d, %ebx
	negl	%ebx
	cmovs	%r10d, %ebx
	subl	%ebp, %eax
	leal	(%rax,%rax,2), %r10d
	subl	%r11d, %r10d
	leal	1(%r10), %r11d
	movl	%r11d, %r10d
	negl	%r10d
	cmovs	%r11d, %r10d
	leal	(%rbx,%r10), %eax
	addl	%eax, %edx
.L191:
	movl	20+puz(%rip), %eax
	testl	%eax, %eax
	je	.L192
	leal	-1(%rax), %r11d
	movslq	%r11d, %rax
	movl	%r11d, %ebp
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ebp
	movl	%ebp, %r10d
	shrq	$32, %rax
	subl	%eax, %r10d
	addl	$1, %r10d
	movl	%r10d, %ebx
	negl	%ebx
	cmovns	%ebx, %r10d
	subl	%ebp, %eax
	leal	(%rax,%rax,2), %eax
	subl	%r11d, %eax
	leal	2(%r10,%rax), %eax
	addl	%eax, %edx
.L192:
	movl	24+puz(%rip), %eax
	testl	%eax, %eax
	je	.L193
	leal	-1(%rax), %ebx
	movslq	%ebx, %rax
	movl	%ebx, %ebp
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ebp
	movl	%ebp, %r11d
	shrq	$32, %rax
	subl	%eax, %r11d
	addl	$2, %r11d
	movl	%r11d, %r10d
	negl	%r10d
	cmovs	%r11d, %r10d
	subl	%ebp, %eax
	leal	(%rax,%rax,2), %r11d
	movl	%ebx, %eax
	subl	%r11d, %eax
	movl	%eax, %r11d
	negl	%r11d
	cmovns	%r11d, %eax
	addl	%r10d, %eax
	addl	%eax, %edx
.L193:
	movl	28+puz(%rip), %eax
	testl	%eax, %eax
	je	.L194
	leal	-1(%rax), %r11d
	movslq	%r11d, %rax
	movl	%r11d, %ebp
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ebp
	movl	%ebp, %r10d
	shrq	$32, %rax
	subl	%eax, %r10d
	addl	$2, %r10d
	movl	%r10d, %ebx
	negl	%ebx
	cmovs	%r10d, %ebx
	subl	%ebp, %eax
	leal	(%rax,%rax,2), %r10d
	subl	%r11d, %r10d
	leal	1(%r10), %r11d
	movl	%r11d, %r10d
	negl	%r10d
	cmovs	%r11d, %r10d
	leal	(%rbx,%r10), %eax
	addl	%eax, %edx
.L194:
	movl	32+puz(%rip), %eax
	testl	%eax, %eax
	jne	.L227
	testl	%edx, %edx
	je	.L197
.L228:
	addl	%ecx, %edx
	cmpl	%r8d, %edx
	jg	.L198
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	movl	%r9d, %edx
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	dfs.part.0
	.p2align 4,,10
	.p2align 3
.L227:
	.cfi_restore_state
	leal	-1(%rax), %r11d
	movslq	%r11d, %rax
	movl	%r11d, %ebp
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ebp
	movl	%ebp, %r10d
	shrq	$32, %rax
	subl	%eax, %r10d
	addl	$2, %r10d
	movl	%r10d, %ebx
	negl	%ebx
	cmovns	%ebx, %r10d
	subl	%ebp, %eax
	leal	(%rax,%rax,2), %eax
	subl	%r11d, %eax
	leal	2(%r10,%rax), %eax
	addl	%eax, %edx
	testl	%edx, %edx
	jne	.L228
.L197:
	movl	%ecx, %eax
.L186:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L198:
	.cfi_restore_state
	movl	$-1, %eax
	jmp	.L186
	.cfi_endproc
.LFE43:
	.size	dfs, .-dfs
	.globl	dy
	.data
	.align 16
	.type	dy, @object
	.size	dy, 16
dy:
	.long	1
	.long	0
	.long	-1
	.long	0
	.globl	dx
	.align 16
	.type	dx, @object
	.size	dx, 16
dx:
	.long	0
	.long	1
	.long	0
	.long	-1
	.globl	tmp
	.bss
	.align 32
	.type	tmp, @object
	.size	tmp, 36
tmp:
	.zero	36
	.globl	puz
	.align 32
	.type	puz, @object
	.size	puz, 36
puz:
	.zero	36
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <stdlib.h>
 
int puz[3][3];
int tmp[3][3];
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};
 
void empty(int *,int *);
int dfs(int,int,int,int,const int);
int cal();
void swap(int *,int *);
 
 
int main() {
    int i,j,ans,x,y,l;
     
    //puzzle input
    for(i=0; i<3; i++) {
        for(j=0; j<3; j++) scanf("%d",&puz[i][j]);
    }
     
     
    empty(&x,&y);
    for(l=0; l<100; l++) {
        //copy
        for(i=0; i<3; i++) {
            for(j=0; j<3; j++) tmp[i][j] = puz[i][j];
        }
         
        //dfs
        ans = dfs(x,y,-1,0,l);
        if(ans!=-1) {
            printf("%d\n",ans);
            break;
        }
         
        //copy
        for(i=0; i<3; i++) {
            for(j=0; j<3; j++) puz[i][j] = tmp[i][j];
        }
         
        //error
        ans = -1;
        if(l==99) printf("%d\n",ans);
    }
     
    //ans output
    //printf("%d\n",ans);
     
    return 0;
}
 
 
void empty(int *x,int *y) {
    int i,j;
    for(i=0; i<3; i++) {
        for(j=0; j<3; j++) {
            if(!puz[i][j]) {
                *x = j;
                *y = i;
                return;
            }
        }
    }
}
 
 
void swap(int *a,int *b) {
    int tmp;
     
    tmp = *a;
    *a = *b;
    *b = tmp;
}
 
 
int cal() {
    int i,a,sum=0;
     
    for(i=0; i<9; i++) {
        a = puz[i/3][i%3];
        if(a) {
            a--;
            sum += abs(i/3 - a/3) + abs(i%3 - a%3);
        }
    }
     
    return sum;
}
 
 
int dfs(int x,int y,int p,int dep,const int lim) {
    int i,h,nx,ny,res;
     
    h = cal();
    if(h==0) return dep;
    if(dep+h>lim) return -1;
     
    for(i=0; i<4; i++) {
        nx = x+dx[i];
        ny = y+dy[i];
         
        if(~p && i==(p+2)%4) continue;
        if(!(0<=nx && nx<3 && 0<=ny && ny<3)) continue;
         
        swap(&puz[y][x],&puz[ny][nx]);
        res = dfs(nx,ny,i,dep+1,lim);
        if(~res) return res;
         
        swap(&puz[y][x],&puz[ny][nx]);
    }
     
    return -1;
}
1 4 0
5 2 3
7 8 6

14

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

```c
#include <stdio.h>
#include <stdlib.h>
 
int puz[3][3];
int tmp[3][3];
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};
 
void empty(int *,int *);
int dfs(int,int,int,int,const int);
int cal();
void swap(int *,int *);
 
 
int main() {
    int i,j,ans,x,y,l;
     
    //puzzle input
    for(i=0; i<3; i++) {
        for(j=0; j<3; j++) scanf("%d",&puz[i][j]);
    }
     
     
    empty(&x,&y);
    for(l=0; l<100; l++) {
        //copy
        for(i=0; i<3; i++) {
            for(j=0; j<3; j++) tmp[i][j] = puz[i][j];
        }
         
        //dfs
        ans = dfs(x,y,-1,0,l);
        if(ans!=-1) {
            printf("%d\n",ans);
            break;
        }
         
        //copy
        for(i=0; i<3; i++) {
            for(j=0; j<3; j++) puz[i][j] = tmp[i][j];
        }
         
        //error
        ans = -1;
        if(l==99) printf("%d\n",ans);
    }
     
    //ans output
    //printf("%d\n",ans);
     
    return 0;
}
 
 
void empty(int *x,int *y) {
    int i,j;
    for(i=0; i<3; i++) {
        for(j=0; j<3; j++) {
            if(!puz[i][j]) {
                *x = j;
                *y = i;
                return;
            }
        }
    }
}
 
 
void swap(int *a,int *b) {
    int tmp;
     
    tmp = *a;
    *a = *b;
    *b = tmp;
}
 
 
int cal() {
    int i,a,sum=0;
     
    for(i=0; i<9; i++) {
        a = puz[i/3][i%3];
        if(a) {
            a--;
            sum += abs(i/3 - a/3) + abs(i%3 - a%3);
        }
    }
     
    return sum;
}
 
 
int dfs(int x,int y,int p,int dep,const int lim) {
    int i,h,nx,ny,res;
     
    h = cal();
    if(h==0) return dep;
    if(dep+h>lim) return -1;
     
    for(i=0; i<4; i++) {
        nx = x+dx[i];
        ny = y+dy[i];
         
        if(~p && i==(p+2)%4) continue;
        if(!(0<=nx && nx<3 && 0<=ny && ny<3)) continue;
         
        swap(&puz[y][x],&puz[ny][nx]);
        res = dfs(nx,ny,i,dep+1,lim);
        if(~res) return res;
         
        swap(&puz[y][x],&puz[ny][nx]);
    }
     
    return -1;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	puz
	.bss
	.align 32
	.type	puz, @object
	.size	puz, 36
puz:
	.zero	36
	.globl	tmp
	.align 32
	.type	tmp, @object
	.size	tmp, 36
tmp:
	.zero	36
	.globl	dx
	.data
	.align 16
	.type	dx, @object
	.size	dx, 16
dx:
	.long	0
	.long	1
	.long	0
	.long	-1
	.globl	dy
	.align 16
	.type	dy, @object
	.size	dy, 16
dy:
	.long	1
	.long	0
	.long	-1
	.long	0
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -24(%rbp)
	jmp	.L2
.L5:
	movl	$0, -20(%rbp)
	jmp	.L3
.L4:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -20(%rbp)
.L3:
	cmpl	$2, -20(%rbp)
	jle	.L4
	addl	$1, -24(%rbp)
.L2:
	cmpl	$2, -24(%rbp)
	jle	.L5
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	empty
	movl	$0, -16(%rbp)
	jmp	.L6
.L18:
	movl	$0, -24(%rbp)
	jmp	.L7
.L10:
	movl	$0, -20(%rbp)
	jmp	.L8
.L9:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	tmp(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -20(%rbp)
.L8:
	cmpl	$2, -20(%rbp)
	jle	.L9
	addl	$1, -24(%rbp)
.L7:
	cmpl	$2, -24(%rbp)
	jle	.L10
	movl	-28(%rbp), %esi
	movl	-32(%rbp), %eax
	movl	-16(%rbp), %edx
	movl	%edx, %r8d
	movl	$0, %ecx
	movl	$-1, %edx
	movl	%eax, %edi
	call	dfs
	movl	%eax, -12(%rbp)
	cmpl	$-1, -12(%rbp)
	je	.L11
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L11:
	movl	$0, -24(%rbp)
	jmp	.L13
.L16:
	movl	$0, -20(%rbp)
	jmp	.L14
.L15:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tmp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	puz(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -20(%rbp)
.L14:
	cmpl	$2, -20(%rbp)
	jle	.L15
	addl	$1, -24(%rbp)
.L13:
	cmpl	$2, -24(%rbp)
	jle	.L16
	movl	$-1, -12(%rbp)
	cmpl	$99, -16(%rbp)
	jne	.L17
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	addl	$1, -16(%rbp)
.L6:
	cmpl	$99, -16(%rbp)
	jle	.L18
.L12:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	empty
	.type	empty, @function
empty:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L22
.L27:
	movl	$0, -4(%rbp)
	jmp	.L23
.L26:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L24
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-8(%rbp), %edx
	movl	%edx, (%rax)
	jmp	.L21
.L24:
	addl	$1, -4(%rbp)
.L23:
	cmpl	$2, -4(%rbp)
	jle	.L26
	addl	$1, -8(%rbp)
.L22:
	cmpl	$2, -8(%rbp)
	jle	.L27
.L21:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	empty, .-empty
	.globl	swap
	.type	swap, @function
swap:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	swap, .-swap
	.globl	cal
	.type	cal, @function
cal:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L30
.L32:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%edx, %esi
	subl	%eax, %esi
	movl	-12(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movslq	%eax, %rcx
	movslq	%esi, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	je	.L31
	subl	$1, -4(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	subl	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %edi
	movl	-12(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rcx
	imulq	$1431655766, %rcx, %rcx
	shrq	$32, %rcx
	movl	%edx, %r8d
	sarl	$31, %r8d
	movl	%ecx, %esi
	subl	%r8d, %esi
	movl	%esi, %ecx
	addl	%ecx, %ecx
	addl	%esi, %ecx
	movl	%edx, %esi
	subl	%ecx, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%edi, %eax
	addl	%eax, -8(%rbp)
.L31:
	addl	$1, -12(%rbp)
.L30:
	cmpl	$8, -12(%rbp)
	jle	.L32
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	cal, .-cal
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	%edx, -44(%rbp)
	movl	%ecx, -48(%rbp)
	movl	%r8d, -52(%rbp)
	movl	$0, %eax
	call	cal
	movl	%eax, -16(%rbp)
	cmpl	$0, -16(%rbp)
	jne	.L35
	movl	-48(%rbp), %eax
	jmp	.L36
.L35:
	movl	-48(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -52(%rbp)
	jge	.L37
	movl	$-1, %eax
	jmp	.L36
.L37:
	movl	$0, -20(%rbp)
	jmp	.L38
.L44:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dx(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dy(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	cmpl	$-1, -44(%rbp)
	je	.L39
	movl	-44(%rbp), %eax
	addl	$2, %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	cmpl	%eax, -20(%rbp)
	je	.L45
.L39:
	cmpl	$0, -12(%rbp)
	js	.L46
	cmpl	$2, -12(%rbp)
	jg	.L46
	cmpl	$0, -8(%rbp)
	js	.L46
	cmpl	$2, -8(%rbp)
	jg	.L46
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	movslq	%eax, %rsi
	movl	-40(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	puz(%rip), %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
	movl	-48(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-52(%rbp), %edi
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %esi
	movl	-12(%rbp), %eax
	movl	%edi, %r8d
	movl	%eax, %edi
	call	dfs
	movl	%eax, -4(%rbp)
	cmpl	$-1, -4(%rbp)
	je	.L43
	movl	-4(%rbp), %eax
	jmp	.L36
.L43:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	movslq	%eax, %rsi
	movl	-40(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	puz(%rip), %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
	jmp	.L40
.L45:
	nop
	jmp	.L40
.L46:
	nop
.L40:
	addl	$1, -20(%rbp)
.L38:
	cmpl	$3, -20(%rbp)
	jle	.L44
	movl	$-1, %eax
.L36:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	dfs, .-dfs
	.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	puz
	.bss
	.align 32
	.type	puz, @object
	.size	puz, 36
puz:
	.zero	36
	.globl	tmp
	.align 32
	.type	tmp, @object
	.size	tmp, 36
tmp:
	.zero	36
	.globl	dx
	.data
	.align 16
	.type	dx, @object
	.size	dx, 16
dx:
	.long	0
	.long	1
	.long	0
	.long	-1
	.globl	dy
	.align 16
	.type	dy, @object
	.size	dy, 16
dy:
	.long	1
	.long	0
	.long	-1
	.long	0
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -24(%rbp)
	jmp	.L2
.L5:
	movl	$0, -20(%rbp)
	jmp	.L3
.L4:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -20(%rbp)
.L3:
	cmpl	$2, -20(%rbp)
	jle	.L4
	addl	$1, -24(%rbp)
.L2:
	cmpl	$2, -24(%rbp)
	jle	.L5
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	empty
	movl	$0, -16(%rbp)
	jmp	.L6
.L18:
	movl	$0, -24(%rbp)
	jmp	.L7
.L10:
	movl	$0, -20(%rbp)
	jmp	.L8
.L9:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	tmp(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -20(%rbp)
.L8:
	cmpl	$2, -20(%rbp)
	jle	.L9
	addl	$1, -24(%rbp)
.L7:
	cmpl	$2, -24(%rbp)
	jle	.L10
	movl	-28(%rbp), %esi
	movl	-32(%rbp), %eax
	movl	-16(%rbp), %edx
	movl	%edx, %r8d
	movl	$0, %ecx
	movl	$-1, %edx
	movl	%eax, %edi
	call	dfs
	movl	%eax, -12(%rbp)
	cmpl	$-1, -12(%rbp)
	je	.L11
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L11:
	movl	$0, -24(%rbp)
	jmp	.L13
.L16:
	movl	$0, -20(%rbp)
	jmp	.L14
.L15:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tmp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	puz(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -20(%rbp)
.L14:
	cmpl	$2, -20(%rbp)
	jle	.L15
	addl	$1, -24(%rbp)
.L13:
	cmpl	$2, -24(%rbp)
	jle	.L16
	movl	$-1, -12(%rbp)
	cmpl	$99, -16(%rbp)
	jne	.L17
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	addl	$1, -16(%rbp)
.L6:
	cmpl	$99, -16(%rbp)
	jle	.L18
.L12:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	empty
	.type	empty, @function
empty:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L22
.L27:
	movl	$0, -4(%rbp)
	jmp	.L23
.L26:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L24
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-8(%rbp), %edx
	movl	%edx, (%rax)
	jmp	.L21
.L24:
	addl	$1, -4(%rbp)
.L23:
	cmpl	$2, -4(%rbp)
	jle	.L26
	addl	$1, -8(%rbp)
.L22:
	cmpl	$2, -8(%rbp)
	jle	.L27
.L21:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	empty, .-empty
	.globl	swap
	.type	swap, @function
swap:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	swap, .-swap
	.globl	cal
	.type	cal, @function
cal:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L30
.L32:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%edx, %esi
	subl	%eax, %esi
	movl	-12(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movslq	%eax, %rcx
	movslq	%esi, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	je	.L31
	subl	$1, -4(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	subl	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %edi
	movl	-12(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rcx
	imulq	$1431655766, %rcx, %rcx
	shrq	$32, %rcx
	movl	%edx, %r8d
	sarl	$31, %r8d
	movl	%ecx, %esi
	subl	%r8d, %esi
	movl	%esi, %ecx
	addl	%ecx, %ecx
	addl	%esi, %ecx
	movl	%edx, %esi
	subl	%ecx, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%edi, %eax
	addl	%eax, -8(%rbp)
.L31:
	addl	$1, -12(%rbp)
.L30:
	cmpl	$8, -12(%rbp)
	jle	.L32
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	cal, .-cal
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	%edx, -44(%rbp)
	movl	%ecx, -48(%rbp)
	movl	%r8d, -52(%rbp)
	movl	$0, %eax
	call	cal
	movl	%eax, -16(%rbp)
	cmpl	$0, -16(%rbp)
	jne	.L35
	movl	-48(%rbp), %eax
	jmp	.L36
.L35:
	movl	-48(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -52(%rbp)
	jge	.L37
	movl	$-1, %eax
	jmp	.L36
.L37:
	movl	$0, -20(%rbp)
	jmp	.L38
.L44:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dx(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dy(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	cmpl	$-1, -44(%rbp)
	je	.L39
	movl	-44(%rbp), %eax
	addl	$2, %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	cmpl	%eax, -20(%rbp)
	je	.L45
.L39:
	cmpl	$0, -12(%rbp)
	js	.L46
	cmpl	$2, -12(%rbp)
	jg	.L46
	cmpl	$0, -8(%rbp)
	js	.L46
	cmpl	$2, -8(%rbp)
	jg	.L46
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	movslq	%eax, %rsi
	movl	-40(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	puz(%rip), %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
	movl	-48(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-52(%rbp), %edi
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %esi
	movl	-12(%rbp), %eax
	movl	%edi, %r8d
	movl	%eax, %edi
	call	dfs
	movl	%eax, -4(%rbp)
	cmpl	$-1, -4(%rbp)
	je	.L43
	movl	-4(%rbp), %eax
	jmp	.L36
.L43:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	puz(%rip), %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	movslq	%eax, %rsi
	movl	-40(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	puz(%rip), %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
	jmp	.L40
.L45:
	nop
	jmp	.L40
.L46:
	nop
.L40:
	addl	$1, -20(%rbp)
.L38:
	cmpl	$3, -20(%rbp)
	jle	.L44
	movl	$-1, %eax
.L36:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	dfs, .-dfs
	.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:
