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

```c
#include<stdio.h>
int graph[101][101],n,c,d;

void warshall_floyd(){
  int i,j;
  for(i=1;i<=n;i++)
    for(j=1;j<=n;j++)
      graph[i][j]=graph[j][i]=min(graph[i][j],graph[i][c]+graph[c][d]+graph[d][j]);
}

int min(int x,int y){
  return x<y?x:y;
}

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

  while(scanf("%d %d",&n,&k),n,k){

    for(i=0;i<=n;i++)
      for(j=0;j<=n;j++)
	graph[i][j]=i==j?0:1000000;

    for(i=0;i<k;i++){
      if(scanf("%d",&x),x){
	scanf("%d %d %d",&c,&d,&e);

	if(graph[c][d]>e){
	graph[c][d]=graph[d][c]=e;
	warshall_floyd();
	}
      }else{
	scanf("%d %d",&a,&b);
	printf(graph[a][b]>=1000000?"-1\n":"%d\n",graph[a][b]);
      }
    }
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	graph
	.bss
	.align 32
	.type	graph, @object
	.size	graph, 40804
graph:
	.zero	40804
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	d
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.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
	subq	$16, %rsp
	movl	$1, -8(%rbp)
	jmp	.L2
.L5:
	movl	$1, -4(%rbp)
	jmp	.L3
.L4:
	movl	c(%rip), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	c(%rip), %eax
	movl	d(%rip), %edx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	(%rcx,%rax), %edi
	movl	d(%rip), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	(%rdi,%rax), %ecx
	movl	-4(%rbp), %eax
	movslq	%eax, %rsi
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	min
	movl	%eax, %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-4(%rbp), %eax
	movslq	%eax, %rsi
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L4
	addl	$1, -8(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L5
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	warshall_floyd, .-warshall_floyd
	.globl	min
	.type	min, @function
min:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	min, .-min
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"-1\n"
.LC4:
	.string	"%d\n"
	.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
	jmp	.L9
.L22:
	movl	$0, -16(%rbp)
	jmp	.L10
.L15:
	movl	$0, -12(%rbp)
	jmp	.L11
.L14:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jne	.L12
	movl	$0, %ecx
	jmp	.L13
.L12:
	movl	$1000000, %ecx
.L13:
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L14
	addl	$1, -16(%rbp)
.L10:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L15
	movl	$0, -16(%rbp)
	jmp	.L16
.L21:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	je	.L17
	leaq	-28(%rbp), %rax
	movq	%rax, %rcx
	leaq	d(%rip), %rax
	movq	%rax, %rdx
	leaq	c(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	c(%rip), %eax
	movl	d(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-28(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L18
	movl	d(%rip), %ecx
	movl	c(%rip), %esi
	movl	-28(%rbp), %edi
	movslq	%esi, %r8
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %r9
	addq	%r9, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%r8, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	%edi, (%rdx,%rax)
	movl	c(%rip), %edi
	movl	d(%rip), %r8d
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movslq	%r8d, %rsi
	movslq	%edi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	$0, %eax
	call	warshall_floyd
	jmp	.L18
.L17:
	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
	movl	-20(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$999999, %eax
	jle	.L19
	leaq	.LC3(%rip), %rax
	jmp	.L20
.L19:
	leaq	.LC4(%rip), %rax
.L20:
	movl	%ecx, %esi
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L18:
	addl	$1, -16(%rbp)
.L16:
	movl	-36(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L21
.L9:
	leaq	-36(%rbp), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	.L22
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	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
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$64, %rsp
	.cfi_def_cfa_offset 120
	movl	n(%rip), %r10d
	movl	%r10d, -48(%rsp)
	testl	%r10d, %r10d
	jle	.L1
	movslq	c(%rip), %rdi
	leal	1(%r10), %esi
	movslq	%r10d, %rax
	movslq	d(%rip), %r8
	movl	%esi, -8(%rsp)
	leaq	408+graph(%rip), %rdx
	leaq	408(,%rax,4), %rbx
	leaq	(%rdi,%rdi,4), %rsi
	leaq	-408(%rdx), %rcx
	movq	%rbx, -112(%rsp)
	movq	%rsi, -88(%rsp)
	leaq	(%rsi,%rsi,4), %rsi
	leaq	404(,%rdi,4), %rbx
	leaq	(%rdi,%rsi,4), %rsi
	movq	%rdi, -80(%rsp)
	leaq	(%rcx,%rdi,4), %r11
	leaq	1(%rsi,%r8), %rsi
	movq	%r8, -72(%rsp)
	leaq	0(,%rsi,4), %rdi
	leaq	(%r8,%r8,4), %rsi
	movq	%rdx, -104(%rsp)
	movq	%rdi, -64(%rsp)
	leaq	(%rsi,%rsi,4), %rsi
	subq	$4, %rdi
	movq	%rdi, -56(%rsp)
	leaq	(%r8,%rsi,4), %r15
	movl	%r10d, %esi
	imulq	$-404, %r8, %rdi
	subl	$1, %esi
	movq	%r15, 24(%rsp)
	imulq	$404, %rax, %r9
	leaq	1(%rax,%r15), %rax
	movl	%esi, -44(%rsp)
	salq	$2, %rax
	imulq	$404, %rsi, %rsi
	movl	$1, -116(%rsp)
	movq	%rax, -32(%rsp)
	movq	%rdi, %rax
	negq	%rax
	addq	$8, %r9
	movq	%rax, 40(%rsp)
	movl	$4, %eax
	subq	%rdi, %rax
	subq	$8, %rdi
	movq	%rsi, 48(%rsp)
	leaq	(%rcx,%rax), %rbp
	movq	%rax, -40(%rsp)
	movl	%r10d, %eax
	andl	$-4, %r10d
	shrl	$2, %eax
	leal	2(%r10), %r8d
	movq	%rdi, -24(%rsp)
	subl	$1, %eax
	movq	%rbp, -96(%rsp)
	addq	$1, %rax
	movl	%r8d, 16(%rsp)
	leal	3(%r10), %r8d
	salq	$4, %rax
	movl	%r10d, -4(%rsp)
	movq	%rax, -16(%rsp)
	leal	1(%r10), %eax
	movl	$408, %r10d
	cltq
	movl	%r8d, 20(%rsp)
	movl	$408, %r8d
	addq	%rax, %r15
	movq	%rax, (%rsp)
	movq	%r15, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L8:
	movq	-64(%rsp), %rsi
	movq	-112(%rsp), %r15
	leaq	4(%rbx), %rdi
	movq	-56(%rsp), %r14
	cmpq	%r8, %rsi
	setle	%r12b
	cmpq	%r15, %r14
	setge	%al
	orl	%eax, %r12d
	cmpq	%r10, %rsi
	setle	%sil
	cmpq	%r9, %r14
	setge	%al
	orl	%esi, %eax
	andl	%r12d, %eax
	cmpl	$2, -44(%rsp)
	seta	%sil
	andl	%esi, %eax
	movq	-24(%rsp), %rsi
	addq	%r8, %rsi
	cmpq	$8, %rsi
	seta	%sil
	andl	%esi, %eax
	cmpq	%r10, -32(%rsp)
	setle	%sil
	cmpq	%r9, -40(%rsp)
	setge	%r12b
	orl	%r12d, %esi
	andl	%eax, %esi
	cmpq	%r9, %r8
	setge	%al
	cmpq	%r10, %r15
	setle	%r12b
	orl	%r12d, %eax
	andl	%esi, %eax
	cmpq	%rdi, %r8
	setge	%sil
	cmpq	%rbx, %r15
	setle	%r12b
	orl	%r12d, %esi
	testb	%sil, %al
	je	.L3
	cmpq	%r10, %rdi
	setle	%sil
	cmpq	%r9, %rbx
	setge	%al
	orb	%sil, %al
	je	.L3
	movq	-88(%rsp), %rax
	movq	-80(%rsp), %rdi
	movq	-104(%rsp), %rsi
	movq	-96(%rsp), %rbp
	leaq	(%rax,%rax,4), %rax
	leaq	(%rdi,%rax,4), %rax
	addq	-72(%rsp), %rax
	movl	(%rcx,%rax,4), %edi
	addl	404(%r11), %edi
	xorl	%eax, %eax
	movd	%edi, %xmm5
	movq	-16(%rsp), %rdi
	pshufd	$0, %xmm5, %xmm3
	.p2align 4,,10
	.p2align 3
.L4:
	movdqu	0(%rbp,%rax), %xmm2
	movdqu	(%rdx,%rax), %xmm4
	addq	$1616, %rsi
	paddd	%xmm3, %xmm2
	movdqa	%xmm4, %xmm1
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm4, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1
	movd	%xmm0, -1616(%rsi)
	movd	%xmm1, -1212(%rsi)
	movdqa	%xmm0, %xmm1
	punpckhdq	%xmm0, %xmm1
	movd	%xmm1, -808(%rsi)
	pshufd	$255, %xmm0, %xmm1
	movd	%xmm1, -404(%rsi)
	movups	%xmm0, (%rdx,%rax)
	addq	$16, %rax
	cmpq	%rdi, %rax
	jne	.L4
	movl	-48(%rsp), %r15d
	movl	-4(%rsp), %eax
	movq	%rbp, -96(%rsp)
	cmpl	%eax, %r15d
	je	.L7
	movq	-88(%rsp), %rax
	movq	-80(%rsp), %rdi
	movslq	-116(%rsp), %rsi
	movq	(%rsp), %rbp
	leaq	(%rax,%rax,4), %rax
	leaq	(%rdi,%rax,4), %r12
	movq	8(%rsp), %rdi
	addq	-72(%rsp), %r12
	movl	(%rcx,%r12,4), %eax
	addl	404(%r11), %eax
	addl	(%rcx,%rdi,4), %eax
	leaq	(%rsi,%rsi,4), %rdi
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rsi,%rdi,4), %rdi
	leaq	(%rdi,%rbp), %r13
	movl	(%rcx,%r13,4), %r14d
	cmpl	%r14d, %eax
	cmovg	%r14d, %eax
	leaq	0(%rbp,%rbp,4), %r14
	leaq	(%r14,%r14,4), %r14
	leaq	0(%rbp,%r14,4), %r14
	addq	%rsi, %r14
	movl	%eax, (%rcx,%r14,4)
	movl	16(%rsp), %r14d
	movl	%eax, (%rcx,%r13,4)
	cmpl	%r14d, %r15d
	jl	.L7
	movq	24(%rsp), %rbp
	movslq	%r14d, %r13
	movl	(%rcx,%r12,4), %eax
	addl	404(%r11), %eax
	leaq	0(%rbp,%r13), %r14
	addl	(%rcx,%r14,4), %eax
	leaq	(%rdi,%r13), %r14
	movl	(%rcx,%r14,4), %r15d
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
	leaq	0(%r13,%r13,4), %r15
	leaq	(%r15,%r15,4), %r15
	leaq	0(%r13,%r15,4), %r13
	addq	%rsi, %r13
	movl	%eax, (%rcx,%r13,4)
	movl	%eax, (%rcx,%r14,4)
	movl	20(%rsp), %r14d
	cmpl	%r14d, -48(%rsp)
	jl	.L7
	movl	(%rcx,%r12,4), %eax
	movslq	%r14d, %r12
	addl	404(%r11), %eax
	addq	%r12, %rdi
	leaq	0(%rbp,%r12), %r13
	addl	(%rcx,%r13,4), %eax
	movl	(%rcx,%rdi,4), %r13d
	cmpl	%r13d, %eax
	cmovg	%r13d, %eax
	leaq	(%r12,%r12,4), %r13
	leaq	0(%r13,%r13,4), %r13
	leaq	(%r12,%r13,4), %r12
	addq	%rsi, %r12
	movl	%eax, (%rcx,%r12,4)
	movl	%eax, (%rcx,%rdi,4)
.L7:
	addl	$1, -116(%rsp)
	addq	$4, %r10
	movl	-116(%rsp), %eax
	addq	$404, %r8
	addq	$404, -112(%rsp)
	addq	$404, %rbx
	addq	$4, %r9
	addq	$404, %rdx
	addq	$4, -104(%rsp)
	addq	$404, %r11
	cmpl	-8(%rsp), %eax
	jne	.L8
.L1:
	addq	$64, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	movq	-104(%rsp), %rax
	movq	-80(%rsp), %r15
	movl	$4, %r12d
	movq	%rdx, %rsi
	movq	%r8, 32(%rsp)
	subq	%r8, %r12
	movq	-96(%rsp), %rbp
	leaq	-404(%rax), %rdi
	movq	48(%rsp), %rax
	movq	40(%rsp), %r8
	leaq	(%rcx,%rax), %r14
	movq	-88(%rsp), %rax
	addq	%r10, %r14
	leaq	(%rax,%rax,4), %rax
	leaq	(%r15,%rax,4), %r13
	addq	-72(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	(%r12,%rsi), %r15
	movl	(%rcx,%r13,4), %eax
	addl	404(%r11), %eax
	addl	(%r15,%r8), %eax
	movl	(%rsi), %r15d
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
	addq	$404, %rdi
	addq	$4, %rsi
	movl	%eax, (%rdi)
	movl	%eax, -4(%rsi)
	cmpq	%r14, %rdi
	jne	.L6
	movq	%rbp, -96(%rsp)
	movq	32(%rsp), %r8
	jmp	.L7
	.cfi_endproc
.LFE23:
	.size	warshall_floyd, .-warshall_floyd
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovle	%esi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"-1\n"
.LC2:
	.string	"%d\n"
.LC5:
	.string	"%d"
.LC6:
	.string	"%d %d %d"
.LC7:
	.string	"%d %d"
	.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
	leaq	graph(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$232, %rsp
	.cfi_def_cfa_offset 288
	movq	%fs:40, %rax
	movq	%rax, 216(%rsp)
	xorl	%eax, %eax
	leaq	196(%rsp), %rax
	movq	%rax, 184(%rsp)
	.p2align 4,,10
	.p2align 3
.L22:
	leaq	n(%rip), %rsi
	movq	184(%rsp), %rdx
	leaq	.LC7(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	196(%rsp), %r11d
	testl	%r11d, %r11d
	je	.L46
	movl	n(%rip), %r8d
	movdqa	.LC3(%rip), %xmm5
	movdqa	.LC4(%rip), %xmm4
	testl	%r8d, %r8d
	js	.L48
	leal	1(%r8), %r9d
	leaq	graph(%rip), %rsi
	xorl	%edx, %edx
	xorl	%ebp, %ebp
	movl	%r9d, %eax
	movl	%r9d, %r12d
	movl	$1000000, %ebx
	shrl	$2, %eax
	andl	$-4, %r12d
	leal	-1(%rax), %r15d
	addq	$1, %r15
	salq	$4, %r15
	.p2align 4,,10
	.p2align 3
.L29:
	cmpl	$2, %r8d
	jle	.L50
	movd	%edx, %xmm7
	movdqa	.LC0(%rip), %xmm1
	leaq	(%r15,%rsi), %rcx
	movq	%rsi, %rax
	pshufd	$0, %xmm7, %xmm2
	.p2align 4,,10
	.p2align 3
.L24:
	movdqa	%xmm1, %xmm0
	addq	$16, %rax
	paddd	%xmm5, %xmm1
	pcmpeqd	%xmm2, %xmm0
	pandn	%xmm4, %xmm0
	movups	%xmm0, -16(%rax)
	cmpq	%rcx, %rax
	jne	.L24
	movl	%r12d, %eax
	cmpl	%r12d, %r9d
	je	.L25
.L23:
	movslq	%edx, %rdi
	cmpl	%eax, %edx
	movl	%ebx, %r10d
	movslq	%eax, %rcx
	leaq	(%rdi,%rdi,4), %r14
	cmove	%ebp, %r10d
	leaq	(%r14,%r14,4), %r14
	leaq	(%rdi,%r14,4), %rdi
	addq	%rdi, %rcx
	movl	%r10d, 0(%r13,%rcx,4)
	leal	1(%rax), %ecx
	cmpl	%ecx, %r8d
	jl	.L25
	cmpl	%edx, %ecx
	movl	%ebx, %r10d
	movslq	%ecx, %rcx
	cmove	%ebp, %r10d
	addq	%rdi, %rcx
	addl	$2, %eax
	movl	%r10d, 0(%r13,%rcx,4)
	cmpl	%r8d, %eax
	jg	.L25
	cmpl	%edx, %eax
	movl	%ebx, %ecx
	cltq
	cmove	%ebp, %ecx
	addq	%rax, %rdi
	movl	%ecx, 0(%r13,%rdi,4)
.L25:
	addl	$1, %edx
	addq	$404, %rsi
	cmpl	%r9d, %edx
	jne	.L29
.L48:
	leaq	200(%rsp), %rax
	movl	$0, 12(%rsp)
	movq	%rax, 128(%rsp)
	testl	%r11d, %r11d
	jg	.L30
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L69:
	leaq	d(%rip), %rdx
	leaq	.LC6(%rip), %rdi
	xorl	%eax, %eax
	leaq	204(%rsp), %rcx
	leaq	c(%rip), %rsi
	call	__isoc99_scanf@PLT
	movslq	c(%rip), %rbx
	movslq	d(%rip), %rdi
	movl	204(%rsp), %eax
	leaq	(%rbx,%rbx,4), %rdx
	movq	%rdi, 48(%rsp)
	movq	%rdx, 56(%rsp)
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rbx,%rdx,4), %rcx
	movq	%rbx, 40(%rsp)
	addq	%rdi, %rcx
	cmpl	%eax, 0(%r13,%rcx,4)
	jg	.L68
.L33:
	addl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	cmpl	%eax, 196(%rsp)
	jle	.L22
.L30:
	movq	128(%rsp), %rsi
	leaq	.LC5(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	200(%rsp), %eax
	testl	%eax, %eax
	jne	.L69
	leaq	212(%rsp), %rdx
	leaq	208(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC7(%rip), %rdi
	call	__isoc99_scanf@PLT
	movslq	208(%rsp), %rax
	movl	$1, %edi
	movslq	212(%rsp), %rcx
	leaq	.LC2(%rip), %rsi
	leaq	(%rax,%rax,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,4), %rax
	addq	%rcx, %rax
	movl	0(%r13,%rax,4), %edx
	leaq	.LC1(%rip), %rax
	cmpl	$999999, %edx
	cmovg	%rax, %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L68:
	leaq	(%rdi,%rdi,4), %rdx
	movq	%rbx, %rsi
	movq	%rdi, %rbx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdi,%rdx,4), %r14
	movl	n(%rip), %edi
	movq	%r14, %rdx
	movq	%r14, 152(%rsp)
	addq	%rsi, %rdx
	movl	%edi, 88(%rsp)
	movl	%eax, 0(%r13,%rdx,4)
	movl	%eax, 0(%r13,%rcx,4)
	testl	%edi, %edi
	jle	.L33
	movslq	%edi, %rax
	leaq	0(%r13,%rsi,4), %r10
	movl	$1, 8(%rsp)
	imulq	$404, %rax, %r8
	leaq	408(,%rax,4), %rdx
	movq	%rdx, 16(%rsp)
	leaq	404(,%rsi,4), %rdx
	leal	1(%rdi), %esi
	movl	%esi, 120(%rsp)
	leaq	4(,%rcx,4), %rsi
	leaq	1(%rax,%r14), %rax
	movq	%rsi, 72(%rsp)
	leaq	0(,%rcx,4), %rsi
	salq	$2, %rax
	addq	$8, %r8
	imulq	$-404, %rbx, %rcx
	movq	%rax, 96(%rsp)
	movq	%rsi, 80(%rsp)
	movl	%edi, %esi
	subl	$1, %esi
	movq	%rdx, 24(%rsp)
	leaq	408+graph(%rip), %rdx
	movq	%rcx, %rax
	movl	%esi, 92(%rsp)
	negq	%rax
	movq	%rdx, 32(%rsp)
	movq	%rax, 176(%rsp)
	movl	$4, %eax
	subq	%rcx, %rax
	movq	%rax, 104(%rsp)
	leaq	0(%r13,%rax), %rbx
	movl	%edi, %eax
	andl	$-4, %edi
	shrl	$2, %eax
	leal	2(%rdi), %r9d
	movl	%edi, 124(%rsp)
	leal	-1(%rax), %r11d
	leal	1(%rdi), %eax
	addl	$3, %edi
	movl	%r9d, 160(%rsp)
	cltq
	addq	$1, %r11
	movl	%edi, 164(%rsp)
	movl	$408, %r9d
	imulq	$404, %rsi, %rdi
	salq	$4, %r11
	leaq	-8(%rcx), %rsi
	addq	%rax, %r14
	movq	%rsi, 112(%rsp)
	movq	%rax, 136(%rsp)
	movq	%r14, 144(%rsp)
	movq	%r11, 64(%rsp)
	movq	%rdi, 168(%rsp)
	movl	$408, %edi
	.p2align 4,,10
	.p2align 3
.L35:
	movq	72(%rsp), %rcx
	movq	16(%rsp), %r14
	movq	80(%rsp), %r12
	movq	24(%rsp), %r15
	cmpq	%rdi, %rcx
	setle	%bpl
	cmpq	%r14, %r12
	leaq	4(%r15), %rsi
	setge	%al
	orl	%eax, %ebp
	cmpq	%r9, %rcx
	setle	%cl
	cmpq	%r8, %r12
	setge	%al
	orl	%ecx, %eax
	andl	%ebp, %eax
	cmpl	$2, 92(%rsp)
	seta	%cl
	andl	%ecx, %eax
	movq	112(%rsp), %rcx
	addq	%rdi, %rcx
	cmpq	$8, %rcx
	seta	%cl
	andl	%ecx, %eax
	cmpq	%r9, 96(%rsp)
	setle	%cl
	cmpq	104(%rsp), %r8
	setle	%bpl
	orl	%ebp, %ecx
	andl	%eax, %ecx
	cmpq	%r8, %rdi
	setge	%al
	cmpq	%r9, %r14
	setle	%bpl
	orl	%ebp, %eax
	andl	%ecx, %eax
	cmpq	%rsi, %rdi
	setge	%cl
	cmpq	%r15, %r14
	setle	%bpl
	orl	%ebp, %ecx
	testb	%cl, %al
	je	.L43
	cmpq	%r9, %rsi
	setle	%cl
	cmpq	%r8, %r15
	setge	%al
	orb	%cl, %al
	je	.L43
	movq	56(%rsp), %rax
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rcx
	movq	64(%rsp), %r11
	leaq	(%rax,%rax,4), %rax
	leaq	(%rsi,%rax,4), %rax
	addq	48(%rsp), %rax
	movl	0(%r13,%rax,4), %esi
	addl	404(%r10), %esi
	xorl	%eax, %eax
	movd	%esi, %xmm7
	pshufd	$0, %xmm7, %xmm3
	.p2align 4,,10
	.p2align 3
.L39:
	movdqu	(%rbx,%rax), %xmm2
	movdqu	(%rdx,%rax), %xmm6
	addq	$1616, %rcx
	paddd	%xmm3, %xmm2
	movdqa	%xmm6, %xmm1
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm6, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1
	movd	%xmm0, -1616(%rcx)
	movd	%xmm1, -1212(%rcx)
	movdqa	%xmm0, %xmm1
	punpckhdq	%xmm0, %xmm1
	movd	%xmm1, -808(%rcx)
	pshufd	$255, %xmm0, %xmm1
	movd	%xmm1, -404(%rcx)
	movups	%xmm0, (%rdx,%rax)
	addq	$16, %rax
	cmpq	%r11, %rax
	jne	.L39
	movl	88(%rsp), %r15d
	movl	124(%rsp), %eax
	movq	%r11, 64(%rsp)
	cmpl	%eax, %r15d
	je	.L38
	movq	56(%rsp), %rax
	movq	40(%rsp), %rsi
	movslq	8(%rsp), %rcx
	movq	136(%rsp), %r11
	leaq	(%rax,%rax,4), %rax
	leaq	(%rsi,%rax,4), %rbp
	addq	48(%rsp), %rbp
	movq	144(%rsp), %rsi
	movl	404(%r10), %eax
	addl	0(%r13,%rbp,4), %eax
	addl	0(%r13,%rsi,4), %eax
	leaq	(%rcx,%rcx,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rcx,%rsi,4), %rsi
	leaq	(%rsi,%r11), %r12
	movl	0(%r13,%r12,4), %r14d
	cmpl	%r14d, %eax
	cmovg	%r14d, %eax
	leaq	(%r11,%r11,4), %r14
	leaq	(%r14,%r14,4), %r14
	leaq	(%r11,%r14,4), %r14
	movl	160(%rsp), %r11d
	addq	%rcx, %r14
	movl	%eax, 0(%r13,%r14,4)
	movl	%eax, 0(%r13,%r12,4)
	cmpl	%r15d, %r11d
	jg	.L38
	movslq	%r11d, %r12
	movq	152(%rsp), %r11
	movl	404(%r10), %eax
	addl	0(%r13,%rbp,4), %eax
	leaq	(%r11,%r12), %r14
	addl	0(%r13,%r14,4), %eax
	leaq	(%rsi,%r12), %r14
	movl	0(%r13,%r14,4), %r15d
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
	leaq	(%r12,%r12,4), %r15
	leaq	(%r15,%r15,4), %r15
	leaq	(%r12,%r15,4), %r12
	movl	88(%rsp), %r15d
	addq	%rcx, %r12
	movl	%eax, 0(%r13,%r12,4)
	movl	%eax, 0(%r13,%r14,4)
	movl	164(%rsp), %r14d
	cmpl	%r15d, %r14d
	jg	.L38
	movl	0(%r13,%rbp,4), %eax
	movslq	%r14d, %rbp
	addl	404(%r10), %eax
	addq	%rbp, %rsi
	leaq	(%r11,%rbp), %r12
	addl	0(%r13,%r12,4), %eax
	movl	0(%r13,%rsi,4), %r12d
	cmpl	%r12d, %eax
	cmovg	%r12d, %eax
	leaq	0(%rbp,%rbp,4), %r12
	leaq	(%r12,%r12,4), %r12
	leaq	0(%rbp,%r12,4), %rbp
	addq	%rcx, %rbp
	movl	%eax, 0(%r13,%rbp,4)
	movl	%eax, 0(%r13,%rsi,4)
.L38:
	addl	$1, 8(%rsp)
	addq	$4, %r9
	movl	8(%rsp), %eax
	addq	$404, %rdi
	addq	$404, 16(%rsp)
	addq	$4, %r8
	addq	$404, %rdx
	addq	$404, %r10
	addq	$404, 24(%rsp)
	addq	$4, 32(%rsp)
	cmpl	120(%rsp), %eax
	jne	.L35
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L43:
	movq	32(%rsp), %rax
	movq	40(%rsp), %r11
	movl	$4, %ebp
	movq	%rdx, %rcx
	subq	%rdi, %rbp
	leaq	-404(%rax), %rsi
	movq	168(%rsp), %rax
	leaq	0(%r13,%rax), %r14
	movq	56(%rsp), %rax
	addq	%r9, %r14
	leaq	(%rax,%rax,4), %rax
	leaq	(%r11,%rax,4), %r12
	movq	176(%rsp), %r11
	addq	48(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L37:
	leaq	0(%rbp,%rcx), %r15
	movl	0(%r13,%r12,4), %eax
	addl	404(%r10), %eax
	addl	(%r15,%r11), %eax
	movl	(%rcx), %r15d
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
	addq	$404, %rsi
	addq	$4, %rcx
	movl	%eax, (%rsi)
	movl	%eax, -4(%rcx)
	cmpq	%r14, %rsi
	jne	.L37
	jmp	.L38
.L50:
	xorl	%eax, %eax
	jmp	.L23
.L46:
	movq	216(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L70
	addq	$232, %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
.L70:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	d
	.bss
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	graph
	.align 32
	.type	graph, @object
	.size	graph, 40804
graph:
	.zero	40804
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC4:
	.long	1000000
	.long	1000000
	.long	1000000
	.long	1000000
	.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
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$64, %rsp
	.cfi_def_cfa_offset 120
	movl	n(%rip), %r10d
	movl	%r10d, -48(%rsp)
	testl	%r10d, %r10d
	jle	.L1
	movslq	c(%rip), %rdi
	leal	1(%r10), %esi
	movslq	%r10d, %rax
	movslq	d(%rip), %r8
	movl	%esi, -8(%rsp)
	leaq	408+graph(%rip), %rdx
	leaq	408(,%rax,4), %rbx
	leaq	(%rdi,%rdi,4), %rsi
	leaq	-408(%rdx), %rcx
	movq	%rbx, -112(%rsp)
	movq	%rsi, -88(%rsp)
	leaq	(%rsi,%rsi,4), %rsi
	leaq	404(,%rdi,4), %rbx
	leaq	(%rdi,%rsi,4), %rsi
	movq	%rdi, -80(%rsp)
	leaq	(%rcx,%rdi,4), %r11
	leaq	1(%rsi,%r8), %rsi
	movq	%r8, -72(%rsp)
	leaq	0(,%rsi,4), %rdi
	leaq	(%r8,%r8,4), %rsi
	movq	%rdx, -104(%rsp)
	movq	%rdi, -64(%rsp)
	leaq	(%rsi,%rsi,4), %rsi
	subq	$4, %rdi
	movq	%rdi, -56(%rsp)
	leaq	(%r8,%rsi,4), %r15
	movl	%r10d, %esi
	imulq	$-404, %r8, %rdi
	subl	$1, %esi
	movq	%r15, 24(%rsp)
	imulq	$404, %rax, %r9
	leaq	1(%rax,%r15), %rax
	movl	%esi, -44(%rsp)
	salq	$2, %rax
	imulq	$404, %rsi, %rsi
	movl	$1, -116(%rsp)
	movq	%rax, -32(%rsp)
	movq	%rdi, %rax
	negq	%rax
	addq	$8, %r9
	movq	%rax, 40(%rsp)
	movl	$4, %eax
	subq	%rdi, %rax
	subq	$8, %rdi
	movq	%rsi, 48(%rsp)
	leaq	(%rcx,%rax), %rbp
	movq	%rax, -40(%rsp)
	movl	%r10d, %eax
	andl	$-4, %r10d
	shrl	$2, %eax
	leal	2(%r10), %r8d
	movq	%rdi, -24(%rsp)
	subl	$1, %eax
	movq	%rbp, -96(%rsp)
	addq	$1, %rax
	movl	%r8d, 16(%rsp)
	leal	3(%r10), %r8d
	salq	$4, %rax
	movl	%r10d, -4(%rsp)
	movq	%rax, -16(%rsp)
	leal	1(%r10), %eax
	movl	$408, %r10d
	cltq
	movl	%r8d, 20(%rsp)
	movl	$408, %r8d
	addq	%rax, %r15
	movq	%rax, (%rsp)
	movq	%r15, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L8:
	movq	-64(%rsp), %rsi
	movq	-112(%rsp), %r15
	leaq	4(%rbx), %rdi
	movq	-56(%rsp), %r14
	cmpq	%r8, %rsi
	setle	%r12b
	cmpq	%r15, %r14
	setge	%al
	orl	%eax, %r12d
	cmpq	%r10, %rsi
	setle	%sil
	cmpq	%r9, %r14
	setge	%al
	orl	%esi, %eax
	andl	%r12d, %eax
	cmpl	$2, -44(%rsp)
	seta	%sil
	andl	%esi, %eax
	movq	-24(%rsp), %rsi
	addq	%r8, %rsi
	cmpq	$8, %rsi
	seta	%sil
	andl	%esi, %eax
	cmpq	%r10, -32(%rsp)
	setle	%sil
	cmpq	%r9, -40(%rsp)
	setge	%r12b
	orl	%r12d, %esi
	andl	%eax, %esi
	cmpq	%r9, %r8
	setge	%al
	cmpq	%r10, %r15
	setle	%r12b
	orl	%r12d, %eax
	andl	%esi, %eax
	cmpq	%rdi, %r8
	setge	%sil
	cmpq	%rbx, %r15
	setle	%r12b
	orl	%r12d, %esi
	testb	%sil, %al
	je	.L3
	cmpq	%r10, %rdi
	setle	%sil
	cmpq	%r9, %rbx
	setge	%al
	orb	%sil, %al
	je	.L3
	movq	-88(%rsp), %rax
	movq	-80(%rsp), %rdi
	movq	-104(%rsp), %rsi
	movq	-96(%rsp), %rbp
	leaq	(%rax,%rax,4), %rax
	leaq	(%rdi,%rax,4), %rax
	addq	-72(%rsp), %rax
	movl	(%rcx,%rax,4), %edi
	addl	404(%r11), %edi
	xorl	%eax, %eax
	movd	%edi, %xmm5
	movq	-16(%rsp), %rdi
	pshufd	$0, %xmm5, %xmm3
	.p2align 4,,10
	.p2align 3
.L4:
	movdqu	0(%rbp,%rax), %xmm2
	movdqu	(%rdx,%rax), %xmm4
	addq	$1616, %rsi
	paddd	%xmm3, %xmm2
	movdqa	%xmm4, %xmm1
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm4, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1
	movd	%xmm0, -1616(%rsi)
	movd	%xmm1, -1212(%rsi)
	movdqa	%xmm0, %xmm1
	punpckhdq	%xmm0, %xmm1
	movd	%xmm1, -808(%rsi)
	pshufd	$255, %xmm0, %xmm1
	movd	%xmm1, -404(%rsi)
	movups	%xmm0, (%rdx,%rax)
	addq	$16, %rax
	cmpq	%rdi, %rax
	jne	.L4
	movl	-48(%rsp), %r15d
	movl	-4(%rsp), %eax
	movq	%rbp, -96(%rsp)
	cmpl	%eax, %r15d
	je	.L7
	movq	-88(%rsp), %rax
	movq	-80(%rsp), %rdi
	movslq	-116(%rsp), %rsi
	movq	(%rsp), %rbp
	leaq	(%rax,%rax,4), %rax
	leaq	(%rdi,%rax,4), %r12
	movq	8(%rsp), %rdi
	addq	-72(%rsp), %r12
	movl	(%rcx,%r12,4), %eax
	addl	404(%r11), %eax
	addl	(%rcx,%rdi,4), %eax
	leaq	(%rsi,%rsi,4), %rdi
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rsi,%rdi,4), %rdi
	leaq	(%rdi,%rbp), %r13
	movl	(%rcx,%r13,4), %r14d
	cmpl	%r14d, %eax
	cmovg	%r14d, %eax
	leaq	0(%rbp,%rbp,4), %r14
	leaq	(%r14,%r14,4), %r14
	leaq	0(%rbp,%r14,4), %r14
	addq	%rsi, %r14
	movl	%eax, (%rcx,%r14,4)
	movl	16(%rsp), %r14d
	movl	%eax, (%rcx,%r13,4)
	cmpl	%r14d, %r15d
	jl	.L7
	movq	24(%rsp), %rbp
	movslq	%r14d, %r13
	movl	(%rcx,%r12,4), %eax
	addl	404(%r11), %eax
	leaq	0(%rbp,%r13), %r14
	addl	(%rcx,%r14,4), %eax
	leaq	(%rdi,%r13), %r14
	movl	(%rcx,%r14,4), %r15d
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
	leaq	0(%r13,%r13,4), %r15
	leaq	(%r15,%r15,4), %r15
	leaq	0(%r13,%r15,4), %r13
	addq	%rsi, %r13
	movl	%eax, (%rcx,%r13,4)
	movl	%eax, (%rcx,%r14,4)
	movl	20(%rsp), %r14d
	cmpl	%r14d, -48(%rsp)
	jl	.L7
	movl	(%rcx,%r12,4), %eax
	movslq	%r14d, %r12
	addl	404(%r11), %eax
	addq	%r12, %rdi
	leaq	0(%rbp,%r12), %r13
	addl	(%rcx,%r13,4), %eax
	movl	(%rcx,%rdi,4), %r13d
	cmpl	%r13d, %eax
	cmovg	%r13d, %eax
	leaq	(%r12,%r12,4), %r13
	leaq	0(%r13,%r13,4), %r13
	leaq	(%r12,%r13,4), %r12
	addq	%rsi, %r12
	movl	%eax, (%rcx,%r12,4)
	movl	%eax, (%rcx,%rdi,4)
.L7:
	addl	$1, -116(%rsp)
	addq	$4, %r10
	movl	-116(%rsp), %eax
	addq	$404, %r8
	addq	$404, -112(%rsp)
	addq	$404, %rbx
	addq	$4, %r9
	addq	$404, %rdx
	addq	$4, -104(%rsp)
	addq	$404, %r11
	cmpl	-8(%rsp), %eax
	jne	.L8
.L1:
	addq	$64, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	movq	-104(%rsp), %rax
	movq	-80(%rsp), %r15
	movl	$4, %r12d
	movq	%rdx, %rsi
	movq	%r8, 32(%rsp)
	subq	%r8, %r12
	movq	-96(%rsp), %rbp
	leaq	-404(%rax), %rdi
	movq	48(%rsp), %rax
	movq	40(%rsp), %r8
	leaq	(%rcx,%rax), %r14
	movq	-88(%rsp), %rax
	addq	%r10, %r14
	leaq	(%rax,%rax,4), %rax
	leaq	(%r15,%rax,4), %r13
	addq	-72(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	(%r12,%rsi), %r15
	movl	(%rcx,%r13,4), %eax
	addl	404(%r11), %eax
	addl	(%r15,%r8), %eax
	movl	(%rsi), %r15d
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
	addq	$404, %rdi
	addq	$4, %rsi
	movl	%eax, (%rdi)
	movl	%eax, -4(%rsi)
	cmpq	%r14, %rdi
	jne	.L6
	movq	%rbp, -96(%rsp)
	movq	32(%rsp), %r8
	jmp	.L7
	.cfi_endproc
.LFE23:
	.size	warshall_floyd, .-warshall_floyd
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovle	%esi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"-1\n"
.LC2:
	.string	"%d\n"
.LC5:
	.string	"%d"
.LC6:
	.string	"%d %d %d"
.LC7:
	.string	"%d %d"
	.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
	leaq	graph(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$232, %rsp
	.cfi_def_cfa_offset 288
	movq	%fs:40, %rax
	movq	%rax, 216(%rsp)
	xorl	%eax, %eax
	leaq	196(%rsp), %rax
	movq	%rax, 184(%rsp)
	.p2align 4,,10
	.p2align 3
.L22:
	leaq	n(%rip), %rsi
	movq	184(%rsp), %rdx
	leaq	.LC7(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	196(%rsp), %r11d
	testl	%r11d, %r11d
	je	.L46
	movl	n(%rip), %r8d
	movdqa	.LC3(%rip), %xmm5
	movdqa	.LC4(%rip), %xmm4
	testl	%r8d, %r8d
	js	.L48
	leal	1(%r8), %r9d
	leaq	graph(%rip), %rsi
	xorl	%edx, %edx
	xorl	%ebp, %ebp
	movl	%r9d, %eax
	movl	%r9d, %r12d
	movl	$1000000, %ebx
	shrl	$2, %eax
	andl	$-4, %r12d
	leal	-1(%rax), %r15d
	addq	$1, %r15
	salq	$4, %r15
	.p2align 4,,10
	.p2align 3
.L29:
	cmpl	$2, %r8d
	jle	.L50
	movd	%edx, %xmm7
	movdqa	.LC0(%rip), %xmm1
	leaq	(%r15,%rsi), %rcx
	movq	%rsi, %rax
	pshufd	$0, %xmm7, %xmm2
	.p2align 4,,10
	.p2align 3
.L24:
	movdqa	%xmm1, %xmm0
	addq	$16, %rax
	paddd	%xmm5, %xmm1
	pcmpeqd	%xmm2, %xmm0
	pandn	%xmm4, %xmm0
	movups	%xmm0, -16(%rax)
	cmpq	%rcx, %rax
	jne	.L24
	movl	%r12d, %eax
	cmpl	%r12d, %r9d
	je	.L25
.L23:
	movslq	%edx, %rdi
	cmpl	%eax, %edx
	movl	%ebx, %r10d
	movslq	%eax, %rcx
	leaq	(%rdi,%rdi,4), %r14
	cmove	%ebp, %r10d
	leaq	(%r14,%r14,4), %r14
	leaq	(%rdi,%r14,4), %rdi
	addq	%rdi, %rcx
	movl	%r10d, 0(%r13,%rcx,4)
	leal	1(%rax), %ecx
	cmpl	%ecx, %r8d
	jl	.L25
	cmpl	%edx, %ecx
	movl	%ebx, %r10d
	movslq	%ecx, %rcx
	cmove	%ebp, %r10d
	addq	%rdi, %rcx
	addl	$2, %eax
	movl	%r10d, 0(%r13,%rcx,4)
	cmpl	%r8d, %eax
	jg	.L25
	cmpl	%edx, %eax
	movl	%ebx, %ecx
	cltq
	cmove	%ebp, %ecx
	addq	%rax, %rdi
	movl	%ecx, 0(%r13,%rdi,4)
.L25:
	addl	$1, %edx
	addq	$404, %rsi
	cmpl	%r9d, %edx
	jne	.L29
.L48:
	leaq	200(%rsp), %rax
	movl	$0, 12(%rsp)
	movq	%rax, 128(%rsp)
	testl	%r11d, %r11d
	jg	.L30
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L69:
	leaq	d(%rip), %rdx
	leaq	.LC6(%rip), %rdi
	xorl	%eax, %eax
	leaq	204(%rsp), %rcx
	leaq	c(%rip), %rsi
	call	__isoc99_scanf@PLT
	movslq	c(%rip), %rbx
	movslq	d(%rip), %rdi
	movl	204(%rsp), %eax
	leaq	(%rbx,%rbx,4), %rdx
	movq	%rdi, 48(%rsp)
	movq	%rdx, 56(%rsp)
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rbx,%rdx,4), %rcx
	movq	%rbx, 40(%rsp)
	addq	%rdi, %rcx
	cmpl	%eax, 0(%r13,%rcx,4)
	jg	.L68
.L33:
	addl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	cmpl	%eax, 196(%rsp)
	jle	.L22
.L30:
	movq	128(%rsp), %rsi
	leaq	.LC5(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	200(%rsp), %eax
	testl	%eax, %eax
	jne	.L69
	leaq	212(%rsp), %rdx
	leaq	208(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC7(%rip), %rdi
	call	__isoc99_scanf@PLT
	movslq	208(%rsp), %rax
	movl	$1, %edi
	movslq	212(%rsp), %rcx
	leaq	.LC2(%rip), %rsi
	leaq	(%rax,%rax,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,4), %rax
	addq	%rcx, %rax
	movl	0(%r13,%rax,4), %edx
	leaq	.LC1(%rip), %rax
	cmpl	$999999, %edx
	cmovg	%rax, %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L68:
	leaq	(%rdi,%rdi,4), %rdx
	movq	%rbx, %rsi
	movq	%rdi, %rbx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdi,%rdx,4), %r14
	movl	n(%rip), %edi
	movq	%r14, %rdx
	movq	%r14, 152(%rsp)
	addq	%rsi, %rdx
	movl	%edi, 88(%rsp)
	movl	%eax, 0(%r13,%rdx,4)
	movl	%eax, 0(%r13,%rcx,4)
	testl	%edi, %edi
	jle	.L33
	movslq	%edi, %rax
	leaq	0(%r13,%rsi,4), %r10
	movl	$1, 8(%rsp)
	imulq	$404, %rax, %r8
	leaq	408(,%rax,4), %rdx
	movq	%rdx, 16(%rsp)
	leaq	404(,%rsi,4), %rdx
	leal	1(%rdi), %esi
	movl	%esi, 120(%rsp)
	leaq	4(,%rcx,4), %rsi
	leaq	1(%rax,%r14), %rax
	movq	%rsi, 72(%rsp)
	leaq	0(,%rcx,4), %rsi
	salq	$2, %rax
	addq	$8, %r8
	imulq	$-404, %rbx, %rcx
	movq	%rax, 96(%rsp)
	movq	%rsi, 80(%rsp)
	movl	%edi, %esi
	subl	$1, %esi
	movq	%rdx, 24(%rsp)
	leaq	408+graph(%rip), %rdx
	movq	%rcx, %rax
	movl	%esi, 92(%rsp)
	negq	%rax
	movq	%rdx, 32(%rsp)
	movq	%rax, 176(%rsp)
	movl	$4, %eax
	subq	%rcx, %rax
	movq	%rax, 104(%rsp)
	leaq	0(%r13,%rax), %rbx
	movl	%edi, %eax
	andl	$-4, %edi
	shrl	$2, %eax
	leal	2(%rdi), %r9d
	movl	%edi, 124(%rsp)
	leal	-1(%rax), %r11d
	leal	1(%rdi), %eax
	addl	$3, %edi
	movl	%r9d, 160(%rsp)
	cltq
	addq	$1, %r11
	movl	%edi, 164(%rsp)
	movl	$408, %r9d
	imulq	$404, %rsi, %rdi
	salq	$4, %r11
	leaq	-8(%rcx), %rsi
	addq	%rax, %r14
	movq	%rsi, 112(%rsp)
	movq	%rax, 136(%rsp)
	movq	%r14, 144(%rsp)
	movq	%r11, 64(%rsp)
	movq	%rdi, 168(%rsp)
	movl	$408, %edi
	.p2align 4,,10
	.p2align 3
.L35:
	movq	72(%rsp), %rcx
	movq	16(%rsp), %r14
	movq	80(%rsp), %r12
	movq	24(%rsp), %r15
	cmpq	%rdi, %rcx
	setle	%bpl
	cmpq	%r14, %r12
	leaq	4(%r15), %rsi
	setge	%al
	orl	%eax, %ebp
	cmpq	%r9, %rcx
	setle	%cl
	cmpq	%r8, %r12
	setge	%al
	orl	%ecx, %eax
	andl	%ebp, %eax
	cmpl	$2, 92(%rsp)
	seta	%cl
	andl	%ecx, %eax
	movq	112(%rsp), %rcx
	addq	%rdi, %rcx
	cmpq	$8, %rcx
	seta	%cl
	andl	%ecx, %eax
	cmpq	%r9, 96(%rsp)
	setle	%cl
	cmpq	104(%rsp), %r8
	setle	%bpl
	orl	%ebp, %ecx
	andl	%eax, %ecx
	cmpq	%r8, %rdi
	setge	%al
	cmpq	%r9, %r14
	setle	%bpl
	orl	%ebp, %eax
	andl	%ecx, %eax
	cmpq	%rsi, %rdi
	setge	%cl
	cmpq	%r15, %r14
	setle	%bpl
	orl	%ebp, %ecx
	testb	%cl, %al
	je	.L43
	cmpq	%r9, %rsi
	setle	%cl
	cmpq	%r8, %r15
	setge	%al
	orb	%cl, %al
	je	.L43
	movq	56(%rsp), %rax
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rcx
	movq	64(%rsp), %r11
	leaq	(%rax,%rax,4), %rax
	leaq	(%rsi,%rax,4), %rax
	addq	48(%rsp), %rax
	movl	0(%r13,%rax,4), %esi
	addl	404(%r10), %esi
	xorl	%eax, %eax
	movd	%esi, %xmm7
	pshufd	$0, %xmm7, %xmm3
	.p2align 4,,10
	.p2align 3
.L39:
	movdqu	(%rbx,%rax), %xmm2
	movdqu	(%rdx,%rax), %xmm6
	addq	$1616, %rcx
	paddd	%xmm3, %xmm2
	movdqa	%xmm6, %xmm1
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm6, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1
	movd	%xmm0, -1616(%rcx)
	movd	%xmm1, -1212(%rcx)
	movdqa	%xmm0, %xmm1
	punpckhdq	%xmm0, %xmm1
	movd	%xmm1, -808(%rcx)
	pshufd	$255, %xmm0, %xmm1
	movd	%xmm1, -404(%rcx)
	movups	%xmm0, (%rdx,%rax)
	addq	$16, %rax
	cmpq	%r11, %rax
	jne	.L39
	movl	88(%rsp), %r15d
	movl	124(%rsp), %eax
	movq	%r11, 64(%rsp)
	cmpl	%eax, %r15d
	je	.L38
	movq	56(%rsp), %rax
	movq	40(%rsp), %rsi
	movslq	8(%rsp), %rcx
	movq	136(%rsp), %r11
	leaq	(%rax,%rax,4), %rax
	leaq	(%rsi,%rax,4), %rbp
	addq	48(%rsp), %rbp
	movq	144(%rsp), %rsi
	movl	404(%r10), %eax
	addl	0(%r13,%rbp,4), %eax
	addl	0(%r13,%rsi,4), %eax
	leaq	(%rcx,%rcx,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rcx,%rsi,4), %rsi
	leaq	(%rsi,%r11), %r12
	movl	0(%r13,%r12,4), %r14d
	cmpl	%r14d, %eax
	cmovg	%r14d, %eax
	leaq	(%r11,%r11,4), %r14
	leaq	(%r14,%r14,4), %r14
	leaq	(%r11,%r14,4), %r14
	movl	160(%rsp), %r11d
	addq	%rcx, %r14
	movl	%eax, 0(%r13,%r14,4)
	movl	%eax, 0(%r13,%r12,4)
	cmpl	%r15d, %r11d
	jg	.L38
	movslq	%r11d, %r12
	movq	152(%rsp), %r11
	movl	404(%r10), %eax
	addl	0(%r13,%rbp,4), %eax
	leaq	(%r11,%r12), %r14
	addl	0(%r13,%r14,4), %eax
	leaq	(%rsi,%r12), %r14
	movl	0(%r13,%r14,4), %r15d
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
	leaq	(%r12,%r12,4), %r15
	leaq	(%r15,%r15,4), %r15
	leaq	(%r12,%r15,4), %r12
	movl	88(%rsp), %r15d
	addq	%rcx, %r12
	movl	%eax, 0(%r13,%r12,4)
	movl	%eax, 0(%r13,%r14,4)
	movl	164(%rsp), %r14d
	cmpl	%r15d, %r14d
	jg	.L38
	movl	0(%r13,%rbp,4), %eax
	movslq	%r14d, %rbp
	addl	404(%r10), %eax
	addq	%rbp, %rsi
	leaq	(%r11,%rbp), %r12
	addl	0(%r13,%r12,4), %eax
	movl	0(%r13,%rsi,4), %r12d
	cmpl	%r12d, %eax
	cmovg	%r12d, %eax
	leaq	0(%rbp,%rbp,4), %r12
	leaq	(%r12,%r12,4), %r12
	leaq	0(%rbp,%r12,4), %rbp
	addq	%rcx, %rbp
	movl	%eax, 0(%r13,%rbp,4)
	movl	%eax, 0(%r13,%rsi,4)
.L38:
	addl	$1, 8(%rsp)
	addq	$4, %r9
	movl	8(%rsp), %eax
	addq	$404, %rdi
	addq	$404, 16(%rsp)
	addq	$4, %r8
	addq	$404, %rdx
	addq	$404, %r10
	addq	$404, 24(%rsp)
	addq	$4, 32(%rsp)
	cmpl	120(%rsp), %eax
	jne	.L35
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L43:
	movq	32(%rsp), %rax
	movq	40(%rsp), %r11
	movl	$4, %ebp
	movq	%rdx, %rcx
	subq	%rdi, %rbp
	leaq	-404(%rax), %rsi
	movq	168(%rsp), %rax
	leaq	0(%r13,%rax), %r14
	movq	56(%rsp), %rax
	addq	%r9, %r14
	leaq	(%rax,%rax,4), %rax
	leaq	(%r11,%rax,4), %r12
	movq	176(%rsp), %r11
	addq	48(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L37:
	leaq	0(%rbp,%rcx), %r15
	movl	0(%r13,%r12,4), %eax
	addl	404(%r10), %eax
	addl	(%r15,%r11), %eax
	movl	(%rcx), %r15d
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
	addq	$404, %rsi
	addq	$4, %rcx
	movl	%eax, (%rsi)
	movl	%eax, -4(%rcx)
	cmpq	%r14, %rsi
	jne	.L37
	jmp	.L38
.L50:
	xorl	%eax, %eax
	jmp	.L23
.L46:
	movq	216(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L70
	addq	$232, %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
.L70:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	d
	.bss
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	graph
	.align 32
	.type	graph, @object
	.size	graph, 40804
graph:
	.zero	40804
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC4:
	.long	1000000
	.long	1000000
	.long	1000000
	.long	1000000
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
int graph[101][101],n,c,d;

void warshall_floyd(){
  int i,j;
  for(i=1;i<=n;i++)
    for(j=1;j<=n;j++)
      graph[i][j]=graph[j][i]=min(graph[i][j],graph[i][c]+graph[c][d]+graph[d][j]);
}

int min(int x,int y){
  return x<y?x:y;
}

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

  while(scanf("%d %d",&n,&k),n,k){

    for(i=0;i<=n;i++)
      for(j=0;j<=n;j++)
	graph[i][j]=i==j?0:1000000;

    for(i=0;i<k;i++){
      if(scanf("%d",&x),x){
	scanf("%d %d %d",&c,&d,&e);

	if(graph[c][d]>e){
	graph[c][d]=graph[d][c]=e;
	warshall_floyd();
	}
      }else{
	scanf("%d %d",&a,&b);
	printf(graph[a][b]>=1000000?"-1\n":"%d\n",graph[a][b]);
      }
    }
  }
  return 0;
}
3 8
1 3 1 10
0 2 3
1 2 2 20
1 1 2 5
0 3 2
1 1 3 7
1 2 1 9
0 2 3
5 16
1 1 2 343750
1 1 3 3343
1 1 4 347392
1 1 5 5497
1 2 3 123394
1 2 4 545492
1 2 5 458
1 3 4 343983
1 3 5 843468
1 4 5 15934
0 2 1
0 4 1
0 3 2
0 4 2
0 4 3
0 5 3
0 0
 3 8
1 3 1 10
0 2 3
1 2 2 20
1 1 1 5
0 3 2
1 1 3 7
1 2 1 9
0 2 3
5 16
1 1 2 343750
1 1 3 3343
1 1 4 347392
1 1 5 5497
1 2 3 212055
1 2 4 545492
1 2 5 458
1 3 4 343983
1 3 5 843468
1 4 5 15934
0 2 1
0 4 1
0 3 2
0 4 2
0 4 3
0 5 3
0 0
 3 8
1 3 1 10
0 2 3
1 2 2 20
1 1 2 5
0 3 2
1 1 3 7
1 2 1 9
0 2 3
5 16
1 1 2 343750
1 1 3 3343
1 1 4 150117
1 1 5 5497
1 2 3 123394
1 2 4 545492
1 2 5 458
1 3 4 343983
1 3 5 843468
1 4 5 15934
0 2 1
0 4 2
0 3 2
0 4 2
0 4 3
0 5 3
0 0
 3 8
1 3 1 10
0 2 3
1 2 3 20
1 1 2 5
0 3 2
1 1 3 7
1 2 1 9
0 2 3
5 16
1 1 2 343750
1 1 3 3343
1 1 4 347392
1 1 5 5497
1 2 3 123394
1 2 4 545492
1 2 5 458
1 3 4 343983
1 3 5 843468
1 4 5 15934
0 2 1
0 4 1
0 1 2
0 4 2
0 4 3
0 5 3
0 0
 3 8
1 3 1 10
0 2 3
1 2 3 20
1 1 2 5
0 3 2
1 1 3 7
1 2 1 9
0 2 3
5 16
1 1 2 85440
1 1 3 3343
1 1 4 347392
1 1 5 5497
1 2 3 123394
1 2 4 545492
1 2 5 458
1 3 4 343983
1 3 1 843468
1 4 5 15934
0 2 1
0 4 2
0 1 2
0 4 2
0 4 3
0 5 3
0 0
 3 8
1 3 1 10
0 2 3
1 2 3 20
1 1 2 5
0 3 2
1 1 3 7
1 2 1 9
0 2 3
5 16
1 1 2 343750
1 1 3 3343
1 1 4 347392
1 1 5 5497
1 2 3 123394
1 2 4 545492
1 2 5 458
1 3 4 343983
1 3 5 843468
1 4 5 2780
0 2 1
0 4 1
0 3 2
0 4 2
0 4 3
0 5 3
0 0
 3 8
1 3 1 10
0 2 3
1 2 3 20
1 1 2 5
0 3 2
1 1 3 7
1 2 1 9
0 1 3
5 16
1 1 2 343750
1 1 3 3343
1 1 4 347392
1 1 5 5497
1 2 3 123394
1 2 4 545492
1 2 5 458
1 3 4 343983
1 3 5 843468
1 4 5 15934
0 2 1
0 4 1
0 3 2
0 4 2
0 4 3
0 5 3
0 0
 3 8
1 3 1 10
0 2 3
1 2 3 20
1 1 2 5
0 3 2
1 1 3 7
1 2 1 9
0 2 3
5 16
1 1 2 85440
1 1 3 3343
1 1 4 347392
1 1 5 5497
1 2 3 123394
1 2 4 545492
1 2 5 458
1 3 4 343983
1 3 1 843468
1 4 5 2961
0 2 1
0 4 1
0 1 2
0 4 2
0 4 3
0 5 3
0 0
 3 8
1 3 1 10
0 2 3
1 2 3 20
1 1 2 5
0 3 2
1 1 3 7
1 2 1 9
0 2 3
5 16
1 1 2 85440
1 1 3 3343
1 1 4 347392
1 1 5 2257
1 2 3 123394
1 2 4 545492
1 2 5 458
1 3 4 343983
1 3 1 843468
1 4 5 2961
0 2 1
0 4 1
0 1 2
0 4 2
0 4 3
0 5 3
0 0
 3 8
1 3 1 10
0 2 3
1 2 3 1
1 1 2 5
0 3 2
1 1 3 7
1 2 1 9
0 2 3
5 16
1 1 2 85440
1 1 3 3343
1 1 4 347392
1 1 5 2257
1 2 3 123394
1 2 4 545492
1 2 5 458
1 3 4 343983
1 3 1 843468
1 4 5 2961
0 2 1
0 4 1
0 1 2
0 4 2
0 4 3
0 5 3
0 0

-1
15
12
5955
21431
9298
16392
24774
8840
 -1
-1
16
5955
21431
9298
16392
24774
8840
 -1
15
12
5955
16392
9298
16392
24774
8840
 -1
15
12
5955
21431
5955
16392
24774
8840
 -1
15
12
5955
16392
5955
16392
24774
8840
 -1
15
12
5955
8277
9298
3238
11620
8840
 -1
15
7
5955
21431
9298
16392
24774
8840
 -1
15
12
5955
8458
5955
3419
11801
8840
 -1
15
12
2715
5218
2715
3419
8561
5600
 -1
1
1
2715
5218
2715
3419
8561
5600

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

```c
#include<stdio.h>
int graph[101][101],n,c,d;

