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

```c
#include<stdio.h>

#define min(a,b) ((a)<(b)?(a):(b))
#define INF 2000000000

int n;
long long dis[500][500];
long long lis[500][500];

void warshall_floyd(){
	int i,j,k;
	for(k=0;k<n;k++){
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
			}
		}
	}
}

void warshall_floydd(){
	int i,j,k;
	for(k=0;k<n;k++){
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				lis[i][j]=min(lis[i][j],lis[i][k]+lis[k][j]);
			}
		}
	}
}

int main(){
	int m,i,j,k,l;
	for(i=0;i<500;i++){
		for(j=0;j<500;j++){
			dis[i][j]=INF;
		}
	}
	scanf("%d%d%d",&n,&m,&l);
	for(i=0;i<m;i++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		a--,b--;
		dis[a][b]=c;
		dis[b][a]=c;
	}
	warshall_floyd();
	for(i=0;i<500;i++){
		for(j=0;j<500;j++){
			lis[i][j]=INF;
		}
	}
	for(i=0;i<500;i++){
		for(j=0;j<500;j++){
			if(dis[i][j]<=l){
				lis[i][j]=1;
			}
		}
	}
	warshall_floydd();
	int q;
	scanf("%d",&q);
	for(i=0;i<q;i++){
		int s,t;
		scanf("%d%d",&s,&t);
		s--,t--;
		if(lis[s][t]<INF)printf("%lld\n",lis[s][t]-1);
		else puts("-1");
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	dis
	.align 32
	.type	dis, @object
	.size	dis, 2000000
dis:
	.zero	2000000
	.globl	lis
	.align 32
	.type	lis, @object
	.size	lis, 2000000
lis:
	.zero	2000000
	.text
	.globl	warshall_floyd
	.type	warshall_floyd, @function
warshall_floyd:
.LFB0:
	.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	.L2
.L7:
	movl	$0, -12(%rbp)
	jmp	.L3
.L6:
	movl	$0, -8(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dis(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dis(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	(%rcx,%rax), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dis(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movl	-8(%rbp), %edx
	movslq	%edx, %rcx
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$500, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dis(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L5
	addl	$1, -12(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L6
	addl	$1, -4(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L7
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	warshall_floyd, .-warshall_floyd
	.globl	warshall_floydd
	.type	warshall_floydd, @function
warshall_floydd:
.LFB1:
	.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	.L9
.L14:
	movl	$0, -12(%rbp)
	jmp	.L10
.L13:
	movl	$0, -8(%rbp)
	jmp	.L11
.L12:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	(%rcx,%rax), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	lis(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movl	-8(%rbp), %edx
	movslq	%edx, %rcx
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$500, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	lis(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L12
	addl	$1, -12(%rbp)
.L10:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	addl	$1, -4(%rbp)
.L9:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L14
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	warshall_floydd, .-warshall_floydd
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%lld\n"
.LC4:
	.string	"-1"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	jmp	.L16
.L19:
	movl	$0, -12(%rbp)
	jmp	.L17
.L18:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dis(%rip), %rax
	movq	$2000000000, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L17:
	cmpl	$499, -12(%rbp)
	jle	.L18
	addl	$1, -16(%rbp)
.L16:
	cmpl	$499, -16(%rbp)
	jle	.L19
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rdx, %rcx
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L20
.L21:
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %ecx
	cltq
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	imulq	$500, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dis(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %ecx
	cltq
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	imulq	$500, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dis(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L20:
	movl	-36(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L21
	movl	$0, %eax
	call	warshall_floyd
	movl	$0, -16(%rbp)
	jmp	.L22
.L25:
	movl	$0, -12(%rbp)
	jmp	.L23
.L24:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	$2000000000, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L23:
	cmpl	$499, -12(%rbp)
	jle	.L24
	addl	$1, -16(%rbp)
.L22:
	cmpl	$499, -16(%rbp)
	jle	.L25
	movl	$0, -16(%rbp)
	jmp	.L26
.L30:
	movl	$0, -12(%rbp)
	jmp	.L27
.L29:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dis(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-32(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jg	.L28
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	$1, (%rdx,%rax)
.L28:
	addl	$1, -12(%rbp)
.L27:
	cmpl	$499, -12(%rbp)
	jle	.L29
	addl	$1, -16(%rbp)
.L26:
	cmpl	$499, -16(%rbp)
	jle	.L30
	movl	$0, %eax
	call	warshall_floydd
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L31
.L34:
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	$1999999999, %rax
	jg	.L32
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L33
.L32:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L33:
	addl	$1, -16(%rbp)
.L31:
	movl	-28(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L34
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	warshall_floyd
	.type	warshall_floyd, @function
warshall_floyd:
.LFB23:
	.cfi_startproc
	endbr64
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L9
	movl	%eax, %r11d
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	dis(%rip), %r12
	leal	-1(%rax), %edx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	8(%r12), %rax
	xorl	%r10d, %r10d
	xorl	%r9d, %r9d
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%r11, %rbx
	imulq	$-4000, %r11, %r11
	leaq	(%rax,%rdx,8), %rbp
	negq	%rbx
	salq	$3, %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rdi
	movq	%rbp, %r8
	xorl	%esi, %esi
	subq	%r10, %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	(%rdi,%r10), %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	(%rdx,%rsi), %rcx
	movq	(%rdi), %rax
	addq	(%rcx,%r9), %rax
	movq	(%rdx), %rcx
	cmpq	%rcx, %rax
	cmovg	%rcx, %rax
	addq	$8, %rdx
	movq	%rax, -8(%rdx)
	cmpq	%r8, %rdx
	jne	.L4
	subq	$4000, %rsi
	addq	$4000, %rdi
	leaq	4000(%rdx), %r8
	cmpq	%r11, %rsi
	jne	.L6
	subq	$8, %r10
	addq	$4000, %r9
	cmpq	%rbx, %r10
	jne	.L3
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	ret
	.cfi_endproc
.LFE23:
	.size	warshall_floyd, .-warshall_floyd
	.p2align 4
	.globl	warshall_floydd
	.type	warshall_floydd, @function
warshall_floydd:
.LFB24:
	.cfi_startproc
	endbr64
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L21
	movl	%eax, %r11d
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	lis(%rip), %r12
	leal	-1(%rax), %edx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	8(%r12), %rax
	xorl	%r10d, %r10d
	xorl	%r9d, %r9d
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%r11, %rbx
	imulq	$-4000, %r11, %r11
	leaq	(%rax,%rdx,8), %rbp
	negq	%rbx
	salq	$3, %rbx
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%r12, %rdi
	movq	%rbp, %r8
	xorl	%esi, %esi
	subq	%r10, %rdi
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	(%rdi,%r10), %rdx
	.p2align 4,,10
	.p2align 3
.L16:
	leaq	(%rdx,%rsi), %rcx
	movq	(%rdi), %rax
	addq	(%rcx,%r9), %rax
	movq	(%rdx), %rcx
	cmpq	%rcx, %rax
	cmovg	%rcx, %rax
	addq	$8, %rdx
	movq	%rax, -8(%rdx)
	cmpq	%r8, %rdx
	jne	.L16
	subq	$4000, %rsi
	addq	$4000, %rdi
	leaq	4000(%rdx), %r8
	cmpq	%r11, %rsi
	jne	.L18
	subq	$8, %r10
	addq	$4000, %r9
	cmpq	%rbx, %r10
	jne	.L15
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	ret
	.cfi_endproc
.LFE24:
	.size	warshall_floydd, .-warshall_floydd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d"
.LC3:
	.string	"%d%d"
.LC4:
	.string	"%lld\n"
.LC5:
	.string	"-1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	dis(%rip), %rbx
	leaq	4000(%rbx), %rdx
	movq	%rbx, %rcx
	leaq	2000000(%rdx), %rsi
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
.L25:
	movq	%rcx, %rax
	.p2align 4,,10
	.p2align 3
.L26:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L26
	leaq	4000(%rax), %rdx
	addq	$4000, %rcx
	cmpq	%rsi, %rdx
	jne	.L25
	leaq	.LC1(%rip), %rbp
	leaq	4(%rsp), %rdx
	xorl	%eax, %eax
	leaq	8(%rsp), %rcx
	leaq	n(%rip), %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	movdqa	.LC0(%rip), %xmm0
	leaq	12(%rsp), %r12
	testl	%edx, %edx
	jle	.L28
	xorl	%r15d, %r15d
	leaq	20(%rsp), %r14
	leaq	16(%rsp), %r13
	leaq	12(%rsp), %r12
.L29:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movslq	20(%rsp), %rsi
	leaq	dis(%rip), %rdi
	movdqa	.LC0(%rip), %xmm0
	leal	-1(%rax), %edx
	movl	16(%rsp), %eax
	movslq	%edx, %rdx
	imulq	$500, %rdx, %rcx
	subl	$1, %eax
	cltq
	addq	%rax, %rcx
	imulq	$500, %rax, %rax
	movq	%rsi, (%rdi,%rcx,8)
	addq	%rdx, %rax
	cmpl	%r15d, 4(%rsp)
	movq	%rsi, (%rdi,%rax,8)
	jg	.L29
.L28:
	xorl	%eax, %eax
	call	warshall_floyd
	leaq	lis(%rip), %rcx
	leaq	4000(%rcx), %rdx
	movq	%rcx, %rsi
	leaq	2000000(%rdx), %rdi
.L30:
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L31:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L31
	leaq	4000(%rax), %rdx
	addq	$4000, %rsi
	cmpq	%rdi, %rdx
	jne	.L30
	movslq	8(%rsp), %rdx
	leaq	2000000+dis(%rip), %rsi
.L32:
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L34:
	cmpq	%rdx, (%rbx,%rax)
	jg	.L33
	movq	$1, (%rcx,%rax)
.L33:
	addq	$8, %rax
	cmpq	$4000, %rax
	jne	.L34
	addq	$4000, %rbx
	addq	$4000, %rcx
	cmpq	%rsi, %rbx
	jne	.L32
	xorl	%eax, %eax
	call	warshall_floydd
	movq	%r12, %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L36
	xorl	%ebp, %ebp
	leaq	20(%rsp), %r14
	leaq	16(%rsp), %r13
	leaq	.LC3(%rip), %r15
	leaq	.LC5(%rip), %r12
	leaq	.LC4(%rip), %rbx
.L39:
	movq	%r14, %rdx
	movq	%r15, %rdi
	movq	%r13, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	movl	20(%rsp), %edi
	subl	$1, %eax
	leal	-1(%rdi), %edx
	leaq	lis(%rip), %rdi
	movl	%eax, 16(%rsp)
	cltq
	imulq	$500, %rax, %rax
	movl	%edx, 20(%rsp)
	movslq	%edx, %rdx
	addq	%rdx, %rax
	movq	(%rdi,%rax,8), %rax
	cmpq	$1999999999, %rax
	jg	.L37
	leaq	-1(%rax), %rdx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %ebp
	cmpl	12(%rsp), %ebp
	jl	.L39
.L36:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L49
	addq	$40, %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
.L37:
	.cfi_restore_state
	movq	%r12, %rdi
	addl	$1, %ebp
	call	puts@PLT
	cmpl	%ebp, 12(%rsp)
	jg	.L39
	jmp	.L36
.L49:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	lis
	.bss
	.align 32
	.type	lis, @object
	.size	lis, 2000000
lis:
	.zero	2000000
	.globl	dis
	.align 32
	.type	dis, @object
	.size	dis, 2000000
dis:
	.zero	2000000
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.quad	2000000000
	.quad	2000000000
	.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	warshall_floyd
	.type	warshall_floyd, @function
warshall_floyd:
.LFB23:
	.cfi_startproc
	endbr64
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L9
	movl	%eax, %r11d
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	dis(%rip), %r12
	leal	-1(%rax), %edx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	8(%r12), %rax
	xorl	%r10d, %r10d
	xorl	%r9d, %r9d
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%r11, %rbx
	imulq	$-4000, %r11, %r11
	leaq	(%rax,%rdx,8), %rbp
	negq	%rbx
	salq	$3, %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rdi
	movq	%rbp, %r8
	xorl	%esi, %esi
	subq	%r10, %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	(%rdi,%r10), %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	(%rdx,%rsi), %rcx
	movq	(%rdi), %rax
	addq	(%rcx,%r9), %rax
	movq	(%rdx), %rcx
	cmpq	%rcx, %rax
	cmovg	%rcx, %rax
	addq	$8, %rdx
	movq	%rax, -8(%rdx)
	cmpq	%r8, %rdx
	jne	.L4
	subq	$4000, %rsi
	addq	$4000, %rdi
	leaq	4000(%rdx), %r8
	cmpq	%r11, %rsi
	jne	.L6
	subq	$8, %r10
	addq	$4000, %r9
	cmpq	%rbx, %r10
	jne	.L3
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	ret
	.cfi_endproc
.LFE23:
	.size	warshall_floyd, .-warshall_floyd
	.p2align 4
	.globl	warshall_floydd
	.type	warshall_floydd, @function
warshall_floydd:
.LFB24:
	.cfi_startproc
	endbr64
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L21
	movl	%eax, %r11d
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	lis(%rip), %r12
	leal	-1(%rax), %edx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	8(%r12), %rax
	xorl	%r10d, %r10d
	xorl	%r9d, %r9d
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%r11, %rbx
	imulq	$-4000, %r11, %r11
	leaq	(%rax,%rdx,8), %rbp
	negq	%rbx
	salq	$3, %rbx
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%r12, %rdi
	movq	%rbp, %r8
	xorl	%esi, %esi
	subq	%r10, %rdi
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	(%rdi,%r10), %rdx
	.p2align 4,,10
	.p2align 3
.L16:
	leaq	(%rdx,%rsi), %rcx
	movq	(%rdi), %rax
	addq	(%rcx,%r9), %rax
	movq	(%rdx), %rcx
	cmpq	%rcx, %rax
	cmovg	%rcx, %rax
	addq	$8, %rdx
	movq	%rax, -8(%rdx)
	cmpq	%r8, %rdx
	jne	.L16
	subq	$4000, %rsi
	addq	$4000, %rdi
	leaq	4000(%rdx), %r8
	cmpq	%r11, %rsi
	jne	.L18
	subq	$8, %r10
	addq	$4000, %r9
	cmpq	%rbx, %r10
	jne	.L15
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	ret
	.cfi_endproc
.LFE24:
	.size	warshall_floydd, .-warshall_floydd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d"
.LC3:
	.string	"%d%d"
.LC4:
	.string	"%lld\n"
.LC5:
	.string	"-1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	dis(%rip), %rbx
	leaq	4000(%rbx), %rdx
	movq	%rbx, %rcx
	leaq	2000000(%rdx), %rsi
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
.L25:
	movq	%rcx, %rax
	.p2align 4,,10
	.p2align 3
.L26:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L26
	leaq	4000(%rax), %rdx
	addq	$4000, %rcx
	cmpq	%rsi, %rdx
	jne	.L25
	leaq	.LC1(%rip), %rbp
	leaq	4(%rsp), %rdx
	xorl	%eax, %eax
	leaq	8(%rsp), %rcx
	leaq	n(%rip), %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	movdqa	.LC0(%rip), %xmm0
	leaq	12(%rsp), %r12
	testl	%edx, %edx
	jle	.L28
	xorl	%r15d, %r15d
	leaq	20(%rsp), %r14
	leaq	16(%rsp), %r13
	leaq	12(%rsp), %r12
.L29:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movslq	20(%rsp), %rsi
	leaq	dis(%rip), %rdi
	movdqa	.LC0(%rip), %xmm0
	leal	-1(%rax), %edx
	movl	16(%rsp), %eax
	movslq	%edx, %rdx
	imulq	$500, %rdx, %rcx
	subl	$1, %eax
	cltq
	addq	%rax, %rcx
	imulq	$500, %rax, %rax
	movq	%rsi, (%rdi,%rcx,8)
	addq	%rdx, %rax
	cmpl	%r15d, 4(%rsp)
	movq	%rsi, (%rdi,%rax,8)
	jg	.L29
.L28:
	xorl	%eax, %eax
	call	warshall_floyd
	leaq	lis(%rip), %rcx
	leaq	4000(%rcx), %rdx
	movq	%rcx, %rsi
	leaq	2000000(%rdx), %rdi
.L30:
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L31:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L31
	leaq	4000(%rax), %rdx
	addq	$4000, %rsi
	cmpq	%rdi, %rdx
	jne	.L30
	movslq	8(%rsp), %rdx
	leaq	2000000+dis(%rip), %rsi
.L32:
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L34:
	cmpq	%rdx, (%rbx,%rax)
	jg	.L33
	movq	$1, (%rcx,%rax)
.L33:
	addq	$8, %rax
	cmpq	$4000, %rax
	jne	.L34
	addq	$4000, %rbx
	addq	$4000, %rcx
	cmpq	%rsi, %rbx
	jne	.L32
	xorl	%eax, %eax
	call	warshall_floydd
	movq	%r12, %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L36
	xorl	%ebp, %ebp
	leaq	20(%rsp), %r14
	leaq	16(%rsp), %r13
	leaq	.LC3(%rip), %r15
	leaq	.LC5(%rip), %r12
	leaq	.LC4(%rip), %rbx
.L39:
	movq	%r14, %rdx
	movq	%r15, %rdi
	movq	%r13, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	movl	20(%rsp), %edi
	subl	$1, %eax
	leal	-1(%rdi), %edx
	leaq	lis(%rip), %rdi
	movl	%eax, 16(%rsp)
	cltq
	imulq	$500, %rax, %rax
	movl	%edx, 20(%rsp)
	movslq	%edx, %rdx
	addq	%rdx, %rax
	movq	(%rdi,%rax,8), %rax
	cmpq	$1999999999, %rax
	jg	.L37
	leaq	-1(%rax), %rdx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %ebp
	cmpl	12(%rsp), %ebp
	jl	.L39
.L36:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L49
	addq	$40, %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
.L37:
	.cfi_restore_state
	movq	%r12, %rdi
	addl	$1, %ebp
	call	puts@PLT
	cmpl	%ebp, 12(%rsp)
	jg	.L39
	jmp	.L36
.L49:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	lis
	.bss
	.align 32
	.type	lis, @object
	.size	lis, 2000000
lis:
	.zero	2000000
	.globl	dis
	.align 32
	.type	dis, @object
	.size	dis, 2000000
dis:
	.zero	2000000
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.quad	2000000000
	.quad	2000000000
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>

#define min(a,b) ((a)<(b)?(a):(b))
#define INF 2000000000

int n;
long long dis[500][500];
long long lis[500][500];

void warshall_floyd(){
	int i,j,k;
	for(k=0;k<n;k++){
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
			}
		}
	}
}

void warshall_floydd(){
	int i,j,k;
	for(k=0;k<n;k++){
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				lis[i][j]=min(lis[i][j],lis[i][k]+lis[k][j]);
			}
		}
	}
}

int main(){
	int m,i,j,k,l;
	for(i=0;i<500;i++){
		for(j=0;j<500;j++){
			dis[i][j]=INF;
		}
	}
	scanf("%d%d%d",&n,&m,&l);
	for(i=0;i<m;i++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		a--,b--;
		dis[a][b]=c;
		dis[b][a]=c;
	}
	warshall_floyd();
	for(i=0;i<500;i++){
		for(j=0;j<500;j++){
			lis[i][j]=INF;
		}
	}
	for(i=0;i<500;i++){
		for(j=0;j<500;j++){
			if(dis[i][j]<=l){
				lis[i][j]=1;
			}
		}
	}
	warshall_floydd();
	int q;
	scanf("%d",&q);
	for(i=0;i<q;i++){
		int s,t;
		scanf("%d%d",&s,&t);
		s--,t--;
		if(lis[s][t]<INF)printf("%lld\n",lis[s][t]-1);
		else puts("-1");
	}
	return 0;
}
4 0 0
1
2 1
 5 4 4
1 2 2
2 3 2
3 4 3
4 5 2
20
2 1
3 1
4 1
5 1
1 2
3 2
4 2
5 2
1 3
2 4
4 3
5 3
1 4
2 4
3 4
5 4
1 5
2 5
3 5
4 5
 5 4 4
1 2 2
2 3 2
3 4 3
4 5 2
20
2 1
3 1
3 1
5 1
1 2
3 2
4 2
5 2
1 3
2 3
4 3
5 3
1 4
2 4
3 4
5 4
1 5
2 5
3 5
4 5
 3 2 5
1 2 3
2 2 3
2
3 2
1 3
 5 4 4
1 2 4
2 3 2
3 4 3
4 5 2
20
2 1
3 1
4 1
5 1
1 2
3 2
4 2
5 2
1 3
2 4
4 3
5 3
1 4
2 4
3 4
5 4
1 5
2 5
3 5
4 5
 5 4 4
1 2 2
2 3 0
3 4 3
4 5 2
20
2 1
3 1
4 1
5 1
1 2
3 2
4 2
5 2
1 3
2 3
4 3
5 3
1 4
2 4
3 4
5 4
1 5
2 5
3 5
4 5
 5 4 4
1 2 4
2 3 2
3 4 3
4 5 2
20
2 1
3 1
4 1
5 1
1 4
3 2
4 2
5 2
1 3
2 4
4 3
5 3
1 4
2 4
3 4
5 4
1 5
2 5
3 5
4 5
 5 4 4
2 2 2
2 3 0
3 4 3
4 5 2
20
2 1
3 1
4 1
5 1
1 2
3 2
4 2
5 2
1 3
2 3
4 3
5 3
1 4
2 4
3 4
5 4
1 5
2 5
3 5
4 5
 5 4 4
2 2 2
2 3 0
3 4 3
4 5 2
20
2 1
3 1
4 1
5 1
1 2
3 2
4 2
5 2
1 3
2 5
4 3
5 3
1 4
2 4
3 4
5 4
1 5
2 5
3 5
4 5
 5 4 4
1 2 2
2 3 2
3 4 3
4 5 2
20
2 1
3 1
4 1
5 1
1 2
5 2
4 2
5 2
1 3
2 3
4 3
5 3
1 4
2 4
3 4
5 4
1 5
2 5
3 5
4 5

-1
 0
0
1
2
0
0
1
2
0
1
0
1
1
1
0
0
2
2
1
0
 0
0
0
2
0
0
1
2
0
0
0
1
1
1
0
0
2
2
1
0
 -1
-1
 0
1
2
3
0
0
1
2
1
1
0
1
2
1
0
0
3
2
1
0
 0
0
1
2
0
0
0
1
0
0
0
1
1
0
0
0
2
1
1
0
 0
1
2
3
2
0
1
2
1
1
0
1
2
1
0
0
3
2
1
0
 -1
-1
-1
-1
-1
0
0
1
-1
0
0
1
-1
0
0
0
-1
1
1
0
 -1
-1
-1
-1
-1
0
0
1
-1
1
0
1
-1
0
0
0
-1
1
1
0
 0
0
1
2
0
2
1
2
0
0
0
1
1
1
0
0
2
2
1
0

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

```c
#include<stdio.h>

#define min(a,b) ((a)<(b)?(a):(b))
#define INF 2000000000

int n;
long long dis[500][500];
long long lis[500][500];

void warshall_floyd(){
	int i,j,k;
	for(k=0;k<n;k++){
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
			}
		}
	}
}

void warshall_floydd(){
	int i,j,k;
	for(k=0;k<n;k++){
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				lis[i][j]=min(lis[i][j],lis[i][k]+lis[k][j]);
			}
		}
	}
}

int main(){
	int m,i,j,k,l;
	for(i=0;i<500;i++){
		for(j=0;j<500;j++){
			dis[i][j]=INF;
		}
	}
	scanf("%d%d%d",&n,&m,&l);
	for(i=0;i<m;i++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		a--,b--;
		dis[a][b]=c;
		dis[b][a]=c;
	}
	warshall_floyd();
	for(i=0;i<500;i++){
		for(j=0;j<500;j++){
			lis[i][j]=INF;
		}
	}
	for(i=0;i<500;i++){
		for(j=0;j<500;j++){
			if(dis[i][j]<=l){
				lis[i][j]=1;
			}
		}
	}
	warshall_floydd();
	int q;
	scanf("%d",&q);
	for(i=0;i<q;i++){
		int s,t;
		scanf("%d%d",&s,&t);
		s--,t--;
		if(lis[s][t]<INF)printf("%lld\n",lis[s][t]-1);
		else puts("-1");
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	dis
	.align 32
	.type	dis, @object
	.size	dis, 2000000
dis:
	.zero	2000000
	.globl	lis
	.align 32
	.type	lis, @object
	.size	lis, 2000000
lis:
	.zero	2000000
	.text
	.globl	warshall_floyd
	.type	warshall_floyd, @function
warshall_floyd:
.LFB0:
	.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	.L2
.L7:
	movl	$0, -12(%rbp)
	jmp	.L3
.L6:
	movl	$0, -8(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dis(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dis(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	(%rcx,%rax), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dis(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movl	-8(%rbp), %edx
	movslq	%edx, %rcx
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$500, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dis(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L5
	addl	$1, -12(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L6
	addl	$1, -4(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L7
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	warshall_floyd, .-warshall_floyd
	.globl	warshall_floydd
	.type	warshall_floydd, @function
warshall_floydd:
.LFB1:
	.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	.L9
.L14:
	movl	$0, -12(%rbp)
	jmp	.L10
.L13:
	movl	$0, -8(%rbp)
	jmp	.L11
.L12:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	(%rcx,%rax), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	lis(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movl	-8(%rbp), %edx
	movslq	%edx, %rcx
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$500, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	lis(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L12
	addl	$1, -12(%rbp)
.L10:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	addl	$1, -4(%rbp)
.L9:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L14
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	warshall_floydd, .-warshall_floydd
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%lld\n"
.LC4:
	.string	"-1"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	jmp	.L16
.L19:
	movl	$0, -12(%rbp)
	jmp	.L17
.L18:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dis(%rip), %rax
	movq	$2000000000, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L17:
	cmpl	$499, -12(%rbp)
	jle	.L18
	addl	$1, -16(%rbp)
.L16:
	cmpl	$499, -16(%rbp)
	jle	.L19
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rdx, %rcx
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L20
.L21:
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %ecx
	cltq
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	imulq	$500, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dis(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %ecx
	cltq
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	imulq	$500, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dis(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L20:
	movl	-36(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L21
	movl	$0, %eax
	call	warshall_floyd
	movl	$0, -16(%rbp)
	jmp	.L22
.L25:
	movl	$0, -12(%rbp)
	jmp	.L23
.L24:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	$2000000000, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L23:
	cmpl	$499, -12(%rbp)
	jle	.L24
	addl	$1, -16(%rbp)
.L22:
	cmpl	$499, -16(%rbp)
	jle	.L25
	movl	$0, -16(%rbp)
	jmp	.L26
.L30:
	movl	$0, -12(%rbp)
	jmp	.L27
.L29:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dis(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-32(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jg	.L28
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	$1, (%rdx,%rax)
.L28:
	addl	$1, -12(%rbp)
.L27:
	cmpl	$499, -12(%rbp)
	jle	.L29
	addl	$1, -16(%rbp)
.L26:
	cmpl	$499, -16(%rbp)
	jle	.L30
	movl	$0, %eax
	call	warshall_floydd
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L31
.L34:
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	$1999999999, %rax
	jg	.L32
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L33
.L32:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L33:
	addl	$1, -16(%rbp)
.L31:
	movl	-28(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L34
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	dis
	.align 32
	.type	dis, @object
	.size	dis, 2000000
dis:
	.zero	2000000
	.globl	lis
	.align 32
	.type	lis, @object
	.size	lis, 2000000
lis:
	.zero	2000000
	.text
	.globl	warshall_floyd
	.type	warshall_floyd, @function
warshall_floyd:
.LFB0:
	.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	.L2
.L7:
	movl	$0, -12(%rbp)
	jmp	.L3
.L6:
	movl	$0, -8(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dis(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dis(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	(%rcx,%rax), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dis(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movl	-8(%rbp), %edx
	movslq	%edx, %rcx
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$500, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dis(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L5
	addl	$1, -12(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L6
	addl	$1, -4(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L7
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	warshall_floyd, .-warshall_floyd
	.globl	warshall_floydd
	.type	warshall_floydd, @function
warshall_floydd:
.LFB1:
	.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	.L9
.L14:
	movl	$0, -12(%rbp)
	jmp	.L10
.L13:
	movl	$0, -8(%rbp)
	jmp	.L11
.L12:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	(%rcx,%rax), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	lis(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movl	-8(%rbp), %edx
	movslq	%edx, %rcx
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$500, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	lis(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L12
	addl	$1, -12(%rbp)
.L10:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	addl	$1, -4(%rbp)
.L9:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L14
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	warshall_floydd, .-warshall_floydd
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%lld\n"
.LC4:
	.string	"-1"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	jmp	.L16
.L19:
	movl	$0, -12(%rbp)
	jmp	.L17
.L18:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dis(%rip), %rax
	movq	$2000000000, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L17:
	cmpl	$499, -12(%rbp)
	jle	.L18
	addl	$1, -16(%rbp)
.L16:
	cmpl	$499, -16(%rbp)
	jle	.L19
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rdx, %rcx
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L20
.L21:
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %ecx
	cltq
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	imulq	$500, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dis(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %ecx
	cltq
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	imulq	$500, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dis(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L20:
	movl	-36(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L21
	movl	$0, %eax
	call	warshall_floyd
	movl	$0, -16(%rbp)
	jmp	.L22
.L25:
	movl	$0, -12(%rbp)
	jmp	.L23
.L24:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	$2000000000, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L23:
	cmpl	$499, -12(%rbp)
	jle	.L24
	addl	$1, -16(%rbp)
.L22:
	cmpl	$499, -16(%rbp)
	jle	.L25
	movl	$0, -16(%rbp)
	jmp	.L26
.L30:
	movl	$0, -12(%rbp)
	jmp	.L27
.L29:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dis(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-32(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jg	.L28
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	$1, (%rdx,%rax)
.L28:
	addl	$1, -12(%rbp)
.L27:
	cmpl	$499, -12(%rbp)
	jle	.L29
	addl	$1, -16(%rbp)
.L26:
	cmpl	$499, -16(%rbp)
	jle	.L30
	movl	$0, %eax
	call	warshall_floydd
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L31
.L34:
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	$1999999999, %rax
	jg	.L32
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	lis(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L33
.L32:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L33:
	addl	$1, -16(%rbp)
.L31:
	movl	-28(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L34
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
