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 min(int a,int b){
    if(a>b)return b;
    else return a;
}
int main(){
    int d[10][10];
    int i,j,k,n,s,ans1,ans2;
    int v;
    v=0;
    s=0;ans1=0;ans2=-1;
    int t1,t2,t3;
    while(1){
        scanf("%d",&n);
        if(n==0)break;
        for(i=0;i<=9;i++){
            for(j=0;j<=9;j++)if(i!=j)d[i][j]=100000;else d[i][j]=0;
	    }
        for(i=1;i<=n;i++){
            scanf("%d%d%d",&t1,&t2,&t3);
            d[t1][t2]=t3;d[t2][t1]=t3;
            if(t1>v)v=t1;if(t2>v)v=t2;
        }
        for(k=0;k<=v;k++)
            for(i=0;i<=v;i++)
                for(j=0;j<=v;j++)d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
        for(i=0;i<=v;i++){
            for(j=0;j<=v;j++)s=s+d[i][j];
            if(ans2<0||s<ans2){ans1=i;ans2=s;}
            s=0;
        }
        printf("%d %d\n",ans1,ans2);
        v=0;ans1=0;ans2=-1;s=0;
    }
    return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	min
	.type	min, @function
min:
.LFB0:
	.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	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L2
	movl	-8(%rbp), %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -420(%rbp)
	movl	$0, -432(%rbp)
	movl	$0, -428(%rbp)
	movl	$-1, -424(%rbp)
.L29:
	leaq	-460(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-460(%rbp), %eax
	testl	%eax, %eax
	je	.L33
	movl	$0, -444(%rbp)
	jmp	.L7
.L12:
	movl	$0, -440(%rbp)
	jmp	.L8
.L11:
	movl	-444(%rbp), %eax
	cmpl	-440(%rbp), %eax
	je	.L9
	movl	-440(%rbp), %eax
	movslq	%eax, %rcx
	movl	-444(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$100000, -416(%rbp,%rax,4)
	jmp	.L10
.L9:
	movl	-440(%rbp), %eax
	movslq	%eax, %rcx
	movl	-444(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$0, -416(%rbp,%rax,4)
.L10:
	addl	$1, -440(%rbp)
.L8:
	cmpl	$9, -440(%rbp)
	jle	.L11
	addl	$1, -444(%rbp)
.L7:
	cmpl	$9, -444(%rbp)
	jle	.L12
	movl	$1, -444(%rbp)
	jmp	.L13
.L16:
	leaq	-448(%rbp), %rcx
	leaq	-452(%rbp), %rdx
	leaq	-456(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-456(%rbp), %eax
	movl	-452(%rbp), %ecx
	movl	-448(%rbp), %edx
	movslq	%ecx, %rsi
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	%edx, -416(%rbp,%rax,4)
	movl	-452(%rbp), %eax
	movl	-456(%rbp), %ecx
	movl	-448(%rbp), %edx
	movslq	%ecx, %rsi
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	%edx, -416(%rbp,%rax,4)
	movl	-456(%rbp), %eax
	cmpl	%eax, -420(%rbp)
	jge	.L14
	movl	-456(%rbp), %eax
	movl	%eax, -420(%rbp)
.L14:
	movl	-452(%rbp), %eax
	cmpl	%eax, -420(%rbp)
	jge	.L15
	movl	-452(%rbp), %eax
	movl	%eax, -420(%rbp)
.L15:
	addl	$1, -444(%rbp)
.L13:
	movl	-460(%rbp), %eax
	cmpl	%eax, -444(%rbp)
	jle	.L16
	movl	$0, -436(%rbp)
	jmp	.L17
.L22:
	movl	$0, -444(%rbp)
	jmp	.L18
.L21:
	movl	$0, -440(%rbp)
	jmp	.L19
.L20:
	movl	-436(%rbp), %eax
	movslq	%eax, %rcx
	movl	-444(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-416(%rbp,%rax,4), %ecx
	movl	-440(%rbp), %eax
	movslq	%eax, %rsi
	movl	-436(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-416(%rbp,%rax,4), %eax
	leal	(%rcx,%rax), %edx
	movl	-440(%rbp), %eax
	movslq	%eax, %rsi
	movl	-444(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-416(%rbp,%rax,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, %edx
	movl	-440(%rbp), %eax
	movslq	%eax, %rsi
	movl	-444(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -440(%rbp)
.L19:
	movl	-440(%rbp), %eax
	cmpl	-420(%rbp), %eax
	jle	.L20
	addl	$1, -444(%rbp)
.L18:
	movl	-444(%rbp), %eax
	cmpl	-420(%rbp), %eax
	jle	.L21
	addl	$1, -436(%rbp)
.L17:
	movl	-436(%rbp), %eax
	cmpl	-420(%rbp), %eax
	jle	.L22
	movl	$0, -444(%rbp)
	jmp	.L23
.L28:
	movl	$0, -440(%rbp)
	jmp	.L24
.L25:
	movl	-440(%rbp), %eax
	movslq	%eax, %rcx
	movl	-444(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -432(%rbp)
	addl	$1, -440(%rbp)
.L24:
	movl	-440(%rbp), %eax
	cmpl	-420(%rbp), %eax
	jle	.L25
	cmpl	$0, -424(%rbp)
	js	.L26
	movl	-432(%rbp), %eax
	cmpl	-424(%rbp), %eax
	jge	.L27
.L26:
	movl	-444(%rbp), %eax
	movl	%eax, -428(%rbp)
	movl	-432(%rbp), %eax
	movl	%eax, -424(%rbp)
.L27:
	movl	$0, -432(%rbp)
	addl	$1, -444(%rbp)
.L23:
	movl	-444(%rbp), %eax
	cmpl	-420(%rbp), %eax
	jle	.L28
	movl	-424(%rbp), %edx
	movl	-428(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -420(%rbp)
	movl	$0, -428(%rbp)
	movl	$-1, -424(%rbp)
	movl	$0, -432(%rbp)
	jmp	.L29
.L33:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC6:
	.string	"%d%d%d"
.LC7:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	$536, %rsp
	.cfi_def_cfa_offset 592
	movq	%fs:40, %rax
	movq	%rax, 520(%rsp)
	xorl	%eax, %eax
	leaq	96(%rsp), %rax
	movq	%rax, 88(%rsp)
.L25:
	movq	88(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	96(%rsp), %eax
	testl	%eax, %eax
	je	.L4
	movdqa	.LC1(%rip), %xmm7
	movdqa	.LC5(%rip), %xmm0
	movaps	%xmm7, 112(%rsp)
	movdqa	.LC2(%rip), %xmm7
	movaps	%xmm0, 240(%rsp)
	movaps	%xmm7, 128(%rsp)
	movdqa	.LC3(%rip), %xmm7
	movaps	%xmm7, 144(%rsp)
	movdqa	.LC2(%rip), %xmm7
	movaps	%xmm7, 160(%rsp)
	movaps	%xmm7, 176(%rsp)
	movdqa	.LC4(%rip), %xmm7
	movaps	%xmm7, 192(%rsp)
	movdqa	.LC2(%rip), %xmm7
	movaps	%xmm7, 208(%rsp)
	movaps	%xmm7, 224(%rsp)
	movaps	%xmm7, 256(%rsp)
	movaps	%xmm7, 272(%rsp)
	movdqa	.LC1(%rip), %xmm7
	movaps	%xmm7, 288(%rsp)
	movdqa	.LC2(%rip), %xmm7
	movaps	%xmm7, 304(%rsp)
	movdqa	.LC3(%rip), %xmm7
	movaps	%xmm7, 320(%rsp)
	movdqa	.LC2(%rip), %xmm7
	movaps	%xmm7, 336(%rsp)
	movaps	%xmm7, 352(%rsp)
	movdqa	.LC4(%rip), %xmm7
	movaps	%xmm7, 368(%rsp)
	movdqa	.LC2(%rip), %xmm7
	movaps	%xmm7, 384(%rsp)
	movaps	%xmm7, 400(%rsp)
	movaps	%xmm0, 416(%rsp)
	movaps	%xmm7, 432(%rsp)
	movaps	%xmm7, 448(%rsp)
	movdqa	.LC1(%rip), %xmm7
	movaps	%xmm7, 464(%rsp)
	movdqa	.LC2(%rip), %xmm7
	movaps	%xmm7, 480(%rsp)
	movdqa	.LC3(%rip), %xmm7
	movaps	%xmm7, 496(%rsp)
	jle	.L27
	xorl	%ebx, %ebx
	movl	$1, %r15d
	leaq	108(%rsp), %r14
	leaq	104(%rsp), %r13
	leaq	100(%rsp), %r12
	leaq	.LC6(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	100(%rsp), %rcx
	movslq	104(%rsp), %rsi
	movl	108(%rsp), %edi
	movq	%rcx, %rax
	movq	%rsi, %rdx
	leaq	(%rcx,%rcx,4), %r8
	cmpl	%edx, %eax
	leaq	(%rsi,%r8,2), %r8
	leaq	(%rsi,%rsi,4), %rsi
	cmovl	%edx, %eax
	leaq	(%rcx,%rsi,2), %rcx
	movl	%edi, 112(%rsp,%r8,4)
	movl	%edi, 112(%rsp,%rcx,4)
	cmpl	%eax, %ebx
	cmovl	%eax, %ebx
	addl	$1, %r15d
	cmpl	%r15d, 96(%rsp)
	jge	.L6
	movl	112(%rsp), %ecx
.L5:
	movslq	%ebx, %rax
	leaq	112(%rsp), %rsi
	movl	%ebx, %edi
	movl	$4, %r9d
	movq	%rax, 80(%rsp)
	salq	$2, %rax
	andl	$-4, %edi
	movq	%rsi, %rbp
	subq	%rsi, %rax
	leal	2(%rdi), %r10d
	movq	%rsi, 72(%rsp)
	negq	%rbp
	movq	%rax, %rdx
	movl	%ebx, %eax
	movl	%edi, 4(%rsp)
	leal	3(%rdi), %r14d
	shrl	$2, %eax
	movl	%r10d, 44(%rsp)
	leaq	4(%rdx), %r13
	movq	%rbp, %r15
	movl	%eax, 40(%rsp)
	leal	1(%rdi), %eax
	movq	%rsi, %r8
	leal	1(%rbx), %r11d
	cltq
	movq	%rsi, 56(%rsp)
	subq	%rsi, %r9
	movq	%rsi, %rdx
	movq	%rax, 8(%rsp)
	movslq	%r10d, %rax
	movq	%rax, 24(%rsp)
	leal	-1(%rbx), %eax
	movq	$0, 64(%rsp)
	movl	%eax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	64(%rsp), %rdi
	movq	72(%rsp), %rax
	xorl	%esi, %esi
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rdi,%rdi), %r12
	movq	8(%rsp), %rdi
	movq	%r12, 48(%rsp)
	addq	%r12, %rdi
	movq	%rdi, 16(%rsp)
	movq	24(%rsp), %rdi
	addq	%r12, %rdi
	movq	%rdi, 32(%rsp)
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L65:
	movl	(%rdx), %ecx
.L17:
	movl	(%rax), %edi
	addl	(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, (%rax)
	testl	%ebx, %ebx
	je	.L13
	leaq	0(%r13,%rax), %rdi
	leaq	0(%rbp,%rax), %rcx
	cmpq	%rcx, %rdi
	leaq	(%rax,%r9), %r10
	leaq	(%r9,%rdx), %rdi
	setle	%cl
	cmpq	%rdi, %r10
	setge	%dil
	orb	%cl, %dil
	je	.L7
	leaq	-4(%r15,%rax), %rcx
	cmpq	$8, %rcx
	seta	%dil
	cmpl	$2, (%rsp)
	seta	%cl
	testb	%cl, %dil
	je	.L7
	movd	(%rdx), %xmm4
	movdqu	4(%r8), %xmm2
	movdqu	4(%rax), %xmm5
	cmpl	$1, 40(%rsp)
	pshufd	$0, %xmm4, %xmm3
	paddd	%xmm3, %xmm2
	movdqa	%xmm5, %xmm1
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm5, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movups	%xmm0, 4(%rax)
	jbe	.L8
	movdqu	20(%r8), %xmm2
	movdqu	20(%rax), %xmm6
	paddd	%xmm3, %xmm2
	movdqa	%xmm6, %xmm1
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm6, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movups	%xmm0, 20(%rax)
.L8:
	cmpl	4(%rsp), %ebx
	je	.L13
	movslq	%esi, %rcx
	movq	8(%rsp), %rdi
	movq	16(%rsp), %r12
	leaq	(%rcx,%rcx,4), %rcx
	addq	%rcx, %rcx
	leaq	(%rcx,%rdi), %r10
	movl	(%rdx), %edi
	addl	112(%rsp,%r12,4), %edi
	movl	112(%rsp,%r10,4), %r12d
	cmpl	%r12d, %edi
	cmovg	%r12d, %edi
	movl	%edi, 112(%rsp,%r10,4)
	cmpl	%ebx, 44(%rsp)
	jg	.L13
	movq	24(%rsp), %rdi
	movq	32(%rsp), %r12
	leaq	(%rcx,%rdi), %r10
	movl	(%rdx), %edi
	addl	112(%rsp,%r12,4), %edi
	movl	112(%rsp,%r10,4), %r12d
	cmpl	%r12d, %edi
	cmovg	%r12d, %edi
	movl	%edi, 112(%rsp,%r10,4)
	cmpl	%ebx, %r14d
	jg	.L13
	movslq	%r14d, %rdi
	movl	(%rdx), %r10d
	addq	%rdi, %rcx
	addq	48(%rsp), %rdi
	addl	112(%rsp,%rdi,4), %r10d
	movl	%r10d, %edi
	movl	112(%rsp,%rcx,4), %r10d
	cmpl	%r10d, %edi
	cmovg	%r10d, %edi
	movl	%edi, 112(%rsp,%rcx,4)
.L13:
	addl	$1, %esi
	addq	$40, %rax
	addq	$40, %rdx
	cmpl	%r11d, %esi
	jne	.L65
	movq	64(%rsp), %rsi
	addq	$40, %r8
	addq	$4, %rbp
	subq	$40, %r15
	addq	$4, 56(%rsp)
	leaq	1(%rsi), %rax
	cmpq	%rsi, 80(%rsp)
	je	.L66
	movq	56(%rsp), %rsi
	movq	%rax, 64(%rsp)
	movl	(%rsi), %ecx
	movq	%rsi, %rdx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L7:
	movl	4(%rax), %edi
	movl	(%rdx), %ecx
	addl	4(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 4(%rax)
	cmpl	$1, %ebx
	je	.L13
	movl	8(%rax), %edi
	movl	(%rdx), %ecx
	addl	8(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 8(%rax)
	cmpl	$2, %ebx
	je	.L13
	movl	12(%rax), %edi
	movl	(%rdx), %ecx
	addl	12(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 12(%rax)
	cmpl	$3, %ebx
	je	.L13
	movl	16(%rax), %edi
	movl	(%rdx), %ecx
	addl	16(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 16(%rax)
	cmpl	$4, %ebx
	je	.L13
	movl	20(%rax), %edi
	movl	(%rdx), %ecx
	addl	20(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 20(%rax)
	cmpl	$5, %ebx
	je	.L13
	movl	24(%rax), %edi
	movl	(%rdx), %ecx
	addl	24(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 24(%rax)
	cmpl	$6, %ebx
	je	.L13
	movl	28(%rax), %edi
	movl	(%rdx), %ecx
	addl	28(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 28(%rax)
	cmpl	$7, %ebx
	je	.L13
	movl	32(%rax), %edi
	movl	(%rdx), %ecx
	addl	32(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 32(%rax)
	cmpl	$8, %ebx
	je	.L13
	movl	36(%rax), %edi
	movl	(%rdx), %ecx
	addl	36(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 36(%rax)
	jmp	.L13
.L66:
	movl	%r11d, %ebp
	movl	%r11d, %r9d
	movq	72(%rsp), %r12
	xorl	%r10d, %r10d
	shrl	$2, %ebp
	andl	$-4, %r9d
	movl	$-1, %r8d
	xorl	%edi, %edi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L67:
	cmpl	%r8d, %eax
	jl	.L29
	addl	$1, %edi
	addq	$40, %r12
	cmpl	%r11d, %edi
	je	.L22
.L15:
	cmpl	$2, %ebx
	jle	.L28
	movdqu	(%r12), %xmm0
	cmpl	$1, %ebp
	jbe	.L19
	movdqu	16(%r12), %xmm7
	paddd	%xmm7, %xmm0
.L19:
	movdqa	%xmm0, %xmm1
	movl	%r9d, %edx
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%r11d, %r9d
	je	.L18
.L23:
	movslq	%edi, %rcx
	movslq	%edx, %rsi
	leaq	(%rcx,%rcx,4), %rcx
	addq	%rcx, %rcx
	addq	%rcx, %rsi
	addl	112(%rsp,%rsi,4), %eax
	leal	1(%rdx), %esi
	cmpl	%ebx, %esi
	jg	.L18
	movslq	%esi, %rsi
	addl	$2, %edx
	addq	%rcx, %rsi
	addl	112(%rsp,%rsi,4), %eax
	cmpl	%edx, %ebx
	jl	.L18
	movslq	%edx, %rdx
	addq	%rdx, %rcx
	addl	112(%rsp,%rcx,4), %eax
.L18:
	testl	%r8d, %r8d
	jns	.L67
.L29:
	movl	%edi, %r10d
	addl	$1, %edi
	movl	%eax, %r8d
	addq	$40, %r12
	cmpl	%r11d, %edi
	jne	.L15
.L22:
	movl	%r8d, %ecx
	movl	%r10d, %edx
	leaq	.LC7(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L25
.L28:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L23
.L27:
	xorl	%ecx, %ecx
	xorl	%ebx, %ebx
	jmp	.L5
.L4:
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L68
	addq	$536, %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
.L68:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	0
	.long	100000
	.long	100000
	.long	100000
	.align 16
.LC2:
	.long	100000
	.long	100000
	.long	100000
	.long	100000
	.align 16
.LC3:
	.long	100000
	.long	100000
	.long	100000
	.long	0
	.align 16
.LC4:
	.long	100000
	.long	100000
	.long	0
	.long	100000
	.align 16
.LC5:
	.long	100000
	.long	0
	.long	100000
	.long	100000
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC6:
	.string	"%d%d%d"
.LC7:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	$536, %rsp
	.cfi_def_cfa_offset 592
	movq	%fs:40, %rax
	movq	%rax, 520(%rsp)
	xorl	%eax, %eax
	leaq	96(%rsp), %rax
	movq	%rax, 88(%rsp)
.L25:
	movq	88(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	96(%rsp), %eax
	testl	%eax, %eax
	je	.L4
	movdqa	.LC1(%rip), %xmm7
	movdqa	.LC5(%rip), %xmm0
	movaps	%xmm7, 112(%rsp)
	movdqa	.LC2(%rip), %xmm7
	movaps	%xmm0, 240(%rsp)
	movaps	%xmm7, 128(%rsp)
	movdqa	.LC3(%rip), %xmm7
	movaps	%xmm7, 144(%rsp)
	movdqa	.LC2(%rip), %xmm7
	movaps	%xmm7, 160(%rsp)
	movaps	%xmm7, 176(%rsp)
	movdqa	.LC4(%rip), %xmm7
	movaps	%xmm7, 192(%rsp)
	movdqa	.LC2(%rip), %xmm7
	movaps	%xmm7, 208(%rsp)
	movaps	%xmm7, 224(%rsp)
	movaps	%xmm7, 256(%rsp)
	movaps	%xmm7, 272(%rsp)
	movdqa	.LC1(%rip), %xmm7
	movaps	%xmm7, 288(%rsp)
	movdqa	.LC2(%rip), %xmm7
	movaps	%xmm7, 304(%rsp)
	movdqa	.LC3(%rip), %xmm7
	movaps	%xmm7, 320(%rsp)
	movdqa	.LC2(%rip), %xmm7
	movaps	%xmm7, 336(%rsp)
	movaps	%xmm7, 352(%rsp)
	movdqa	.LC4(%rip), %xmm7
	movaps	%xmm7, 368(%rsp)
	movdqa	.LC2(%rip), %xmm7
	movaps	%xmm7, 384(%rsp)
	movaps	%xmm7, 400(%rsp)
	movaps	%xmm0, 416(%rsp)
	movaps	%xmm7, 432(%rsp)
	movaps	%xmm7, 448(%rsp)
	movdqa	.LC1(%rip), %xmm7
	movaps	%xmm7, 464(%rsp)
	movdqa	.LC2(%rip), %xmm7
	movaps	%xmm7, 480(%rsp)
	movdqa	.LC3(%rip), %xmm7
	movaps	%xmm7, 496(%rsp)
	jle	.L27
	xorl	%ebx, %ebx
	movl	$1, %r15d
	leaq	108(%rsp), %r14
	leaq	104(%rsp), %r13
	leaq	100(%rsp), %r12
	leaq	.LC6(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	100(%rsp), %rcx
	movslq	104(%rsp), %rsi
	movl	108(%rsp), %edi
	movq	%rcx, %rax
	movq	%rsi, %rdx
	leaq	(%rcx,%rcx,4), %r8
	cmpl	%edx, %eax
	leaq	(%rsi,%r8,2), %r8
	leaq	(%rsi,%rsi,4), %rsi
	cmovl	%edx, %eax
	leaq	(%rcx,%rsi,2), %rcx
	movl	%edi, 112(%rsp,%r8,4)
	movl	%edi, 112(%rsp,%rcx,4)
	cmpl	%eax, %ebx
	cmovl	%eax, %ebx
	addl	$1, %r15d
	cmpl	%r15d, 96(%rsp)
	jge	.L6
	movl	112(%rsp), %ecx
.L5:
	movslq	%ebx, %rax
	leaq	112(%rsp), %rsi
	movl	%ebx, %edi
	movl	$4, %r9d
	movq	%rax, 80(%rsp)
	salq	$2, %rax
	andl	$-4, %edi
	movq	%rsi, %rbp
	subq	%rsi, %rax
	leal	2(%rdi), %r10d
	movq	%rsi, 72(%rsp)
	negq	%rbp
	movq	%rax, %rdx
	movl	%ebx, %eax
	movl	%edi, 4(%rsp)
	leal	3(%rdi), %r14d
	shrl	$2, %eax
	movl	%r10d, 44(%rsp)
	leaq	4(%rdx), %r13
	movq	%rbp, %r15
	movl	%eax, 40(%rsp)
	leal	1(%rdi), %eax
	movq	%rsi, %r8
	leal	1(%rbx), %r11d
	cltq
	movq	%rsi, 56(%rsp)
	subq	%rsi, %r9
	movq	%rsi, %rdx
	movq	%rax, 8(%rsp)
	movslq	%r10d, %rax
	movq	%rax, 24(%rsp)
	leal	-1(%rbx), %eax
	movq	$0, 64(%rsp)
	movl	%eax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	64(%rsp), %rdi
	movq	72(%rsp), %rax
	xorl	%esi, %esi
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rdi,%rdi), %r12
	movq	8(%rsp), %rdi
	movq	%r12, 48(%rsp)
	addq	%r12, %rdi
	movq	%rdi, 16(%rsp)
	movq	24(%rsp), %rdi
	addq	%r12, %rdi
	movq	%rdi, 32(%rsp)
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L65:
	movl	(%rdx), %ecx
.L17:
	movl	(%rax), %edi
	addl	(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, (%rax)
	testl	%ebx, %ebx
	je	.L13
	leaq	0(%r13,%rax), %rdi
	leaq	0(%rbp,%rax), %rcx
	cmpq	%rcx, %rdi
	leaq	(%rax,%r9), %r10
	leaq	(%r9,%rdx), %rdi
	setle	%cl
	cmpq	%rdi, %r10
	setge	%dil
	orb	%cl, %dil
	je	.L7
	leaq	-4(%r15,%rax), %rcx
	cmpq	$8, %rcx
	seta	%dil
	cmpl	$2, (%rsp)
	seta	%cl
	testb	%cl, %dil
	je	.L7
	movd	(%rdx), %xmm4
	movdqu	4(%r8), %xmm2
	movdqu	4(%rax), %xmm5
	cmpl	$1, 40(%rsp)
	pshufd	$0, %xmm4, %xmm3
	paddd	%xmm3, %xmm2
	movdqa	%xmm5, %xmm1
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm5, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movups	%xmm0, 4(%rax)
	jbe	.L8
	movdqu	20(%r8), %xmm2
	movdqu	20(%rax), %xmm6
	paddd	%xmm3, %xmm2
	movdqa	%xmm6, %xmm1
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm6, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movups	%xmm0, 20(%rax)
.L8:
	cmpl	4(%rsp), %ebx
	je	.L13
	movslq	%esi, %rcx
	movq	8(%rsp), %rdi
	movq	16(%rsp), %r12
	leaq	(%rcx,%rcx,4), %rcx
	addq	%rcx, %rcx
	leaq	(%rcx,%rdi), %r10
	movl	(%rdx), %edi
	addl	112(%rsp,%r12,4), %edi
	movl	112(%rsp,%r10,4), %r12d
	cmpl	%r12d, %edi
	cmovg	%r12d, %edi
	movl	%edi, 112(%rsp,%r10,4)
	cmpl	%ebx, 44(%rsp)
	jg	.L13
	movq	24(%rsp), %rdi
	movq	32(%rsp), %r12
	leaq	(%rcx,%rdi), %r10
	movl	(%rdx), %edi
	addl	112(%rsp,%r12,4), %edi
	movl	112(%rsp,%r10,4), %r12d
	cmpl	%r12d, %edi
	cmovg	%r12d, %edi
	movl	%edi, 112(%rsp,%r10,4)
	cmpl	%ebx, %r14d
	jg	.L13
	movslq	%r14d, %rdi
	movl	(%rdx), %r10d
	addq	%rdi, %rcx
	addq	48(%rsp), %rdi
	addl	112(%rsp,%rdi,4), %r10d
	movl	%r10d, %edi
	movl	112(%rsp,%rcx,4), %r10d
	cmpl	%r10d, %edi
	cmovg	%r10d, %edi
	movl	%edi, 112(%rsp,%rcx,4)
.L13:
	addl	$1, %esi
	addq	$40, %rax
	addq	$40, %rdx
	cmpl	%r11d, %esi
	jne	.L65
	movq	64(%rsp), %rsi
	addq	$40, %r8
	addq	$4, %rbp
	subq	$40, %r15
	addq	$4, 56(%rsp)
	leaq	1(%rsi), %rax
	cmpq	%rsi, 80(%rsp)
	je	.L66
	movq	56(%rsp), %rsi
	movq	%rax, 64(%rsp)
	movl	(%rsi), %ecx
	movq	%rsi, %rdx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L7:
	movl	4(%rax), %edi
	movl	(%rdx), %ecx
	addl	4(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 4(%rax)
	cmpl	$1, %ebx
	je	.L13
	movl	8(%rax), %edi
	movl	(%rdx), %ecx
	addl	8(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 8(%rax)
	cmpl	$2, %ebx
	je	.L13
	movl	12(%rax), %edi
	movl	(%rdx), %ecx
	addl	12(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 12(%rax)
	cmpl	$3, %ebx
	je	.L13
	movl	16(%rax), %edi
	movl	(%rdx), %ecx
	addl	16(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 16(%rax)
	cmpl	$4, %ebx
	je	.L13
	movl	20(%rax), %edi
	movl	(%rdx), %ecx
	addl	20(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 20(%rax)
	cmpl	$5, %ebx
	je	.L13
	movl	24(%rax), %edi
	movl	(%rdx), %ecx
	addl	24(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 24(%rax)
	cmpl	$6, %ebx
	je	.L13
	movl	28(%rax), %edi
	movl	(%rdx), %ecx
	addl	28(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 28(%rax)
	cmpl	$7, %ebx
	je	.L13
	movl	32(%rax), %edi
	movl	(%rdx), %ecx
	addl	32(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 32(%rax)
	cmpl	$8, %ebx
	je	.L13
	movl	36(%rax), %edi
	movl	(%rdx), %ecx
	addl	36(%r8), %ecx
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, 36(%rax)
	jmp	.L13
.L66:
	movl	%r11d, %ebp
	movl	%r11d, %r9d
	movq	72(%rsp), %r12
	xorl	%r10d, %r10d
	shrl	$2, %ebp
	andl	$-4, %r9d
	movl	$-1, %r8d
	xorl	%edi, %edi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L67:
	cmpl	%r8d, %eax
	jl	.L29
	addl	$1, %edi
	addq	$40, %r12
	cmpl	%r11d, %edi
	je	.L22
.L15:
	cmpl	$2, %ebx
	jle	.L28
	movdqu	(%r12), %xmm0
	cmpl	$1, %ebp
	jbe	.L19
	movdqu	16(%r12), %xmm7
	paddd	%xmm7, %xmm0
.L19:
	movdqa	%xmm0, %xmm1
	movl	%r9d, %edx
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%r11d, %r9d
	je	.L18
.L23:
	movslq	%edi, %rcx
	movslq	%edx, %rsi
	leaq	(%rcx,%rcx,4), %rcx
	addq	%rcx, %rcx
	addq	%rcx, %rsi
	addl	112(%rsp,%rsi,4), %eax
	leal	1(%rdx), %esi
	cmpl	%ebx, %esi
	jg	.L18
	movslq	%esi, %rsi
	addl	$2, %edx
	addq	%rcx, %rsi
	addl	112(%rsp,%rsi,4), %eax
	cmpl	%edx, %ebx
	jl	.L18
	movslq	%edx, %rdx
	addq	%rdx, %rcx
	addl	112(%rsp,%rcx,4), %eax
.L18:
	testl	%r8d, %r8d
	jns	.L67
.L29:
	movl	%edi, %r10d
	addl	$1, %edi
	movl	%eax, %r8d
	addq	$40, %r12
	cmpl	%r11d, %edi
	jne	.L15
.L22:
	movl	%r8d, %ecx
	movl	%r10d, %edx
	leaq	.LC7(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L25
.L28:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L23
.L27:
	xorl	%ecx, %ecx
	xorl	%ebx, %ebx
	jmp	.L5
.L4:
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L68
	addq	$536, %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
.L68:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	0
	.long	100000
	.long	100000
	.long	100000
	.align 16
.LC2:
	.long	100000
	.long	100000
	.long	100000
	.long	100000
	.align 16
.LC3:
	.long	100000
	.long	100000
	.long	100000
	.long	0
	.align 16
.LC4:
	.long	100000
	.long	100000
	.long	0
	.long	100000
	.align 16
.LC5:
	.long	100000
	.long	0
	.long	100000
	.long	100000
	.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 min(int a,int b){
    if(a>b)return b;
    else return a;
}
int main(){
    int d[10][10];
    int i,j,k,n,s,ans1,ans2;
    int v;
    v=0;
    s=0;ans1=0;ans2=-1;
    int t1,t2,t3;
    while(1){
        scanf("%d",&n);
        if(n==0)break;
        for(i=0;i<=9;i++){
            for(j=0;j<=9;j++)if(i!=j)d[i][j]=100000;else d[i][j]=0;
	    }
        for(i=1;i<=n;i++){
            scanf("%d%d%d",&t1,&t2,&t3);
            d[t1][t2]=t3;d[t2][t1]=t3;
            if(t1>v)v=t1;if(t2>v)v=t2;
        }
        for(k=0;k<=v;k++)
            for(i=0;i<=v;i++)
                for(j=0;j<=v;j++)d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
        for(i=0;i<=v;i++){
            for(j=0;j<=v;j++)s=s+d[i][j];
            if(ans2<0||s<ans2){ans1=i;ans2=s;}
            s=0;
        }
        printf("%d %d\n",ans1,ans2);
        v=0;ans1=0;ans2=-1;s=0;
    }
    return 0;
}


6
0 1 80
1 2 20
0 2 60
2 3 50
3 4 66
1 4 90
2
0 1 1
1 2 1
0
 6
0 1 80
1 2 20
0 2 60
2 3 50
3 4 66
0 4 90
2
0 1 1
1 2 1
0
 6
0 1 80
1 2 20
0 2 60
2 2 50
3 4 66
0 4 90
2
0 1 1
1 2 1
0
 6
0 1 80
1 2 20
0 2 60
2 2 50
3 4 66
1 4 90
2
0 1 1
1 2 1
0
 6
0 1 80
1 2 20
0 2 60
2 2 50
3 4 66
1 4 90
2
0 1 1
1 0 1
0
 6
0 1 80
1 2 28
0 2 60
2 2 50
3 4 66
1 4 90
2
0 1 1
1 0 1
0
 6
0 1 80
1 3 20
0 2 60
2 3 50
3 4 60
1 4 90
2
0 1 1
1 2 1
0
 6
0 1 80
1 2 20
0 2 60
2 3 50
2 4 66
1 4 90
2
0 1 1
1 2 1
0
 6
0 1 80
1 2 20
0 2 60
2 3 50
3 2 66
0 4 90
2
0 1 1
1 2 1
0
 6
0 0 80
1 2 20
0 2 60
2 3 50
3 4 66
1 4 90
2
0 1 1
1 1 1
0

2 240
1 2
 2 246
1 2
 0 386
1 2
 1 346
1 2
 1 346
0 1
 1 354
0 1
 3 230
1 2
 2 196
1 2
 2 296
1 2
 2 240
0 1

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 min(int a,int b){
    if(a>b)return b;
    else return a;
}
int main(){
    int d[10][10];
    int i,j,k,n,s,ans1,ans2;
    int v;
    v=0;
    s=0;ans1=0;ans2=-1;
    int t1,t2,t3;
    while(1){
        scanf("%d",&n);
        if(n==0)break;
        for(i=0;i<=9;i++){
            for(j=0;j<=9;j++)if(i!=j)d[i][j]=100000;else d[i][j]=0;
	    }
        for(i=1;i<=n;i++){
            scanf("%d%d%d",&t1,&t2,&t3);
            d[t1][t2]=t3;d[t2][t1]=t3;
            if(t1>v)v=t1;if(t2>v)v=t2;
        }
        for(k=0;k<=v;k++)
            for(i=0;i<=v;i++)
                for(j=0;j<=v;j++)d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
        for(i=0;i<=v;i++){
            for(j=0;j<=v;j++)s=s+d[i][j];
            if(ans2<0||s<ans2){ans1=i;ans2=s;}
            s=0;
        }
        printf("%d %d\n",ans1,ans2);
        v=0;ans1=0;ans2=-1;s=0;
    }
    return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	min
	.type	min, @function
min:
.LFB0:
	.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	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L2
	movl	-8(%rbp), %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -420(%rbp)
	movl	$0, -432(%rbp)
	movl	$0, -428(%rbp)
	movl	$-1, -424(%rbp)
.L29:
	leaq	-460(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-460(%rbp), %eax
	testl	%eax, %eax
	je	.L33
	movl	$0, -444(%rbp)
	jmp	.L7
.L12:
	movl	$0, -440(%rbp)
	jmp	.L8
.L11:
	movl	-444(%rbp), %eax
	cmpl	-440(%rbp), %eax
	je	.L9
	movl	-440(%rbp), %eax
	movslq	%eax, %rcx
	movl	-444(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$100000, -416(%rbp,%rax,4)
	jmp	.L10
.L9:
	movl	-440(%rbp), %eax
	movslq	%eax, %rcx
	movl	-444(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$0, -416(%rbp,%rax,4)
.L10:
	addl	$1, -440(%rbp)
.L8:
	cmpl	$9, -440(%rbp)
	jle	.L11
	addl	$1, -444(%rbp)
.L7:
	cmpl	$9, -444(%rbp)
	jle	.L12
	movl	$1, -444(%rbp)
	jmp	.L13
.L16:
	leaq	-448(%rbp), %rcx
	leaq	-452(%rbp), %rdx
	leaq	-456(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-456(%rbp), %eax
	movl	-452(%rbp), %ecx
	movl	-448(%rbp), %edx
	movslq	%ecx, %rsi
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	%edx, -416(%rbp,%rax,4)
	movl	-452(%rbp), %eax
	movl	-456(%rbp), %ecx
	movl	-448(%rbp), %edx
	movslq	%ecx, %rsi
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	%edx, -416(%rbp,%rax,4)
	movl	-456(%rbp), %eax
	cmpl	%eax, -420(%rbp)
	jge	.L14
	movl	-456(%rbp), %eax
	movl	%eax, -420(%rbp)
.L14:
	movl	-452(%rbp), %eax
	cmpl	%eax, -420(%rbp)
	jge	.L15
	movl	-452(%rbp), %eax
	movl	%eax, -420(%rbp)
.L15:
	addl	$1, -444(%rbp)
.L13:
	movl	-460(%rbp), %eax
	cmpl	%eax, -444(%rbp)
	jle	.L16
	movl	$0, -436(%rbp)
	jmp	.L17
.L22:
	movl	$0, -444(%rbp)
	jmp	.L18
.L21:
	movl	$0, -440(%rbp)
	jmp	.L19
.L20:
	movl	-436(%rbp), %eax
	movslq	%eax, %rcx
	movl	-444(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-416(%rbp,%rax,4), %ecx
	movl	-440(%rbp), %eax
	movslq	%eax, %rsi
	movl	-436(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-416(%rbp,%rax,4), %eax
	leal	(%rcx,%rax), %edx
	movl	-440(%rbp), %eax
	movslq	%eax, %rsi
	movl	-444(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-416(%rbp,%rax,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, %edx
	movl	-440(%rbp), %eax
	movslq	%eax, %rsi
	movl	-444(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -440(%rbp)
.L19:
	movl	-440(%rbp), %eax
	cmpl	-420(%rbp), %eax
	jle	.L20
	addl	$1, -444(%rbp)
.L18:
	movl	-444(%rbp), %eax
	cmpl	-420(%rbp), %eax
	jle	.L21
	addl	$1, -436(%rbp)
.L17:
	movl	-436(%rbp), %eax
	cmpl	-420(%rbp), %eax
	jle	.L22
	movl	$0, -444(%rbp)
	jmp	.L23
.L28:
	movl	$0, -440(%rbp)
	jmp	.L24
.L25:
	movl	-440(%rbp), %eax
	movslq	%eax, %rcx
	movl	-444(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -432(%rbp)
	addl	$1, -440(%rbp)
.L24:
	movl	-440(%rbp), %eax
	cmpl	-420(%rbp), %eax
	jle	.L25
	cmpl	$0, -424(%rbp)
	js	.L26
	movl	-432(%rbp), %eax
	cmpl	-424(%rbp), %eax
	jge	.L27
.L26:
	movl	-444(%rbp), %eax
	movl	%eax, -428(%rbp)
	movl	-432(%rbp), %eax
	movl	%eax, -424(%rbp)
.L27:
	movl	$0, -432(%rbp)
	addl	$1, -444(%rbp)
.L23:
	movl	-444(%rbp), %eax
	cmpl	-420(%rbp), %eax
	jle	.L28
	movl	-424(%rbp), %edx
	movl	-428(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -420(%rbp)
	movl	$0, -428(%rbp)
	movl	$-1, -424(%rbp)
	movl	$0, -432(%rbp)
	jmp	.L29
.L33:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	min
	.type	min, @function
min:
.LFB0:
	.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	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L2
	movl	-8(%rbp), %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -420(%rbp)
	movl	$0, -432(%rbp)
	movl	$0, -428(%rbp)
	movl	$-1, -424(%rbp)
.L29:
	leaq	-460(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-460(%rbp), %eax
	testl	%eax, %eax
	je	.L33
	movl	$0, -444(%rbp)
	jmp	.L7
.L12:
	movl	$0, -440(%rbp)
	jmp	.L8
.L11:
	movl	-444(%rbp), %eax
	cmpl	-440(%rbp), %eax
	je	.L9
	movl	-440(%rbp), %eax
	movslq	%eax, %rcx
	movl	-444(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$100000, -416(%rbp,%rax,4)
	jmp	.L10
.L9:
	movl	-440(%rbp), %eax
	movslq	%eax, %rcx
	movl	-444(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$0, -416(%rbp,%rax,4)
.L10:
	addl	$1, -440(%rbp)
.L8:
	cmpl	$9, -440(%rbp)
	jle	.L11
	addl	$1, -444(%rbp)
.L7:
	cmpl	$9, -444(%rbp)
	jle	.L12
	movl	$1, -444(%rbp)
	jmp	.L13
.L16:
	leaq	-448(%rbp), %rcx
	leaq	-452(%rbp), %rdx
	leaq	-456(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-456(%rbp), %eax
	movl	-452(%rbp), %ecx
	movl	-448(%rbp), %edx
	movslq	%ecx, %rsi
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	%edx, -416(%rbp,%rax,4)
	movl	-452(%rbp), %eax
	movl	-456(%rbp), %ecx
	movl	-448(%rbp), %edx
	movslq	%ecx, %rsi
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	%edx, -416(%rbp,%rax,4)
	movl	-456(%rbp), %eax
	cmpl	%eax, -420(%rbp)
	jge	.L14
	movl	-456(%rbp), %eax
	movl	%eax, -420(%rbp)
.L14:
	movl	-452(%rbp), %eax
	cmpl	%eax, -420(%rbp)
	jge	.L15
	movl	-452(%rbp), %eax
	movl	%eax, -420(%rbp)
.L15:
	addl	$1, -444(%rbp)
.L13:
	movl	-460(%rbp), %eax
	cmpl	%eax, -444(%rbp)
	jle	.L16
	movl	$0, -436(%rbp)
	jmp	.L17
.L22:
	movl	$0, -444(%rbp)
	jmp	.L18
.L21:
	movl	$0, -440(%rbp)
	jmp	.L19
.L20:
	movl	-436(%rbp), %eax
	movslq	%eax, %rcx
	movl	-444(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-416(%rbp,%rax,4), %ecx
	movl	-440(%rbp), %eax
	movslq	%eax, %rsi
	movl	-436(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-416(%rbp,%rax,4), %eax
	leal	(%rcx,%rax), %edx
	movl	-440(%rbp), %eax
	movslq	%eax, %rsi
	movl	-444(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-416(%rbp,%rax,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, %edx
	movl	-440(%rbp), %eax
	movslq	%eax, %rsi
	movl	-444(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -440(%rbp)
.L19:
	movl	-440(%rbp), %eax
	cmpl	-420(%rbp), %eax
	jle	.L20
	addl	$1, -444(%rbp)
.L18:
	movl	-444(%rbp), %eax
	cmpl	-420(%rbp), %eax
	jle	.L21
	addl	$1, -436(%rbp)
.L17:
	movl	-436(%rbp), %eax
	cmpl	-420(%rbp), %eax
	jle	.L22
	movl	$0, -444(%rbp)
	jmp	.L23
.L28:
	movl	$0, -440(%rbp)
	jmp	.L24
.L25:
	movl	-440(%rbp), %eax
	movslq	%eax, %rcx
	movl	-444(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -432(%rbp)
	addl	$1, -440(%rbp)
.L24:
	movl	-440(%rbp), %eax
	cmpl	-420(%rbp), %eax
	jle	.L25
	cmpl	$0, -424(%rbp)
	js	.L26
	movl	-432(%rbp), %eax
	cmpl	-424(%rbp), %eax
	jge	.L27
.L26:
	movl	-444(%rbp), %eax
	movl	%eax, -428(%rbp)
	movl	-432(%rbp), %eax
	movl	%eax, -424(%rbp)
.L27:
	movl	$0, -432(%rbp)
	addl	$1, -444(%rbp)
.L23:
	movl	-444(%rbp), %eax
	cmpl	-420(%rbp), %eax
	jle	.L28
	movl	-424(%rbp), %edx
	movl	-428(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -420(%rbp)
	movl	$0, -428(%rbp)
	movl	$-1, -424(%rbp)
	movl	$0, -432(%rbp)
	jmp	.L29
.L33:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