void warshall_floyd(){
  int i,j;
  for(i=1;i<=n;i++)
    for(j=1;j<=n;j++)
      graph[i][j]=graph[j][i]=min(graph[i][j],graph[i][c]+graph[c][d]+graph[d][j]);
}

int min(int x,int y){
  return x<y?x:y;
}

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

  while(scanf("%d %d",&n,&k),n,k){

    for(i=0;i<=n;i++)
      for(j=0;j<=n;j++)
	graph[i][j]=i==j?0:1000000;

    for(i=0;i<k;i++){
      if(scanf("%d",&x),x){
	scanf("%d %d %d",&c,&d,&e);

	if(graph[c][d]>e){
	graph[c][d]=graph[d][c]=e;
	warshall_floyd();
	}
      }else{
	scanf("%d %d",&a,&b);
	printf(graph[a][b]>=1000000?"-1\n":"%d\n",graph[a][b]);
      }
    }
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	graph
	.bss
	.align 32
	.type	graph, @object
	.size	graph, 40804
graph:
	.zero	40804
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	d
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.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
	subq	$16, %rsp
	movl	$1, -8(%rbp)
	jmp	.L2
.L5:
	movl	$1, -4(%rbp)
	jmp	.L3
.L4:
	movl	c(%rip), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	c(%rip), %eax
	movl	d(%rip), %edx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	(%rcx,%rax), %edi
	movl	d(%rip), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	(%rdi,%rax), %ecx
	movl	-4(%rbp), %eax
	movslq	%eax, %rsi
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	min
	movl	%eax, %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-4(%rbp), %eax
	movslq	%eax, %rsi
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L4
	addl	$1, -8(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L5
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	warshall_floyd, .-warshall_floyd
	.globl	min
	.type	min, @function
min:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	min, .-min
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"-1\n"
.LC4:
	.string	"%d\n"
	.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
	jmp	.L9
.L22:
	movl	$0, -16(%rbp)
	jmp	.L10
.L15:
	movl	$0, -12(%rbp)
	jmp	.L11
.L14:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jne	.L12
	movl	$0, %ecx
	jmp	.L13
.L12:
	movl	$1000000, %ecx
.L13:
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L14
	addl	$1, -16(%rbp)
.L10:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L15
	movl	$0, -16(%rbp)
	jmp	.L16
.L21:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	je	.L17
	leaq	-28(%rbp), %rax
	movq	%rax, %rcx
	leaq	d(%rip), %rax
	movq	%rax, %rdx
	leaq	c(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	c(%rip), %eax
	movl	d(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-28(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L18
	movl	d(%rip), %ecx
	movl	c(%rip), %esi
	movl	-28(%rbp), %edi
	movslq	%esi, %r8
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %r9
	addq	%r9, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%r8, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	%edi, (%rdx,%rax)
	movl	c(%rip), %edi
	movl	d(%rip), %r8d
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movslq	%r8d, %rsi
	movslq	%edi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	$0, %eax
	call	warshall_floyd
	jmp	.L18
.L17:
	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
	movl	-20(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$999999, %eax
	jle	.L19
	leaq	.LC3(%rip), %rax
	jmp	.L20
.L19:
	leaq	.LC4(%rip), %rax
.L20:
	movl	%ecx, %esi
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L18:
	addl	$1, -16(%rbp)
.L16:
	movl	-36(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L21
.L9:
	leaq	-36(%rbp), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	.L22
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	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	graph
	.bss
	.align 32
	.type	graph, @object
	.size	graph, 40804
graph:
	.zero	40804
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	d
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.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
	subq	$16, %rsp
	movl	$1, -8(%rbp)
	jmp	.L2
.L5:
	movl	$1, -4(%rbp)
	jmp	.L3
.L4:
	movl	c(%rip), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	c(%rip), %eax
	movl	d(%rip), %edx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	(%rcx,%rax), %edi
	movl	d(%rip), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	(%rdi,%rax), %ecx
	movl	-4(%rbp), %eax
	movslq	%eax, %rsi
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	min
	movl	%eax, %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-4(%rbp), %eax
	movslq	%eax, %rsi
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L4
	addl	$1, -8(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L5
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	warshall_floyd, .-warshall_floyd
	.globl	min
	.type	min, @function
min:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	min, .-min
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"-1\n"
.LC4:
	.string	"%d\n"
	.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
	jmp	.L9
.L22:
	movl	$0, -16(%rbp)
	jmp	.L10
.L15:
	movl	$0, -12(%rbp)
	jmp	.L11
.L14:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jne	.L12
	movl	$0, %ecx
	jmp	.L13
.L12:
	movl	$1000000, %ecx
.L13:
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L14
	addl	$1, -16(%rbp)
.L10:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L15
	movl	$0, -16(%rbp)
	jmp	.L16
.L21:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	je	.L17
	leaq	-28(%rbp), %rax
	movq	%rax, %rcx
	leaq	d(%rip), %rax
	movq	%rax, %rdx
	leaq	c(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	c(%rip), %eax
	movl	d(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-28(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L18
	movl	d(%rip), %ecx
	movl	c(%rip), %esi
	movl	-28(%rbp), %edi
	movslq	%esi, %r8
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %r9
	addq	%r9, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%r8, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	%edi, (%rdx,%rax)
	movl	c(%rip), %edi
	movl	d(%rip), %r8d
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movslq	%r8d, %rsi
	movslq	%edi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	$0, %eax
	call	warshall_floyd
	jmp	.L18
.L17:
	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
	movl	-20(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	graph(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$999999, %eax
	jle	.L19
	leaq	.LC3(%rip), %rax
	jmp	.L20
.L19:
	leaq	.LC4(%rip), %rax
.L20:
	movl	%ecx, %esi
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L18:
	addl	$1, -16(%rbp)
.L16:
	movl	-36(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L21
.L9:
	leaq	-36(%rbp), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	.L22
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	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:
