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

```c
// AOJ 1553: Manhattan Warp Machine 1
// 2019.2.22 bal4u

#include <stdio.h>
#include <stdlib.h>

#define MAX 1300000
typedef struct { int x, c; } QUE;
QUE que[MAX]; int qsize;

#define PARENT(i) ((i)>>1)
#define LEFT(i)   ((i)<<1)
#define RIGHT(i)  (((i)<<1)+1)

void min_heapify(int i)
{
	int l, r, min;
	QUE qt;

	l = LEFT(i), r = RIGHT(i);
	if (l < qsize && que[l].c < que[i].c) min = l; else min = i;
	if (r < qsize && que[r].c < que[min].c) min = r;
	if (min != i) {
		qt = que[i], que[i] = que[min], que[min] = qt;
		min_heapify(min);
	}
}

void deq()
{
	que[0] = que[--qsize];
	min_heapify(0);
}

void enq(int x, int c)
{
	int i, min;
	QUE qt;

	i = qsize++, que[i].x = x, que[i].c = c;
	while (i > 0 && que[min = PARENT(i)].c > que[i].c) {
		qt = que[i], que[i] = que[min], que[min] = qt;
		i = min;
	}
}

int N;
int D[20], C[20];
char visited[200005];

int dijkstra(int start, int goal)
{
	int i, x, y, c;
	int lim = goal << 1;

	qsize = 0;
	enq(start, 0);
	while (qsize) {
		x = que[0].x, c = que[0].c; deq();
		if (x == goal) return c;
		if (visited[x]) continue;
		visited[x] = 1;
		for (i = 0; i < N; i++) {
			y = x + D[i];
			if (y < 200005 && visited[y] == 0) enq(y, c+C[i]);
			y = x - D[i];
			if (y > 0 && visited[y] == 0) enq(y, c+C[i]);
		}
	}
	return -1;
}

typedef struct { int d, c; } T;
T tbl[20];

int cmp(const void *a, const void *b)
{
	return ((T *)a)->c - ((T *)b)->c;
}

int main()
{
	int i, X;

	scanf("%d%d", &N, &X);
	for (i = 0; i < N; i++) scanf("%d%d", &tbl[i].d, &tbl[i].c);
	qsort(tbl, N, sizeof(T), cmp);
	for (i = 0; i < N; i++) D[i] = tbl[i].d, C[i] = tbl[i].c;
	printf("%d\n", dijkstra(0, X));
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	que
	.bss
	.align 32
	.type	que, @object
	.size	que, 10400000
que:
	.zero	10400000
	.globl	qsize
	.align 4
	.type	qsize, @object
	.size	qsize, 4
qsize:
	.zero	4
	.text
	.globl	min_heapify
	.type	min_heapify, @function
min_heapify:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	qsize(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jge	.L2
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L2
	movl	-16(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L3
.L2:
	movl	-36(%rbp), %eax
	movl	%eax, -20(%rbp)
.L3:
	movl	qsize(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L4
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-12(%rbp), %eax
	movl	%eax, -20(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	-36(%rbp), %eax
	je	.L6
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	leaq	que(%rip), %rax
	movq	(%rsi,%rax), %rax
	movq	%rax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	min_heapify
.L6:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	min_heapify, .-min_heapify
	.globl	deq
	.type	deq, @function
deq:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	qsize(%rip), %eax
	subl	$1, %eax
	movl	%eax, qsize(%rip)
	movl	qsize(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, que(%rip)
	movl	$0, %edi
	call	min_heapify
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	deq, .-deq
	.globl	enq
	.type	enq, @function
enq:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	qsize(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, qsize(%rip)
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L9
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	leaq	que(%rip), %rax
	movq	(%rsi,%rax), %rax
	movq	%rax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
.L9:
	cmpl	$0, -16(%rbp)
	jle	.L12
	movl	-16(%rbp), %eax
	sarl	%eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L11
.L12:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	enq, .-enq
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 80
D:
	.zero	80
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 80
C:
	.zero	80
	.globl	visited
	.align 32
	.type	visited, @object
	.size	visited, 200005
visited:
	.zero	200005
	.text
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-40(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -16(%rbp)
	movl	$0, qsize(%rip)
	movl	-36(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	enq
	jmp	.L14
.L22:
	movl	que(%rip), %eax
	movl	%eax, -12(%rbp)
	movl	4+que(%rip), %eax
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	deq
	movl	-12(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jne	.L15
	movl	-8(%rbp), %eax
	jmp	.L16
.L15:
	movl	-12(%rbp), %eax
	cltq
	leaq	visited(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L17
	jmp	.L14
.L17:
	movl	-12(%rbp), %eax
	cltq
	leaq	visited(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	$0, -20(%rbp)
	jmp	.L18
.L21:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$200004, -4(%rbp)
	jg	.L19
	movl	-4(%rbp), %eax
	cltq
	leaq	visited(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L19
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	enq
.L19:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L20
	movl	-4(%rbp), %eax
	cltq
	leaq	visited(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L20
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	enq
.L20:
	addl	$1, -20(%rbp)
.L18:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L21
.L14:
	movl	qsize(%rip), %eax
	testl	%eax, %eax
	jne	.L22
	movl	$-1, %eax
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	dijkstra, .-dijkstra
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 160
tbl:
	.zero	160
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	4(%rax), %edx
	movq	-16(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L26
.L27:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	tbl(%rip), %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	tbl(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L26:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L27
	movl	N(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	tbl(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -12(%rbp)
	jmp	.L28
.L29:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	D(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	C(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
.L28:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L29
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	dijkstra
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	cmp
	.type	cmp, @function
cmp:
.LFB43:
	.cfi_startproc
	endbr64
	movl	4(%rdi), %eax
	subl	4(%rsi), %eax
	ret
	.cfi_endproc
.LFE43:
	.size	cmp, .-cmp
	.p2align 4
	.globl	min_heapify
	.type	min_heapify, @function
min_heapify:
.LFB39:
	.cfi_startproc
	endbr64
	movl	qsize(%rip), %r8d
	leaq	que(%rip), %rax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%edi, %rcx
	movslq	%esi, %r9
	movl	4(%rax,%rcx,8), %r11d
	cmpl	%r11d, 4(%rax,%r9,8)
	jge	.L4
	cmpl	%edx, %r8d
	jg	.L10
	movl	%esi, %edx
.L5:
	cmpl	%edi, %edx
	je	.L3
	movslq	%edx, %rsi
	movq	(%rax,%rcx,8), %rdi
	movq	(%rax,%rsi,8), %r9
	movq	%r9, (%rax,%rcx,8)
	movq	%rdi, (%rax,%rsi,8)
	movl	%edx, %edi
.L7:
	leal	(%rdi,%rdi), %esi
	leal	1(%rsi), %edx
	cmpl	%esi, %r8d
	jg	.L11
.L4:
	cmpl	%edx, %r8d
	jle	.L3
	movslq	%edx, %rsi
	movslq	%edi, %rcx
	movl	4(%rax,%rsi,8), %esi
	cmpl	%esi, 4(%rax,%rcx,8)
	jg	.L5
.L3:
	ret
.L10:
	movslq	%edx, %r10
	movl	4(%rax,%r9,8), %r11d
	cmpl	%r11d, 4(%rax,%r10,8)
	cmovge	%esi, %edx
	jmp	.L5
	.cfi_endproc
.LFE39:
	.size	min_heapify, .-min_heapify
	.p2align 4
	.globl	deq
	.type	deq, @function
deq:
.LFB40:
	.cfi_startproc
	endbr64
	movl	qsize(%rip), %eax
	leaq	que(%rip), %rdx
	xorl	%edi, %edi
	subl	$1, %eax
	movl	%eax, qsize(%rip)
	cltq
	movq	(%rdx,%rax,8), %rax
	movq	%rax, que(%rip)
	jmp	min_heapify
	.cfi_endproc
.LFE40:
	.size	deq, .-deq
	.p2align 4
	.globl	enq
	.type	enq, @function
enq:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	qsize(%rip), %rcx
	movd	%edi, %xmm0
	movd	%esi, %xmm2
	punpckldq	%xmm2, %xmm0
	leal	1(%rcx), %edx
	movq	%rcx, %rax
	movl	%edx, qsize(%rip)
	leaq	que(%rip), %rdx
	movq	%xmm0, (%rdx,%rcx,8)
	testl	%ecx, %ecx
	jg	.L14
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L16:
	movd	(%rdx,%rcx,8), %xmm0
	movq	(%rdx,%rdi,8), %r8
	movd	%esi, %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%r8, (%rdx,%rcx,8)
	movq	%xmm0, (%rdx,%rdi,8)
	testl	%eax, %eax
	je	.L13
.L14:
	movslq	%eax, %rcx
	sarl	%eax
	movslq	%eax, %rdi
	cmpl	%esi, 4(%rdx,%rdi,8)
	jg	.L16
.L13:
	ret
.L21:
	ret
	.cfi_endproc
.LFE41:
	.size	enq, .-enq
	.p2align 4
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB42:
	.cfi_startproc
	endbr64
	movl	$1, qsize(%rip)
	movl	$1, %eax
	movl	%edi, que(%rip)
	movl	$0, 4+que(%rip)
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	visited(%rip), %r14
	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
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	que(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L25:
	testl	%eax, %eax
	je	.L45
	subl	$1, %eax
	movl	(%rbx), %r13d
	xorl	%edi, %edi
	movl	4+que(%rip), %r15d
	movl	%eax, qsize(%rip)
	cltq
	movq	(%rbx,%rax,8), %rax
	movq	%rax, (%rbx)
	call	min_heapify
	cmpl	%r13d, %ebp
	je	.L22
	movslq	%r13d, %rdx
	movl	qsize(%rip), %eax
	cmpb	$0, (%r14,%rdx)
	jne	.L25
	movb	$1, (%r14,%rdx)
	movl	N(%rip), %edx
	testl	%edx, %edx
	jle	.L25
	leaq	D(%rip), %rsi
	subl	$1, %edx
	leaq	C(%rip), %r9
	leaq	4(%rsi), %rdi
	leaq	(%rdi,%rdx,4), %r10
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L30:
	addq	$4, %rsi
	addq	$4, %r9
	cmpq	%rsi, %r10
	je	.L25
.L33:
	movl	(%rsi), %r8d
	leal	(%r8,%r13), %edx
	cmpl	$200004, %edx
	jg	.L27
	movslq	%edx, %rcx
	cmpb	$0, (%r14,%rcx)
	je	.L46
.L27:
	movl	%r13d, %edx
	subl	%r8d, %edx
	testl	%edx, %edx
	jle	.L30
	movslq	%edx, %rcx
	cmpb	$0, (%r14,%rcx)
	jne	.L30
	movl	(%r9), %edi
	movd	%edx, %xmm0
	leal	1(%rax), %r8d
	movslq	%eax, %rcx
	movl	%r8d, qsize(%rip)
	addl	%r15d, %edi
	movd	%edi, %xmm3
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, (%rbx,%rcx,8)
	testl	%eax, %eax
	jg	.L31
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L32:
	movd	(%rbx,%rdx,8), %xmm0
	movq	(%rbx,%rcx,8), %r11
	movd	%edi, %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%r11, (%rbx,%rdx,8)
	movq	%xmm0, (%rbx,%rcx,8)
	testl	%eax, %eax
	je	.L36
.L31:
	movslq	%eax, %rdx
	sarl	%eax
	movslq	%eax, %rcx
	cmpl	4(%rbx,%rcx,8), %edi
	jl	.L32
.L36:
	movl	%r8d, %eax
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L46:
	movl	(%r9), %edi
	movslq	%eax, %rcx
	leal	1(%rax), %r11d
	movl	%r11d, qsize(%rip)
	addl	%r15d, %edi
	movl	%edx, (%rbx,%rcx,8)
	movl	%edi, 4(%rbx,%rcx,8)
	testl	%eax, %eax
	jg	.L28
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L29:
	movd	(%rbx,%rdx,8), %xmm0
	movq	(%rbx,%rcx,8), %r12
	movd	%edi, %xmm2
	punpckldq	%xmm2, %xmm0
	movq	%r12, (%rbx,%rdx,8)
	movq	%xmm0, (%rbx,%rcx,8)
	testl	%eax, %eax
	je	.L35
.L28:
	movslq	%eax, %rdx
	sarl	%eax
	movslq	%eax, %rcx
	cmpl	4(%rbx,%rcx,8), %edi
	jl	.L29
.L35:
	movl	%r11d, %eax
	jmp	.L27
.L45:
	movl	$-1, %r15d
.L22:
	popq	%rbx
	.cfi_def_cfa_offset 48
	movl	%r15d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE42:
	.size	dijkstra, .-dijkstra
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB44:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	leaq	N(%rip), %rsi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	leaq	tbl(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movslq	N(%rip), %rsi
	testl	%esi, %esi
	jle	.L48
	movq	%r12, %rbx
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L49:
	movq	%rbx, %rsi
	leaq	4(%rbx), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	N(%rip), %rsi
	addl	$1, %ebp
	addq	$8, %rbx
	cmpl	%ebp, %esi
	jg	.L49
.L48:
	movl	$8, %edx
	leaq	cmp(%rip), %rcx
	movq	%r12, %rdi
	call	qsort@PLT
	movl	N(%rip), %edx
	testl	%edx, %edx
	jle	.L53
	leal	-1(%rdx), %eax
	cmpl	$2, %eax
	jbe	.L58
	movdqa	tbl(%rip), %xmm0
	movl	%edx, %eax
	shrl	$2, %eax
	movdqa	%xmm0, %xmm1
	shufps	$221, 16+tbl(%rip), %xmm0
	shufps	$136, 16+tbl(%rip), %xmm1
	movaps	%xmm0, C(%rip)
	movaps	%xmm1, D(%rip)
	cmpl	$1, %eax
	je	.L52
	movdqa	32+tbl(%rip), %xmm0
	movdqa	%xmm0, %xmm1
	shufps	$221, 48+tbl(%rip), %xmm0
	shufps	$136, 48+tbl(%rip), %xmm1
	movaps	%xmm0, 16+C(%rip)
	movaps	%xmm1, 16+D(%rip)
	cmpl	$2, %eax
	je	.L52
	movdqa	64+tbl(%rip), %xmm0
	movdqa	%xmm0, %xmm1
	shufps	$221, 80+tbl(%rip), %xmm0
	shufps	$136, 80+tbl(%rip), %xmm1
	movaps	%xmm0, 32+C(%rip)
	movaps	%xmm1, 32+D(%rip)
	cmpl	$3, %eax
	je	.L52
	movdqa	96+tbl(%rip), %xmm0
	movdqa	%xmm0, %xmm1
	shufps	$221, 112+tbl(%rip), %xmm0
	shufps	$136, 112+tbl(%rip), %xmm1
	movaps	%xmm0, 48+C(%rip)
	movaps	%xmm1, 48+D(%rip)
	cmpl	$4, %eax
	je	.L52
	movdqa	128+tbl(%rip), %xmm0
	movdqa	%xmm0, %xmm1
	shufps	$221, 144+tbl(%rip), %xmm0
	shufps	$136, 144+tbl(%rip), %xmm1
	movaps	%xmm0, 64+C(%rip)
	movaps	%xmm1, 64+D(%rip)
.L52:
	movl	%edx, %ecx
	andl	$-4, %ecx
	movl	%ecx, %eax
	cmpl	%ecx, %edx
	je	.L53
.L51:
	subl	%ecx, %edx
	leaq	D(%rip), %rdi
	leaq	C(%rip), %rsi
	cmpl	$1, %edx
	je	.L55
	leaq	(%r12,%rcx,8), %rsi
	leaq	D(%rip), %rdi
	movq	(%rsi), %xmm0
	movq	8(%rsi), %xmm1
	leaq	C(%rip), %rsi
	movdqa	%xmm0, %xmm2
	punpckldq	%xmm1, %xmm0
	punpckldq	%xmm1, %xmm2
	pshufd	$14, %xmm0, %xmm0
	movq	%xmm2, (%rdi,%rcx,4)
	movq	%xmm0, (%rsi,%rcx,4)
	movl	%edx, %ecx
	andl	$-2, %ecx
	addl	%ecx, %eax
	cmpl	%ecx, %edx
	je	.L53
.L55:
	cltq
	movl	(%r12,%rax,8), %edx
	movl	%edx, (%rdi,%rax,4)
	movl	4(%r12,%rax,8), %edx
	movl	%edx, (%rsi,%rax,4)
.L53:
	movl	4(%rsp), %esi
	xorl	%edi, %edi
	call	dijkstra
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L78
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L58:
	.cfi_restore_state
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	jmp	.L51
.L78:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE44:
	.size	main, .-main
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 160
tbl:
	.zero	160
	.globl	visited
	.align 32
	.type	visited, @object
	.size	visited, 200005
visited:
	.zero	200005
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 80
C:
	.zero	80
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 80
D:
	.zero	80
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	qsize
	.align 4
	.type	qsize, @object
	.size	qsize, 4
qsize:
	.zero	4
	.globl	que
	.align 32
	.type	que, @object
	.size	que, 10400000
que:
	.zero	10400000
	.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	cmp
	.type	cmp, @function
cmp:
.LFB43:
	.cfi_startproc
	endbr64
	movl	4(%rdi), %eax
	subl	4(%rsi), %eax
	ret
	.cfi_endproc
.LFE43:
	.size	cmp, .-cmp
	.p2align 4
	.globl	min_heapify
	.type	min_heapify, @function
min_heapify:
.LFB39:
	.cfi_startproc
	endbr64
	movl	qsize(%rip), %r8d
	leaq	que(%rip), %rax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%edi, %rcx
	movslq	%esi, %r9
	movl	4(%rax,%rcx,8), %r11d
	cmpl	%r11d, 4(%rax,%r9,8)
	jge	.L4
	cmpl	%edx, %r8d
	jg	.L10
	movl	%esi, %edx
.L5:
	cmpl	%edi, %edx
	je	.L3
	movslq	%edx, %rsi
	movq	(%rax,%rcx,8), %rdi
	movq	(%rax,%rsi,8), %r9
	movq	%r9, (%rax,%rcx,8)
	movq	%rdi, (%rax,%rsi,8)
	movl	%edx, %edi
.L7:
	leal	(%rdi,%rdi), %esi
	leal	1(%rsi), %edx
	cmpl	%esi, %r8d
	jg	.L11
.L4:
	cmpl	%edx, %r8d
	jle	.L3
	movslq	%edx, %rsi
	movslq	%edi, %rcx
	movl	4(%rax,%rsi,8), %esi
	cmpl	%esi, 4(%rax,%rcx,8)
	jg	.L5
.L3:
	ret
.L10:
	movslq	%edx, %r10
	movl	4(%rax,%r9,8), %r11d
	cmpl	%r11d, 4(%rax,%r10,8)
	cmovge	%esi, %edx
	jmp	.L5
	.cfi_endproc
.LFE39:
	.size	min_heapify, .-min_heapify
	.p2align 4
	.globl	deq
	.type	deq, @function
deq:
.LFB40:
	.cfi_startproc
	endbr64
	movl	qsize(%rip), %eax
	leaq	que(%rip), %rdx
	xorl	%edi, %edi
	subl	$1, %eax
	movl	%eax, qsize(%rip)
	cltq
	movq	(%rdx,%rax,8), %rax
	movq	%rax, que(%rip)
	jmp	min_heapify
	.cfi_endproc
.LFE40:
	.size	deq, .-deq
	.p2align 4
	.globl	enq
	.type	enq, @function
enq:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	qsize(%rip), %rcx
	movd	%edi, %xmm0
	movd	%esi, %xmm2
	punpckldq	%xmm2, %xmm0
	leal	1(%rcx), %edx
	movq	%rcx, %rax
	movl	%edx, qsize(%rip)
	leaq	que(%rip), %rdx
	movq	%xmm0, (%rdx,%rcx,8)
	testl	%ecx, %ecx
	jg	.L14
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L16:
	movd	(%rdx,%rcx,8), %xmm0
	movq	(%rdx,%rdi,8), %r8
	movd	%esi, %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%r8, (%rdx,%rcx,8)
	movq	%xmm0, (%rdx,%rdi,8)
	testl	%eax, %eax
	je	.L13
.L14:
	movslq	%eax, %rcx
	sarl	%eax
	movslq	%eax, %rdi
	cmpl	%esi, 4(%rdx,%rdi,8)
	jg	.L16
.L13:
	ret
.L21:
	ret
	.cfi_endproc
.LFE41:
	.size	enq, .-enq
	.p2align 4
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB42:
	.cfi_startproc
	endbr64
	movl	$1, qsize(%rip)
	movl	$1, %eax
	movl	%edi, que(%rip)
	movl	$0, 4+que(%rip)
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	visited(%rip), %r14
	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
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	que(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L25:
	testl	%eax, %eax
	je	.L45
	subl	$1, %eax
	movl	(%rbx), %r13d
	xorl	%edi, %edi
	movl	4+que(%rip), %r15d
	movl	%eax, qsize(%rip)
	cltq
	movq	(%rbx,%rax,8), %rax
	movq	%rax, (%rbx)
	call	min_heapify
	cmpl	%r13d, %ebp
	je	.L22
	movslq	%r13d, %rdx
	movl	qsize(%rip), %eax
	cmpb	$0, (%r14,%rdx)
	jne	.L25
	movb	$1, (%r14,%rdx)
	movl	N(%rip), %edx
	testl	%edx, %edx
	jle	.L25
	leaq	D(%rip), %rsi
	subl	$1, %edx
	leaq	C(%rip), %r9
	leaq	4(%rsi), %rdi
	leaq	(%rdi,%rdx,4), %r10
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L30:
	addq	$4, %rsi
	addq	$4, %r9
	cmpq	%rsi, %r10
	je	.L25
.L33:
	movl	(%rsi), %r8d
	leal	(%r8,%r13), %edx
	cmpl	$200004, %edx
	jg	.L27
	movslq	%edx, %rcx
	cmpb	$0, (%r14,%rcx)
	je	.L46
.L27:
	movl	%r13d, %edx
	subl	%r8d, %edx
	testl	%edx, %edx
	jle	.L30
	movslq	%edx, %rcx
	cmpb	$0, (%r14,%rcx)
	jne	.L30
	movl	(%r9), %edi
	movd	%edx, %xmm0
	leal	1(%rax), %r8d
	movslq	%eax, %rcx
	movl	%r8d, qsize(%rip)
	addl	%r15d, %edi
	movd	%edi, %xmm3
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, (%rbx,%rcx,8)
	testl	%eax, %eax
	jg	.L31
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L32:
	movd	(%rbx,%rdx,8), %xmm0
	movq	(%rbx,%rcx,8), %r11
	movd	%edi, %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%r11, (%rbx,%rdx,8)
	movq	%xmm0, (%rbx,%rcx,8)
	testl	%eax, %eax
	je	.L36
.L31:
	movslq	%eax, %rdx
	sarl	%eax
	movslq	%eax, %rcx
	cmpl	4(%rbx,%rcx,8), %edi
	jl	.L32
.L36:
	movl	%r8d, %eax
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L46:
	movl	(%r9), %edi
	movslq	%eax, %rcx
	leal	1(%rax), %r11d
	movl	%r11d, qsize(%rip)
	addl	%r15d, %edi
	movl	%edx, (%rbx,%rcx,8)
	movl	%edi, 4(%rbx,%rcx,8)
	testl	%eax, %eax
	jg	.L28
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L29:
	movd	(%rbx,%rdx,8), %xmm0
	movq	(%rbx,%rcx,8), %r12
	movd	%edi, %xmm2
	punpckldq	%xmm2, %xmm0
	movq	%r12, (%rbx,%rdx,8)
	movq	%xmm0, (%rbx,%rcx,8)
	testl	%eax, %eax
	je	.L35
.L28:
	movslq	%eax, %rdx
	sarl	%eax
	movslq	%eax, %rcx
	cmpl	4(%rbx,%rcx,8), %edi
	jl	.L29
.L35:
	movl	%r11d, %eax
	jmp	.L27
.L45:
	movl	$-1, %r15d
.L22:
	popq	%rbx
	.cfi_def_cfa_offset 48
	movl	%r15d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE42:
	.size	dijkstra, .-dijkstra
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB44:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	leaq	N(%rip), %rsi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	leaq	tbl(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movslq	N(%rip), %rsi
	testl	%esi, %esi
	jle	.L48
	movq	%r12, %rbx
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L49:
	movq	%rbx, %rsi
	leaq	4(%rbx), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	N(%rip), %rsi
	addl	$1, %ebp
	addq	$8, %rbx
	cmpl	%ebp, %esi
	jg	.L49
.L48:
	movl	$8, %edx
	leaq	cmp(%rip), %rcx
	movq	%r12, %rdi
	call	qsort@PLT
	movl	N(%rip), %edx
	testl	%edx, %edx
	jle	.L53
	leal	-1(%rdx), %eax
	cmpl	$2, %eax
	jbe	.L58
	movdqa	tbl(%rip), %xmm0
	movl	%edx, %eax
	shrl	$2, %eax
	movdqa	%xmm0, %xmm1
	shufps	$221, 16+tbl(%rip), %xmm0
	shufps	$136, 16+tbl(%rip), %xmm1
	movaps	%xmm0, C(%rip)
	movaps	%xmm1, D(%rip)
	cmpl	$1, %eax
	je	.L52
	movdqa	32+tbl(%rip), %xmm0
	movdqa	%xmm0, %xmm1
	shufps	$221, 48+tbl(%rip), %xmm0
	shufps	$136, 48+tbl(%rip), %xmm1
	movaps	%xmm0, 16+C(%rip)
	movaps	%xmm1, 16+D(%rip)
	cmpl	$2, %eax
	je	.L52
	movdqa	64+tbl(%rip), %xmm0
	movdqa	%xmm0, %xmm1
	shufps	$221, 80+tbl(%rip), %xmm0
	shufps	$136, 80+tbl(%rip), %xmm1
	movaps	%xmm0, 32+C(%rip)
	movaps	%xmm1, 32+D(%rip)
	cmpl	$3, %eax
	je	.L52
	movdqa	96+tbl(%rip), %xmm0
	movdqa	%xmm0, %xmm1
	shufps	$221, 112+tbl(%rip), %xmm0
	shufps	$136, 112+tbl(%rip), %xmm1
	movaps	%xmm0, 48+C(%rip)
	movaps	%xmm1, 48+D(%rip)
	cmpl	$4, %eax
	je	.L52
	movdqa	128+tbl(%rip), %xmm0
	movdqa	%xmm0, %xmm1
	shufps	$221, 144+tbl(%rip), %xmm0
	shufps	$136, 144+tbl(%rip), %xmm1
	movaps	%xmm0, 64+C(%rip)
	movaps	%xmm1, 64+D(%rip)
.L52:
	movl	%edx, %ecx
	andl	$-4, %ecx
	movl	%ecx, %eax
	cmpl	%ecx, %edx
	je	.L53
.L51:
	subl	%ecx, %edx
	leaq	D(%rip), %rdi
	leaq	C(%rip), %rsi
	cmpl	$1, %edx
	je	.L55
	leaq	(%r12,%rcx,8), %rsi
	leaq	D(%rip), %rdi
	movq	(%rsi), %xmm0
	movq	8(%rsi), %xmm1
	leaq	C(%rip), %rsi
	movdqa	%xmm0, %xmm2
	punpckldq	%xmm1, %xmm0
	punpckldq	%xmm1, %xmm2
	pshufd	$14, %xmm0, %xmm0
	movq	%xmm2, (%rdi,%rcx,4)
	movq	%xmm0, (%rsi,%rcx,4)
	movl	%edx, %ecx
	andl	$-2, %ecx
	addl	%ecx, %eax
	cmpl	%ecx, %edx
	je	.L53
.L55:
	cltq
	movl	(%r12,%rax,8), %edx
	movl	%edx, (%rdi,%rax,4)
	movl	4(%r12,%rax,8), %edx
	movl	%edx, (%rsi,%rax,4)
.L53:
	movl	4(%rsp), %esi
	xorl	%edi, %edi
	call	dijkstra
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L78
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L58:
	.cfi_restore_state
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	jmp	.L51
.L78:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE44:
	.size	main, .-main
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 160
tbl:
	.zero	160
	.globl	visited
	.align 32
	.type	visited, @object
	.size	visited, 200005
visited:
	.zero	200005
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 80
C:
	.zero	80
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 80
D:
	.zero	80
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	qsize
	.align 4
	.type	qsize, @object
	.size	qsize, 4
qsize:
	.zero	4
	.globl	que
	.align 32
	.type	que, @object
	.size	que, 10400000
que:
	.zero	10400000
	.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:

// AOJ 1553: Manhattan Warp Machine 1
// 2019.2.22 bal4u

#include <stdio.h>
#include <stdlib.h>

#define MAX 1300000
typedef struct { int x, c; } QUE;
QUE que[MAX]; int qsize;

#define PARENT(i) ((i)>>1)
#define LEFT(i)   ((i)<<1)
#define RIGHT(i)  (((i)<<1)+1)

void min_heapify(int i)
{
	int l, r, min;
	QUE qt;

	l = LEFT(i), r = RIGHT(i);
	if (l < qsize && que[l].c < que[i].c) min = l; else min = i;
	if (r < qsize && que[r].c < que[min].c) min = r;
	if (min != i) {
		qt = que[i], que[i] = que[min], que[min] = qt;
		min_heapify(min);
	}
}

void deq()
{
	que[0] = que[--qsize];
	min_heapify(0);
}

void enq(int x, int c)
{
	int i, min;
	QUE qt;

	i = qsize++, que[i].x = x, que[i].c = c;
	while (i > 0 && que[min = PARENT(i)].c > que[i].c) {
		qt = que[i], que[i] = que[min], que[min] = qt;
		i = min;
	}
}

int N;
int D[20], C[20];
char visited[200005];

int dijkstra(int start, int goal)
{
	int i, x, y, c;
	int lim = goal << 1;

	qsize = 0;
	enq(start, 0);
	while (qsize) {
		x = que[0].x, c = que[0].c; deq();
		if (x == goal) return c;
		if (visited[x]) continue;
		visited[x] = 1;
		for (i = 0; i < N; i++) {
			y = x + D[i];
			if (y < 200005 && visited[y] == 0) enq(y, c+C[i]);
			y = x - D[i];
			if (y > 0 && visited[y] == 0) enq(y, c+C[i]);
		}
	}
	return -1;
}

typedef struct { int d, c; } T;
T tbl[20];

int cmp(const void *a, const void *b)
{
	return ((T *)a)->c - ((T *)b)->c;
}

int main()
{
	int i, X;

	scanf("%d%d", &N, &X);
	for (i = 0; i < N; i++) scanf("%d%d", &tbl[i].d, &tbl[i].c);
	qsort(tbl, N, sizeof(T), cmp);
	for (i = 0; i < N; i++) D[i] = tbl[i].d, C[i] = tbl[i].c;
	printf("%d\n", dijkstra(0, X));
	return 0;
}


1 4
4 1
 2 12
9 1
3 4
 2 5
2 1
2 1
 2 4
1 1
 3 12
11 0
3 4
 3 12
1 0
3 4
 3 3
2 1
1 1
 2 12
9 1
6 4
 3 3
2 1
1 2
 3 12
17 0
4 4

1
 5
 -1
 4
 16
 0
 2
 6
 3
 12

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

```c
// AOJ 1553: Manhattan Warp Machine 1
// 2019.2.22 bal4u

#include <stdio.h>
#include <stdlib.h>

#define MAX 1300000
typedef struct { int x, c; } QUE;
QUE que[MAX]; int qsize;

#define PARENT(i) ((i)>>1)
#define LEFT(i)   ((i)<<1)
#define RIGHT(i)  (((i)<<1)+1)

void min_heapify(int i)
{
	int l, r, min;
	QUE qt;

	l = LEFT(i), r = RIGHT(i);
	if (l < qsize && que[l].c < que[i].c) min = l; else min = i;
	if (r < qsize && que[r].c < que[min].c) min = r;
	if (min != i) {
		qt = que[i], que[i] = que[min], que[min] = qt;
		min_heapify(min);
	}
}

void deq()
{
	que[0] = que[--qsize];
	min_heapify(0);
}

void enq(int x, int c)
{
	int i, min;
	QUE qt;

	i = qsize++, que[i].x = x, que[i].c = c;
	while (i > 0 && que[min = PARENT(i)].c > que[i].c) {
		qt = que[i], que[i] = que[min], que[min] = qt;
		i = min;
	}
}

int N;
int D[20], C[20];
char visited[200005];

int dijkstra(int start, int goal)
{
	int i, x, y, c;
	int lim = goal << 1;

	qsize = 0;
	enq(start, 0);
	while (qsize) {
		x = que[0].x, c = que[0].c; deq();
		if (x == goal) return c;
		if (visited[x]) continue;
		visited[x] = 1;
		for (i = 0; i < N; i++) {
			y = x + D[i];
			if (y < 200005 && visited[y] == 0) enq(y, c+C[i]);
			y = x - D[i];
			if (y > 0 && visited[y] == 0) enq(y, c+C[i]);
		}
	}
	return -1;
}

