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

```c
// AOJ 1590: One-Time Path
// 2017.11.29 bal4u@uu

#include <stdio.h>
#include <string.h>

#define MAX 200000
typedef struct { int t, node; } 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].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);
//	return 1;
}

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

	i = qsize++;
	que[i].node = n, 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 1000000010
typedef struct { int to[20]; int c[20]; } TBL;
TBL tbl[100002];
int len[100002];
int dist[100002];
int lastn[100002], lastc[100002]; sz;

void dijkstra(int start)
{
	int i, s, e, c, d;

	qsize = 0;
	dist[start] = 0;
	enq(start, 0);
	while (qsize) {
		s = que[0].node; c = que[0].t, deq();
		for (i = 0; i < len[s]; i++) {
			e = tbl[s].to[i];
			if (c <= (d = tbl[s].c[i]) && d < dist[e]) dist[e] = d, enq(e, d);
		}
	}
}

char buf[40], *bp;
int getint()
{
	int n = 0;
	while (*bp >= '0') n = (n<<3) + (n<<1) + (*bp++ & 0xf);
	return n;
}

int main()
{
	int n, n1, m, a, b, c, i, ans;

	fgets(bp=buf, 40, stdin);
	n = getint(), bp++, m = getint();
	n1 = n - 1;

	for (i = 0; i < m; i++) {
		fgets(bp=buf, 40, stdin);
		a = getint()-1, bp++, b = getint()-1, bp++, c = getint();
		tbl[a].to[len[a]] = b, tbl[a].c[len[a]++] = c;
		if (b == n1) lastn[sz] = a, lastc[sz++] = c;
	}

	memset(dist, 0x77, sizeof(dist));
	dijkstra(0);

	ans = 0;
	if (dist[n-1] > INF) puts("-1");
	else {
		for (i = 0; i < sz; i++) {
			a = lastn[i], c = lastc[i];
			if (dist[a] <= c && c > ans) ans = c;
		}
		printf("%d\n", ans);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	que
	.bss
	.align 32
	.type	que, @object
	.size	que, 1600000
que:
	.zero	1600000
	.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	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	-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	.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	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	.L11
.L12:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	enq, .-enq
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 16000320
tbl:
	.zero	16000320
	.globl	len
	.align 32
	.type	len, @object
	.size	len, 400008
len:
	.zero	400008
	.globl	dist
	.align 32
	.type	dist, @object
	.size	dist, 400008
dist:
	.zero	400008
	.globl	lastn
	.align 32
	.type	lastn, @object
	.size	lastn, 400008
lastn:
	.zero	400008
	.globl	lastc
	.align 32
	.type	lastc, @object
	.size	lastc, 400008
lastc:
	.zero	400008
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.text
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB3:
	.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	$0, qsize(%rip)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-36(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	enq
	jmp	.L14
.L18:
	movl	4+que(%rip), %eax
	movl	%eax, -16(%rbp)
	movl	que(%rip), %eax
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	deq
	movl	$0, -20(%rbp)
	jmp	.L15
.L17:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$20, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L16
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L16
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dist(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	enq
.L16:
	addl	$1, -20(%rbp)
.L15:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L17
.L14:
	movl	qsize(%rip), %eax
	testl	%eax, %eax
	jne	.L18
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	dijkstra, .-dijkstra
	.globl	buf
	.bss
	.align 32
	.type	buf, @object
	.size	buf, 40
buf:
	.zero	40
	.globl	bp
	.align 8
	.type	bp, @object
	.size	bp, 8
bp:
	.zero	8
	.text
	.globl	getint
	.type	getint, @function
getint:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L20
.L21:
	movl	-4(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	(%rdx,%rax), %ecx
	movq	bp(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, bp(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
.L20:
	movq	bp(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$47, %al
	jg	.L21
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	getint, .-getint
	.section	.rodata
.LC0:
	.string	"-1"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, bp(%rip)
	movq	bp(%rip), %rax
	movl	$40, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	getint
	movl	%eax, -24(%rbp)
	movq	bp(%rip), %rax
	addq	$1, %rax
	movq	%rax, bp(%rip)
	movl	$0, %eax
	call	getint
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -16(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L24
.L26:
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, bp(%rip)
	movq	bp(%rip), %rax
	movl	$40, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	getint
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movq	bp(%rip), %rax
	addq	$1, %rax
	movq	%rax, bp(%rip)
	movl	$0, %eax
	call	getint
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movq	bp(%rip), %rax
	addq	$1, %rax
	movq	%rax, bp(%rip)
	movl	$0, %eax
	call	getint
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-12(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	len(%rip), %rcx
	movl	%edx, (%rsi,%rcx)
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$20, %rax
	leaq	0(,%rax,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jne	.L25
	movl	sz(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	lastn(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	lastc(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L25:
	addl	$1, -32(%rbp)
.L24:
	movl	-32(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L26
	movl	$400008, %edx
	movl	$119, %esi
	leaq	dist(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, %edi
	call	dijkstra
	movl	$0, -28(%rbp)
	movl	-24(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1000000010, %eax
	jle	.L27
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L28
.L27:
	movl	$0, -32(%rbp)
	jmp	.L29
.L31:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	lastn(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	lastc(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L30
	movl	-8(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L30
	movl	-8(%rbp), %eax
	movl	%eax, -28(%rbp)
.L30:
	addl	$1, -32(%rbp)
.L29:
	movl	sz(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L31
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L28:
	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:
.LFB35:
	.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
.LFE35:
	.size	min_heapify, .-min_heapify
	.p2align 4
	.globl	deq
	.type	deq, @function
deq:
.LFB36:
	.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
.LFE36:
	.size	deq, .-deq
	.p2align 4
	.globl	enq
	.type	enq, @function
enq:
.LFB37:
	.cfi_startproc
	endbr64
	movslq	qsize(%rip), %rcx
	movd	%esi, %xmm0
	movd	%edi, %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	.L13
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L15:
	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
.L13:
	movl	%eax, %edi
	sarl	%edi
	movslq	%edi, %rcx
	cmpl	%esi, (%rdx,%rcx,8)
	jg	.L15
.L12:
	ret
.L20:
	ret
	.cfi_endproc
.LFE37:
	.size	enq, .-enq
	.p2align 4
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB38:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	dist(%rip), %r15
	movl	$1, %edx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	xorl	%r14d, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	que(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	tbl(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%edi, %rbp
	movl	$0, (%r15,%rbp,4)
	movl	%edi, 4+que(%rip)
	movl	$0, que(%rip)
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	len(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L29:
	subl	$1, %edx
	xorl	%edi, %edi
	movl	%edx, qsize(%rip)
	movslq	%edx, %rdx
	movq	0(%r13,%rdx,8), %rdx
	movq	%rdx, 0(%r13)
	call	min_heapify
	movl	(%rbx,%rbp,4), %ecx
	testl	%ecx, %ecx
	jle	.L22
	leaq	0(%rbp,%rbp,4), %rax
	subl	$1, %ecx
	movslq	qsize(%rip), %rdx
	movq	%rax, %rdi
	leaq	(%rcx,%rax,8), %rax
	leaq	4+tbl(%rip), %rcx
	salq	$5, %rdi
	leaq	(%rcx,%rax,4), %r8
	addq	%r12, %rdi
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L23:
	addq	$4, %rdi
	cmpq	%r8, %rdi
	je	.L27
.L26:
	movl	80(%rdi), %eax
	cmpl	%eax, %r14d
	jg	.L23
	movd	(%rdi), %xmm2
	movslq	(%rdi), %rcx
	movd	%eax, %xmm0
	punpckldq	%xmm2, %xmm0
	cmpl	%eax, (%r15,%rcx,4)
	jle	.L23
	movl	%eax, (%r15,%rcx,4)
	leal	1(%rdx), %r9d
	movslq	%edx, %rcx
	movl	%r9d, qsize(%rip)
	movq	%xmm0, 0(%r13,%rcx,8)
	testl	%edx, %edx
	jg	.L24
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L25:
	movd	4(%r13,%rdx,8), %xmm1
	movq	0(%r13,%rcx,8), %r10
	movd	%eax, %xmm0
	punpckldq	%xmm1, %xmm0
	movq	%r10, 0(%r13,%rdx,8)
	movq	%xmm0, 0(%r13,%rcx,8)
	testl	%esi, %esi
	je	.L30
	movl	0(%r13,%rcx,8), %eax
	movslq	%esi, %rdx
.L24:
	movl	%edx, %esi
	sarl	%esi
	movslq	%esi, %rcx
	cmpl	0(%r13,%rcx,8), %eax
	jl	.L25
.L30:
	addq	$4, %rdi
	movslq	%r9d, %rdx
	cmpq	%r8, %rdi
	jne	.L26
	.p2align 4,,10
	.p2align 3
.L27:
	testl	%edx, %edx
	je	.L21
	movl	0(%r13), %r14d
	movslq	4+que(%rip), %rbp
	jmp	.L29
.L21:
	popq	%rbx
	.cfi_remember_state
	.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
.L22:
	.cfi_restore_state
	movl	qsize(%rip), %edx
	jmp	.L27
	.cfi_endproc
.LFE38:
	.size	dijkstra, .-dijkstra
	.p2align 4
	.globl	getint
	.type	getint, @function
getint:
.LFB39:
	.cfi_startproc
	endbr64
	movq	bp(%rip), %rax
	cmpb	$47, (%rax)
	jle	.L37
	addq	$1, %rax
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L36:
	movq	%rax, bp(%rip)
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	leal	(%r8,%r8,4), %ecx
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rcx,2), %r8d
	jg	.L36
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L37:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	getint, .-getint
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"-1"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$40, %esi
	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	buf(%rip), %rbx
	movq	%rbx, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	stdin(%rip), %rdx
	movq	%rbx, bp(%rip)
	call	fgets@PLT
	movq	bp(%rip), %rsi
	cmpb	$47, (%rsi)
	jle	.L60
	leaq	1(%rsi), %rax
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L41:
	movq	%rax, bp(%rip)
	movzbl	-1(%rax), %edx
	movq	%rax, %rsi
	addq	$1, %rax
	leal	0(%rbp,%rbp,4), %ecx
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rcx,2), %ebp
	jg	.L41
.L40:
	leaq	1(%rsi), %rax
	xorl	%r12d, %r12d
	movq	%rax, bp(%rip)
	leal	-1(%rbp), %eax
	cmpb	$47, 1(%rsi)
	movl	%eax, 12(%rsp)
	leaq	2(%rsi), %rax
	jle	.L46
	.p2align 4,,10
	.p2align 3
.L45:
	movq	%rax, bp(%rip)
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	leal	(%r12,%r12,4), %ecx
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rcx,2), %r12d
	jg	.L45
	testl	%r12d, %r12d
	jle	.L46
	xorl	%r13d, %r13d
	leaq	len(%rip), %r15
	leaq	tbl(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L54:
	movq	stdin(%rip), %rdx
	movl	$40, %esi
	movq	%rbx, %rdi
	movq	%rbx, bp(%rip)
	call	fgets@PLT
	movq	bp(%rip), %rdx
	cmpb	$47, (%rdx)
	jle	.L61
	leaq	1(%rdx), %rax
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L48:
	movq	%rax, %rdx
	movq	%rax, bp(%rip)
	movzbl	-1(%rax), %eax
	leal	(%rcx,%rcx,4), %ecx
	andl	$15, %eax
	cmpb	$47, (%rdx)
	leal	(%rax,%rcx,2), %ecx
	leaq	1(%rdx), %rax
	jg	.L48
	subl	$1, %ecx
.L47:
	leaq	1(%rdx), %rax
	movq	%rax, bp(%rip)
	cmpb	$47, 1(%rdx)
	jle	.L62
	addq	$2, %rdx
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L50:
	movq	%rdx, %rax
	movq	%rdx, bp(%rip)
	movzbl	-1(%rdx), %edx
	leal	(%rsi,%rsi,4), %esi
	andl	$15, %edx
	cmpb	$47, (%rax)
	leal	(%rdx,%rsi,2), %esi
	leaq	1(%rax), %rdx
	jg	.L50
	leal	-1(%rsi), %r8d
.L49:
	leaq	1(%rax), %rdx
	movq	%rdx, bp(%rip)
	cmpb	$47, 1(%rax)
	jle	.L63
	addq	$2, %rax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L52:
	movq	%rax, bp(%rip)
	leal	(%rdx,%rdx,4), %edi
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rdi,2), %edx
	jg	.L52
.L51:
	movslq	%ecx, %rax
	movslq	(%r15,%rax,4), %r9
	leaq	(%rax,%rax,4), %r10
	movq	%r9, %rdi
	leaq	(%r9,%r10,8), %r9
	addl	$1, %edi
	movl	%r8d, (%r14,%r9,4)
	movl	%edi, (%r15,%rax,4)
	movl	%edx, 80(%r14,%r9,4)
	cmpl	%esi, %ebp
	jne	.L53
	movslq	sz(%rip), %rsi
	leaq	lastn(%rip), %rdi
	movq	%rsi, %rax
	movl	%ecx, (%rdi,%rsi,4)
	addl	$1, %eax
	movl	%eax, sz(%rip)
	leaq	lastc(%rip), %rax
	movl	%edx, (%rax,%rsi,4)
.L53:
	addl	$1, %r13d
	cmpl	%r12d, %r13d
	jne	.L54
.L46:
	leaq	dist(%rip), %rbx
	movl	$400008, %edx
	movl	$119, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	xorl	%edi, %edi
	call	dijkstra
	movslq	12(%rsp), %rax
	cmpl	$1000000010, (%rbx,%rax,4)
	jg	.L75
	movslq	sz(%rip), %rsi
	xorl	%r8d, %r8d
	testl	%esi, %esi
	jle	.L56
	xorl	%eax, %eax
	xorl	%r8d, %r8d
	leaq	lastn(%rip), %r9
	leaq	lastc(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L59:
	movslq	(%r9,%rax,4), %rcx
	movl	(%rdi,%rax,4), %edx
	cmpl	%edx, (%rbx,%rcx,4)
	jg	.L58
	cmpl	%edx, %r8d
	cmovl	%edx, %r8d
.L58:
	addq	$1, %rax
	cmpq	%rax, %rsi
	jne	.L59
.L56:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L57:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L61:
	.cfi_restore_state
	movl	$-1, %ecx
	jmp	.L47
	.p2align 4,,10
	.p2align 3
.L63:
	xorl	%edx, %edx
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L62:
	movl	$-1, %r8d
	xorl	%esi, %esi
	jmp	.L49
.L75:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L57
.L60:
	xorl	%ebp, %ebp
	jmp	.L40
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	bp
	.bss
	.align 8
	.type	bp, @object
	.size	bp, 8
bp:
	.zero	8
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 40
buf:
	.zero	40
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	lastc
	.align 32
	.type	lastc, @object
	.size	lastc, 400008
lastc:
	.zero	400008
	.globl	lastn
	.align 32
	.type	lastn, @object
	.size	lastn, 400008
lastn:
	.zero	400008
	.globl	dist
	.align 32
	.type	dist, @object
	.size	dist, 400008
dist:
	.zero	400008
	.globl	len
	.align 32
	.type	len, @object
	.size	len, 400008
len:
	.zero	400008
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 16000320
tbl:
	.zero	16000320
	.globl	qsize
	.align 4
	.type	qsize, @object
	.size	qsize, 4
qsize:
	.zero	4
	.globl	que
	.align 32
	.type	que, @object
	.size	que, 1600000
que:
	.zero	1600000
	.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:
.LFB35:
	.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
.LFE35:
	.size	min_heapify, .-min_heapify
	.p2align 4
	.globl	deq
	.type	deq, @function
deq:
.LFB36:
	.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
.LFE36:
	.size	deq, .-deq
	.p2align 4
	.globl	enq
	.type	enq, @function
enq:
.LFB37:
	.cfi_startproc
	endbr64
	movslq	qsize(%rip), %rcx
	movd	%esi, %xmm0
	movd	%edi, %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	.L13
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L15:
	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
.L13:
	movl	%eax, %edi
	sarl	%edi
	movslq	%edi, %rcx
	cmpl	%esi, (%rdx,%rcx,8)
	jg	.L15
.L12:
	ret
.L20:
	ret
	.cfi_endproc
.LFE37:
	.size	enq, .-enq
	.p2align 4
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB38:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	dist(%rip), %r15
	movl	$1, %edx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	xorl	%r14d, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	que(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	tbl(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%edi, %rbp
	movl	$0, (%r15,%rbp,4)
	movl	%edi, 4+que(%rip)
	movl	$0, que(%rip)
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	len(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L29:
	subl	$1, %edx
	xorl	%edi, %edi
	movl	%edx, qsize(%rip)
	movslq	%edx, %rdx
	movq	0(%r13,%rdx,8), %rdx
	movq	%rdx, 0(%r13)
	call	min_heapify
	movl	(%rbx,%rbp,4), %ecx
	testl	%ecx, %ecx
	jle	.L22
	leaq	0(%rbp,%rbp,4), %rax
	subl	$1, %ecx
	movslq	qsize(%rip), %rdx
	movq	%rax, %rdi
	leaq	(%rcx,%rax,8), %rax
	leaq	4+tbl(%rip), %rcx
	salq	$5, %rdi
	leaq	(%rcx,%rax,4), %r8
	addq	%r12, %rdi
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L23:
	addq	$4, %rdi
	cmpq	%r8, %rdi
	je	.L27
.L26:
	movl	80(%rdi), %eax
	cmpl	%eax, %r14d
	jg	.L23
	movd	(%rdi), %xmm2
	movslq	(%rdi), %rcx
	movd	%eax, %xmm0
	punpckldq	%xmm2, %xmm0
	cmpl	%eax, (%r15,%rcx,4)
	jle	.L23
	movl	%eax, (%r15,%rcx,4)
	leal	1(%rdx), %r9d
	movslq	%edx, %rcx
	movl	%r9d, qsize(%rip)
	movq	%xmm0, 0(%r13,%rcx,8)
	testl	%edx, %edx
	jg	.L24
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L25:
	movd	4(%r13,%rdx,8), %xmm1
	movq	0(%r13,%rcx,8), %r10
	movd	%eax, %xmm0
	punpckldq	%xmm1, %xmm0
	movq	%r10, 0(%r13,%rdx,8)
	movq	%xmm0, 0(%r13,%rcx,8)
	testl	%esi, %esi
	je	.L30
	movl	0(%r13,%rcx,8), %eax
	movslq	%esi, %rdx
.L24:
	movl	%edx, %esi
	sarl	%esi
	movslq	%esi, %rcx
	cmpl	0(%r13,%rcx,8), %eax
	jl	.L25
.L30:
	addq	$4, %rdi
	movslq	%r9d, %rdx
	cmpq	%r8, %rdi
	jne	.L26
	.p2align 4,,10
	.p2align 3
.L27:
	testl	%edx, %edx
	je	.L21
	movl	0(%r13), %r14d
	movslq	4+que(%rip), %rbp
	jmp	.L29
.L21:
	popq	%rbx
	.cfi_remember_state
	.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
.L22:
	.cfi_restore_state
	movl	qsize(%rip), %edx
	jmp	.L27
	.cfi_endproc
.LFE38:
	.size	dijkstra, .-dijkstra
	.p2align 4
	.globl	getint
	.type	getint, @function
getint:
.LFB39:
	.cfi_startproc
	endbr64
	movq	bp(%rip), %rax
	cmpb	$47, (%rax)
	jle	.L37
	addq	$1, %rax
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L36:
	movq	%rax, bp(%rip)
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	leal	(%r8,%r8,4), %ecx
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rcx,2), %r8d
	jg	.L36
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L37:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	getint, .-getint
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"-1"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$40, %esi
	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	buf(%rip), %rbx
	movq	%rbx, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	stdin(%rip), %rdx
	movq	%rbx, bp(%rip)
	call	fgets@PLT
	movq	bp(%rip), %rsi
	cmpb	$47, (%rsi)
	jle	.L60
	leaq	1(%rsi), %rax
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L41:
	movq	%rax, bp(%rip)
	movzbl	-1(%rax), %edx
	movq	%rax, %rsi
	addq	$1, %rax
	leal	0(%rbp,%rbp,4), %ecx
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rcx,2), %ebp
	jg	.L41
.L40:
	leaq	1(%rsi), %rax
	xorl	%r12d, %r12d
	movq	%rax, bp(%rip)
	leal	-1(%rbp), %eax
	cmpb	$47, 1(%rsi)
	movl	%eax, 12(%rsp)
	leaq	2(%rsi), %rax
	jle	.L46
	.p2align 4,,10
	.p2align 3
.L45:
	movq	%rax, bp(%rip)
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	leal	(%r12,%r12,4), %ecx
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rcx,2), %r12d
	jg	.L45
	testl	%r12d, %r12d
	jle	.L46
	xorl	%r13d, %r13d
	leaq	len(%rip), %r15
	leaq	tbl(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L54:
	movq	stdin(%rip), %rdx
	movl	$40, %esi
	movq	%rbx, %rdi
	movq	%rbx, bp(%rip)
	call	fgets@PLT
	movq	bp(%rip), %rdx
	cmpb	$47, (%rdx)
	jle	.L61
	leaq	1(%rdx), %rax
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L48:
	movq	%rax, %rdx
	movq	%rax, bp(%rip)
	movzbl	-1(%rax), %eax
	leal	(%rcx,%rcx,4), %ecx
	andl	$15, %eax
	cmpb	$47, (%rdx)
	leal	(%rax,%rcx,2), %ecx
	leaq	1(%rdx), %rax
	jg	.L48
	subl	$1, %ecx
.L47:
	leaq	1(%rdx), %rax
	movq	%rax, bp(%rip)
	cmpb	$47, 1(%rdx)
	jle	.L62
	addq	$2, %rdx
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L50:
	movq	%rdx, %rax
	movq	%rdx, bp(%rip)
	movzbl	-1(%rdx), %edx
	leal	(%rsi,%rsi,4), %esi
	andl	$15, %edx
	cmpb	$47, (%rax)
	leal	(%rdx,%rsi,2), %esi
	leaq	1(%rax), %rdx
	jg	.L50
	leal	-1(%rsi), %r8d
.L49:
	leaq	1(%rax), %rdx
	movq	%rdx, bp(%rip)
	cmpb	$47, 1(%rax)
	jle	.L63
	addq	$2, %rax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L52:
	movq	%rax, bp(%rip)
	leal	(%rdx,%rdx,4), %edi
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rdi,2), %edx
	jg	.L52
.L51:
	movslq	%ecx, %rax
	movslq	(%r15,%rax,4), %r9
	leaq	(%rax,%rax,4), %r10
	movq	%r9, %rdi
	leaq	(%r9,%r10,8), %r9
	addl	$1, %edi
	movl	%r8d, (%r14,%r9,4)
	movl	%edi, (%r15,%rax,4)
	movl	%edx, 80(%r14,%r9,4)
	cmpl	%esi, %ebp
	jne	.L53
	movslq	sz(%rip), %rsi
	leaq	lastn(%rip), %rdi
	movq	%rsi, %rax
	movl	%ecx, (%rdi,%rsi,4)
	addl	$1, %eax
	movl	%eax, sz(%rip)
	leaq	lastc(%rip), %rax
	movl	%edx, (%rax,%rsi,4)
.L53:
	addl	$1, %r13d
	cmpl	%r12d, %r13d
	jne	.L54
.L46:
	leaq	dist(%rip), %rbx
	movl	$400008, %edx
	movl	$119, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	xorl	%edi, %edi
	call	dijkstra
	movslq	12(%rsp), %rax
	cmpl	$1000000010, (%rbx,%rax,4)
	jg	.L75
	movslq	sz(%rip), %rsi
	xorl	%r8d, %r8d
	testl	%esi, %esi
	jle	.L56
	xorl	%eax, %eax
	xorl	%r8d, %r8d
	leaq	lastn(%rip), %r9
	leaq	lastc(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L59:
	movslq	(%r9,%rax,4), %rcx
	movl	(%rdi,%rax,4), %edx
	cmpl	%edx, (%rbx,%rcx,4)
	jg	.L58
	cmpl	%edx, %r8d
	cmovl	%edx, %r8d
.L58:
	addq	$1, %rax
	cmpq	%rax, %rsi
	jne	.L59
.L56:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L57:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L61:
	.cfi_restore_state
	movl	$-1, %ecx
	jmp	.L47
	.p2align 4,,10
	.p2align 3
.L63:
	xorl	%edx, %edx
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L62:
	movl	$-1, %r8d
	xorl	%esi, %esi
	jmp	.L49
.L75:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L57
.L60:
	xorl	%ebp, %ebp
	jmp	.L40
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	bp
	.bss
	.align 8
	.type	bp, @object
	.size	bp, 8
bp:
	.zero	8
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 40
buf:
	.zero	40
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	lastc
	.align 32
	.type	lastc, @object
	.size	lastc, 400008
lastc:
	.zero	400008
	.globl	lastn
	.align 32
	.type	lastn, @object
	.size	lastn, 400008
lastn:
	.zero	400008
	.globl	dist
	.align 32
	.type	dist, @object
	.size	dist, 400008
dist:
	.zero	400008
	.globl	len
	.align 32
	.type	len, @object
	.size	len, 400008
len:
	.zero	400008
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 16000320
tbl:
	.zero	16000320
	.globl	qsize
	.align 4
	.type	qsize, @object
	.size	qsize, 4
qsize:
	.zero	4
	.globl	que
	.align 32
	.type	que, @object
	.size	que, 1600000
que:
	.zero	1600000
	.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 1590: One-Time Path
// 2017.11.29 bal4u@uu

#include <stdio.h>
#include <string.h>

#define MAX 200000
typedef struct { int t, node; } 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].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);
//	return 1;
}

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

	i = qsize++;
	que[i].node = n, 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 1000000010
typedef struct { int to[20]; int c[20]; } TBL;
TBL tbl[100002];
int len[100002];
int dist[100002];
int lastn[100002], lastc[100002]; sz;

void dijkstra(int start)
{
	int i, s, e, c, d;

	qsize = 0;
	dist[start] = 0;
	enq(start, 0);
	while (qsize) {
		s = que[0].node; c = que[0].t, deq();
		for (i = 0; i < len[s]; i++) {
			e = tbl[s].to[i];
			if (c <= (d = tbl[s].c[i]) && d < dist[e]) dist[e] = d, enq(e, d);
		}
	}
}

char buf[40], *bp;
int getint()
{
	int n = 0;
	while (*bp >= '0') n = (n<<3) + (n<<1) + (*bp++ & 0xf);
	return n;
}

int main()
{
	int n, n1, m, a, b, c, i, ans;

	fgets(bp=buf, 40, stdin);
	n = getint(), bp++, m = getint();
	n1 = n - 1;

	for (i = 0; i < m; i++) {
		fgets(bp=buf, 40, stdin);
		a = getint()-1, bp++, b = getint()-1, bp++, c = getint();
		tbl[a].to[len[a]] = b, tbl[a].c[len[a]++] = c;
		if (b == n1) lastn[sz] = a, lastc[sz++] = c;
	}

	memset(dist, 0x77, sizeof(dist));
	dijkstra(0);

	ans = 0;
	if (dist[n-1] > INF) puts("-1");
	else {
		for (i = 0; i < sz; i++) {
			a = lastn[i], c = lastc[i];
			if (dist[a] <= c && c > ans) ans = c;
		}
		printf("%d\n", ans);
	}
	return 0;
}
3 2
1 2 20
3 3 10
 3 2
1 2 10
2 3 37
 3 3
1 2 13
2 3 17
2 3 21
 3 4
1 2 27
2 3 10
1 3 47
3 1 57
 3 3
2 1 1
2 3 24
1 3 5
 3 3
1 2 13
2 3 17
2 3 30
 3 3
2 0 1
2 3 24
1 3 3
 3 2
1 3 10
2 3 9
 3 2
1 2 3
2 3 56
 3 3
1 2 13
2 3 32
2 3 30

-1
 37
 21
 47
 5
 30
 3
 10
 56
 32

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

```c
// AOJ 1590: One-Time Path
// 2017.11.29 bal4u@uu

