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

```c
#include <stdio.h>

int N,M,R,r[8],cost[201][201];

int dfs(int now){
    int i,ret,rt,tmpcost,flag;
    flag = 0;
    ret = 1000000000;
    for(i=0;i<R;i++){
        if(r[i]>0){
            rt=r[i];
            r[i]=0;
            tmpcost = cost[now][rt] + dfs(rt);
            r[i]=rt;
            if(tmpcost<ret)ret=tmpcost;
            flag=1;
        }
    }
    return (flag?ret:0);
}

int main(){
    int a,b,c;
    int i,j,k;

    scanf("%d %d %d",&N,&M,&R);
    for(i=0;i<R;i++){
        scanf("%d",&r[i]);
    }

    for(i=1;i<=N;i++){
        for(j=1;j<=N;j++){
            cost[i][j]=100000000;
        }
        cost[0][i]=cost[i][0]=cost[i][i]=0;
    }

    for(i=0;i<M;i++){
        scanf("%d %d %d",&a,&b,&c);
        cost[a][b] = cost[b][a] = c;
    }

    /* ワーシャルフロイド */
    for(k=1;k<=N;k++){
        for(i=1;i<=N;i++){
            for(j=1;j<=N;j++){
                if(cost[i][j] > cost[i][k] + cost[k][j]){
                    cost[i][j] = cost[i][k] + cost[k][j];
                }
            }
        }
    }

    printf("%d\n",dfs(0));
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 32
r:
	.zero	32
	.globl	cost
	.align 32
	.type	cost, @object
	.size	cost, 161604
cost:
	.zero	161604
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movl	%edi, -52(%rbp)
	movl	$0, -28(%rbp)
	movl	$1000000000, -32(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L2
.L5:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L3
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %ebx
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	dfs
	addl	%ebx, %eax
	movl	%eax, -20(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	r(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L4
	movl	-20(%rbp), %eax
	movl	%eax, -32(%rbp)
.L4:
	movl	$1, -28(%rbp)
.L3:
	addl	$1, -36(%rbp)
.L2:
	movl	R(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L5
	cmpl	$0, -28(%rbp)
	je	.L6
	movl	-32(%rbp), %eax
	jmp	.L8
.L6:
	movl	$0, %eax
.L8:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	R(%rip), %rax
	movq	%rax, %rcx
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L10
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -20(%rbp)
.L10:
	movl	R(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L11
	movl	$1, -20(%rbp)
	jmp	.L12
.L15:
	movl	$1, -16(%rbp)
	jmp	.L13
.L14:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	$100000000, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L13:
	movl	N(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L14
	movl	-20(%rbp), %eax
	cltq
	imulq	$808, %rax, %rax
	leaq	cost(%rip), %rdx
	movl	$0, (%rax,%rdx)
	movl	-20(%rbp), %eax
	cltq
	imulq	$808, %rax, %rax
	leaq	cost(%rip), %rdx
	movl	(%rax,%rdx), %edx
	movl	-20(%rbp), %eax
	cltq
	imulq	$804, %rax, %rax
	leaq	cost(%rip), %rcx
	movl	%edx, (%rax,%rcx)
	movl	-20(%rbp), %eax
	cltq
	imulq	$804, %rax, %rax
	leaq	cost(%rip), %rdx
	movl	(%rax,%rdx), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cost(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L12:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L15
	movl	$0, -20(%rbp)
	jmp	.L16
.L17:
	leaq	-24(%rbp), %rcx
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %ecx
	movl	-32(%rbp), %esi
	movl	-24(%rbp), %edi
	movslq	%esi, %r8
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %r9
	addq	%r9, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%r8, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	%edi, (%rdx,%rax)
	movl	-32(%rbp), %edi
	movl	-28(%rbp), %r8d
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movslq	%r8d, %rsi
	movslq	%edi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L16:
	movl	M(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L17
	movl	$1, -12(%rbp)
	jmp	.L18
.L24:
	movl	$1, -20(%rbp)
	jmp	.L19
.L23:
	movl	$1, -16(%rbp)
	jmp	.L20
.L22:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-16(%rbp), %eax
	movslq	%eax, %rdi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %r8
	addq	%r8, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jle	.L21
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L21:
	addl	$1, -16(%rbp)
.L20:
	movl	N(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L22
	addl	$1, -20(%rbp)
.L19:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L23
	addl	$1, -12(%rbp)
.L18:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L24
	movl	$0, %edi
	call	dfs
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$344, %rsp
	.cfi_def_cfa_offset 400
	movl	R(%rip), %r9d
	testl	%r9d, %r9d
	jle	.L49
	movslq	%edi, %rcx
	leaq	r(%rip), %rax
	movl	%r9d, %r11d
	movl	$1000000000, 240(%rsp)
	leaq	(%rcx,%rcx,4), %rsi
	movq	%rcx, 272(%rsp)
	leaq	0(,%rsi,4), %rbx
	movq	%rsi, 280(%rsp)
	movl	$0, 168(%rsp)
	movq	%rbx, 288(%rsp)
	movq	%rax, 192(%rsp)
	xorl	%eax, %eax
.L48:
	movq	192(%rsp), %rdx
	movl	(%rdx), %ecx
	movl	%ecx, 244(%rsp)
	testl	%ecx, %ecx
	jg	.L106
.L4:
	addl	$1, 168(%rsp)
	movl	168(%rsp), %ebx
	addq	$4, 192(%rsp)
	cmpl	%r11d, %ebx
	jl	.L48
	testl	%eax, %eax
	je	.L49
.L1:
	movl	240(%rsp), %eax
	addq	$344, %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
.L106:
	.cfi_restore_state
	movslq	%ecx, %rsi
	movq	272(%rsp), %rcx
	movq	280(%rsp), %rax
	leaq	cost(%rip), %r9
	addq	288(%rsp), %rax
	movl	$0, (%rdx)
	leaq	(%rcx,%rax,8), %rax
	movq	%rsi, 256(%rsp)
	addq	%rsi, %rax
	movl	(%r9,%rax,4), %eax
	movl	%eax, 236(%rsp)
	testl	%r11d, %r11d
	jle	.L47
	leaq	(%rsi,%rsi,4), %rdx
	leaq	r(%rip), %rax
	movl	%r11d, %r10d
	movl	$1000000000, 232(%rsp)
	leaq	(%rdx,%rdx,4), %rsi
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	movl	$0, 128(%rsp)
	movq	%rsi, 264(%rsp)
.L46:
	movq	152(%rsp), %rdx
	movslq	(%rdx), %rcx
	movl	%ecx, 212(%rsp)
	testl	%ecx, %ecx
	jg	.L107
.L6:
	addl	$1, 128(%rsp)
	movl	128(%rsp), %ecx
	addq	$4, 152(%rsp)
	cmpl	%r10d, %ecx
	jl	.L46
	movl	236(%rsp), %ebx
	movl	232(%rsp), %edx
	movl	%r10d, %r11d
	addl	%ebx, %edx
	testl	%eax, %eax
	cmove	%ebx, %edx
	movl	%edx, 236(%rsp)
.L47:
	movq	192(%rsp), %rax
	movl	244(%rsp), %esi
	movl	240(%rsp), %edi
	movl	%esi, (%rax)
	movl	236(%rsp), %eax
	cmpl	%eax, %edi
	cmovle	%edi, %eax
	movl	%eax, 240(%rsp)
	movl	$1, %eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L107:
	movq	256(%rsp), %rax
	movq	264(%rsp), %rbx
	movl	$0, (%rdx)
	movq	%rcx, 224(%rsp)
	leaq	(%rax,%rbx,8), %rax
	addq	%rcx, %rax
	movl	(%r9,%rax,4), %eax
	movl	%eax, 208(%rsp)
	testl	%r10d, %r10d
	jle	.L45
	leaq	(%rcx,%rcx,4), %rdx
	movl	$0, 80(%rsp)
	leaq	r(%rip), %rax
	leaq	(%rdx,%rdx,4), %rcx
	movq	%rax, 96(%rsp)
	xorl	%eax, %eax
	movl	$1000000000, 188(%rsp)
	movq	%rcx, 248(%rsp)
.L44:
	movq	96(%rsp), %rdi
	movl	(%rdi), %ebx
	movl	%ebx, 184(%rsp)
	testl	%ebx, %ebx
	jg	.L108
.L8:
	addl	$1, 80(%rsp)
	movl	80(%rsp), %ebx
	addq	$4, 96(%rsp)
	cmpl	%r10d, %ebx
	jl	.L44
	movl	208(%rsp), %ebx
	movl	188(%rsp), %edx
	addl	%ebx, %edx
	testl	%eax, %eax
	cmove	%ebx, %edx
	movl	%edx, 208(%rsp)
.L45:
	movq	152(%rsp), %rax
	movl	212(%rsp), %ecx
	movl	232(%rsp), %edi
	movl	%ecx, (%rax)
	movl	208(%rsp), %eax
	cmpl	%eax, %edi
	cmovle	%edi, %eax
	movl	%eax, 232(%rsp)
	movl	$1, %eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L108:
	movl	$0, (%rdi)
	movq	224(%rsp), %rax
	movslq	%ebx, %rdi
	movq	248(%rsp), %rbx
	movq	%rdi, 200(%rsp)
	leaq	(%rax,%rbx,8), %rax
	addq	%rdi, %rax
	movl	(%r9,%rax,4), %eax
	movl	%eax, 172(%rsp)
	testl	%r10d, %r10d
	jle	.L43
	leaq	(%rdi,%rdi,4), %rdx
	movl	$0, 36(%rsp)
	leaq	r(%rip), %rax
	leaq	(%rdx,%rdx,4), %rcx
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movl	$1000000000, 148(%rsp)
	movq	%rcx, 216(%rsp)
.L42:
	movq	40(%rsp), %rsi
	movl	(%rsi), %ecx
	movl	%ecx, 144(%rsp)
	testl	%ecx, %ecx
	jg	.L109
.L10:
	addl	$1, 36(%rsp)
	movl	36(%rsp), %edi
	addq	$4, 40(%rsp)
	cmpl	%r10d, %edi
	jl	.L42
	movl	172(%rsp), %esi
	movl	148(%rsp), %edx
	addl	%esi, %edx
	testl	%eax, %eax
	cmove	%esi, %edx
	movl	%edx, 172(%rsp)
.L43:
	movq	96(%rsp), %rax
	movl	184(%rsp), %edi
	movl	188(%rsp), %ebx
	movl	%edi, (%rax)
	movl	172(%rsp), %eax
	cmpl	%eax, %ebx
	cmovle	%ebx, %eax
	movl	%eax, 188(%rsp)
	movl	$1, %eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L109:
	movq	200(%rsp), %rax
	movslq	%ecx, %rbx
	movq	216(%rsp), %rdi
	movl	$0, (%rsi)
	movq	%rbx, 160(%rsp)
	leaq	(%rax,%rdi,8), %rax
	addq	%rbx, %rax
	movl	(%r9,%rax,4), %eax
	movl	%eax, 132(%rsp)
	testl	%r10d, %r10d
	jle	.L41
	leaq	(%rbx,%rbx,4), %rdx
	movl	$1000000000, 104(%rsp)
	movl	%r10d, %r11d
	leaq	r(%rip), %rax
	leaq	(%rdx,%rdx,4), %rdi
	movl	$0, 12(%rsp)
	movq	%rdi, 176(%rsp)
	movq	%rax, 16(%rsp)
	xorl	%eax, %eax
.L40:
	movq	16(%rsp), %rdi
	movl	(%rdi), %ebx
	movl	%ebx, 88(%rsp)
	testl	%ebx, %ebx
	jg	.L110
.L12:
	addl	$1, 12(%rsp)
	movl	12(%rsp), %ecx
	addq	$4, 16(%rsp)
	cmpl	%r11d, %ecx
	jl	.L40
	movl	132(%rsp), %ebx
	movl	104(%rsp), %edx
	movl	%r11d, %r10d
	addl	%ebx, %edx
	testl	%eax, %eax
	cmove	%ebx, %edx
	movl	%edx, 132(%rsp)
.L41:
	movq	40(%rsp), %rax
	movl	144(%rsp), %esi
	movl	%esi, (%rax)
	movl	148(%rsp), %esi
	movl	132(%rsp), %eax
	cmpl	%eax, %esi
	cmovle	%esi, %eax
	movl	%eax, 148(%rsp)
	movl	$1, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L110:
	movl	$0, (%rdi)
	movq	160(%rsp), %rax
	movslq	%ebx, %rsi
	movq	176(%rsp), %rdi
	movq	%rsi, 120(%rsp)
	leaq	(%rax,%rdi,8), %rax
	addq	%rsi, %rax
	movl	(%r9,%rax,4), %eax
	movl	%eax, 84(%rsp)
	testl	%r11d, %r11d
	jle	.L39
	leaq	(%rsi,%rsi,4), %rdx
	leaq	r(%rip), %r10
	xorl	%eax, %eax
	movl	$1000000000, 60(%rsp)
	leaq	(%rdx,%rdx,4), %rsi
	movl	$0, 8(%rsp)
	movq	%rsi, 136(%rsp)
.L38:
	movl	(%r10), %edx
	movl	%edx, 56(%rsp)
	testl	%edx, %edx
	jg	.L111
.L14:
	addl	$1, 8(%rsp)
	movl	8(%rsp), %edi
	addq	$4, %r10
	cmpl	%edi, %r11d
	jg	.L38
	movl	84(%rsp), %esi
	movl	60(%rsp), %edx
	addl	%esi, %edx
	testl	%eax, %eax
	cmove	%esi, %edx
	movl	%edx, 84(%rsp)
.L39:
	movq	16(%rsp), %rax
	movl	88(%rsp), %ecx
	movl	104(%rsp), %edx
	movl	%ecx, (%rax)
	movl	84(%rsp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, 104(%rsp)
	movl	$1, %eax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L111:
	movq	120(%rsp), %rax
	movslq	%edx, %rsi
	movq	%r10, 112(%rsp)
	xorl	%r8d, %r8d
	leaq	(%rsi,%rsi,4), %rdx
	movq	136(%rsp), %rbx
	movq	%rsi, 64(%rsp)
	leaq	r(%rip), %rcx
	movl	$0, (%r10)
	leaq	(%rax,%rbx,8), %rax
	movl	$1000000000, 32(%rsp)
	addq	%rsi, %rax
	leaq	(%rdx,%rdx,4), %rsi
	movl	(%r9,%rax,4), %eax
	movq	%rsi, 72(%rsp)
	movl	%eax, 108(%rsp)
	xorl	%eax, %eax
.L36:
	movl	(%rcx), %r14d
	testl	%r14d, %r14d
	jg	.L112
.L15:
	addl	$1, %r8d
	addq	$4, %rcx
	cmpl	%r8d, %r11d
	jg	.L36
	movl	108(%rsp), %ecx
	movl	32(%rsp), %edx
	movl	60(%rsp), %edi
	movq	112(%rsp), %r10
	addl	%ecx, %edx
	testl	%eax, %eax
	movl	56(%rsp), %esi
	movl	%edx, %eax
	cmove	%ecx, %eax
	movl	%esi, (%r10)
	cmpl	%eax, %edi
	cmovle	%edi, %eax
	movl	%eax, 60(%rsp)
	movl	$1, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L112:
	movq	72(%rsp), %rdx
	movq	64(%rsp), %rax
	movslq	%r14d, %rsi
	xorl	%ebp, %ebp
	movl	$0, (%rcx)
	leaq	r(%rip), %rbx
	movl	$1000000000, %r10d
	leaq	(%rax,%rdx,8), %rax
	leaq	(%rsi,%rsi,4), %rdx
	movq	%rcx, 48(%rsp)
	movq	%rsi, %rcx
	leaq	(%rdx,%rdx,4), %rdi
	addq	%rsi, %rax
	movq	%rdi, 24(%rsp)
	movl	(%r9,%rax,4), %r13d
	xorl	%eax, %eax
.L34:
	movl	(%rbx), %r12d
	testl	%r12d, %r12d
	jg	.L113
.L16:
	addl	$1, %ebp
	addq	$4, %rbx
	cmpl	%r11d, %ebp
	jl	.L34
	addl	%r13d, %r10d
	testl	%eax, %eax
	movl	32(%rsp), %eax
	movq	48(%rsp), %rcx
	cmovne	%r10d, %r13d
	movl	%r14d, (%rcx)
	cmpl	%r13d, %eax
	cmovle	%eax, %r13d
	movl	$1, %eax
	movl	%r13d, 32(%rsp)
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L113:
	movq	24(%rsp), %rax
	movslq	%r12d, %rdx
	movl	$0, (%rbx)
	leaq	(%rcx,%rax,8), %rax
	addq	%rdx, %rax
	movl	(%r9,%rax,4), %r15d
	testl	%r11d, %r11d
	jle	.L33
	leaq	r(%rip), %rdi
	movl	(%rdi), %esi
	testl	%esi, %esi
	jg	.L114
	movl	$1000000000, 92(%rsp)
	xorl	%eax, %eax
	cmpl	$1, %r11d
	je	.L33
	movl	4+r(%rip), %esi
	testl	%esi, %esi
	jg	.L115
.L20:
	cmpl	$2, %r11d
	je	.L22
	movl	8+r(%rip), %esi
	testl	%esi, %esi
	jg	.L116
.L23:
	cmpl	$3, %r11d
	je	.L22
.L24:
	movl	12+r(%rip), %esi
	testl	%esi, %esi
	jg	.L117
	cmpl	$4, %r11d
	je	.L22
.L26:
	movl	16+r(%rip), %esi
	testl	%esi, %esi
	jg	.L118
	cmpl	$5, %r11d
	je	.L22
.L28:
	movl	20+r(%rip), %esi
	testl	%esi, %esi
	jg	.L119
	cmpl	$6, %r11d
	je	.L22
.L30:
	movl	24+r(%rip), %esi
	testl	%esi, %esi
	jg	.L120
	cmpl	$7, %r11d
	je	.L22
	movl	28+r(%rip), %esi
	testl	%esi, %esi
	jg	.L32
	.p2align 4,,10
	.p2align 3
.L22:
	testl	%eax, %eax
	je	.L33
.L19:
	addl	92(%rsp), %r15d
.L33:
	cmpl	%r15d, %r10d
	movl	%r12d, (%rbx)
	movl	$1, %eax
	cmovg	%r15d, %r10d
	jmp	.L16
.L49:
	movl	$0, 240(%rsp)
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L114:
	leaq	(%rdx,%rdx,4), %rax
	movslq	%esi, %rdi
	movq	%rcx, 312(%rsp)
	leaq	(%rax,%rax,4), %rax
	movl	%r10d, 304(%rsp)
	leaq	(%rdx,%rax,8), %rax
	movl	%r8d, 300(%rsp)
	addq	%rdi, %rax
	movl	%esi, %edi
	movl	%esi, 296(%rsp)
	movl	(%r9,%rax,4), %eax
	movq	%rdx, 320(%rsp)
	movl	$0, r(%rip)
	movl	%eax, 92(%rsp)
	call	dfs
	movl	296(%rsp), %esi
	addl	92(%rsp), %eax
	leaq	r(%rip), %rdi
	movl	R(%rip), %r11d
	movl	300(%rsp), %r8d
	leaq	cost(%rip), %r9
	movl	%esi, (%rdi)
	movl	%eax, %edi
	movl	$1000000000, %eax
	movl	304(%rsp), %r10d
	cmpl	%eax, %edi
	movq	312(%rsp), %rcx
	cmovle	%edi, %eax
	cmpl	$1, %r11d
	movl	%eax, 92(%rsp)
	jle	.L19
	movl	4+r(%rip), %esi
	movq	320(%rsp), %rdx
	movl	$1, %eax
	testl	%esi, %esi
	jle	.L20
	.p2align 4,,10
	.p2align 3
.L115:
	leaq	(%rdx,%rdx,4), %rax
	movslq	%esi, %rdi
	movq	%rcx, 328(%rsp)
	leaq	(%rax,%rax,4), %rax
	movl	%r10d, 320(%rsp)
	leaq	(%rdx,%rax,8), %rax
	movl	%r8d, 312(%rsp)
	addq	%rdi, %rax
	movl	%esi, %edi
	movq	%rdx, 304(%rsp)
	movl	(%r9,%rax,4), %eax
	movl	%esi, 300(%rsp)
	movl	$0, 4+r(%rip)
	movl	%eax, 296(%rsp)
	call	dfs
	movl	92(%rsp), %ecx
	addl	296(%rsp), %eax
	leaq	cost(%rip), %r9
	movl	R(%rip), %r11d
	movl	300(%rsp), %esi
	cmpl	%eax, %ecx
	movq	304(%rsp), %rdx
	movl	312(%rsp), %r8d
	cmovle	%ecx, %eax
	cmpl	$2, %r11d
	movl	%esi, 4+r(%rip)
	movl	320(%rsp), %r10d
	movq	328(%rsp), %rcx
	movl	%eax, 92(%rsp)
	movl	$1, %eax
	jle	.L19
	movl	8+r(%rip), %esi
	testl	%esi, %esi
	jle	.L23
	.p2align 4,,10
	.p2align 3
.L116:
	leaq	(%rdx,%rdx,4), %rax
	movslq	%esi, %rdi
	movq	%rcx, 328(%rsp)
	leaq	(%rax,%rax,4), %rax
	movl	%r10d, 320(%rsp)
	leaq	(%rdx,%rax,8), %rax
	movl	%r8d, 312(%rsp)
	addq	%rdi, %rax
	movl	%esi, %edi
	movq	%rdx, 304(%rsp)
	movl	(%r9,%rax,4), %eax
	movl	%esi, 300(%rsp)
	movl	$0, 8+r(%rip)
	movl	%eax, 296(%rsp)
	call	dfs
	movl	92(%rsp), %edi
	addl	296(%rsp), %eax
	leaq	cost(%rip), %r9
	movl	R(%rip), %r11d
	movl	300(%rsp), %esi
	cmpl	%eax, %edi
	movq	304(%rsp), %rdx
	movl	312(%rsp), %r8d
	cmovle	%edi, %eax
	cmpl	$3, %r11d
	movl	%esi, 8+r(%rip)
	movl	320(%rsp), %r10d
	movq	328(%rsp), %rcx
	movl	%eax, 92(%rsp)
	movl	$1, %eax
	jg	.L24
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L117:
	leaq	(%rdx,%rdx,4), %rax
	movslq	%esi, %rdi
	movq	%rcx, 328(%rsp)
	leaq	(%rax,%rax,4), %rax
	movl	%r10d, 320(%rsp)
	leaq	(%rdx,%rax,8), %rax
	movl	%r8d, 312(%rsp)
	addq	%rdi, %rax
	movl	%esi, %edi
	movq	%rdx, 304(%rsp)
	movl	(%r9,%rax,4), %eax
	movl	%esi, 300(%rsp)
	movl	$0, 12+r(%rip)
	movl	%eax, 296(%rsp)
	call	dfs
	movl	92(%rsp), %ecx
	addl	296(%rsp), %eax
	leaq	cost(%rip), %r9
	movl	R(%rip), %r11d
	movl	300(%rsp), %esi
	cmpl	%eax, %ecx
	movq	304(%rsp), %rdx
	movl	312(%rsp), %r8d
	cmovle	%ecx, %eax
	cmpl	$4, %r11d
	movl	%esi, 12+r(%rip)
	movl	320(%rsp), %r10d
	movq	328(%rsp), %rcx
	movl	%eax, 92(%rsp)
	movl	$1, %eax
	jg	.L26
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L118:
	leaq	(%rdx,%rdx,4), %rax
	movslq	%esi, %rdi
	movq	%rcx, 328(%rsp)
	leaq	(%rax,%rax,4), %rax
	movl	%r10d, 320(%rsp)
	leaq	(%rdx,%rax,8), %rax
	movl	%r8d, 312(%rsp)
	addq	%rdi, %rax
	movl	%esi, %edi
	movq	%rdx, 304(%rsp)
	movl	(%r9,%rax,4), %eax
	movl	%esi, 300(%rsp)
	movl	$0, 16+r(%rip)
	movl	%eax, 296(%rsp)
	call	dfs
	movl	300(%rsp), %esi
	addl	296(%rsp), %eax
	leaq	cost(%rip), %r9
	movl	R(%rip), %r11d
	movq	304(%rsp), %rdx
	movl	%esi, 16+r(%rip)
	movl	92(%rsp), %esi
	movl	312(%rsp), %r8d
	movl	320(%rsp), %r10d
	cmpl	%eax, %esi
	movq	328(%rsp), %rcx
	cmovle	%esi, %eax
	cmpl	$5, %r11d
	movl	%eax, 92(%rsp)
	movl	$1, %eax
	jg	.L28
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L119:
	leaq	(%rdx,%rdx,4), %rax
	movslq	%esi, %rdi
	movq	%rcx, 328(%rsp)
	leaq	(%rax,%rax,4), %rax
	movl	%r10d, 320(%rsp)
	leaq	(%rdx,%rax,8), %rax
	movl	%r8d, 312(%rsp)
	addq	%rdi, %rax
	movl	%esi, %edi
	movq	%rdx, 304(%rsp)
	movl	(%r9,%rax,4), %eax
	movl	%esi, 300(%rsp)
	movl	$0, 20+r(%rip)
	movl	%eax, 296(%rsp)
	call	dfs
	movl	92(%rsp), %edi
	addl	296(%rsp), %eax
	leaq	cost(%rip), %r9
	movl	R(%rip), %r11d
	movl	300(%rsp), %esi
	cmpl	%eax, %edi
	movq	304(%rsp), %rdx
	movl	312(%rsp), %r8d
	cmovle	%edi, %eax
	cmpl	$6, %r11d
	movl	%esi, 20+r(%rip)
	movl	320(%rsp), %r10d
	movq	328(%rsp), %rcx
	movl	%eax, 92(%rsp)
	movl	$1, %eax
	jg	.L30
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L120:
	leaq	(%rdx,%rdx,4), %rax
	movslq	%esi, %rdi
	movq	%rcx, 328(%rsp)
	leaq	(%rax,%rax,4), %rax
	movl	%r10d, 320(%rsp)
	leaq	(%rdx,%rax,8), %rax
	movl	%r8d, 312(%rsp)
	addq	%rdi, %rax
	movl	%esi, %edi
	movl	%esi, 300(%rsp)
	movl	(%r9,%rax,4), %eax
	movq	%rdx, 304(%rsp)
	movl	$0, 24+r(%rip)
	movl	%eax, 296(%rsp)
	call	dfs
	movl	92(%rsp), %ecx
	addl	296(%rsp), %eax
	leaq	cost(%rip), %r9
	movl	R(%rip), %r11d
	movl	300(%rsp), %esi
	cmpl	%eax, %ecx
	movl	312(%rsp), %r8d
	movl	320(%rsp), %r10d
	cmovle	%ecx, %eax
	cmpl	$7, %r11d
	movl	%esi, 24+r(%rip)
	movq	328(%rsp), %rcx
	movl	%eax, 92(%rsp)
	jle	.L19
	movl	28+r(%rip), %esi
	movq	304(%rsp), %rdx
	testl	%esi, %esi
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L32:
	leaq	(%rdx,%rdx,4), %rax
	movslq	%esi, %rdi
	movq	%rcx, 320(%rsp)
	leaq	(%rax,%rax,4), %rax
	movl	%r10d, 312(%rsp)
	leaq	(%rdx,%rax,8), %rax
	movl	%r8d, 304(%rsp)
	addq	%rdi, %rax
	movl	%esi, %edi
	movl	%esi, 300(%rsp)
	movl	$0, 28+r(%rip)
	movl	(%r9,%rax,4), %eax
	movl	%eax, 296(%rsp)
	call	dfs
	movl	300(%rsp), %esi
	addl	296(%rsp), %eax
	leaq	cost(%rip), %r9
	movl	R(%rip), %r11d
	movl	304(%rsp), %r8d
	movl	%esi, 28+r(%rip)
	movl	92(%rsp), %esi
	movl	312(%rsp), %r10d
	movq	320(%rsp), %rcx
	cmpl	%eax, %esi
	cmovle	%esi, %eax
	movl	%eax, 92(%rsp)
	jmp	.L19
	.cfi_endproc
.LFE23:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	M(%rip), %rdx
	leaq	R(%rip), %rcx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	N(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	r(%rip), %r12
	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
	movq	%rbp, %rdi
	xorl	%ebx, %ebx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	R(%rip), %edx
	testl	%edx, %edx
	jle	.L126
	.p2align 4,,10
	.p2align 3
.L125:
	movq	%r12, %rsi
	xorl	%eax, %eax
	movq	%r13, %rdi
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %r12
	cmpl	%ebx, R(%rip)
	jg	.L125
.L126:
	movl	M(%rip), %eax
	movl	N(%rip), %ebx
	movl	%eax, 12(%rsp)
	testl	%ebx, %ebx
	jle	.L161
	movl	%ebx, %eax
	movl	%ebx, %r13d
	leal	1(%rbx), %r14d
	movl	$1, %esi
	shrl	$2, %eax
	andl	$-4, %r13d
	leal	-1(%rbx), %r9d
	movdqa	.LC2(%rip), %xmm0
	leal	-1(%rax), %r12d
	leaq	808+cost(%rip), %rdi
	addq	$1, %r12
	leal	1(%r13), %r15d
	movq	%rdi, %rcx
	leaq	-808(%rdi), %r11
	salq	$4, %r12
	.p2align 4,,10
	.p2align 3
.L129:
	leaq	(%r12,%rcx), %rdx
	movq	%rcx, %rax
	cmpl	$2, %r9d
	jbe	.L162
	.p2align 4,,10
	.p2align 3
.L131:
	movups	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L131
	movl	%r15d, %eax
	cmpl	%ebx, %r13d
	je	.L132
.L127:
	movslq	%esi, %rdx
	movslq	%eax, %r8
	leaq	(%rdx,%rdx,4), %r10
	leaq	(%r10,%r10,4), %r10
	leaq	(%rdx,%r10,8), %rdx
	addq	%rdx, %r8
	movl	$100000000, (%r11,%r8,4)
	leal	1(%rax), %r8d
	cmpl	%r8d, %ebx
	jl	.L132
	movslq	%r8d, %r8
	addl	$2, %eax
	addq	%rdx, %r8
	movl	$100000000, (%r11,%r8,4)
	cmpl	%eax, %ebx
	jl	.L132
	cltq
	addq	%rax, %rdx
	movl	$100000000, (%r11,%rdx,4)
.L132:
	addl	$1, %esi
	movl	$0, (%rdi)
	addq	$804, %rcx
	addq	$808, %rdi
	cmpl	%r14d, %esi
	jne	.L129
	movl	%r9d, %edx
	leaq	804+cost(%rip), %rax
	imulq	$804, %rdx, %rdx
	leaq	804(%rax), %rcx
	addq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L133:
	movl	$0, (%rax)
	addq	$804, %rax
	cmpq	%rdx, %rax
	jne	.L133
	leaq	4+cost(%rip), %r10
	movl	%ebx, %edx
	xorl	%esi, %esi
	movq	%r10, %rdi
	salq	$2, %rdx
	call	memset@PLT
	movq	%rax, %r10
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L134
.L142:
	xorl	%r14d, %r14d
	leaq	36(%rsp), %r13
	leaq	32(%rsp), %r12
	leaq	cost(%rip), %r15
	leaq	28(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L135:
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movslq	32(%rsp), %rax
	movslq	28(%rsp), %rdx
	movl	36(%rsp), %esi
	leaq	(%rax,%rax,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,8), %rcx
	addq	%rdx, %rcx
	movl	%esi, (%r15,%rcx,4)
	leaq	(%rdx,%rdx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rdx,%rcx,8), %rdx
	addq	%rdx, %rax
	cmpl	%r14d, M(%rip)
	movl	%esi, (%r15,%rax,4)
	jg	.L135
	movl	N(%rip), %ebx
	leaq	4+cost(%rip), %r10
	testl	%ebx, %ebx
	jle	.L136
.L134:
	leaq	4+cost(%rip), %r12
	movl	$804, %r9d
	movl	$1, %ebp
	.p2align 4,,10
	.p2align 3
.L140:
	movq	%r12, %r8
	movq	$-804, %rdi
	movl	$1, %r11d
	.p2align 4,,10
	.p2align 3
.L141:
	movq	%r10, %rax
	movl	$1, %ecx
	subq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L138:
	leaq	(%rax,%rdi), %rsi
	movl	804(%r8), %edx
	addl	(%rsi,%r9), %edx
	cmpl	%edx, (%rax)
	jle	.L137
	movl	%edx, (%rax)
.L137:
	addl	$1, %ecx
	addq	$4, %rax
	cmpl	%ecx, %ebx
	jge	.L138
	addl	$1, %r11d
	addq	$804, %r8
	subq	$804, %rdi
	cmpl	%r11d, %ebx
	jge	.L141
	addl	$1, %ebp
	addq	$804, %r9
	addq	$4, %r12
	cmpl	%ebp, %ebx
	jge	.L140
.L136:
	xorl	%edi, %edi
	call	dfs
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L163
	addq	$56, %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
.L162:
	.cfi_restore_state
	movl	$1, %eax
	jmp	.L127
.L161:
	cmpl	$0, 12(%rsp)
	jg	.L142
	jmp	.L136
.L163:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	cost
	.bss
	.align 32
	.type	cost, @object
	.size	cost, 161604
cost:
	.zero	161604
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 32
r:
	.zero	32
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	100000000
	.long	100000000
	.long	100000000
	.long	100000000
	.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	dfs
	.type	dfs, @function
dfs:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$344, %rsp
	.cfi_def_cfa_offset 400
	movl	R(%rip), %r9d
	testl	%r9d, %r9d
	jle	.L49
	movslq	%edi, %rcx
	leaq	r(%rip), %rax
	movl	%r9d, %r11d
	movl	$1000000000, 240(%rsp)
	leaq	(%rcx,%rcx,4), %rsi
	movq	%rcx, 272(%rsp)
	leaq	0(,%rsi,4), %rbx
	movq	%rsi, 280(%rsp)
	movl	$0, 168(%rsp)
	movq	%rbx, 288(%rsp)
	movq	%rax, 192(%rsp)
	xorl	%eax, %eax
.L48:
	movq	192(%rsp), %rdx
	movl	(%rdx), %ecx
	movl	%ecx, 244(%rsp)
	testl	%ecx, %ecx
	jg	.L106
.L4:
	addl	$1, 168(%rsp)
	movl	168(%rsp), %ebx
	addq	$4, 192(%rsp)
	cmpl	%r11d, %ebx
	jl	.L48
	testl	%eax, %eax
	je	.L49
.L1:
	movl	240(%rsp), %eax
	addq	$344, %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
.L106:
	.cfi_restore_state
	movslq	%ecx, %rsi
	movq	272(%rsp), %rcx
	movq	280(%rsp), %rax
	leaq	cost(%rip), %r9
	addq	288(%rsp), %rax
	movl	$0, (%rdx)
	leaq	(%rcx,%rax,8), %rax
	movq	%rsi, 256(%rsp)
	addq	%rsi, %rax
	movl	(%r9,%rax,4), %eax
	movl	%eax, 236(%rsp)
	testl	%r11d, %r11d
	jle	.L47
	leaq	(%rsi,%rsi,4), %rdx
	leaq	r(%rip), %rax
	movl	%r11d, %r10d
	movl	$1000000000, 232(%rsp)
	leaq	(%rdx,%rdx,4), %rsi
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	movl	$0, 128(%rsp)
	movq	%rsi, 264(%rsp)
.L46:
	movq	152(%rsp), %rdx
	movslq	(%rdx), %rcx
	movl	%ecx, 212(%rsp)
	testl	%ecx, %ecx
	jg	.L107
.L6:
	addl	$1, 128(%rsp)
	movl	128(%rsp), %ecx
	addq	$4, 152(%rsp)
	cmpl	%r10d, %ecx
	jl	.L46
	movl	236(%rsp), %ebx
	movl	232(%rsp), %edx
	movl	%r10d, %r11d
	addl	%ebx, %edx
	testl	%eax, %eax
	cmove	%ebx, %edx
	movl	%edx, 236(%rsp)
.L47:
	movq	192(%rsp), %rax
	movl	244(%rsp), %esi
	movl	240(%rsp), %edi
	movl	%esi, (%rax)
	movl	236(%rsp), %eax
	cmpl	%eax, %edi
	cmovle	%edi, %eax
	movl	%eax, 240(%rsp)
	movl	$1, %eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L107:
	movq	256(%rsp), %rax
	movq	264(%rsp), %rbx
	movl	$0, (%rdx)
	movq	%rcx, 224(%rsp)
	leaq	(%rax,%rbx,8), %rax
	addq	%rcx, %rax
	movl	(%r9,%rax,4), %eax
	movl	%eax, 208(%rsp)
	testl	%r10d, %r10d
	jle	.L45
	leaq	(%rcx,%rcx,4), %rdx
	movl	$0, 80(%rsp)
	leaq	r(%rip), %rax
	leaq	(%rdx,%rdx,4), %rcx
	movq	%rax, 96(%rsp)
	xorl	%eax, %eax
	movl	$1000000000, 188(%rsp)
	movq	%rcx, 248(%rsp)
.L44:
	movq	96(%rsp), %rdi
	movl	(%rdi), %ebx
	movl	%ebx, 184(%rsp)
	testl	%ebx, %ebx
	jg	.L108
.L8:
	addl	$1, 80(%rsp)
	movl	80(%rsp), %ebx
	addq	$4, 96(%rsp)
	cmpl	%r10d, %ebx
	jl	.L44
	movl	208(%rsp), %ebx
	movl	188(%rsp), %edx
	addl	%ebx, %edx
	testl	%eax, %eax
	cmove	%ebx, %edx
	movl	%edx, 208(%rsp)
.L45:
	movq	152(%rsp), %rax
	movl	212(%rsp), %ecx
	movl	232(%rsp), %edi
	movl	%ecx, (%rax)
	movl	208(%rsp), %eax
	cmpl	%eax, %edi
	cmovle	%edi, %eax
	movl	%eax, 232(%rsp)
	movl	$1, %eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L108:
	movl	$0, (%rdi)
	movq	224(%rsp), %rax
	movslq	%ebx, %rdi
	movq	248(%rsp), %rbx
	movq	%rdi, 200(%rsp)
	leaq	(%rax,%rbx,8), %rax
	addq	%rdi, %rax
	movl	(%r9,%rax,4), %eax
	movl	%eax, 172(%rsp)
	testl	%r10d, %r10d
	jle	.L43
	leaq	(%rdi,%rdi,4), %rdx
	movl	$0, 36(%rsp)
	leaq	r(%rip), %rax
	leaq	(%rdx,%rdx,4), %rcx
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movl	$1000000000, 148(%rsp)
	movq	%rcx, 216(%rsp)
.L42:
	movq	40(%rsp), %rsi
	movl	(%rsi), %ecx
	movl	%ecx, 144(%rsp)
	testl	%ecx, %ecx
	jg	.L109
.L10:
	addl	$1, 36(%rsp)
	movl	36(%rsp), %edi
	addq	$4, 40(%rsp)
	cmpl	%r10d, %edi
	jl	.L42
	movl	172(%rsp), %esi
	movl	148(%rsp), %edx
	addl	%esi, %edx
	testl	%eax, %eax
	cmove	%esi, %edx
	movl	%edx, 172(%rsp)
.L43:
	movq	96(%rsp), %rax
	movl	184(%rsp), %edi
	movl	188(%rsp), %ebx
	movl	%edi, (%rax)
	movl	172(%rsp), %eax
	cmpl	%eax, %ebx
	cmovle	%ebx, %eax
	movl	%eax, 188(%rsp)
	movl	$1, %eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L109:
	movq	200(%rsp), %rax
	movslq	%ecx, %rbx
	movq	216(%rsp), %rdi
	movl	$0, (%rsi)
	movq	%rbx, 160(%rsp)
	leaq	(%rax,%rdi,8), %rax
	addq	%rbx, %rax
	movl	(%r9,%rax,4), %eax
	movl	%eax, 132(%rsp)
	testl	%r10d, %r10d
	jle	.L41
	leaq	(%rbx,%rbx,4), %rdx
	movl	$1000000000, 104(%rsp)
	movl	%r10d, %r11d
	leaq	r(%rip), %rax
	leaq	(%rdx,%rdx,4), %rdi
	movl	$0, 12(%rsp)
	movq	%rdi, 176(%rsp)
	movq	%rax, 16(%rsp)
	xorl	%eax, %eax
.L40:
	movq	16(%rsp), %rdi
	movl	(%rdi), %ebx
	movl	%ebx, 88(%rsp)
	testl	%ebx, %ebx
	jg	.L110
.L12:
	addl	$1, 12(%rsp)
	movl	12(%rsp), %ecx
	addq	$4, 16(%rsp)
	cmpl	%r11d, %ecx
	jl	.L40
	movl	132(%rsp), %ebx
	movl	104(%rsp), %edx
	movl	%r11d, %r10d
	addl	%ebx, %edx
	testl	%eax, %eax
	cmove	%ebx, %edx
	movl	%edx, 132(%rsp)
.L41:
	movq	40(%rsp), %rax
	movl	144(%rsp), %esi
	movl	%esi, (%rax)
	movl	148(%rsp), %esi
	movl	132(%rsp), %eax
	cmpl	%eax, %esi
	cmovle	%esi, %eax
	movl	%eax, 148(%rsp)
	movl	$1, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L110:
	movl	$0, (%rdi)
	movq	160(%rsp), %rax
	movslq	%ebx, %rsi
	movq	176(%rsp), %rdi
	movq	%rsi, 120(%rsp)
	leaq	(%rax,%rdi,8), %rax
	addq	%rsi, %rax
	movl	(%r9,%rax,4), %eax
	movl	%eax, 84(%rsp)
	testl	%r11d, %r11d
	jle	.L39
	leaq	(%rsi,%rsi,4), %rdx
	leaq	r(%rip), %r10
	xorl	%eax, %eax
	movl	$1000000000, 60(%rsp)
	leaq	(%rdx,%rdx,4), %rsi
	movl	$0, 8(%rsp)
	movq	%rsi, 136(%rsp)
.L38:
	movl	(%r10), %edx
	movl	%edx, 56(%rsp)
	testl	%edx, %edx
	jg	.L111
.L14:
	addl	$1, 8(%rsp)
	movl	8(%rsp), %edi
	addq	$4, %r10
	cmpl	%edi, %r11d
	jg	.L38
	movl	84(%rsp), %esi
	movl	60(%rsp), %edx
	addl	%esi, %edx
	testl	%eax, %eax
	cmove	%esi, %edx
	movl	%edx, 84(%rsp)
.L39:
	movq	16(%rsp), %rax
	movl	88(%rsp), %ecx
	movl	104(%rsp), %edx
	movl	%ecx, (%rax)
	movl	84(%rsp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, 104(%rsp)
	movl	$1, %eax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L111:
	movq	120(%rsp), %rax
	movslq	%edx, %rsi
	movq	%r10, 112(%rsp)
	xorl	%r8d, %r8d
	leaq	(%rsi,%rsi,4), %rdx
	movq	136(%rsp), %rbx
	movq	%rsi, 64(%rsp)
	leaq	r(%rip), %rcx
	movl	$0, (%r10)
	leaq	(%rax,%rbx,8), %rax
	movl	$1000000000, 32(%rsp)
	addq	%rsi, %rax
	leaq	(%rdx,%rdx,4), %rsi
	movl	(%r9,%rax,4), %eax
	movq	%rsi, 72(%rsp)
	movl	%eax, 108(%rsp)
	xorl	%eax, %eax
.L36:
	movl	(%rcx), %r14d
	testl	%r14d, %r14d
	jg	.L112
.L15:
	addl	$1, %r8d
	addq	$4, %rcx
	cmpl	%r8d, %r11d
	jg	.L36
	movl	108(%rsp), %ecx
	movl	32(%rsp), %edx
	movl	60(%rsp), %edi
	movq	112(%rsp), %r10
	addl	%ecx, %edx
	testl	%eax, %eax
	movl	56(%rsp), %esi
	movl	%edx, %eax
	cmove	%ecx, %eax
	movl	%esi, (%r10)
	cmpl	%eax, %edi
	cmovle	%edi, %eax
	movl	%eax, 60(%rsp)
	movl	$1, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L112:
	movq	72(%rsp), %rdx
	movq	64(%rsp), %rax
	movslq	%r14d, %rsi
	xorl	%ebp, %ebp
	movl	$0, (%rcx)
	leaq	r(%rip), %rbx
	movl	$1000000000, %r10d
	leaq	(%rax,%rdx,8), %rax
	leaq	(%rsi,%rsi,4), %rdx
	movq	%rcx, 48(%rsp)
	movq	%rsi, %rcx
	leaq	(%rdx,%rdx,4), %rdi
	addq	%rsi, %rax
	movq	%rdi, 24(%rsp)
	movl	(%r9,%rax,4), %r13d
	xorl	%eax, %eax
.L34:
	movl	(%rbx), %r12d
	testl	%r12d, %r12d
	jg	.L113
.L16:
	addl	$1, %ebp
	addq	$4, %rbx
	cmpl	%r11d, %ebp
	jl	.L34
	addl	%r13d, %r10d
	testl	%eax, %eax
	movl	32(%rsp), %eax
	movq	48(%rsp), %rcx
	cmovne	%r10d, %r13d
	movl	%r14d, (%rcx)
	cmpl	%r13d, %eax
	cmovle	%eax, %r13d
	movl	$1, %eax
	movl	%r13d, 32(%rsp)
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L113:
	movq	24(%rsp), %rax
	movslq	%r12d, %rdx
	movl	$0, (%rbx)
	leaq	(%rcx,%rax,8), %rax
	addq	%rdx, %rax
	movl	(%r9,%rax,4), %r15d
	testl	%r11d, %r11d
	jle	.L33
	leaq	r(%rip), %rdi
	movl	(%rdi), %esi
	testl	%esi, %esi
	jg	.L114
	movl	$1000000000, 92(%rsp)
	xorl	%eax, %eax
	cmpl	$1, %r11d
	je	.L33
	movl	4+r(%rip), %esi
	testl	%esi, %esi
	jg	.L115
.L20:
	cmpl	$2, %r11d
	je	.L22
	movl	8+r(%rip), %esi
	testl	%esi, %esi
	jg	.L116
.L23:
	cmpl	$3, %r11d
	je	.L22
.L24:
	movl	12+r(%rip), %esi
	testl	%esi, %esi
	jg	.L117
	cmpl	$4, %r11d
	je	.L22
.L26:
	movl	16+r(%rip), %esi
	testl	%esi, %esi
	jg	.L118
	cmpl	$5, %r11d
	je	.L22
.L28:
	movl	20+r(%rip), %esi
	testl	%esi, %esi
	jg	.L119
	cmpl	$6, %r11d
	je	.L22
.L30:
	movl	24+r(%rip), %esi
	testl	%esi, %esi
	jg	.L120
	cmpl	$7, %r11d
	je	.L22
	movl	28+r(%rip), %esi
	testl	%esi, %esi
	jg	.L32
	.p2align 4,,10
	.p2align 3
.L22:
	testl	%eax, %eax
	je	.L33
.L19:
	addl	92(%rsp), %r15d
.L33:
	cmpl	%r15d, %r10d
	movl	%r12d, (%rbx)
	movl	$1, %eax
	cmovg	%r15d, %r10d
	jmp	.L16
.L49:
	movl	$0, 240(%rsp)
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L114:
	leaq	(%rdx,%rdx,4), %rax
	movslq	%esi, %rdi
	movq	%rcx, 312(%rsp)
	leaq	(%rax,%rax,4), %rax
	movl	%r10d, 304(%rsp)
	leaq	(%rdx,%rax,8), %rax
	movl	%r8d, 300(%rsp)
	addq	%rdi, %rax
	movl	%esi, %edi
	movl	%esi, 296(%rsp)
	movl	(%r9,%rax,4), %eax
	movq	%rdx, 320(%rsp)
	movl	$0, r(%rip)
	movl	%eax, 92(%rsp)
	call	dfs
	movl	296(%rsp), %esi
	addl	92(%rsp), %eax
	leaq	r(%rip), %rdi
	movl	R(%rip), %r11d
	movl	300(%rsp), %r8d
	leaq	cost(%rip), %r9
	movl	%esi, (%rdi)
	movl	%eax, %edi
	movl	$1000000000, %eax
	movl	304(%rsp), %r10d
	cmpl	%eax, %edi
	movq	312(%rsp), %rcx
	cmovle	%edi, %eax
	cmpl	$1, %r11d
	movl	%eax, 92(%rsp)
	jle	.L19
	movl	4+r(%rip), %esi
	movq	320(%rsp), %rdx
	movl	$1, %eax
	testl	%esi, %esi
	jle	.L20
	.p2align 4,,10
	.p2align 3
.L115:
	leaq	(%rdx,%rdx,4), %rax
	movslq	%esi, %rdi
	movq	%rcx, 328(%rsp)
	leaq	(%rax,%rax,4), %rax
	movl	%r10d, 320(%rsp)
	leaq	(%rdx,%rax,8), %rax
	movl	%r8d, 312(%rsp)
	addq	%rdi, %rax
	movl	%esi, %edi
	movq	%rdx, 304(%rsp)
	movl	(%r9,%rax,4), %eax
	movl	%esi, 300(%rsp)
	movl	$0, 4+r(%rip)
	movl	%eax, 296(%rsp)
	call	dfs
	movl	92(%rsp), %ecx
	addl	296(%rsp), %eax
	leaq	cost(%rip), %r9
	movl	R(%rip), %r11d
	movl	300(%rsp), %esi
	cmpl	%eax, %ecx
	movq	304(%rsp), %rdx
	movl	312(%rsp), %r8d
	cmovle	%ecx, %eax
	cmpl	$2, %r11d
	movl	%esi, 4+r(%rip)
	movl	320(%rsp), %r10d
	movq	328(%rsp), %rcx
	movl	%eax, 92(%rsp)
	movl	$1, %eax
	jle	.L19
	movl	8+r(%rip), %esi
	testl	%esi, %esi
	jle	.L23
	.p2align 4,,10
	.p2align 3
.L116:
	leaq	(%rdx,%rdx,4), %rax
	movslq	%esi, %rdi
	movq	%rcx, 328(%rsp)
	leaq	(%rax,%rax,4), %rax
	movl	%r10d, 320(%rsp)
	leaq	(%rdx,%rax,8), %rax
	movl	%r8d, 312(%rsp)
	addq	%rdi, %rax
	movl	%esi, %edi
	movq	%rdx, 304(%rsp)
	movl	(%r9,%rax,4), %eax
	movl	%esi, 300(%rsp)
	movl	$0, 8+r(%rip)
	movl	%eax, 296(%rsp)
	call	dfs
	movl	92(%rsp), %edi
	addl	296(%rsp), %eax
	leaq	cost(%rip), %r9
	movl	R(%rip), %r11d
	movl	300(%rsp), %esi
	cmpl	%eax, %edi
	movq	304(%rsp), %rdx
	movl	312(%rsp), %r8d
	cmovle	%edi, %eax
	cmpl	$3, %r11d
	movl	%esi, 8+r(%rip)
	movl	320(%rsp), %r10d
	movq	328(%rsp), %rcx
	movl	%eax, 92(%rsp)
	movl	$1, %eax
	jg	.L24
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L117:
	leaq	(%rdx,%rdx,4), %rax
	movslq	%esi, %rdi
	movq	%rcx, 328(%rsp)
	leaq	(%rax,%rax,4), %rax
	movl	%r10d, 320(%rsp)
	leaq	(%rdx,%rax,8), %rax
	movl	%r8d, 312(%rsp)
	addq	%rdi, %rax
	movl	%esi, %edi
	movq	%rdx, 304(%rsp)
	movl	(%r9,%rax,4), %eax
	movl	%esi, 300(%rsp)
	movl	$0, 12+r(%rip)
	movl	%eax, 296(%rsp)
	call	dfs
	movl	92(%rsp), %ecx
	addl	296(%rsp), %eax
	leaq	cost(%rip), %r9
	movl	R(%rip), %r11d
	movl	300(%rsp), %esi
	cmpl	%eax, %ecx
	movq	304(%rsp), %rdx
	movl	312(%rsp), %r8d
	cmovle	%ecx, %eax
	cmpl	$4, %r11d
	movl	%esi, 12+r(%rip)
	movl	320(%rsp), %r10d
	movq	328(%rsp), %rcx
	movl	%eax, 92(%rsp)
	movl	$1, %eax
	jg	.L26
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L118:
	leaq	(%rdx,%rdx,4), %rax
	movslq	%esi, %rdi
	movq	%rcx, 328(%rsp)
	leaq	(%rax,%rax,4), %rax
	movl	%r10d, 320(%rsp)
	leaq	(%rdx,%rax,8), %rax
	movl	%r8d, 312(%rsp)
	addq	%rdi, %rax
	movl	%esi, %edi
	movq	%rdx, 304(%rsp)
	movl	(%r9,%rax,4), %eax
	movl	%esi, 300(%rsp)
	movl	$0, 16+r(%rip)
	movl	%eax, 296(%rsp)
	call	dfs
	movl	300(%rsp), %esi
	addl	296(%rsp), %eax
	leaq	cost(%rip), %r9
	movl	R(%rip), %r11d
	movq	304(%rsp), %rdx
	movl	%esi, 16+r(%rip)
	movl	92(%rsp), %esi
	movl	312(%rsp), %r8d
	movl	320(%rsp), %r10d
	cmpl	%eax, %esi
	movq	328(%rsp), %rcx
	cmovle	%esi, %eax
	cmpl	$5, %r11d
	movl	%eax, 92(%rsp)
	movl	$1, %eax
	jg	.L28
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L119:
	leaq	(%rdx,%rdx,4), %rax
	movslq	%esi, %rdi
	movq	%rcx, 328(%rsp)
	leaq	(%rax,%rax,4), %rax
	movl	%r10d, 320(%rsp)
	leaq	(%rdx,%rax,8), %rax
	movl	%r8d, 312(%rsp)
	addq	%rdi, %rax
	movl	%esi, %edi
	movq	%rdx, 304(%rsp)
	movl	(%r9,%rax,4), %eax
	movl	%esi, 300(%rsp)
	movl	$0, 20+r(%rip)
	movl	%eax, 296(%rsp)
	call	dfs
	movl	92(%rsp), %edi
	addl	296(%rsp), %eax
	leaq	cost(%rip), %r9
	movl	R(%rip), %r11d
	movl	300(%rsp), %esi
	cmpl	%eax, %edi
	movq	304(%rsp), %rdx
	movl	312(%rsp), %r8d
	cmovle	%edi, %eax
	cmpl	$6, %r11d
	movl	%esi, 20+r(%rip)
	movl	320(%rsp), %r10d
	movq	328(%rsp), %rcx
	movl	%eax, 92(%rsp)
	movl	$1, %eax
	jg	.L30
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L120:
	leaq	(%rdx,%rdx,4), %rax
	movslq	%esi, %rdi
	movq	%rcx, 328(%rsp)
	leaq	(%rax,%rax,4), %rax
	movl	%r10d, 320(%rsp)
	leaq	(%rdx,%rax,8), %rax
	movl	%r8d, 312(%rsp)
	addq	%rdi, %rax
	movl	%esi, %edi
	movl	%esi, 300(%rsp)
	movl	(%r9,%rax,4), %eax
	movq	%rdx, 304(%rsp)
	movl	$0, 24+r(%rip)
	movl	%eax, 296(%rsp)
	call	dfs
	movl	92(%rsp), %ecx
	addl	296(%rsp), %eax
	leaq	cost(%rip), %r9
	movl	R(%rip), %r11d
	movl	300(%rsp), %esi
	cmpl	%eax, %ecx
	movl	312(%rsp), %r8d
	movl	320(%rsp), %r10d
	cmovle	%ecx, %eax
	cmpl	$7, %r11d
	movl	%esi, 24+r(%rip)
	movq	328(%rsp), %rcx
	movl	%eax, 92(%rsp)
	jle	.L19
	movl	28+r(%rip), %esi
	movq	304(%rsp), %rdx
	testl	%esi, %esi
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L32:
	leaq	(%rdx,%rdx,4), %rax
	movslq	%esi, %rdi
	movq	%rcx, 320(%rsp)
	leaq	(%rax,%rax,4), %rax
	movl	%r10d, 312(%rsp)
	leaq	(%rdx,%rax,8), %rax
	movl	%r8d, 304(%rsp)
	addq	%rdi, %rax
	movl	%esi, %edi
	movl	%esi, 300(%rsp)
	movl	$0, 28+r(%rip)
	movl	(%r9,%rax,4), %eax
	movl	%eax, 296(%rsp)
	call	dfs
	movl	300(%rsp), %esi
	addl	296(%rsp), %eax
	leaq	cost(%rip), %r9
	movl	R(%rip), %r11d
	movl	304(%rsp), %r8d
	movl	%esi, 28+r(%rip)
	movl	92(%rsp), %esi
	movl	312(%rsp), %r10d
	movq	320(%rsp), %rcx
	cmpl	%eax, %esi
	cmovle	%esi, %eax
	movl	%eax, 92(%rsp)
	jmp	.L19
	.cfi_endproc
.LFE23:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	M(%rip), %rdx
	leaq	R(%rip), %rcx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	N(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	r(%rip), %r12
	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
	movq	%rbp, %rdi
	xorl	%ebx, %ebx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	R(%rip), %edx
	testl	%edx, %edx
	jle	.L126
	.p2align 4,,10
	.p2align 3
.L125:
	movq	%r12, %rsi
	xorl	%eax, %eax
	movq	%r13, %rdi
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %r12
	cmpl	%ebx, R(%rip)
	jg	.L125
.L126:
	movl	M(%rip), %eax
	movl	N(%rip), %ebx
	movl	%eax, 12(%rsp)
	testl	%ebx, %ebx
	jle	.L161
	movl	%ebx, %eax
	movl	%ebx, %r13d
	leal	1(%rbx), %r14d
	movl	$1, %esi
	shrl	$2, %eax
	andl	$-4, %r13d
	leal	-1(%rbx), %r9d
	movdqa	.LC2(%rip), %xmm0
	leal	-1(%rax), %r12d
	leaq	808+cost(%rip), %rdi
	addq	$1, %r12
	leal	1(%r13), %r15d
	movq	%rdi, %rcx
	leaq	-808(%rdi), %r11
	salq	$4, %r12
	.p2align 4,,10
	.p2align 3
.L129:
	leaq	(%r12,%rcx), %rdx
	movq	%rcx, %rax
	cmpl	$2, %r9d
	jbe	.L162
	.p2align 4,,10
	.p2align 3
.L131:
	movups	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L131
	movl	%r15d, %eax
	cmpl	%ebx, %r13d
	je	.L132
.L127:
	movslq	%esi, %rdx
	movslq	%eax, %r8
	leaq	(%rdx,%rdx,4), %r10
	leaq	(%r10,%r10,4), %r10
	leaq	(%rdx,%r10,8), %rdx
	addq	%rdx, %r8
	movl	$100000000, (%r11,%r8,4)
	leal	1(%rax), %r8d
	cmpl	%r8d, %ebx
	jl	.L132
	movslq	%r8d, %r8
	addl	$2, %eax
	addq	%rdx, %r8
	movl	$100000000, (%r11,%r8,4)
	cmpl	%eax, %ebx
	jl	.L132
	cltq
	addq	%rax, %rdx
	movl	$100000000, (%r11,%rdx,4)
.L132:
	addl	$1, %esi
	movl	$0, (%rdi)
	addq	$804, %rcx
	addq	$808, %rdi
	cmpl	%r14d, %esi
	jne	.L129
	movl	%r9d, %edx
	leaq	804+cost(%rip), %rax
	imulq	$804, %rdx, %rdx
	leaq	804(%rax), %rcx
	addq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L133:
	movl	$0, (%rax)
	addq	$804, %rax
	cmpq	%rdx, %rax
	jne	.L133
	leaq	4+cost(%rip), %r10
	movl	%ebx, %edx
	xorl	%esi, %esi
	movq	%r10, %rdi
	salq	$2, %rdx
	call	memset@PLT
	movq	%rax, %r10
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L134
.L142:
	xorl	%r14d, %r14d
	leaq	36(%rsp), %r13
	leaq	32(%rsp), %r12
	leaq	cost(%rip), %r15
	leaq	28(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L135:
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movslq	32(%rsp), %rax
	movslq	28(%rsp), %rdx
	movl	36(%rsp), %esi
	leaq	(%rax,%rax,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,8), %rcx
	addq	%rdx, %rcx
	movl	%esi, (%r15,%rcx,4)
	leaq	(%rdx,%rdx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rdx,%rcx,8), %rdx
	addq	%rdx, %rax
	cmpl	%r14d, M(%rip)
	movl	%esi, (%r15,%rax,4)
	jg	.L135
	movl	N(%rip), %ebx
	leaq	4+cost(%rip), %r10
	testl	%ebx, %ebx
	jle	.L136
.L134:
	leaq	4+cost(%rip), %r12
	movl	$804, %r9d
	movl	$1, %ebp
	.p2align 4,,10
	.p2align 3
.L140:
	movq	%r12, %r8
	movq	$-804, %rdi
	movl	$1, %r11d
	.p2align 4,,10
	.p2align 3
.L141:
	movq	%r10, %rax
	movl	$1, %ecx
	subq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L138:
	leaq	(%rax,%rdi), %rsi
	movl	804(%r8), %edx
	addl	(%rsi,%r9), %edx
	cmpl	%edx, (%rax)
	jle	.L137
	movl	%edx, (%rax)
.L137:
	addl	$1, %ecx
	addq	$4, %rax
	cmpl	%ecx, %ebx
	jge	.L138
	addl	$1, %r11d
	addq	$804, %r8
	subq	$804, %rdi
	cmpl	%r11d, %ebx
	jge	.L141
	addl	$1, %ebp
	addq	$804, %r9
	addq	$4, %r12
	cmpl	%ebp, %ebx
	jge	.L140
.L136:
	xorl	%edi, %edi
	call	dfs
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L163
	addq	$56, %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
.L162:
	.cfi_restore_state
	movl	$1, %eax
	jmp	.L127
.L161:
	cmpl	$0, 12(%rsp)
	jg	.L142
	jmp	.L136
.L163:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	cost
	.bss
	.align 32
	.type	cost, @object
	.size	cost, 161604
cost:
	.zero	161604
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 32
r:
	.zero	32
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	100000000
	.long	100000000
	.long	100000000
	.long	100000000
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>

int N,M,R,r[8],cost[201][201];

int dfs(int now){
    int i,ret,rt,tmpcost,flag;
    flag = 0;
    ret = 1000000000;
    for(i=0;i<R;i++){
        if(r[i]>0){
            rt=r[i];
            r[i]=0;
            tmpcost = cost[now][rt] + dfs(rt);
            r[i]=rt;
            if(tmpcost<ret)ret=tmpcost;
            flag=1;
        }
    }
    return (flag?ret:0);
}

int main(){
    int a,b,c;
    int i,j,k;

    scanf("%d %d %d",&N,&M,&R);
    for(i=0;i<R;i++){
        scanf("%d",&r[i]);
    }

    for(i=1;i<=N;i++){
        for(j=1;j<=N;j++){
            cost[i][j]=100000000;
        }
        cost[0][i]=cost[i][0]=cost[i][i]=0;
    }

    for(i=0;i<M;i++){
        scanf("%d %d %d",&a,&b,&c);
        cost[a][b] = cost[b][a] = c;
    }

    /* ワーシャルフロイド */
    for(k=1;k<=N;k++){
        for(i=1;i<=N;i++){
            for(j=1;j<=N;j++){
                if(cost[i][j] > cost[i][k] + cost[k][j]){
                    cost[i][j] = cost[i][k] + cost[k][j];
                }
            }
        }
    }

    printf("%d\n",dfs(0));
    return 0;
}

4 6 3
2 3 4
1 2 4
2 3 6
4 3 1
1 4 1
4 2 2
3 1 6
 5 3 2
1 3
2 3 2
1 3 6
1 2 2
 4 6 3
2 3 4
1 2 4
2 3 6
4 3 1
1 4 1
4 1 2
3 1 6
 5 3 2
1 3
2 3 2
1 3 6
1 1 2
 3 3 3
1 2 3
1 2 1
2 2 1
3 1 4
 4 6 3
2 3 4
1 2 4
2 3 6
4 4 1
1 4 1
4 2 2
3 1 6
 4 6 3
2 3 4
1 2 4
2 3 0
4 3 1
1 4 1
4 1 2
3 1 6
 3 3 2
1 3
2 3 0
0 3 6
1 2 2
 6 3 2
1 3
2 3 2
1 3 9
0 1 2
 5 3 2
1 3
2 3 2
1 3 10
1 1 2

3
 4
 7
 6
 5
 8
 1
 2
 9
 10

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

```c
#include <stdio.h>

int N,M,R,r[8],cost[201][201];

int dfs(int now){
    int i,ret,rt,tmpcost,flag;
    flag = 0;
    ret = 1000000000;
    for(i=0;i<R;i++){
        if(r[i]>0){
            rt=r[i];
            r[i]=0;
            tmpcost = cost[now][rt] + dfs(rt);
            r[i]=rt;
            if(tmpcost<ret)ret=tmpcost;
            flag=1;
        }
    }
    return (flag?ret:0);
}

int main(){
    int a,b,c;
    int i,j,k;

    scanf("%d %d %d",&N,&M,&R);
    for(i=0;i<R;i++){
        scanf("%d",&r[i]);
    }

    for(i=1;i<=N;i++){
        for(j=1;j<=N;j++){
            cost[i][j]=100000000;
        }
        cost[0][i]=cost[i][0]=cost[i][i]=0;
    }

    for(i=0;i<M;i++){
        scanf("%d %d %d",&a,&b,&c);
        cost[a][b] = cost[b][a] = c;
    }

    /* ワーシャルフロイド */
    for(k=1;k<=N;k++){
        for(i=1;i<=N;i++){
            for(j=1;j<=N;j++){
                if(cost[i][j] > cost[i][k] + cost[k][j]){
                    cost[i][j] = cost[i][k] + cost[k][j];
                }
            }
        }
    }

    printf("%d\n",dfs(0));
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 32
r:
	.zero	32
	.globl	cost
	.align 32
	.type	cost, @object
	.size	cost, 161604
cost:
	.zero	161604
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movl	%edi, -52(%rbp)
	movl	$0, -28(%rbp)
	movl	$1000000000, -32(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L2
.L5:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L3
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %ebx
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	dfs
	addl	%ebx, %eax
	movl	%eax, -20(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	r(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L4
	movl	-20(%rbp), %eax
	movl	%eax, -32(%rbp)
.L4:
	movl	$1, -28(%rbp)
.L3:
	addl	$1, -36(%rbp)
.L2:
	movl	R(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L5
	cmpl	$0, -28(%rbp)
	je	.L6
	movl	-32(%rbp), %eax
	jmp	.L8
.L6:
	movl	$0, %eax
.L8:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	R(%rip), %rax
	movq	%rax, %rcx
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L10
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -20(%rbp)
.L10:
	movl	R(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L11
	movl	$1, -20(%rbp)
	jmp	.L12
.L15:
	movl	$1, -16(%rbp)
	jmp	.L13
.L14:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	$100000000, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L13:
	movl	N(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L14
	movl	-20(%rbp), %eax
	cltq
	imulq	$808, %rax, %rax
	leaq	cost(%rip), %rdx
	movl	$0, (%rax,%rdx)
	movl	-20(%rbp), %eax
	cltq
	imulq	$808, %rax, %rax
	leaq	cost(%rip), %rdx
	movl	(%rax,%rdx), %edx
	movl	-20(%rbp), %eax
	cltq
	imulq	$804, %rax, %rax
	leaq	cost(%rip), %rcx
	movl	%edx, (%rax,%rcx)
	movl	-20(%rbp), %eax
	cltq
	imulq	$804, %rax, %rax
	leaq	cost(%rip), %rdx
	movl	(%rax,%rdx), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cost(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L12:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L15
	movl	$0, -20(%rbp)
	jmp	.L16
.L17:
	leaq	-24(%rbp), %rcx
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %ecx
	movl	-32(%rbp), %esi
	movl	-24(%rbp), %edi
	movslq	%esi, %r8
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %r9
	addq	%r9, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%r8, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	%edi, (%rdx,%rax)
	movl	-32(%rbp), %edi
	movl	-28(%rbp), %r8d
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movslq	%r8d, %rsi
	movslq	%edi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L16:
	movl	M(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L17
	movl	$1, -12(%rbp)
	jmp	.L18
.L24:
	movl	$1, -20(%rbp)
	jmp	.L19
.L23:
	movl	$1, -16(%rbp)
	jmp	.L20
.L22:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-16(%rbp), %eax
	movslq	%eax, %rdi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %r8
	addq	%r8, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jle	.L21
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L21:
	addl	$1, -16(%rbp)
.L20:
	movl	N(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L22
	addl	$1, -20(%rbp)
.L19:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L23
	addl	$1, -12(%rbp)
.L18:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L24
	movl	$0, %edi
	call	dfs
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 32
r:
	.zero	32
	.globl	cost
	.align 32
	.type	cost, @object
	.size	cost, 161604
cost:
	.zero	161604
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movl	%edi, -52(%rbp)
	movl	$0, -28(%rbp)
	movl	$1000000000, -32(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L2
.L5:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L3
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %ebx
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	dfs
	addl	%ebx, %eax
	movl	%eax, -20(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	r(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L4
	movl	-20(%rbp), %eax
	movl	%eax, -32(%rbp)
.L4:
	movl	$1, -28(%rbp)
.L3:
	addl	$1, -36(%rbp)
.L2:
	movl	R(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L5
	cmpl	$0, -28(%rbp)
	je	.L6
	movl	-32(%rbp), %eax
	jmp	.L8
.L6:
	movl	$0, %eax
.L8:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	R(%rip), %rax
	movq	%rax, %rcx
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L10
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -20(%rbp)
.L10:
	movl	R(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L11
	movl	$1, -20(%rbp)
	jmp	.L12
.L15:
	movl	$1, -16(%rbp)
	jmp	.L13
.L14:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	$100000000, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L13:
	movl	N(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L14
	movl	-20(%rbp), %eax
	cltq
	imulq	$808, %rax, %rax
	leaq	cost(%rip), %rdx
	movl	$0, (%rax,%rdx)
	movl	-20(%rbp), %eax
	cltq
	imulq	$808, %rax, %rax
	leaq	cost(%rip), %rdx
	movl	(%rax,%rdx), %edx
	movl	-20(%rbp), %eax
	cltq
	imulq	$804, %rax, %rax
	leaq	cost(%rip), %rcx
	movl	%edx, (%rax,%rcx)
	movl	-20(%rbp), %eax
	cltq
	imulq	$804, %rax, %rax
	leaq	cost(%rip), %rdx
	movl	(%rax,%rdx), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cost(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L12:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L15
	movl	$0, -20(%rbp)
	jmp	.L16
.L17:
	leaq	-24(%rbp), %rcx
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %ecx
	movl	-32(%rbp), %esi
	movl	-24(%rbp), %edi
	movslq	%esi, %r8
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %r9
	addq	%r9, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%r8, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	%edi, (%rdx,%rax)
	movl	-32(%rbp), %edi
	movl	-28(%rbp), %r8d
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movslq	%r8d, %rsi
	movslq	%edi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L16:
	movl	M(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L17
	movl	$1, -12(%rbp)
	jmp	.L18
.L24:
	movl	$1, -20(%rbp)
	jmp	.L19
.L23:
	movl	$1, -16(%rbp)
	jmp	.L20
.L22:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-16(%rbp), %eax
	movslq	%eax, %rdi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %r8
	addq	%r8, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jle	.L21
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cost(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L21:
	addl	$1, -16(%rbp)
.L20:
	movl	N(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L22
	addl	$1, -20(%rbp)
.L19:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L23
	addl	$1, -12(%rbp)
.L18:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L24
	movl	$0, %edi
	call	dfs
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