typedef struct { int d, c; } T;
T tbl[20];

int cmp(const void *a, const void *b)
{
	return ((T *)a)->c - ((T *)b)->c;
}

int main()
{
	int i, X;

	scanf("%d%d", &N, &X);
	for (i = 0; i < N; i++) scanf("%d%d", &tbl[i].d, &tbl[i].c);
	qsort(tbl, N, sizeof(T), cmp);
	for (i = 0; i < N; i++) D[i] = tbl[i].d, C[i] = tbl[i].c;
	printf("%d\n", dijkstra(0, X));
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	que
	.bss
	.align 32
	.type	que, @object
	.size	que, 10400000
que:
	.zero	10400000
	.globl	qsize
	.align 4
	.type	qsize, @object
	.size	qsize, 4
qsize:
	.zero	4
	.text
	.globl	min_heapify
	.type	min_heapify, @function
min_heapify:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	qsize(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jge	.L2
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L2
	movl	-16(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L3
.L2:
	movl	-36(%rbp), %eax
	movl	%eax, -20(%rbp)
.L3:
	movl	qsize(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L4
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-12(%rbp), %eax
	movl	%eax, -20(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	-36(%rbp), %eax
	je	.L6
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	leaq	que(%rip), %rax
	movq	(%rsi,%rax), %rax
	movq	%rax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	min_heapify
.L6:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	min_heapify, .-min_heapify
	.globl	deq
	.type	deq, @function
deq:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	qsize(%rip), %eax
	subl	$1, %eax
	movl	%eax, qsize(%rip)
	movl	qsize(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, que(%rip)
	movl	$0, %edi
	call	min_heapify
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	deq, .-deq
	.globl	enq
	.type	enq, @function
enq:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	qsize(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, qsize(%rip)
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L9
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	leaq	que(%rip), %rax
	movq	(%rsi,%rax), %rax
	movq	%rax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
.L9:
	cmpl	$0, -16(%rbp)
	jle	.L12
	movl	-16(%rbp), %eax
	sarl	%eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L11
.L12:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	enq, .-enq
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 80
D:
	.zero	80
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 80
C:
	.zero	80
	.globl	visited
	.align 32
	.type	visited, @object
	.size	visited, 200005
visited:
	.zero	200005
	.text
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-40(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -16(%rbp)
	movl	$0, qsize(%rip)
	movl	-36(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	enq
	jmp	.L14
.L22:
	movl	que(%rip), %eax
	movl	%eax, -12(%rbp)
	movl	4+que(%rip), %eax
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	deq
	movl	-12(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jne	.L15
	movl	-8(%rbp), %eax
	jmp	.L16
.L15:
	movl	-12(%rbp), %eax
	cltq
	leaq	visited(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L17
	jmp	.L14
.L17:
	movl	-12(%rbp), %eax
	cltq
	leaq	visited(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	$0, -20(%rbp)
	jmp	.L18
.L21:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$200004, -4(%rbp)
	jg	.L19
	movl	-4(%rbp), %eax
	cltq
	leaq	visited(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L19
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	enq
.L19:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L20
	movl	-4(%rbp), %eax
	cltq
	leaq	visited(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L20
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	enq
.L20:
	addl	$1, -20(%rbp)
.L18:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L21
.L14:
	movl	qsize(%rip), %eax
	testl	%eax, %eax
	jne	.L22
	movl	$-1, %eax
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	dijkstra, .-dijkstra
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 160
tbl:
	.zero	160
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	4(%rax), %edx
	movq	-16(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L26
.L27:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	tbl(%rip), %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	tbl(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L26:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L27
	movl	N(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	tbl(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -12(%rbp)
	jmp	.L28
.L29:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	D(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	C(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
.L28:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L29
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	dijkstra
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	que
	.bss
	.align 32
	.type	que, @object
	.size	que, 10400000
que:
	.zero	10400000
	.globl	qsize
	.align 4
	.type	qsize, @object
	.size	qsize, 4
qsize:
	.zero	4
	.text
	.globl	min_heapify
	.type	min_heapify, @function
min_heapify:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	qsize(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jge	.L2
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L2
	movl	-16(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L3
.L2:
	movl	-36(%rbp), %eax
	movl	%eax, -20(%rbp)
.L3:
	movl	qsize(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L4
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-12(%rbp), %eax
	movl	%eax, -20(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	-36(%rbp), %eax
	je	.L6
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	leaq	que(%rip), %rax
	movq	(%rsi,%rax), %rax
	movq	%rax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	min_heapify
.L6:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	min_heapify, .-min_heapify
	.globl	deq
	.type	deq, @function
deq:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	qsize(%rip), %eax
	subl	$1, %eax
	movl	%eax, qsize(%rip)
	movl	qsize(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, que(%rip)
	movl	$0, %edi
	call	min_heapify
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	deq, .-deq
	.globl	enq
	.type	enq, @function
enq:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	qsize(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, qsize(%rip)
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L9
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	leaq	que(%rip), %rax
	movq	(%rsi,%rax), %rax
	movq	%rax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
.L9:
	cmpl	$0, -16(%rbp)
	jle	.L12
	movl	-16(%rbp), %eax
	sarl	%eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L11
.L12:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	enq, .-enq
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 80
D:
	.zero	80
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 80
C:
	.zero	80
	.globl	visited
	.align 32
	.type	visited, @object
	.size	visited, 200005
visited:
	.zero	200005
	.text
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-40(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -16(%rbp)
	movl	$0, qsize(%rip)
	movl	-36(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	enq
	jmp	.L14
.L22:
	movl	que(%rip), %eax
	movl	%eax, -12(%rbp)
	movl	4+que(%rip), %eax
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	deq
	movl	-12(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jne	.L15
	movl	-8(%rbp), %eax
	jmp	.L16
.L15:
	movl	-12(%rbp), %eax
	cltq
	leaq	visited(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L17
	jmp	.L14
.L17:
	movl	-12(%rbp), %eax
	cltq
	leaq	visited(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	$0, -20(%rbp)
	jmp	.L18
.L21:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$200004, -4(%rbp)
	jg	.L19
	movl	-4(%rbp), %eax
	cltq
	leaq	visited(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L19
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	enq
.L19:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L20
	movl	-4(%rbp), %eax
	cltq
	leaq	visited(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L20
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	enq
.L20:
	addl	$1, -20(%rbp)
.L18:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L21
.L14:
	movl	qsize(%rip), %eax
	testl	%eax, %eax
	jne	.L22
	movl	$-1, %eax
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	dijkstra, .-dijkstra
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 160
tbl:
	.zero	160
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	4(%rax), %edx
	movq	-16(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L26
.L27:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	tbl(%rip), %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	tbl(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L26:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L27
	movl	N(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	tbl(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -12(%rbp)
	jmp	.L28
.L29:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	D(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	C(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
.L28:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L29
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	dijkstra
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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:
