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

```c
// AOJ 2548 Sugoroku
// 2018.2.5 bal4u

#include <stdio.h>

#define QMAX 10000
typedef struct { int t, s; } QUE;
QUE que[QMAX]; 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].t < que[i].t) min = l; else min = i;
	if (r < qsize && que[r].t < que[min].t) min = r;
	if (min != i) {
		qt = que[i], que[i] = que[min], que[min] = qt;
		min_heapify(min);
	}
}

void deq()
{
//	if (qsize == 0) return 0;
//	*n = que[0].node, *t = que[0].t, *c = que[0].c;
	que[0] = que[--qsize];
	min_heapify(0);
}

int qmax;
void enq(int s, int t)
{
	int i, min;
	QUE qt;

	i = qsize++;	if (qsize > qmax) qmax = qsize;
	que[i].s = s, que[i].t = t;
	while (i > 0 && que[min = PARENT(i)].t > que[i].t) {
		qt = que[i], que[i] = que[min], que[min] = qt;
		i = min;
	}
}

#define INF 10000
int a[7];
int tbl[302];
int to[302][100], hi[302];
dist[302];

#define getchar_unlocked()  getchar()
int in()
{
	int n = 0;
	int c = getchar_unlocked();
	if (c == '-') {
		c = getchar_unlocked();
		do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
		while (c >= '0');
		return -n;
	}
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}
 
void dijkstra(int start, int goal)
{
	int i, s, d, e;

	for (i = 0; i <= 300; i++) dist[i] = INF;
	qsize = 0;
	dist[start] = 0;
	enq(start, 0);
	while (qsize) {
		s = que[0].s, d = que[0].t+1, deq();
		if (s == goal) break;
		for (i = 0; i < hi[s]; i++) {
			e = to[s][i];
			if (d < dist[e]) dist[e] = d, enq(e, d); 
		}
	}
}

int main()
{
	int m, i, j, s, g, ni, t;
int max = 0;
	m = in();
	for (i = 1; i <= 6; i++) a[i] = in();
	s = in(), g = in();
	for (i = 1; i <= m; i++) tbl[i] = in();

	for (i = 1; i <= m; i++) for (j = 1; j <= 6; j++) {
		ni = i - a[j];
		if (ni > 0 && ni <= m) t = ni+tbl[ni], to[t][hi[t]++] = i;
		ni = i + a[j];
		if (ni > 0 && ni <= m) t = ni+tbl[ni], to[t][hi[t]++] = i;
	}

	dijkstra(g, s);

	i = s, t = dist[i];
	while (i != g) {
		j = in();
		ni = i - a[j];
		if (ni > 0 && ni <= m && dist[ni+tbl[ni]] < t) {
			i = ni+tbl[ni], t = dist[i], puts("-1"); goto next;
		}
		ni = i + a[j];
		if (ni > 0 && ni <= m && dist[ni+tbl[ni]] < t) {
			i = ni+tbl[ni], t = dist[i], puts("1"); goto next;
		}
		puts("0");
next:	fflush(stdout);
	}
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	que
	.bss
	.align 32
	.type	que, @object
	.size	que, 80000
que:
	.zero	80000
	.globl	qsize
	.align 4
	.type	qsize, @object
	.size	qsize, 4
qsize:
	.zero	4
	.text
	.globl	min_heapify
	.type	min_heapify, @function
min_heapify:
.LFB0:
	.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	que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	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	que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	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
.LFE0:
	.size	min_heapify, .-min_heapify
	.globl	deq
	.type	deq, @function
deq:
.LFB1:
	.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
.LFE1:
	.size	deq, .-deq
	.globl	qmax
	.bss
	.align 4
	.type	qmax, @object
	.size	qmax, 4
qmax:
	.zero	4
	.text
	.globl	enq
	.type	enq, @function
enq:
.LFB2:
	.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	qsize(%rip), %edx
	movl	qmax(%rip), %eax
	cmpl	%eax, %edx
	jle	.L9
	movl	qsize(%rip), %eax
	movl	%eax, qmax(%rip)
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L10
.L12:
	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)
.L10:
	cmpl	$0, -16(%rbp)
	jle	.L13
	movl	-16(%rbp), %eax
	sarl	%eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L12
.L13:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	enq, .-enq
	.globl	a
	.bss
	.align 16
	.type	a, @object
	.size	a, 28
a:
	.zero	28
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 1208
tbl:
	.zero	1208
	.globl	to
	.align 32
	.type	to, @object
	.size	to, 120800
to:
	.zero	120800
	.globl	hi
	.align 32
	.type	hi, @object
	.size	hi, 1208
hi:
	.zero	1208
	.globl	dist
	.align 32
	.type	dist, @object
	.size	dist, 1208
dist:
	.zero	1208
	.text
	.globl	in
	.type	in, @function
in:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar@PLT
	movl	%eax, -4(%rbp)
	cmpl	$45, -4(%rbp)
	jne	.L15
	call	getchar@PLT
	movl	%eax, -4(%rbp)
.L16:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L16
	movl	-8(%rbp), %eax
	negl	%eax
	jmp	.L17
.L15:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L15
	movl	-8(%rbp), %eax
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	in, .-in
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L19
.L20:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	$10000, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L19:
	cmpl	$300, -16(%rbp)
	jle	.L20
	movl	$0, qsize(%rip)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	enq
	jmp	.L21
.L27:
	movl	4+que(%rip), %eax
	movl	%eax, -12(%rbp)
	movl	que(%rip), %eax
	addl	$1, %eax
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	deq
	movl	-12(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L28
	movl	$0, -16(%rbp)
	jmp	.L24
.L26:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	to(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L25
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dist(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	enq
.L25:
	addl	$1, -16(%rbp)
.L24:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L26
.L21:
	movl	qsize(%rip), %eax
	testl	%eax, %eax
	jne	.L27
	jmp	.L29
.L28:
	nop
.L29:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	dijkstra, .-dijkstra
	.section	.rodata
.LC0:
	.string	"-1"
.LC1:
	.string	"1"
.LC2:
	.string	"0"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	$0, -20(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$1, -32(%rbp)
	jmp	.L31
.L32:
	movl	$0, %eax
	call	in
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -32(%rbp)
.L31:
	cmpl	$6, -32(%rbp)
	jle	.L32
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	movl	$1, -32(%rbp)
	jmp	.L33
.L34:
	movl	$0, %eax
	call	in
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -32(%rbp)
.L33:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L34
	movl	$1, -32(%rbp)
	jmp	.L35
.L40:
	movl	$1, -28(%rbp)
	jmp	.L36
.L39:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L37
	movl	-4(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jg	.L37
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	hi(%rip), %rcx
	movl	%edx, (%rsi,%rcx)
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	to(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L37:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L38
	movl	-4(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jg	.L38
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	hi(%rip), %rcx
	movl	%edx, (%rsi,%rcx)
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	to(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L38:
	addl	$1, -28(%rbp)
.L36:
	cmpl	$6, -28(%rbp)
	jle	.L39
	addl	$1, -32(%rbp)
.L35:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L40
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dijkstra
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	jmp	.L41
.L45:
	movl	$0, %eax
	call	in
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L42
	movl	-4(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jg	.L42
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L42
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L43
.L42:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L44
	movl	-4(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jg	.L44
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L44
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L43
.L44:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L43:
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
.L41:
	movl	-32(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jne	.L45
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	min_heapify
	.type	min_heapify, @function
min_heapify:
.LFB23:
	.cfi_startproc
	endbr64
	movl	qsize(%rip), %r8d
	leaq	que(%rip), %rax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	%edi, %rcx
	movslq	%esi, %r9
	movl	(%rax,%rcx,8), %r11d
	cmpl	%r11d, (%rax,%r9,8)
	jge	.L2
	cmpl	%edx, %r8d
	jg	.L9
	movl	%esi, %edx
.L3:
	cmpl	%edi, %edx
	je	.L1
	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
.L5:
	leal	(%rdi,%rdi), %esi
	leal	1(%rsi), %edx
	cmpl	%esi, %r8d
	jg	.L10
.L2:
	cmpl	%edx, %r8d
	jle	.L1
	movslq	%edx, %rsi
	movslq	%edi, %rcx
	movl	(%rax,%rsi,8), %esi
	cmpl	%esi, (%rax,%rcx,8)
	jg	.L3
.L1:
	ret
.L9:
	movslq	%edx, %r10
	movl	(%rax,%r9,8), %r11d
	cmpl	%r11d, (%rax,%r10,8)
	cmovge	%esi, %edx
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	min_heapify, .-min_heapify
	.p2align 4
	.globl	deq
	.type	deq, @function
deq:
.LFB24:
	.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
.LFE24:
	.size	deq, .-deq
	.p2align 4
	.globl	enq
	.type	enq, @function
enq:
.LFB25:
	.cfi_startproc
	endbr64
	movslq	qsize(%rip), %rax
	movd	%esi, %xmm0
	movd	%edi, %xmm2
	punpckldq	%xmm2, %xmm0
	leal	1(%rax), %edx
	cmpl	qmax(%rip), %edx
	movl	%edx, qsize(%rip)
	jle	.L13
	movl	%edx, qmax(%rip)
.L13:
	movslq	%eax, %rcx
	leaq	que(%rip), %rdx
	movq	%xmm0, (%rdx,%rcx,8)
	testl	%eax, %eax
	jg	.L14
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L16:
	movd	4(%rdx,%rax,8), %xmm1
	movq	(%rdx,%rcx,8), %r8
	movd	%esi, %xmm0
	punpckldq	%xmm1, %xmm0
	movq	%r8, (%rdx,%rax,8)
	movq	%xmm0, (%rdx,%rcx,8)
	testl	%edi, %edi
	je	.L12
	movl	(%rdx,%rcx,8), %esi
	movslq	%edi, %rax
.L14:
	movl	%eax, %edi
	sarl	%edi
	movslq	%edi, %rcx
	cmpl	%esi, (%rdx,%rcx,8)
	jg	.L16
.L12:
	ret
.L21:
	ret
	.cfi_endproc
.LFE25:
	.size	enq, .-enq
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	stdin(%rip), %rdi
	xorl	%r12d, %r12d
	call	getc@PLT
	cmpl	$45, %eax
	je	.L31
	.p2align 4,,10
	.p2align 3
.L23:
	movq	stdin(%rip), %rdi
	andl	$15, %eax
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
	call	getc@PLT
	cmpl	$47, %eax
	jg	.L23
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L31:
	.cfi_restore_state
	movq	stdin(%rip), %rdi
	call	getc@PLT
	.p2align 4,,10
	.p2align 3
.L24:
	movq	stdin(%rip), %rdi
	andl	$15, %eax
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
	call	getc@PLT
	cmpl	$47, %eax
	jg	.L24
	negl	%r12d
	movl	%r12d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE26:
	.size	in, .-in
	.p2align 4
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB27:
	.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
	leaq	dist(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rax
	leaq	1200(%r13), %rcx
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	movdqa	.LC0(%rip), %xmm0
	movl	%esi, 4(%rsp)
	.p2align 4,,10
	.p2align 3
.L33:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L33
	movl	$10000, 1200+dist(%rip)
	movslq	%ebp, %rax
	movl	$0, 0(%r13,%rax,4)
	movl	qmax(%rip), %eax
	testl	%eax, %eax
	jg	.L34
	movl	$1, qmax(%rip)
	.p2align 4,,10
	.p2align 3
.L34:
	movl	%ebp, 4+que(%rip)
	xorl	%r15d, %r15d
	movl	$1, %eax
	leaq	que(%rip), %rbx
	leaq	hi(%rip), %r12
	leaq	to(%rip), %r14
	movl	$0, que(%rip)
	.p2align 4,,10
	.p2align 3
.L42:
	subl	$1, %eax
	xorl	%edi, %edi
	addl	$1, %r15d
	movl	%eax, qsize(%rip)
	cltq
	movq	(%rbx,%rax,8), %rax
	movq	%rax, (%rbx)
	call	min_heapify
	cmpl	%ebp, 4(%rsp)
	je	.L32
	movslq	%ebp, %rdx
	movl	qsize(%rip), %eax
	movl	(%r12,%rdx,4), %ecx
	testl	%ecx, %ecx
	jle	.L36
	leaq	(%rdx,%rdx,4), %rdx
	subl	$1, %ecx
	leaq	4+to(%rip), %rdi
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rdx, %rsi
	leaq	(%rcx,%rdx,4), %rdx
	salq	$4, %rsi
	leaq	(%rdi,%rdx,4), %r9
	addq	%r14, %rsi
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L37:
	addq	$4, %rsi
	cmpq	%r9, %rsi
	je	.L36
.L41:
	movd	(%rsi), %xmm2
	movslq	(%rsi), %rdx
	movd	%r15d, %xmm0
	punpckldq	%xmm2, %xmm0
	cmpl	%r15d, 0(%r13,%rdx,4)
	jle	.L37
	leal	1(%rax), %edi
	cmpl	qmax(%rip), %edi
	movl	%r15d, 0(%r13,%rdx,4)
	movl	%edi, qsize(%rip)
	jle	.L38
	movl	%edi, qmax(%rip)
.L38:
	movslq	%eax, %rdx
	movq	%xmm0, (%rbx,%rdx,8)
	testl	%eax, %eax
	jg	.L39
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L40:
	movd	4(%rbx,%rdx,8), %xmm1
	movq	(%rbx,%rcx,8), %r10
	movd	%r15d, %xmm0
	punpckldq	%xmm1, %xmm0
	movq	%r10, (%rbx,%rdx,8)
	movq	%xmm0, (%rbx,%rcx,8)
	testl	%eax, %eax
	je	.L43
.L39:
	movslq	%eax, %rdx
	sarl	%eax
	movslq	%eax, %rcx
	cmpl	(%rbx,%rcx,8), %r15d
	jl	.L40
.L43:
	addq	$4, %rsi
	movl	%edi, %eax
	cmpq	%r9, %rsi
	jne	.L41
.L36:
	testl	%eax, %eax
	je	.L32
	movl	(%rbx), %r15d
	movl	4+que(%rip), %ebp
	jmp	.L42
.L32:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE27:
	.size	dijkstra, .-dijkstra
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"-1"
.LC2:
	.string	"1"
.LC3:
	.string	"0"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB28:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	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
	leaq	a(%rip), %rbx
	leaq	24(%rbx), %rbp
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	call	in
	movl	%eax, %r15d
	.p2align 4,,10
	.p2align 3
.L55:
	movq	stdin(%rip), %rdi
	xorl	%r12d, %r12d
	call	getc@PLT
	cmpl	$45, %eax
	je	.L183
	.p2align 4,,10
	.p2align 3
.L52:
	movq	stdin(%rip), %rdi
	andl	$15, %eax
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
	call	getc@PLT
	cmpl	$47, %eax
	jg	.L52
	movl	%r12d, 4(%rbx)
	addq	$4, %rbx
	cmpq	%rbx, %rbp
	jne	.L55
.L189:
	xorl	%eax, %eax
	call	in
	movl	%eax, 140(%rsp)
	xorl	%eax, %eax
	call	in
	movl	%eax, 136(%rsp)
	testl	%r15d, %r15d
	jle	.L56
	movl	$1, %ebp
	leaq	tbl(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L60:
	movq	stdin(%rip), %rdi
	xorl	%r12d, %r12d
	call	getc@PLT
	cmpl	$45, %eax
	je	.L184
	.p2align 4,,10
	.p2align 3
.L57:
	movq	stdin(%rip), %rdi
	andl	$15, %eax
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
	call	getc@PLT
	cmpl	$47, %eax
	jg	.L57
	movl	%r12d, (%rbx,%rbp,4)
	addq	$1, %rbp
	cmpl	%ebp, %r15d
	jge	.L60
.L188:
	movl	24+a(%rip), %r13d
	movl	20+a(%rip), %esi
	movl	$1, %edi
	movl	12+a(%rip), %r14d
	movl	%edi, %r11d
	movl	%edi, %ebp
	movl	%edi, %r8d
	leal	1(%r13), %eax
	movl	4+a(%rip), %edx
	movl	%edi, %r9d
	movl	%edi, %r10d
	movl	%eax, 28(%rsp)
	leal	1(%rsi), %eax
	movl	8+a(%rip), %ecx
	subl	%r14d, %r10d
	movl	%eax, 24(%rsp)
	movl	16+a(%rip), %eax
	subl	%edx, %r11d
	subl	%esi, %r8d
	subl	%ecx, %edi
	subl	16+a(%rip), %r9d
	leal	1(%rcx), %r12d
	subl	%r13d, %ebp
	addl	$1, %eax
	movl	%eax, 20(%rsp)
	leal	1(%r14), %eax
	movl	%eax, 16(%rsp)
	leal	1(%rdx), %eax
	movl	%eax, 12(%rsp)
	movslq	%r15d, %rax
	movq	%rax, 32(%rsp)
	movslq	%r11d, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 40(%rsp)
	movslq	%edx, %rax
	xorl	%edx, %edx
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 48(%rsp)
	movslq	%edi, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 56(%rsp)
	movslq	%ecx, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 64(%rsp)
	movslq	%r10d, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 72(%rsp)
	movslq	%r14d, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 80(%rsp)
	movslq	%r9d, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 88(%rsp)
	movslq	16+a(%rip), %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 96(%rsp)
	movslq	%r8d, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 104(%rsp)
	movslq	%esi, %rax
	leaq	to(%rip), %rsi
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 112(%rsp)
	movslq	%ebp, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 120(%rsp)
	movslq	%r13d, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 128(%rsp)
	leaq	hi(%rip), %rax
	.p2align 4,,10
	.p2align 3
.L73:
	leal	1(%rdx), %ecx
	testl	%r11d, %r11d
	jle	.L61
	cmpl	%r11d, %r15d
	jl	.L61
	movq	40(%rsp), %r14
	movl	(%r14,%rdx,4), %ebx
	addl	%r11d, %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L61:
	movl	12(%rsp), %ebx
	cmpl	%r15d, %ebx
	jg	.L62
	testl	%ebx, %ebx
	jle	.L62
	movq	48(%rsp), %r14
	addl	4(%r14,%rdx,4), %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L62:
	testl	%edi, %edi
	jle	.L63
	cmpl	%edi, %r15d
	jl	.L63
	movq	56(%rsp), %r14
	movl	(%r14,%rdx,4), %ebx
	addl	%edi, %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L63:
	testl	%r12d, %r12d
	jle	.L64
	cmpl	%r12d, %r15d
	jl	.L64
	movq	64(%rsp), %r14
	movl	4(%r14,%rdx,4), %ebx
	addl	%r12d, %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L64:
	testl	%r10d, %r10d
	jle	.L65
	cmpl	%r10d, %r15d
	jl	.L65
	movq	72(%rsp), %r14
	movl	(%r14,%rdx,4), %ebx
	addl	%r10d, %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L65:
	movl	16(%rsp), %ebx
	testl	%ebx, %ebx
	jle	.L66
	cmpl	%ebx, %r15d
	jl	.L66
	movq	80(%rsp), %r14
	addl	4(%r14,%rdx,4), %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L66:
	testl	%r9d, %r9d
	jle	.L67
	cmpl	%r9d, %r15d
	jl	.L67
	movq	88(%rsp), %r14
	movl	(%r14,%rdx,4), %ebx
	addl	%r9d, %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L67:
	movl	20(%rsp), %ebx
	testl	%ebx, %ebx
	jle	.L68
	cmpl	%ebx, %r15d
	jl	.L68
	movq	96(%rsp), %r14
	addl	4(%r14,%rdx,4), %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L68:
	testl	%r8d, %r8d
	jle	.L69
	cmpl	%r8d, %r15d
	jl	.L69
	movq	104(%rsp), %r14
	movl	(%r14,%rdx,4), %ebx
	addl	%r8d, %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L69:
	movl	24(%rsp), %ebx
	testl	%ebx, %ebx
	jle	.L70
	cmpl	%ebx, %r15d
	jl	.L70
	movq	112(%rsp), %r14
	addl	4(%r14,%rdx,4), %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L70:
	testl	%ebp, %ebp
	jle	.L71
	cmpl	%ebp, %r15d
	jl	.L71
	movq	120(%rsp), %r14
	movl	(%r14,%rdx,4), %ebx
	addl	%ebp, %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L71:
	movl	28(%rsp), %ebx
	testl	%ebx, %ebx
	jle	.L72
	cmpl	%ebx, %r15d
	jl	.L72
	movq	128(%rsp), %r14
	addl	4(%r14,%rdx,4), %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L72:
	addl	$1, 28(%rsp)
	addq	$1, %rdx
	addl	$1, %r11d
	addl	$1, %ebp
	addl	$1, 24(%rsp)
	addl	$1, %r8d
	addl	$1, %r9d
	addl	$1, %edi
	addl	$1, 20(%rsp)
	addl	$1, %r10d
	addl	$1, %r12d
	addl	$1, 16(%rsp)
	addl	$1, 12(%rsp)
	cmpq	%rdx, 32(%rsp)
	jne	.L73
.L56:
	movl	140(%rsp), %r14d
	movl	136(%rsp), %r13d
	leaq	dist(%rip), %rbp
	movl	%r14d, %esi
	movl	%r13d, %edi
	call	dijkstra
	movslq	%r14d, %rax
	movl	0(%rbp,%rax,4), %ebx
	cmpl	%r13d, %r14d
	je	.L74
	movl	%ebx, 12(%rsp)
	leaq	.LC3(%rip), %r13
	leaq	tbl(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L81:
	movq	stdin(%rip), %rdi
	xorl	%ebx, %ebx
	call	getc@PLT
	cmpl	$45, %eax
	je	.L185
	.p2align 4,,10
	.p2align 3
.L75:
	movq	stdin(%rip), %rdi
	andl	$15, %eax
	leal	(%rbx,%rbx,4), %edx
	leal	(%rax,%rdx,2), %ebx
	call	getc@PLT
	cmpl	$47, %eax
	jg	.L75
.L77:
	movslq	%ebx, %rdx
	leaq	a(%rip), %rax
	movl	(%rax,%rdx,4), %eax
	movl	%r14d, %edx
	subl	%eax, %edx
	testl	%edx, %edx
	jle	.L78
	cmpl	%edx, %r15d
	jl	.L78
	movslq	%edx, %rcx
	addl	(%r12,%rcx,4), %edx
	movslq	%edx, %rcx
	movl	0(%rbp,%rcx,4), %ecx
	cmpl	12(%rsp), %ecx
	jl	.L186
.L78:
	addl	%r14d, %eax
	testl	%eax, %eax
	jle	.L80
	cmpl	%eax, %r15d
	jl	.L80
	movslq	%eax, %rdx
	addl	(%r12,%rdx,4), %eax
	movl	%eax, %edx
	cltq
	movl	0(%rbp,%rax,4), %ecx
	cmpl	12(%rsp), %ecx
	jl	.L187
.L80:
	movq	%r13, %rdi
	call	puts@PLT
.L79:
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	cmpl	136(%rsp), %r14d
	jne	.L81
.L74:
	addq	$152, %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
	.p2align 4,,10
	.p2align 3
.L187:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	movl	%ecx, 12(%rsp)
	movl	%edx, 16(%rsp)
	call	puts@PLT
	movl	16(%rsp), %r14d
	jmp	.L79
	.p2align 4,,10
	.p2align 3
.L185:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	.p2align 4,,10
	.p2align 3
.L76:
	movq	stdin(%rip), %rdi
	andl	$15, %eax
	leal	(%rbx,%rbx,4), %edx
	leal	(%rax,%rdx,2), %ebx
	call	getc@PLT
	cmpl	$47, %eax
	jg	.L76
	negl	%ebx
	jmp	.L77
	.p2align 4,,10
	.p2align 3
.L184:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	.p2align 4,,10
	.p2align 3
.L58:
	movq	stdin(%rip), %rdi
	andl	$15, %eax
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
	call	getc@PLT
	cmpl	$47, %eax
	jg	.L58
	negl	%r12d
	movl	%r12d, (%rbx,%rbp,4)
	addq	$1, %rbp
	cmpl	%ebp, %r15d
	jge	.L60
	jmp	.L188
	.p2align 4,,10
	.p2align 3
.L186:
	leaq	.LC1(%rip), %rdi
	movl	%ecx, 12(%rsp)
	movl	%edx, 16(%rsp)
	call	puts@PLT
	movl	16(%rsp), %r14d
	jmp	.L79
	.p2align 4,,10
	.p2align 3
.L183:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	.p2align 4,,10
	.p2align 3
.L53:
	movq	stdin(%rip), %rdi
	andl	$15, %eax
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
	call	getc@PLT
	cmpl	$47, %eax
	jg	.L53
	negl	%r12d
	addq	$4, %rbx
	movl	%r12d, (%rbx)
	cmpq	%rbx, %rbp
	jne	.L55
	jmp	.L189
	.cfi_endproc
.LFE28:
	.size	main, .-main
	.globl	dist
	.bss
	.align 32
	.type	dist, @object
	.size	dist, 1208
dist:
	.zero	1208
	.globl	hi
	.align 32
	.type	hi, @object
	.size	hi, 1208
hi:
	.zero	1208
	.globl	to
	.align 32
	.type	to, @object
	.size	to, 120800
to:
	.zero	120800
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 1208
tbl:
	.zero	1208
	.globl	a
	.align 16
	.type	a, @object
	.size	a, 28
a:
	.zero	28
	.globl	qmax
	.align 4
	.type	qmax, @object
	.size	qmax, 4
qmax:
	.zero	4
	.globl	qsize
	.align 4
	.type	qsize, @object
	.size	qsize, 4
qsize:
	.zero	4
	.globl	que
	.align 32
	.type	que, @object
	.size	que, 80000
que:
	.zero	80000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	10000
	.long	10000
	.long	10000
	.long	10000
	.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	min_heapify
	.type	min_heapify, @function
min_heapify:
.LFB23:
	.cfi_startproc
	endbr64
	movl	qsize(%rip), %r8d
	leaq	que(%rip), %rax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	%edi, %rcx
	movslq	%esi, %r9
	movl	(%rax,%rcx,8), %r11d
	cmpl	%r11d, (%rax,%r9,8)
	jge	.L2
	cmpl	%edx, %r8d
	jg	.L9
	movl	%esi, %edx
.L3:
	cmpl	%edi, %edx
	je	.L1
	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
.L5:
	leal	(%rdi,%rdi), %esi
	leal	1(%rsi), %edx
	cmpl	%esi, %r8d
	jg	.L10
.L2:
	cmpl	%edx, %r8d
	jle	.L1
	movslq	%edx, %rsi
	movslq	%edi, %rcx
	movl	(%rax,%rsi,8), %esi
	cmpl	%esi, (%rax,%rcx,8)
	jg	.L3
.L1:
	ret
.L9:
	movslq	%edx, %r10
	movl	(%rax,%r9,8), %r11d
	cmpl	%r11d, (%rax,%r10,8)
	cmovge	%esi, %edx
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	min_heapify, .-min_heapify
	.p2align 4
	.globl	deq
	.type	deq, @function
deq:
.LFB24:
	.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
.LFE24:
	.size	deq, .-deq
	.p2align 4
	.globl	enq
	.type	enq, @function
enq:
.LFB25:
	.cfi_startproc
	endbr64
	movslq	qsize(%rip), %rax
	movd	%esi, %xmm0
	movd	%edi, %xmm2
	punpckldq	%xmm2, %xmm0
	leal	1(%rax), %edx
	cmpl	qmax(%rip), %edx
	movl	%edx, qsize(%rip)
	jle	.L13
	movl	%edx, qmax(%rip)
.L13:
	movslq	%eax, %rcx
	leaq	que(%rip), %rdx
	movq	%xmm0, (%rdx,%rcx,8)
	testl	%eax, %eax
	jg	.L14
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L16:
	movd	4(%rdx,%rax,8), %xmm1
	movq	(%rdx,%rcx,8), %r8
	movd	%esi, %xmm0
	punpckldq	%xmm1, %xmm0
	movq	%r8, (%rdx,%rax,8)
	movq	%xmm0, (%rdx,%rcx,8)
	testl	%edi, %edi
	je	.L12
	movl	(%rdx,%rcx,8), %esi
	movslq	%edi, %rax
.L14:
	movl	%eax, %edi
	sarl	%edi
	movslq	%edi, %rcx
	cmpl	%esi, (%rdx,%rcx,8)
	jg	.L16
.L12:
	ret
.L21:
	ret
	.cfi_endproc
.LFE25:
	.size	enq, .-enq
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	stdin(%rip), %rdi
	xorl	%r12d, %r12d
	call	getc@PLT
	cmpl	$45, %eax
	je	.L31
	.p2align 4,,10
	.p2align 3
.L23:
	movq	stdin(%rip), %rdi
	andl	$15, %eax
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
	call	getc@PLT
	cmpl	$47, %eax
	jg	.L23
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L31:
	.cfi_restore_state
	movq	stdin(%rip), %rdi
	call	getc@PLT
	.p2align 4,,10
	.p2align 3
.L24:
	movq	stdin(%rip), %rdi
	andl	$15, %eax
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
	call	getc@PLT
	cmpl	$47, %eax
	jg	.L24
	negl	%r12d
	movl	%r12d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE26:
	.size	in, .-in
	.p2align 4
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB27:
	.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
	leaq	dist(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rax
	leaq	1200(%r13), %rcx
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	movdqa	.LC0(%rip), %xmm0
	movl	%esi, 4(%rsp)
	.p2align 4,,10
	.p2align 3
.L33:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L33
	movl	$10000, 1200+dist(%rip)
	movslq	%ebp, %rax
	movl	$0, 0(%r13,%rax,4)
	movl	qmax(%rip), %eax
	testl	%eax, %eax
	jg	.L34
	movl	$1, qmax(%rip)
	.p2align 4,,10
	.p2align 3
.L34:
	movl	%ebp, 4+que(%rip)
	xorl	%r15d, %r15d
	movl	$1, %eax
	leaq	que(%rip), %rbx
	leaq	hi(%rip), %r12
	leaq	to(%rip), %r14
	movl	$0, que(%rip)
	.p2align 4,,10
	.p2align 3
.L42:
	subl	$1, %eax
	xorl	%edi, %edi
	addl	$1, %r15d
	movl	%eax, qsize(%rip)
	cltq
	movq	(%rbx,%rax,8), %rax
	movq	%rax, (%rbx)
	call	min_heapify
	cmpl	%ebp, 4(%rsp)
	je	.L32
	movslq	%ebp, %rdx
	movl	qsize(%rip), %eax
	movl	(%r12,%rdx,4), %ecx
	testl	%ecx, %ecx
	jle	.L36
	leaq	(%rdx,%rdx,4), %rdx
	subl	$1, %ecx
	leaq	4+to(%rip), %rdi
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rdx, %rsi
	leaq	(%rcx,%rdx,4), %rdx
	salq	$4, %rsi
	leaq	(%rdi,%rdx,4), %r9
	addq	%r14, %rsi
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L37:
	addq	$4, %rsi
	cmpq	%r9, %rsi
	je	.L36
.L41:
	movd	(%rsi), %xmm2
	movslq	(%rsi), %rdx
	movd	%r15d, %xmm0
	punpckldq	%xmm2, %xmm0
	cmpl	%r15d, 0(%r13,%rdx,4)
	jle	.L37
	leal	1(%rax), %edi
	cmpl	qmax(%rip), %edi
	movl	%r15d, 0(%r13,%rdx,4)
	movl	%edi, qsize(%rip)
	jle	.L38
	movl	%edi, qmax(%rip)
.L38:
	movslq	%eax, %rdx
	movq	%xmm0, (%rbx,%rdx,8)
	testl	%eax, %eax
	jg	.L39
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L40:
	movd	4(%rbx,%rdx,8), %xmm1
	movq	(%rbx,%rcx,8), %r10
	movd	%r15d, %xmm0
	punpckldq	%xmm1, %xmm0
	movq	%r10, (%rbx,%rdx,8)
	movq	%xmm0, (%rbx,%rcx,8)
	testl	%eax, %eax
	je	.L43
.L39:
	movslq	%eax, %rdx
	sarl	%eax
	movslq	%eax, %rcx
	cmpl	(%rbx,%rcx,8), %r15d
	jl	.L40
.L43:
	addq	$4, %rsi
	movl	%edi, %eax
	cmpq	%r9, %rsi
	jne	.L41
.L36:
	testl	%eax, %eax
	je	.L32
	movl	(%rbx), %r15d
	movl	4+que(%rip), %ebp
	jmp	.L42
.L32:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE27:
	.size	dijkstra, .-dijkstra
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"-1"
.LC2:
	.string	"1"
.LC3:
	.string	"0"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB28:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	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
	leaq	a(%rip), %rbx
	leaq	24(%rbx), %rbp
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	call	in
	movl	%eax, %r15d
	.p2align 4,,10
	.p2align 3
.L55:
	movq	stdin(%rip), %rdi
	xorl	%r12d, %r12d
	call	getc@PLT
	cmpl	$45, %eax
	je	.L183
	.p2align 4,,10
	.p2align 3
.L52:
	movq	stdin(%rip), %rdi
	andl	$15, %eax
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
	call	getc@PLT
	cmpl	$47, %eax
	jg	.L52
	movl	%r12d, 4(%rbx)
	addq	$4, %rbx
	cmpq	%rbx, %rbp
	jne	.L55
.L189:
	xorl	%eax, %eax
	call	in
	movl	%eax, 140(%rsp)
	xorl	%eax, %eax
	call	in
	movl	%eax, 136(%rsp)
	testl	%r15d, %r15d
	jle	.L56
	movl	$1, %ebp
	leaq	tbl(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L60:
	movq	stdin(%rip), %rdi
	xorl	%r12d, %r12d
	call	getc@PLT
	cmpl	$45, %eax
	je	.L184
	.p2align 4,,10
	.p2align 3
.L57:
	movq	stdin(%rip), %rdi
	andl	$15, %eax
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
	call	getc@PLT
	cmpl	$47, %eax
	jg	.L57
	movl	%r12d, (%rbx,%rbp,4)
	addq	$1, %rbp
	cmpl	%ebp, %r15d
	jge	.L60
.L188:
	movl	24+a(%rip), %r13d
	movl	20+a(%rip), %esi
	movl	$1, %edi
	movl	12+a(%rip), %r14d
	movl	%edi, %r11d
	movl	%edi, %ebp
	movl	%edi, %r8d
	leal	1(%r13), %eax
	movl	4+a(%rip), %edx
	movl	%edi, %r9d
	movl	%edi, %r10d
	movl	%eax, 28(%rsp)
	leal	1(%rsi), %eax
	movl	8+a(%rip), %ecx
	subl	%r14d, %r10d
	movl	%eax, 24(%rsp)
	movl	16+a(%rip), %eax
	subl	%edx, %r11d
	subl	%esi, %r8d
	subl	%ecx, %edi
	subl	16+a(%rip), %r9d
	leal	1(%rcx), %r12d
	subl	%r13d, %ebp
	addl	$1, %eax
	movl	%eax, 20(%rsp)
	leal	1(%r14), %eax
	movl	%eax, 16(%rsp)
	leal	1(%rdx), %eax
	movl	%eax, 12(%rsp)
	movslq	%r15d, %rax
	movq	%rax, 32(%rsp)
	movslq	%r11d, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 40(%rsp)
	movslq	%edx, %rax
	xorl	%edx, %edx
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 48(%rsp)
	movslq	%edi, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 56(%rsp)
	movslq	%ecx, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 64(%rsp)
	movslq	%r10d, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 72(%rsp)
	movslq	%r14d, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 80(%rsp)
	movslq	%r9d, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 88(%rsp)
	movslq	16+a(%rip), %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 96(%rsp)
	movslq	%r8d, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 104(%rsp)
	movslq	%esi, %rax
	leaq	to(%rip), %rsi
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 112(%rsp)
	movslq	%ebp, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 120(%rsp)
	movslq	%r13d, %rax
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, 128(%rsp)
	leaq	hi(%rip), %rax
	.p2align 4,,10
	.p2align 3
.L73:
	leal	1(%rdx), %ecx
	testl	%r11d, %r11d
	jle	.L61
	cmpl	%r11d, %r15d
	jl	.L61
	movq	40(%rsp), %r14
	movl	(%r14,%rdx,4), %ebx
	addl	%r11d, %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L61:
	movl	12(%rsp), %ebx
	cmpl	%r15d, %ebx
	jg	.L62
	testl	%ebx, %ebx
	jle	.L62
	movq	48(%rsp), %r14
	addl	4(%r14,%rdx,4), %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L62:
	testl	%edi, %edi
	jle	.L63
	cmpl	%edi, %r15d
	jl	.L63
	movq	56(%rsp), %r14
	movl	(%r14,%rdx,4), %ebx
	addl	%edi, %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L63:
	testl	%r12d, %r12d
	jle	.L64
	cmpl	%r12d, %r15d
	jl	.L64
	movq	64(%rsp), %r14
	movl	4(%r14,%rdx,4), %ebx
	addl	%r12d, %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L64:
	testl	%r10d, %r10d
	jle	.L65
	cmpl	%r10d, %r15d
	jl	.L65
	movq	72(%rsp), %r14
	movl	(%r14,%rdx,4), %ebx
	addl	%r10d, %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L65:
	movl	16(%rsp), %ebx
	testl	%ebx, %ebx
	jle	.L66
	cmpl	%ebx, %r15d
	jl	.L66
	movq	80(%rsp), %r14
	addl	4(%r14,%rdx,4), %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L66:
	testl	%r9d, %r9d
	jle	.L67
	cmpl	%r9d, %r15d
	jl	.L67
	movq	88(%rsp), %r14
	movl	(%r14,%rdx,4), %ebx
	addl	%r9d, %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L67:
	movl	20(%rsp), %ebx
	testl	%ebx, %ebx
	jle	.L68
	cmpl	%ebx, %r15d
	jl	.L68
	movq	96(%rsp), %r14
	addl	4(%r14,%rdx,4), %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L68:
	testl	%r8d, %r8d
	jle	.L69
	cmpl	%r8d, %r15d
	jl	.L69
	movq	104(%rsp), %r14
	movl	(%r14,%rdx,4), %ebx
	addl	%r8d, %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L69:
	movl	24(%rsp), %ebx
	testl	%ebx, %ebx
	jle	.L70
	cmpl	%ebx, %r15d
	jl	.L70
	movq	112(%rsp), %r14
	addl	4(%r14,%rdx,4), %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L70:
	testl	%ebp, %ebp
	jle	.L71
	cmpl	%ebp, %r15d
	jl	.L71
	movq	120(%rsp), %r14
	movl	(%r14,%rdx,4), %ebx
	addl	%ebp, %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L71:
	movl	28(%rsp), %ebx
	testl	%ebx, %ebx
	jle	.L72
	cmpl	%ebx, %r15d
	jl	.L72
	movq	128(%rsp), %r14
	addl	4(%r14,%rdx,4), %ebx
	movslq	%ebx, %rbx
	movslq	(%rax,%rbx,4), %r13
	leal	1(%r13), %r14d
	movl	%r14d, (%rax,%rbx,4)
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	0(%r13,%rbx,4), %rbx
	movl	%ecx, (%rsi,%rbx,4)
.L72:
	addl	$1, 28(%rsp)
	addq	$1, %rdx
	addl	$1, %r11d
	addl	$1, %ebp
	addl	$1, 24(%rsp)
	addl	$1, %r8d
	addl	$1, %r9d
	addl	$1, %edi
	addl	$1, 20(%rsp)
	addl	$1, %r10d
	addl	$1, %r12d
	addl	$1, 16(%rsp)
	addl	$1, 12(%rsp)
	cmpq	%rdx, 32(%rsp)
	jne	.L73
.L56:
	movl	140(%rsp), %r14d
	movl	136(%rsp), %r13d
	leaq	dist(%rip), %rbp
	movl	%r14d, %esi
	movl	%r13d, %edi
	call	dijkstra
	movslq	%r14d, %rax
	movl	0(%rbp,%rax,4), %ebx
	cmpl	%r13d, %r14d
	je	.L74
	movl	%ebx, 12(%rsp)
	leaq	.LC3(%rip), %r13
	leaq	tbl(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L81:
	movq	stdin(%rip), %rdi
	xorl	%ebx, %ebx
	call	getc@PLT
	cmpl	$45, %eax
	je	.L185
	.p2align 4,,10
	.p2align 3
.L75:
	movq	stdin(%rip), %rdi
	andl	$15, %eax
	leal	(%rbx,%rbx,4), %edx
	leal	(%rax,%rdx,2), %ebx
	call	getc@PLT
	cmpl	$47, %eax
	jg	.L75
.L77:
	movslq	%ebx, %rdx
	leaq	a(%rip), %rax
	movl	(%rax,%rdx,4), %eax
	movl	%r14d, %edx
	subl	%eax, %edx
	testl	%edx, %edx
	jle	.L78
	cmpl	%edx, %r15d
	jl	.L78
	movslq	%edx, %rcx
	addl	(%r12,%rcx,4), %edx
	movslq	%edx, %rcx
	movl	0(%rbp,%rcx,4), %ecx
	cmpl	12(%rsp), %ecx
	jl	.L186
.L78:
	addl	%r14d, %eax
	testl	%eax, %eax
	jle	.L80
	cmpl	%eax, %r15d
	jl	.L80
	movslq	%eax, %rdx
	addl	(%r12,%rdx,4), %eax
	movl	%eax, %edx
	cltq
	movl	0(%rbp,%rax,4), %ecx
	cmpl	12(%rsp), %ecx
	jl	.L187
.L80:
	movq	%r13, %rdi
	call	puts@PLT
.L79:
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	cmpl	136(%rsp), %r14d
	jne	.L81
.L74:
	addq	$152, %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
	.p2align 4,,10
	.p2align 3
.L187:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	movl	%ecx, 12(%rsp)
	movl	%edx, 16(%rsp)
	call	puts@PLT
	movl	16(%rsp), %r14d
	jmp	.L79
	.p2align 4,,10
	.p2align 3
.L185:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	.p2align 4,,10
	.p2align 3
.L76:
	movq	stdin(%rip), %rdi
	andl	$15, %eax
	leal	(%rbx,%rbx,4), %edx
	leal	(%rax,%rdx,2), %ebx
	call	getc@PLT
	cmpl	$47, %eax
	jg	.L76
	negl	%ebx
	jmp	.L77
	.p2align 4,,10
	.p2align 3
.L184:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	.p2align 4,,10
	.p2align 3
.L58:
	movq	stdin(%rip), %rdi
	andl	$15, %eax
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
	call	getc@PLT
	cmpl	$47, %eax
	jg	.L58
	negl	%r12d
	movl	%r12d, (%rbx,%rbp,4)
	addq	$1, %rbp
	cmpl	%ebp, %r15d
	jge	.L60
	jmp	.L188
	.p2align 4,,10
	.p2align 3
.L186:
	leaq	.LC1(%rip), %rdi
	movl	%ecx, 12(%rsp)
	movl	%edx, 16(%rsp)
	call	puts@PLT
	movl	16(%rsp), %r14d
	jmp	.L79
	.p2align 4,,10
	.p2align 3
.L183:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	.p2align 4,,10
	.p2align 3
.L53:
	movq	stdin(%rip), %rdi
	andl	$15, %eax
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
	call	getc@PLT
	cmpl	$47, %eax
	jg	.L53
	negl	%r12d
	addq	$4, %rbx
	movl	%r12d, (%rbx)
	cmpq	%rbx, %rbp
	jne	.L55
	jmp	.L189
	.cfi_endproc
.LFE28:
	.size	main, .-main
	.globl	dist
	.bss
	.align 32
	.type	dist, @object
	.size	dist, 1208
dist:
	.zero	1208
	.globl	hi
	.align 32
	.type	hi, @object
	.size	hi, 1208
hi:
	.zero	1208
	.globl	to
	.align 32
	.type	to, @object
	.size	to, 120800
to:
	.zero	120800
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 1208
tbl:
	.zero	1208
	.globl	a
	.align 16
	.type	a, @object
	.size	a, 28
a:
	.zero	28
	.globl	qmax
	.align 4
	.type	qmax, @object
	.size	qmax, 4
qmax:
	.zero	4
	.globl	qsize
	.align 4
	.type	qsize, @object
	.size	qsize, 4
qsize:
	.zero	4
	.globl	que
	.align 32
	.type	que, @object
	.size	que, 80000
que:
	.zero	80000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	10000
	.long	10000
	.long	10000
	.long	10000
	.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 2548 Sugoroku
// 2018.2.5 bal4u

#include <stdio.h>

#define QMAX 10000
typedef struct { int t, s; } QUE;
QUE que[QMAX]; 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].t < que[i].t) min = l; else min = i;
	if (r < qsize && que[r].t < que[min].t) min = r;
	if (min != i) {
		qt = que[i], que[i] = que[min], que[min] = qt;
		min_heapify(min);
	}
}

void deq()
{
//	if (qsize == 0) return 0;
//	*n = que[0].node, *t = que[0].t, *c = que[0].c;
	que[0] = que[--qsize];
	min_heapify(0);
}

int qmax;
void enq(int s, int t)
{
	int i, min;
	QUE qt;

	i = qsize++;	if (qsize > qmax) qmax = qsize;
	que[i].s = s, que[i].t = t;
	while (i > 0 && que[min = PARENT(i)].t > que[i].t) {
		qt = que[i], que[i] = que[min], que[min] = qt;
		i = min;
	}
}

#define INF 10000
int a[7];
int tbl[302];
int to[302][100], hi[302];
dist[302];

#define getchar_unlocked()  getchar()
int in()
{
	int n = 0;
	int c = getchar_unlocked();
	if (c == '-') {
		c = getchar_unlocked();
		do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
		while (c >= '0');
		return -n;
	}
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}
 
void dijkstra(int start, int goal)
{
	int i, s, d, e;

	for (i = 0; i <= 300; i++) dist[i] = INF;
	qsize = 0;
	dist[start] = 0;
	enq(start, 0);
	while (qsize) {
		s = que[0].s, d = que[0].t+1, deq();
		if (s == goal) break;
		for (i = 0; i < hi[s]; i++) {
			e = to[s][i];
			if (d < dist[e]) dist[e] = d, enq(e, d); 
		}
	}
}

int main()
{
	int m, i, j, s, g, ni, t;
int max = 0;
	m = in();
	for (i = 1; i <= 6; i++) a[i] = in();
	s = in(), g = in();
	for (i = 1; i <= m; i++) tbl[i] = in();

	for (i = 1; i <= m; i++) for (j = 1; j <= 6; j++) {
		ni = i - a[j];
		if (ni > 0 && ni <= m) t = ni+tbl[ni], to[t][hi[t]++] = i;
		ni = i + a[j];
		if (ni > 0 && ni <= m) t = ni+tbl[ni], to[t][hi[t]++] = i;
	}

	dijkstra(g, s);

	i = s, t = dist[i];
	while (i != g) {
		j = in();
		ni = i - a[j];
		if (ni > 0 && ni <= m && dist[ni+tbl[ni]] < t) {
			i = ni+tbl[ni], t = dist[i], puts("-1"); goto next;
		}
		ni = i + a[j];
		if (ni > 0 && ni <= m && dist[ni+tbl[ni]] < t) {
			i = ni+tbl[ni], t = dist[i], puts("1"); goto next;
		}
		puts("0");
next:	fflush(stdout);
	}
	return 0;
}

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

```c
// AOJ 2548 Sugoroku
// 2018.2.5 bal4u

#include <stdio.h>

#define QMAX 10000
typedef struct { int t, s; } QUE;
QUE que[QMAX]; 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].t < que[i].t) min = l; else min = i;
	if (r < qsize && que[r].t < que[min].t) min = r;
	if (min != i) {
		qt = que[i], que[i] = que[min], que[min] = qt;
		min_heapify(min);
	}
}

void deq()
{
//	if (qsize == 0) return 0;
//	*n = que[0].node, *t = que[0].t, *c = que[0].c;
	que[0] = que[--qsize];
	min_heapify(0);
}

int qmax;
void enq(int s, int t)
{
	int i, min;
	QUE qt;

	i = qsize++;	if (qsize > qmax) qmax = qsize;
	que[i].s = s, que[i].t = t;
	while (i > 0 && que[min = PARENT(i)].t > que[i].t) {
		qt = que[i], que[i] = que[min], que[min] = qt;
		i = min;
	}
}

#define INF 10000
int a[7];
int tbl[302];
int to[302][100], hi[302];
dist[302];

#define getchar_unlocked()  getchar()
int in()
{
	int n = 0;
	int c = getchar_unlocked();
	if (c == '-') {
		c = getchar_unlocked();
		do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
		while (c >= '0');
		return -n;
	}
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}
 
void dijkstra(int start, int goal)
{
	int i, s, d, e;

	for (i = 0; i <= 300; i++) dist[i] = INF;
	qsize = 0;
	dist[start] = 0;
	enq(start, 0);
	while (qsize) {
		s = que[0].s, d = que[0].t+1, deq();
		if (s == goal) break;
		for (i = 0; i < hi[s]; i++) {
			e = to[s][i];
			if (d < dist[e]) dist[e] = d, enq(e, d); 
		}
	}
}

int main()
{
	int m, i, j, s, g, ni, t;
int max = 0;
	m = in();
	for (i = 1; i <= 6; i++) a[i] = in();
	s = in(), g = in();
	for (i = 1; i <= m; i++) tbl[i] = in();

	for (i = 1; i <= m; i++) for (j = 1; j <= 6; j++) {
		ni = i - a[j];
		if (ni > 0 && ni <= m) t = ni+tbl[ni], to[t][hi[t]++] = i;
		ni = i + a[j];
		if (ni > 0 && ni <= m) t = ni+tbl[ni], to[t][hi[t]++] = i;
	}

	dijkstra(g, s);

	i = s, t = dist[i];
	while (i != g) {
		j = in();
		ni = i - a[j];
		if (ni > 0 && ni <= m && dist[ni+tbl[ni]] < t) {
			i = ni+tbl[ni], t = dist[i], puts("-1"); goto next;
		}
		ni = i + a[j];
		if (ni > 0 && ni <= m && dist[ni+tbl[ni]] < t) {
			i = ni+tbl[ni], t = dist[i], puts("1"); goto next;
		}
		puts("0");
next:	fflush(stdout);
	}
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	que
	.bss
	.align 32
	.type	que, @object
	.size	que, 80000
que:
	.zero	80000
	.globl	qsize
	.align 4
	.type	qsize, @object
	.size	qsize, 4
qsize:
	.zero	4
	.text
	.globl	min_heapify
	.type	min_heapify, @function
min_heapify:
.LFB0:
	.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	que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	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	que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	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
.LFE0:
	.size	min_heapify, .-min_heapify
	.globl	deq
	.type	deq, @function
deq:
.LFB1:
	.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
.LFE1:
	.size	deq, .-deq
	.globl	qmax
	.bss
	.align 4
	.type	qmax, @object
	.size	qmax, 4
qmax:
	.zero	4
	.text
	.globl	enq
	.type	enq, @function
enq:
.LFB2:
	.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	qsize(%rip), %edx
	movl	qmax(%rip), %eax
	cmpl	%eax, %edx
	jle	.L9
	movl	qsize(%rip), %eax
	movl	%eax, qmax(%rip)
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L10
.L12:
	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)
.L10:
	cmpl	$0, -16(%rbp)
	jle	.L13
	movl	-16(%rbp), %eax
	sarl	%eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L12
.L13:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	enq, .-enq
	.globl	a
	.bss
	.align 16
	.type	a, @object
	.size	a, 28
a:
	.zero	28
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 1208
tbl:
	.zero	1208
	.globl	to
	.align 32
	.type	to, @object
	.size	to, 120800
to:
	.zero	120800
	.globl	hi
	.align 32
	.type	hi, @object
	.size	hi, 1208
hi:
	.zero	1208
	.globl	dist
	.align 32
	.type	dist, @object
	.size	dist, 1208
dist:
	.zero	1208
	.text
	.globl	in
	.type	in, @function
in:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar@PLT
	movl	%eax, -4(%rbp)
	cmpl	$45, -4(%rbp)
	jne	.L15
	call	getchar@PLT
	movl	%eax, -4(%rbp)
.L16:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L16
	movl	-8(%rbp), %eax
	negl	%eax
	jmp	.L17
.L15:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L15
	movl	-8(%rbp), %eax
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	in, .-in
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L19
.L20:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	$10000, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L19:
	cmpl	$300, -16(%rbp)
	jle	.L20
	movl	$0, qsize(%rip)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	enq
	jmp	.L21
.L27:
	movl	4+que(%rip), %eax
	movl	%eax, -12(%rbp)
	movl	que(%rip), %eax
	addl	$1, %eax
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	deq
	movl	-12(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L28
	movl	$0, -16(%rbp)
	jmp	.L24
.L26:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	to(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L25
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dist(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	enq
.L25:
	addl	$1, -16(%rbp)
.L24:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L26
.L21:
	movl	qsize(%rip), %eax
	testl	%eax, %eax
	jne	.L27
	jmp	.L29
.L28:
	nop
.L29:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	dijkstra, .-dijkstra
	.section	.rodata
.LC0:
	.string	"-1"
.LC1:
	.string	"1"
.LC2:
	.string	"0"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	$0, -20(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$1, -32(%rbp)
	jmp	.L31
.L32:
	movl	$0, %eax
	call	in
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -32(%rbp)
.L31:
	cmpl	$6, -32(%rbp)
	jle	.L32
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	movl	$1, -32(%rbp)
	jmp	.L33
.L34:
	movl	$0, %eax
	call	in
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -32(%rbp)
.L33:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L34
	movl	$1, -32(%rbp)
	jmp	.L35
.L40:
	movl	$1, -28(%rbp)
	jmp	.L36
.L39:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L37
	movl	-4(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jg	.L37
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	hi(%rip), %rcx
	movl	%edx, (%rsi,%rcx)
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	to(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L37:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L38
	movl	-4(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jg	.L38
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	hi(%rip), %rcx
	movl	%edx, (%rsi,%rcx)
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	to(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L38:
	addl	$1, -28(%rbp)
.L36:
	cmpl	$6, -28(%rbp)
	jle	.L39
	addl	$1, -32(%rbp)
.L35:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L40
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dijkstra
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	jmp	.L41
.L45:
	movl	$0, %eax
	call	in
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L42
	movl	-4(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jg	.L42
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L42
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L43
.L42:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L44
	movl	-4(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jg	.L44
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L44
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L43
.L44:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L43:
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
.L41:
	movl	-32(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jne	.L45
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	que
	.bss
	.align 32
	.type	que, @object
	.size	que, 80000
que:
	.zero	80000
	.globl	qsize
	.align 4
	.type	qsize, @object
	.size	qsize, 4
qsize:
	.zero	4
	.text
	.globl	min_heapify
	.type	min_heapify, @function
min_heapify:
.LFB0:
	.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	que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	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	que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	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
.LFE0:
	.size	min_heapify, .-min_heapify
	.globl	deq
	.type	deq, @function
deq:
.LFB1:
	.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
.LFE1:
	.size	deq, .-deq
	.globl	qmax
	.bss
	.align 4
	.type	qmax, @object
	.size	qmax, 4
qmax:
	.zero	4
	.text
	.globl	enq
	.type	enq, @function
enq:
.LFB2:
	.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	qsize(%rip), %edx
	movl	qmax(%rip), %eax
	cmpl	%eax, %edx
	jle	.L9
	movl	qsize(%rip), %eax
	movl	%eax, qmax(%rip)
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L10
.L12:
	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)
.L10:
	cmpl	$0, -16(%rbp)
	jle	.L13
	movl	-16(%rbp), %eax
	sarl	%eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L12
.L13:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	enq, .-enq
	.globl	a
	.bss
	.align 16
	.type	a, @object
	.size	a, 28
a:
	.zero	28
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 1208
tbl:
	.zero	1208
	.globl	to
	.align 32
	.type	to, @object
	.size	to, 120800
to:
	.zero	120800
	.globl	hi
	.align 32
	.type	hi, @object
	.size	hi, 1208
hi:
	.zero	1208
	.globl	dist
	.align 32
	.type	dist, @object
	.size	dist, 1208
dist:
	.zero	1208
	.text
	.globl	in
	.type	in, @function
in:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar@PLT
	movl	%eax, -4(%rbp)
	cmpl	$45, -4(%rbp)
	jne	.L15
	call	getchar@PLT
	movl	%eax, -4(%rbp)
.L16:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L16
	movl	-8(%rbp), %eax
	negl	%eax
	jmp	.L17
.L15:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L15
	movl	-8(%rbp), %eax
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	in, .-in
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L19
.L20:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	$10000, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L19:
	cmpl	$300, -16(%rbp)
	jle	.L20
	movl	$0, qsize(%rip)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	enq
	jmp	.L21
.L27:
	movl	4+que(%rip), %eax
	movl	%eax, -12(%rbp)
	movl	que(%rip), %eax
	addl	$1, %eax
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	deq
	movl	-12(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L28
	movl	$0, -16(%rbp)
	jmp	.L24
.L26:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	to(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L25
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dist(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	enq
.L25:
	addl	$1, -16(%rbp)
.L24:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L26
.L21:
	movl	qsize(%rip), %eax
	testl	%eax, %eax
	jne	.L27
	jmp	.L29
.L28:
	nop
.L29:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	dijkstra, .-dijkstra
	.section	.rodata
.LC0:
	.string	"-1"
.LC1:
	.string	"1"
.LC2:
	.string	"0"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	$0, -20(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$1, -32(%rbp)
	jmp	.L31
.L32:
	movl	$0, %eax
	call	in
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -32(%rbp)
.L31:
	cmpl	$6, -32(%rbp)
	jle	.L32
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	movl	$1, -32(%rbp)
	jmp	.L33
.L34:
	movl	$0, %eax
	call	in
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -32(%rbp)
.L33:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L34
	movl	$1, -32(%rbp)
	jmp	.L35
.L40:
	movl	$1, -28(%rbp)
	jmp	.L36
.L39:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L37
	movl	-4(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jg	.L37
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	hi(%rip), %rcx
	movl	%edx, (%rsi,%rcx)
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	to(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L37:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L38
	movl	-4(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jg	.L38
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	hi(%rip), %rcx
	movl	%edx, (%rsi,%rcx)
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	to(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L38:
	addl	$1, -28(%rbp)
.L36:
	cmpl	$6, -28(%rbp)
	jle	.L39
	addl	$1, -32(%rbp)
.L35:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L40
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dijkstra
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	jmp	.L41
.L45:
	movl	$0, %eax
	call	in
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L42
	movl	-4(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jg	.L42
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L42
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L43
.L42:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L44
	movl	-4(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jg	.L44
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L44
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L43
.L44:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L43:
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
.L41:
	movl	-32(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jne	.L45
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