#include <stdio.h>
#include <string.h>

#define MAX 200000
typedef struct { int t, node; } 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].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);
//	return 1;
}

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

	i = qsize++;
	que[i].node = n, 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 1000000010
typedef struct { int to[20]; int c[20]; } TBL;
TBL tbl[100002];
int len[100002];
int dist[100002];
int lastn[100002], lastc[100002]; sz;

void dijkstra(int start)
{
	int i, s, e, c, d;

	qsize = 0;
	dist[start] = 0;
	enq(start, 0);
	while (qsize) {
		s = que[0].node; c = que[0].t, deq();
		for (i = 0; i < len[s]; i++) {
			e = tbl[s].to[i];
			if (c <= (d = tbl[s].c[i]) && d < dist[e]) dist[e] = d, enq(e, d);
		}
	}
}

char buf[40], *bp;
int getint()
{
	int n = 0;
	while (*bp >= '0') n = (n<<3) + (n<<1) + (*bp++ & 0xf);
	return n;
}

int main()
{
	int n, n1, m, a, b, c, i, ans;

	fgets(bp=buf, 40, stdin);
	n = getint(), bp++, m = getint();
	n1 = n - 1;

	for (i = 0; i < m; i++) {
		fgets(bp=buf, 40, stdin);
		a = getint()-1, bp++, b = getint()-1, bp++, c = getint();
		tbl[a].to[len[a]] = b, tbl[a].c[len[a]++] = c;
		if (b == n1) lastn[sz] = a, lastc[sz++] = c;
	}

	memset(dist, 0x77, sizeof(dist));
	dijkstra(0);

	ans = 0;
	if (dist[n-1] > INF) puts("-1");
	else {
		for (i = 0; i < sz; i++) {
			a = lastn[i], c = lastc[i];
			if (dist[a] <= c && c > ans) ans = c;
		}
		printf("%d\n", ans);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	que
	.bss
	.align 32
	.type	que, @object
	.size	que, 1600000
que:
	.zero	1600000
	.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	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	-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	.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	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	.L11
.L12:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	enq, .-enq
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 16000320
tbl:
	.zero	16000320
	.globl	len
	.align 32
	.type	len, @object
	.size	len, 400008
len:
	.zero	400008
	.globl	dist
	.align 32
	.type	dist, @object
	.size	dist, 400008
dist:
	.zero	400008
	.globl	lastn
	.align 32
	.type	lastn, @object
	.size	lastn, 400008
lastn:
	.zero	400008
	.globl	lastc
	.align 32
	.type	lastc, @object
	.size	lastc, 400008
lastc:
	.zero	400008
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.text
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB3:
	.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	$0, qsize(%rip)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-36(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	enq
	jmp	.L14
.L18:
	movl	4+que(%rip), %eax
	movl	%eax, -16(%rbp)
	movl	que(%rip), %eax
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	deq
	movl	$0, -20(%rbp)
	jmp	.L15
.L17:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$20, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L16
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L16
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dist(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	enq
.L16:
	addl	$1, -20(%rbp)
.L15:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L17
.L14:
	movl	qsize(%rip), %eax
	testl	%eax, %eax
	jne	.L18
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	dijkstra, .-dijkstra
	.globl	buf
	.bss
	.align 32
	.type	buf, @object
	.size	buf, 40
buf:
	.zero	40
	.globl	bp
	.align 8
	.type	bp, @object
	.size	bp, 8
bp:
	.zero	8
	.text
	.globl	getint
	.type	getint, @function
getint:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L20
.L21:
	movl	-4(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	(%rdx,%rax), %ecx
	movq	bp(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, bp(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
.L20:
	movq	bp(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$47, %al
	jg	.L21
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	getint, .-getint
	.section	.rodata
.LC0:
	.string	"-1"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, bp(%rip)
	movq	bp(%rip), %rax
	movl	$40, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	getint
	movl	%eax, -24(%rbp)
	movq	bp(%rip), %rax
	addq	$1, %rax
	movq	%rax, bp(%rip)
	movl	$0, %eax
	call	getint
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -16(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L24
.L26:
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, bp(%rip)
	movq	bp(%rip), %rax
	movl	$40, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	getint
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movq	bp(%rip), %rax
	addq	$1, %rax
	movq	%rax, bp(%rip)
	movl	$0, %eax
	call	getint
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movq	bp(%rip), %rax
	addq	$1, %rax
	movq	%rax, bp(%rip)
	movl	$0, %eax
	call	getint
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-12(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	len(%rip), %rcx
	movl	%edx, (%rsi,%rcx)
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$20, %rax
	leaq	0(,%rax,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jne	.L25
	movl	sz(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	lastn(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	lastc(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L25:
	addl	$1, -32(%rbp)
.L24:
	movl	-32(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L26
	movl	$400008, %edx
	movl	$119, %esi
	leaq	dist(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, %edi
	call	dijkstra
	movl	$0, -28(%rbp)
	movl	-24(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1000000010, %eax
	jle	.L27
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L28
.L27:
	movl	$0, -32(%rbp)
	jmp	.L29
.L31:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	lastn(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	lastc(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L30
	movl	-8(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L30
	movl	-8(%rbp), %eax
	movl	%eax, -28(%rbp)
.L30:
	addl	$1, -32(%rbp)
.L29:
	movl	sz(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L31
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L28:
	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, 1600000
que:
	.zero	1600000
	.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	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	-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	.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	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	.L11
.L12:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	enq, .-enq
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 16000320
tbl:
	.zero	16000320
	.globl	len
	.align 32
	.type	len, @object
	.size	len, 400008
len:
	.zero	400008
	.globl	dist
	.align 32
	.type	dist, @object
	.size	dist, 400008
dist:
	.zero	400008
	.globl	lastn
	.align 32
	.type	lastn, @object
	.size	lastn, 400008
lastn:
	.zero	400008
	.globl	lastc
	.align 32
	.type	lastc, @object
	.size	lastc, 400008
lastc:
	.zero	400008
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.text
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB3:
	.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	$0, qsize(%rip)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-36(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	enq
	jmp	.L14
.L18:
	movl	4+que(%rip), %eax
	movl	%eax, -16(%rbp)
	movl	que(%rip), %eax
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	deq
	movl	$0, -20(%rbp)
	jmp	.L15
.L17:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$20, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L16
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L16
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dist(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	enq
.L16:
	addl	$1, -20(%rbp)
.L15:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L17
.L14:
	movl	qsize(%rip), %eax
	testl	%eax, %eax
	jne	.L18
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	dijkstra, .-dijkstra
	.globl	buf
	.bss
	.align 32
	.type	buf, @object
	.size	buf, 40
buf:
	.zero	40
	.globl	bp
	.align 8
	.type	bp, @object
	.size	bp, 8
bp:
	.zero	8
	.text
	.globl	getint
	.type	getint, @function
getint:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L20
.L21:
	movl	-4(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	(%rdx,%rax), %ecx
	movq	bp(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, bp(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
.L20:
	movq	bp(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$47, %al
	jg	.L21
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	getint, .-getint
	.section	.rodata
.LC0:
	.string	"-1"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, bp(%rip)
	movq	bp(%rip), %rax
	movl	$40, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	getint
	movl	%eax, -24(%rbp)
	movq	bp(%rip), %rax
	addq	$1, %rax
	movq	%rax, bp(%rip)
	movl	$0, %eax
	call	getint
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -16(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L24
.L26:
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, bp(%rip)
	movq	bp(%rip), %rax
	movl	$40, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	getint
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movq	bp(%rip), %rax
	addq	$1, %rax
	movq	%rax, bp(%rip)
	movl	$0, %eax
	call	getint
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movq	bp(%rip), %rax
	addq	$1, %rax
	movq	%rax, bp(%rip)
	movl	$0, %eax
	call	getint
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-12(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	len(%rip), %rcx
	movl	%edx, (%rsi,%rcx)
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$20, %rax
	leaq	0(,%rax,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jne	.L25
	movl	sz(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	lastn(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	lastc(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L25:
	addl	$1, -32(%rbp)
.L24:
	movl	-32(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L26
	movl	$400008, %edx
	movl	$119, %esi
	leaq	dist(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, %edi
	call	dijkstra
	movl	$0, -28(%rbp)
	movl	-24(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1000000010, %eax
	jle	.L27
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L28
.L27:
	movl	$0, -32(%rbp)
	jmp	.L29
.L31:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	lastn(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	lastc(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dist(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L30
	movl	-8(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L30
	movl	-8(%rbp), %eax
	movl	%eax, -28(%rbp)
.L30:
	addl	$1, -32(%rbp)
.L29:
	movl	sz(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L31
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L28:
	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:
