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 main(){
	int n, a, b, t, ans=0;
	int i, j, k, l, p, q, far=0, sta[20]={0}, now=0, tail=0, count;
	int lis[20][23];//0-19隣接リスト,20隣接する島への時間の合計,21隣接する島の数,22島1からの時間
	scanf("%d", &n);
	while(n>0)
	{
		for(p=0;p<20;p++)
		{
			for(q=0;q<23;q++)
			{
				lis[p][q]=0;
			}
		}
		for(i=0;i<n-1;i++)
		{
			scanf("%d %d %d", &a, &b, &t);
			lis[a-1][b-1]=t;
			lis[a-1][20]+=t;
			lis[a-1][21]++;
			lis[b-1][a-1]=t;
			lis[b-1][20]+=t;
			lis[b-1][21]++;
		}
		for(j=0;j<n;j++)
		{
			if(lis[j][21]>=2 || j==0) ans+=lis[j][20];
			else if(lis[j][21]==1) ans-=lis[j][20];
		}
		while(now>=0)
		{
			count=0;
			for(k=0;k<n;k++)
			{
				if(lis[sta[now]][k]>0 && lis[k][21]>=2 && lis[k][22]==0 && k>0)
				{
					lis[k][22] = lis[sta[now]][k] + lis[sta[now]][22];
					sta[tail+1] = k;
					tail++;
					count++;
				}
			}
			if(count==0) tail--;
			now=tail;
		}
		for(l=0;l<n;l++)
		{
			if(lis[l][22]>far)far=lis[l][22];
		}
		ans -= far;
		printf("%d\n", ans);
		
		
		scanf("%d", &n);
		far=0;
		now=0;
		tail=0;
		ans=0;
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2000, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -1980(%rbp)
	movl	$0, -1952(%rbp)
	movq	$0, -1936(%rbp)
	movq	$0, -1928(%rbp)
	movq	$0, -1920(%rbp)
	movq	$0, -1912(%rbp)
	movq	$0, -1904(%rbp)
	movq	$0, -1896(%rbp)
	movq	$0, -1888(%rbp)
	movq	$0, -1880(%rbp)
	movq	$0, -1872(%rbp)
	movq	$0, -1864(%rbp)
	movl	$0, -1948(%rbp)
	movl	$0, -1944(%rbp)
	leaq	-1996(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L2
.L23:
	movl	$0, -1960(%rbp)
	jmp	.L3
.L6:
	movl	$0, -1956(%rbp)
	jmp	.L4
.L5:
	movl	-1956(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1960(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movl	$0, -1856(%rbp,%rax,4)
	addl	$1, -1956(%rbp)
.L4:
	cmpl	$22, -1956(%rbp)
	jle	.L5
	addl	$1, -1960(%rbp)
.L3:
	cmpl	$19, -1960(%rbp)
	jle	.L6
	movl	$0, -1976(%rbp)
	jmp	.L7
.L8:
	leaq	-1984(%rbp), %rcx
	leaq	-1988(%rbp), %rdx
	leaq	-1992(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1992(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-1988(%rbp), %eax
	subl	$1, %eax
	movl	-1984(%rbp), %ecx
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rsi, %rax
	movl	%ecx, -1856(%rbp,%rax,4)
	movl	-1992(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	(%rax), %ecx
	movl	-1984(%rbp), %edx
	movl	-1992(%rbp), %eax
	subl	$1, %eax
	addl	%ecx, %edx
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	%edx, (%rax)
	movl	-1992(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	imulq	$92, %rdx, %rdx
	addq	%rbp, %rdx
	subq	$1772, %rdx
	movl	(%rdx), %edx
	addl	$1, %edx
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1772, %rax
	movl	%edx, (%rax)
	movl	-1988(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-1992(%rbp), %eax
	subl	$1, %eax
	movl	-1984(%rbp), %ecx
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rsi, %rax
	movl	%ecx, -1856(%rbp,%rax,4)
	movl	-1988(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	(%rax), %ecx
	movl	-1984(%rbp), %edx
	movl	-1988(%rbp), %eax
	subl	$1, %eax
	addl	%ecx, %edx
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	%edx, (%rax)
	movl	-1988(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	imulq	$92, %rdx, %rdx
	addq	%rbp, %rdx
	subq	$1772, %rdx
	movl	(%rdx), %edx
	addl	$1, %edx
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1772, %rax
	movl	%edx, (%rax)
	addl	$1, -1976(%rbp)
.L7:
	movl	-1996(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1976(%rbp)
	jl	.L8
	movl	$0, -1972(%rbp)
	jmp	.L9
.L13:
	movl	-1972(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1772, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jg	.L10
	cmpl	$0, -1972(%rbp)
	jne	.L11
.L10:
	movl	-1972(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	(%rax), %eax
	addl	%eax, -1980(%rbp)
	jmp	.L12
.L11:
	movl	-1972(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1772, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L12
	movl	-1972(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	(%rax), %eax
	subl	%eax, -1980(%rbp)
.L12:
	addl	$1, -1972(%rbp)
.L9:
	movl	-1996(%rbp), %eax
	cmpl	%eax, -1972(%rbp)
	jl	.L13
	jmp	.L14
.L19:
	movl	$0, -1940(%rbp)
	movl	$0, -1968(%rbp)
	jmp	.L15
.L17:
	movl	-1948(%rbp), %eax
	cltq
	movl	-1936(%rbp,%rax,4), %eax
	movl	-1968(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movl	-1856(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jle	.L16
	movl	-1968(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1772, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jle	.L16
	movl	-1968(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1768, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L16
	cmpl	$0, -1968(%rbp)
	jle	.L16
	movl	-1948(%rbp), %eax
	cltq
	movl	-1936(%rbp,%rax,4), %eax
	movl	-1968(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movl	-1856(%rbp,%rax,4), %edx
	movl	-1948(%rbp), %eax
	cltq
	movl	-1936(%rbp,%rax,4), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1768, %rax
	movl	(%rax), %eax
	addl	%eax, %edx
	movl	-1968(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1768, %rax
	movl	%edx, (%rax)
	movl	-1944(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1968(%rbp), %edx
	movl	%edx, -1936(%rbp,%rax,4)
	addl	$1, -1944(%rbp)
	addl	$1, -1940(%rbp)
.L16:
	addl	$1, -1968(%rbp)
.L15:
	movl	-1996(%rbp), %eax
	cmpl	%eax, -1968(%rbp)
	jl	.L17
	cmpl	$0, -1940(%rbp)
	jne	.L18
	subl	$1, -1944(%rbp)
.L18:
	movl	-1944(%rbp), %eax
	movl	%eax, -1948(%rbp)
.L14:
	cmpl	$0, -1948(%rbp)
	jns	.L19
	movl	$0, -1964(%rbp)
	jmp	.L20
.L22:
	movl	-1964(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1768, %rax
	movl	(%rax), %eax
	cmpl	%eax, -1952(%rbp)
	jge	.L21
	movl	-1964(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1768, %rax
	movl	(%rax), %eax
	movl	%eax, -1952(%rbp)
.L21:
	addl	$1, -1964(%rbp)
.L20:
	movl	-1996(%rbp), %eax
	cmpl	%eax, -1964(%rbp)
	jl	.L22
	movl	-1952(%rbp), %eax
	subl	%eax, -1980(%rbp)
	movl	-1980(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	leaq	-1996(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1952(%rbp)
	movl	$0, -1948(%rbp)
	movl	$0, -1944(%rbp)
	movl	$0, -1980(%rbp)
.L2:
	movl	-1996(%rbp), %eax
	testl	%eax, %eax
	jg	.L23
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pxor	%xmm0, %xmm0
	leaq	.LC0(%rip), %rdi
	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
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$1976, %rsp
	.cfi_def_cfa_offset 2032
	movq	%fs:40, %rax
	movq	%rax, 1960(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	movaps	%xmm0, 32(%rsp)
	leaq	112(%rsp), %rbx
	movq	%rsi, 8(%rsp)
	movaps	%xmm0, 48(%rsp)
	movaps	%xmm0, 64(%rsp)
	movaps	%xmm0, 80(%rsp)
	movaps	%xmm0, 96(%rsp)
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L20
.L2:
	movl	$230, %ecx
	xorl	%eax, %eax
	movq	%rbx, %rdi
	rep stosq
	cmpl	$1, %r8d
	je	.L3
	xorl	%r15d, %r15d
	leaq	28(%rsp), %r14
	leaq	24(%rsp), %r13
	leaq	20(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	movl	28(%rsp), %ecx
	leal	-1(%rax), %edx
	movl	24(%rsp), %eax
	movslq	%edx, %rdx
	subl	$1, %eax
	leaq	(%rdx,%rdx,2), %rsi
	cltq
	leaq	(%rax,%rsi,8), %rsi
	subq	%rdx, %rsi
	movl	%ecx, 112(%rsp,%rsi,4)
	imulq	$92, %rdx, %rsi
	movl	192(%rsp,%rsi), %edi
	addl	%ecx, %edi
	movd	%edi, %xmm0
	movl	196(%rsp,%rsi), %edi
	addl	$1, %edi
	movd	%edi, %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, 80(%rbx,%rsi)
	leaq	(%rax,%rax,2), %rsi
	salq	$3, %rsi
	subq	%rax, %rsi
	imulq	$92, %rax, %rax
	addq	%rsi, %rdx
	movl	%ecx, 112(%rsp,%rdx,4)
	movl	196(%rsp,%rax), %edi
	addl	192(%rsp,%rax), %ecx
	movd	%ecx, %xmm0
	leal	1(%rdi), %edx
	movd	%edx, %xmm2
	punpckldq	%xmm2, %xmm0
	movq	%xmm0, 80(%rbx,%rax)
	movl	16(%rsp), %r8d
	leal	-1(%r8), %eax
	cmpl	%r15d, %eax
	jg	.L4
	xorl	%r11d, %r11d
	testl	%r8d, %r8d
	jle	.L5
.L3:
	leaq	192(%rsp), %rax
	xorl	%edx, %edx
	xorl	%r11d, %r11d
.L9:
	movl	4(%rax), %ecx
	cmpl	$1, %ecx
	jg	.L23
	testl	%edx, %edx
	jne	.L6
.L23:
	addl	(%rax), %r11d
.L8:
	addl	$1, %edx
	addq	$92, %rax
	cmpl	%r8d, %edx
	jne	.L9
.L5:
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L14:
	testl	%r8d, %r8d
	jle	.L18
	leaq	200(%rsp), %rsi
	xorl	%r10d, %r10d
	xorl	%eax, %eax
	movslq	%r9d, %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	32(%rsp,%rdi,4), %rdx
	movslq	%eax, %rcx
	leaq	(%rdx,%rdx,2), %r12
	leaq	(%rcx,%r12,8), %rcx
	subq	%rdx, %rcx
	movl	112(%rsp,%rcx,4), %ecx
	testl	%ecx, %ecx
	jle	.L10
	cmpl	$1, -4(%rsi)
	jle	.L10
	movl	(%rsi), %r12d
	testl	%r12d, %r12d
	jne	.L10
	testl	%eax, %eax
	je	.L10
	imulq	$92, %rdx, %rdx
	addl	$1, %r9d
	addl	$1, %r10d
	addl	200(%rsp,%rdx), %ecx
	movslq	%r9d, %rdx
	movl	%ecx, (%rsi)
	movl	%eax, 32(%rsp,%rdx,4)
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %eax
	addq	$92, %rsi
	cmpl	%r8d, %eax
	jne	.L11
	testl	%r10d, %r10d
	jne	.L14
.L18:
	subl	$1, %r9d
	jnb	.L14
	testl	%r8d, %r8d
	jle	.L16
	leal	-1(%r8), %edx
	leaq	200(%rsp), %rax
	imulq	$92, %rdx, %rdx
	leaq	292(%rsp,%rdx), %rsi
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L19:
	movl	(%rax), %ecx
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	addq	$92, %rax
	cmpq	%rsi, %rax
	jne	.L19
	subl	%edx, %r11d
.L16:
	movl	%r11d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %r8d
	testl	%r8d, %r8d
	jg	.L2
.L20:
	movq	1960(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$1976, %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
.L6:
	.cfi_restore_state
	cmpl	$1, %ecx
	jne	.L8
	subl	(%rax), %r11d
	jmp	.L8
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pxor	%xmm0, %xmm0
	leaq	.LC0(%rip), %rdi
	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
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$1976, %rsp
	.cfi_def_cfa_offset 2032
	movq	%fs:40, %rax
	movq	%rax, 1960(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	movaps	%xmm0, 32(%rsp)
	leaq	112(%rsp), %rbx
	movq	%rsi, 8(%rsp)
	movaps	%xmm0, 48(%rsp)
	movaps	%xmm0, 64(%rsp)
	movaps	%xmm0, 80(%rsp)
	movaps	%xmm0, 96(%rsp)
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L20
.L2:
	movl	$230, %ecx
	xorl	%eax, %eax
	movq	%rbx, %rdi
	rep stosq
	cmpl	$1, %r8d
	je	.L3
	xorl	%r15d, %r15d
	leaq	28(%rsp), %r14
	leaq	24(%rsp), %r13
	leaq	20(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	movl	28(%rsp), %ecx
	leal	-1(%rax), %edx
	movl	24(%rsp), %eax
	movslq	%edx, %rdx
	subl	$1, %eax
	leaq	(%rdx,%rdx,2), %rsi
	cltq
	leaq	(%rax,%rsi,8), %rsi
	subq	%rdx, %rsi
	movl	%ecx, 112(%rsp,%rsi,4)
	imulq	$92, %rdx, %rsi
	movl	192(%rsp,%rsi), %edi
	addl	%ecx, %edi
	movd	%edi, %xmm0
	movl	196(%rsp,%rsi), %edi
	addl	$1, %edi
	movd	%edi, %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, 80(%rbx,%rsi)
	leaq	(%rax,%rax,2), %rsi
	salq	$3, %rsi
	subq	%rax, %rsi
	imulq	$92, %rax, %rax
	addq	%rsi, %rdx
	movl	%ecx, 112(%rsp,%rdx,4)
	movl	196(%rsp,%rax), %edi
	addl	192(%rsp,%rax), %ecx
	movd	%ecx, %xmm0
	leal	1(%rdi), %edx
	movd	%edx, %xmm2
	punpckldq	%xmm2, %xmm0
	movq	%xmm0, 80(%rbx,%rax)
	movl	16(%rsp), %r8d
	leal	-1(%r8), %eax
	cmpl	%r15d, %eax
	jg	.L4
	xorl	%r11d, %r11d
	testl	%r8d, %r8d
	jle	.L5
.L3:
	leaq	192(%rsp), %rax
	xorl	%edx, %edx
	xorl	%r11d, %r11d
.L9:
	movl	4(%rax), %ecx
	cmpl	$1, %ecx
	jg	.L23
	testl	%edx, %edx
	jne	.L6
.L23:
	addl	(%rax), %r11d
.L8:
	addl	$1, %edx
	addq	$92, %rax
	cmpl	%r8d, %edx
	jne	.L9
.L5:
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L14:
	testl	%r8d, %r8d
	jle	.L18
	leaq	200(%rsp), %rsi
	xorl	%r10d, %r10d
	xorl	%eax, %eax
	movslq	%r9d, %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	32(%rsp,%rdi,4), %rdx
	movslq	%eax, %rcx
	leaq	(%rdx,%rdx,2), %r12
	leaq	(%rcx,%r12,8), %rcx
	subq	%rdx, %rcx
	movl	112(%rsp,%rcx,4), %ecx
	testl	%ecx, %ecx
	jle	.L10
	cmpl	$1, -4(%rsi)
	jle	.L10
	movl	(%rsi), %r12d
	testl	%r12d, %r12d
	jne	.L10
	testl	%eax, %eax
	je	.L10
	imulq	$92, %rdx, %rdx
	addl	$1, %r9d
	addl	$1, %r10d
	addl	200(%rsp,%rdx), %ecx
	movslq	%r9d, %rdx
	movl	%ecx, (%rsi)
	movl	%eax, 32(%rsp,%rdx,4)
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %eax
	addq	$92, %rsi
	cmpl	%r8d, %eax
	jne	.L11
	testl	%r10d, %r10d
	jne	.L14
.L18:
	subl	$1, %r9d
	jnb	.L14
	testl	%r8d, %r8d
	jle	.L16
	leal	-1(%r8), %edx
	leaq	200(%rsp), %rax
	imulq	$92, %rdx, %rdx
	leaq	292(%rsp,%rdx), %rsi
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L19:
	movl	(%rax), %ecx
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	addq	$92, %rax
	cmpq	%rsi, %rax
	jne	.L19
	subl	%edx, %r11d
.L16:
	movl	%r11d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %r8d
	testl	%r8d, %r8d
	jg	.L2
.L20:
	movq	1960(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$1976, %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
.L6:
	.cfi_restore_state
	cmpl	$1, %ecx
	jne	.L8
	subl	(%rax), %r11d
	jmp	.L8
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:

#include<stdio.h>

int main(){
	int n, a, b, t, ans=0;
	int i, j, k, l, p, q, far=0, sta[20]={0}, now=0, tail=0, count;
	int lis[20][23];//0-19隣接リスト,20隣接する島への時間の合計,21隣接する島の数,22島1からの時間
	scanf("%d", &n);
	while(n>0)
	{
		for(p=0;p<20;p++)
		{
			for(q=0;q<23;q++)
			{
				lis[p][q]=0;
			}
		}
		for(i=0;i<n-1;i++)
		{
			scanf("%d %d %d", &a, &b, &t);
			lis[a-1][b-1]=t;
			lis[a-1][20]+=t;
			lis[a-1][21]++;
			lis[b-1][a-1]=t;
			lis[b-1][20]+=t;
			lis[b-1][21]++;
		}
		for(j=0;j<n;j++)
		{
			if(lis[j][21]>=2 || j==0) ans+=lis[j][20];
			else if(lis[j][21]==1) ans-=lis[j][20];
		}
		while(now>=0)
		{
			count=0;
			for(k=0;k<n;k++)
			{
				if(lis[sta[now]][k]>0 && lis[k][21]>=2 && lis[k][22]==0 && k>0)
				{
					lis[k][22] = lis[sta[now]][k] + lis[sta[now]][22];
					sta[tail+1] = k;
					tail++;
					count++;
				}
			}
			if(count==0) tail--;
			now=tail;
		}
		for(l=0;l<n;l++)
		{
			if(lis[l][22]>far)far=lis[l][22];
		}
		ans -= far;
		printf("%d\n", ans);
		
		
		scanf("%d", &n);
		far=0;
		now=0;
		tail=0;
		ans=0;
	}
	return 0;
}
7
1 2 5
2 3 2
3 4 3
2 5 3
5 6 5
5 7 8
0
 7
1 2 5
2 3 2
3 4 3
2 5 0
5 6 10
5 7 7
0
 7
1 2 5
1 3 2
6 4 3
2 5 3
5 6 5
5 7 8
0
 7
1 2 5
2 3 3
3 4 3
2 5 3
5 6 5
5 7 8
0
 7
1 2 5
1 3 2
3 4 3
2 5 3
5 6 5
6 7 8
0
 7
1 2 5
2 3 3
3 4 3
2 5 5
5 6 5
5 7 8
0
 7
1 2 5
2 3 1
3 4 3
2 5 3
5 6 5
5 7 8
0
 7
1 2 2
2 3 2
3 4 1
2 5 3
5 6 5
5 7 7
0
 7
1 2 10
2 3 3
3 4 3
2 5 3
5 6 5
5 7 8
0
 7
1 2 2
2 3 1
3 4 3
1 5 5
5 6 2
5 7 15
0

12
 7
 13
 14
 17
 16
 10
 9
 19
 11

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 main(){
	int n, a, b, t, ans=0;
	int i, j, k, l, p, q, far=0, sta[20]={0}, now=0, tail=0, count;
	int lis[20][23];//0-19隣接リスト,20隣接する島への時間の合計,21隣接する島の数,22島1からの時間
	scanf("%d", &n);
	while(n>0)
	{
		for(p=0;p<20;p++)
		{
			for(q=0;q<23;q++)
			{
				lis[p][q]=0;
			}
		}
		for(i=0;i<n-1;i++)
		{
			scanf("%d %d %d", &a, &b, &t);
			lis[a-1][b-1]=t;
			lis[a-1][20]+=t;
			lis[a-1][21]++;
			lis[b-1][a-1]=t;
			lis[b-1][20]+=t;
			lis[b-1][21]++;
		}
		for(j=0;j<n;j++)
		{
			if(lis[j][21]>=2 || j==0) ans+=lis[j][20];
			else if(lis[j][21]==1) ans-=lis[j][20];
		}
		while(now>=0)
		{
			count=0;
			for(k=0;k<n;k++)
			{
				if(lis[sta[now]][k]>0 && lis[k][21]>=2 && lis[k][22]==0 && k>0)
				{
					lis[k][22] = lis[sta[now]][k] + lis[sta[now]][22];
					sta[tail+1] = k;
					tail++;
					count++;
				}
			}
			if(count==0) tail--;
			now=tail;
		}
		for(l=0;l<n;l++)
		{
			if(lis[l][22]>far)far=lis[l][22];
		}
		ans -= far;
		printf("%d\n", ans);
		
		
		scanf("%d", &n);
		far=0;
		now=0;
		tail=0;
		ans=0;
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2000, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -1980(%rbp)
	movl	$0, -1952(%rbp)
	movq	$0, -1936(%rbp)
	movq	$0, -1928(%rbp)
	movq	$0, -1920(%rbp)
	movq	$0, -1912(%rbp)
	movq	$0, -1904(%rbp)
	movq	$0, -1896(%rbp)
	movq	$0, -1888(%rbp)
	movq	$0, -1880(%rbp)
	movq	$0, -1872(%rbp)
	movq	$0, -1864(%rbp)
	movl	$0, -1948(%rbp)
	movl	$0, -1944(%rbp)
	leaq	-1996(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L2
.L23:
	movl	$0, -1960(%rbp)
	jmp	.L3
.L6:
	movl	$0, -1956(%rbp)
	jmp	.L4
.L5:
	movl	-1956(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1960(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movl	$0, -1856(%rbp,%rax,4)
	addl	$1, -1956(%rbp)
.L4:
	cmpl	$22, -1956(%rbp)
	jle	.L5
	addl	$1, -1960(%rbp)
.L3:
	cmpl	$19, -1960(%rbp)
	jle	.L6
	movl	$0, -1976(%rbp)
	jmp	.L7
.L8:
	leaq	-1984(%rbp), %rcx
	leaq	-1988(%rbp), %rdx
	leaq	-1992(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1992(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-1988(%rbp), %eax
	subl	$1, %eax
	movl	-1984(%rbp), %ecx
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rsi, %rax
	movl	%ecx, -1856(%rbp,%rax,4)
	movl	-1992(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	(%rax), %ecx
	movl	-1984(%rbp), %edx
	movl	-1992(%rbp), %eax
	subl	$1, %eax
	addl	%ecx, %edx
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	%edx, (%rax)
	movl	-1992(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	imulq	$92, %rdx, %rdx
	addq	%rbp, %rdx
	subq	$1772, %rdx
	movl	(%rdx), %edx
	addl	$1, %edx
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1772, %rax
	movl	%edx, (%rax)
	movl	-1988(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-1992(%rbp), %eax
	subl	$1, %eax
	movl	-1984(%rbp), %ecx
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rsi, %rax
	movl	%ecx, -1856(%rbp,%rax,4)
	movl	-1988(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	(%rax), %ecx
	movl	-1984(%rbp), %edx
	movl	-1988(%rbp), %eax
	subl	$1, %eax
	addl	%ecx, %edx
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	%edx, (%rax)
	movl	-1988(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	imulq	$92, %rdx, %rdx
	addq	%rbp, %rdx
	subq	$1772, %rdx
	movl	(%rdx), %edx
	addl	$1, %edx
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1772, %rax
	movl	%edx, (%rax)
	addl	$1, -1976(%rbp)
.L7:
	movl	-1996(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1976(%rbp)
	jl	.L8
	movl	$0, -1972(%rbp)
	jmp	.L9
.L13:
	movl	-1972(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1772, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jg	.L10
	cmpl	$0, -1972(%rbp)
	jne	.L11
.L10:
	movl	-1972(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	(%rax), %eax
	addl	%eax, -1980(%rbp)
	jmp	.L12
.L11:
	movl	-1972(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1772, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L12
	movl	-1972(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	(%rax), %eax
	subl	%eax, -1980(%rbp)
.L12:
	addl	$1, -1972(%rbp)
.L9:
	movl	-1996(%rbp), %eax
	cmpl	%eax, -1972(%rbp)
	jl	.L13
	jmp	.L14
.L19:
	movl	$0, -1940(%rbp)
	movl	$0, -1968(%rbp)
	jmp	.L15
.L17:
	movl	-1948(%rbp), %eax
	cltq
	movl	-1936(%rbp,%rax,4), %eax
	movl	-1968(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movl	-1856(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jle	.L16
	movl	-1968(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1772, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jle	.L16
	movl	-1968(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1768, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L16
	cmpl	$0, -1968(%rbp)
	jle	.L16
	movl	-1948(%rbp), %eax
	cltq
	movl	-1936(%rbp,%rax,4), %eax
	movl	-1968(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movl	-1856(%rbp,%rax,4), %edx
	movl	-1948(%rbp), %eax
	cltq
	movl	-1936(%rbp,%rax,4), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1768, %rax
	movl	(%rax), %eax
	addl	%eax, %edx
	movl	-1968(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1768, %rax
	movl	%edx, (%rax)
	movl	-1944(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1968(%rbp), %edx
	movl	%edx, -1936(%rbp,%rax,4)
	addl	$1, -1944(%rbp)
	addl	$1, -1940(%rbp)
.L16:
	addl	$1, -1968(%rbp)
.L15:
	movl	-1996(%rbp), %eax
	cmpl	%eax, -1968(%rbp)
	jl	.L17
	cmpl	$0, -1940(%rbp)
	jne	.L18
	subl	$1, -1944(%rbp)
.L18:
	movl	-1944(%rbp), %eax
	movl	%eax, -1948(%rbp)
.L14:
	cmpl	$0, -1948(%rbp)
	jns	.L19
	movl	$0, -1964(%rbp)
	jmp	.L20
.L22:
	movl	-1964(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1768, %rax
	movl	(%rax), %eax
	cmpl	%eax, -1952(%rbp)
	jge	.L21
	movl	-1964(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1768, %rax
	movl	(%rax), %eax
	movl	%eax, -1952(%rbp)
.L21:
	addl	$1, -1964(%rbp)
.L20:
	movl	-1996(%rbp), %eax
	cmpl	%eax, -1964(%rbp)
	jl	.L22
	movl	-1952(%rbp), %eax
	subl	%eax, -1980(%rbp)
	movl	-1980(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	leaq	-1996(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1952(%rbp)
	movl	$0, -1948(%rbp)
	movl	$0, -1944(%rbp)
	movl	$0, -1980(%rbp)
.L2:
	movl	-1996(%rbp), %eax
	testl	%eax, %eax
	jg	.L23
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2000, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -1980(%rbp)
	movl	$0, -1952(%rbp)
	movq	$0, -1936(%rbp)
	movq	$0, -1928(%rbp)
	movq	$0, -1920(%rbp)
	movq	$0, -1912(%rbp)
	movq	$0, -1904(%rbp)
	movq	$0, -1896(%rbp)
	movq	$0, -1888(%rbp)
	movq	$0, -1880(%rbp)
	movq	$0, -1872(%rbp)
	movq	$0, -1864(%rbp)
	movl	$0, -1948(%rbp)
	movl	$0, -1944(%rbp)
	leaq	-1996(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L2
.L23:
	movl	$0, -1960(%rbp)
	jmp	.L3
.L6:
	movl	$0, -1956(%rbp)
	jmp	.L4
.L5:
	movl	-1956(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1960(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movl	$0, -1856(%rbp,%rax,4)
	addl	$1, -1956(%rbp)
.L4:
	cmpl	$22, -1956(%rbp)
	jle	.L5
	addl	$1, -1960(%rbp)
.L3:
	cmpl	$19, -1960(%rbp)
	jle	.L6
	movl	$0, -1976(%rbp)
	jmp	.L7
.L8:
	leaq	-1984(%rbp), %rcx
	leaq	-1988(%rbp), %rdx
	leaq	-1992(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1992(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-1988(%rbp), %eax
	subl	$1, %eax
	movl	-1984(%rbp), %ecx
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rsi, %rax
	movl	%ecx, -1856(%rbp,%rax,4)
	movl	-1992(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	(%rax), %ecx
	movl	-1984(%rbp), %edx
	movl	-1992(%rbp), %eax
	subl	$1, %eax
	addl	%ecx, %edx
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	%edx, (%rax)
	movl	-1992(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	imulq	$92, %rdx, %rdx
	addq	%rbp, %rdx
	subq	$1772, %rdx
	movl	(%rdx), %edx
	addl	$1, %edx
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1772, %rax
	movl	%edx, (%rax)
	movl	-1988(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-1992(%rbp), %eax
	subl	$1, %eax
	movl	-1984(%rbp), %ecx
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rsi, %rax
	movl	%ecx, -1856(%rbp,%rax,4)
	movl	-1988(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	(%rax), %ecx
	movl	-1984(%rbp), %edx
	movl	-1988(%rbp), %eax
	subl	$1, %eax
	addl	%ecx, %edx
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	%edx, (%rax)
	movl	-1988(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	imulq	$92, %rdx, %rdx
	addq	%rbp, %rdx
	subq	$1772, %rdx
	movl	(%rdx), %edx
	addl	$1, %edx
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1772, %rax
	movl	%edx, (%rax)
	addl	$1, -1976(%rbp)
.L7:
	movl	-1996(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1976(%rbp)
	jl	.L8
	movl	$0, -1972(%rbp)
	jmp	.L9
.L13:
	movl	-1972(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1772, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jg	.L10
	cmpl	$0, -1972(%rbp)
	jne	.L11
.L10:
	movl	-1972(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	(%rax), %eax
	addl	%eax, -1980(%rbp)
	jmp	.L12
.L11:
	movl	-1972(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1772, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L12
	movl	-1972(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1776, %rax
	movl	(%rax), %eax
	subl	%eax, -1980(%rbp)
.L12:
	addl	$1, -1972(%rbp)
.L9:
	movl	-1996(%rbp), %eax
	cmpl	%eax, -1972(%rbp)
	jl	.L13
	jmp	.L14
.L19:
	movl	$0, -1940(%rbp)
	movl	$0, -1968(%rbp)
	jmp	.L15
.L17:
	movl	-1948(%rbp), %eax
	cltq
	movl	-1936(%rbp,%rax,4), %eax
	movl	-1968(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movl	-1856(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jle	.L16
	movl	-1968(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1772, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jle	.L16
	movl	-1968(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1768, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L16
	cmpl	$0, -1968(%rbp)
	jle	.L16
	movl	-1948(%rbp), %eax
	cltq
	movl	-1936(%rbp,%rax,4), %eax
	movl	-1968(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movl	-1856(%rbp,%rax,4), %edx
	movl	-1948(%rbp), %eax
	cltq
	movl	-1936(%rbp,%rax,4), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1768, %rax
	movl	(%rax), %eax
	addl	%eax, %edx
	movl	-1968(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1768, %rax
	movl	%edx, (%rax)
	movl	-1944(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1968(%rbp), %edx
	movl	%edx, -1936(%rbp,%rax,4)
	addl	$1, -1944(%rbp)
	addl	$1, -1940(%rbp)
.L16:
	addl	$1, -1968(%rbp)
.L15:
	movl	-1996(%rbp), %eax
	cmpl	%eax, -1968(%rbp)
	jl	.L17
	cmpl	$0, -1940(%rbp)
	jne	.L18
	subl	$1, -1944(%rbp)
.L18:
	movl	-1944(%rbp), %eax
	movl	%eax, -1948(%rbp)
.L14:
	cmpl	$0, -1948(%rbp)
	jns	.L19
	movl	$0, -1964(%rbp)
	jmp	.L20
.L22:
	movl	-1964(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1768, %rax
	movl	(%rax), %eax
	cmpl	%eax, -1952(%rbp)
	jge	.L21
	movl	-1964(%rbp), %eax
	cltq
	imulq	$92, %rax, %rax
	addq	%rbp, %rax
	subq	$1768, %rax
	movl	(%rax), %eax
	movl	%eax, -1952(%rbp)
.L21:
	addl	$1, -1964(%rbp)
.L20:
	movl	-1996(%rbp), %eax
	cmpl	%eax, -1964(%rbp)
	jl	.L22
	movl	-1952(%rbp), %eax
	subl	%eax, -1980(%rbp)
	movl	-1980(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	leaq	-1996(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1952(%rbp)
	movl	$0, -1948(%rbp)
	movl	$0, -1944(%rbp)
	movl	$0, -1980(%rbp)
.L2:
	movl	-1996(%rbp), %eax
	testl	%eax, %eax
	jg	.L23
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
