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,i,j,k,a[100],b[100],c[100],d[100],e[100][100],s=0,max=0;
	while(scanf("%d",&n),n){
		for(i=s=0;i<=n;i++)d[i]=0;
		for(i=0;i<n-1;i++){
			scanf("%d %d %d",&a[i],&b[i],&c[i]);
			d[a[i]]++;
			d[b[i]]++;
		}
		d[1]++;
		for(i=0;i<n-1;i++){
			if(d[a[i]]==1||d[b[i]]==1)c[i]=0;
		}
		//for(i=0;i<n-1;i++)printf("%d %d %d\n",a[i],b[i],c[i]);
		for(i=0;i<n-1;i++)s+=c[i];
		for(i=0;i<n*n;i++)e[i/n][i%n]=1e9;
		for(i=0;i<n;i++)e[i][i]=0;
		for(i=0;i<n-1;i++)e[a[i]-1][b[i]-1]=e[b[i]-1][a[i]-1]=c[i];
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				for(k=0;k<n;k++){
					if(e[j][k]>e[j][i]+e[i][k])e[j][k]=e[j][i]+e[i][k];
				}
			}
		}
		for(i=max=0;i<n-1;i++){//printf("%d ",e[0][i]);printf("\n");
			if(max<e[0][i])max=e[0][i];
		}//printf("%d\n",max);
		printf("%d\n",s*2-max);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.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
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$688, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -41624(%rbp)
	movl	$0, -41620(%rbp)
	jmp	.L2
.L29:
	movl	$0, -41624(%rbp)
	movl	-41624(%rbp), %eax
	movl	%eax, -41636(%rbp)
	jmp	.L3
.L4:
	movl	-41636(%rbp), %eax
	cltq
	movl	$0, -40416(%rbp,%rax,4)
	addl	$1, -41636(%rbp)
.L3:
	movl	-41640(%rbp), %eax
	cmpl	%eax, -41636(%rbp)
	jle	.L4
	movl	$0, -41636(%rbp)
	jmp	.L5
.L6:
	leaq	-40816(%rbp), %rdx
	movl	-41636(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-41216(%rbp), %rdx
	movl	-41636(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-41616(%rbp), %rsi
	movl	-41636(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-41636(%rbp), %eax
	cltq
	movl	-41616(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movl	-40416(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -40416(%rbp,%rax,4)
	movl	-41636(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movl	-40416(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -40416(%rbp,%rax,4)
	addl	$1, -41636(%rbp)
.L5:
	movl	-41640(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L6
	movl	-40412(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -40412(%rbp)
	movl	$0, -41636(%rbp)
	jmp	.L7
.L10:
	movl	-41636(%rbp), %eax
	cltq
	movl	-41616(%rbp,%rax,4), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	je	.L8
	movl	-41636(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L9
.L8:
	movl	-41636(%rbp), %eax
	cltq
	movl	$0, -40816(%rbp,%rax,4)
.L9:
	addl	$1, -41636(%rbp)
.L7:
	movl	-41640(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L10
	movl	$0, -41636(%rbp)
	jmp	.L11
.L12:
	movl	-41636(%rbp), %eax
	cltq
	movl	-40816(%rbp,%rax,4), %eax
	addl	%eax, -41624(%rbp)
	addl	$1, -41636(%rbp)
.L11:
	movl	-41640(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L12
	movl	$0, -41636(%rbp)
	jmp	.L13
.L14:
	movl	-41640(%rbp), %edi
	movl	-41636(%rbp), %eax
	cltd
	idivl	%edi
	movl	%eax, %esi
	movl	-41640(%rbp), %ecx
	movl	-41636(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	movslq	%eax, %rcx
	movslq	%esi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$1000000000, -40016(%rbp,%rax,4)
	addl	$1, -41636(%rbp)
.L13:
	movl	-41640(%rbp), %edx
	movl	-41640(%rbp), %eax
	imull	%edx, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L14
	movl	$0, -41636(%rbp)
	jmp	.L15
.L16:
	movl	-41636(%rbp), %eax
	cltq
	imulq	$404, %rax, %rax
	addq	%rbp, %rax
	subq	$40016, %rax
	movl	$0, (%rax)
	addl	$1, -41636(%rbp)
.L15:
	movl	-41640(%rbp), %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L16
	movl	$0, -41636(%rbp)
	jmp	.L17
.L18:
	movl	-41636(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-41636(%rbp), %eax
	cltq
	movl	-41616(%rbp,%rax,4), %eax
	leal	-1(%rax), %ecx
	movl	-41636(%rbp), %eax
	cltq
	movl	-40816(%rbp,%rax,4), %esi
	movslq	%ecx, %r8
	movslq	%edx, %rdi
	movq	%rdi, %rax
	salq	$2, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%r8, %rax
	movl	%esi, -40016(%rbp,%rax,4)
	movl	-41636(%rbp), %eax
	cltq
	movl	-41616(%rbp,%rax,4), %eax
	leal	-1(%rax), %esi
	movl	-41636(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %eax
	leal	-1(%rax), %edi
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-40016(%rbp,%rax,4), %edx
	movslq	%edi, %rdi
	movslq	%esi, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdi, %rax
	movl	%edx, -40016(%rbp,%rax,4)
	addl	$1, -41636(%rbp)
.L17:
	movl	-41640(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L18
	movl	$0, -41636(%rbp)
	jmp	.L19
.L25:
	movl	$0, -41632(%rbp)
	jmp	.L20
.L24:
	movl	$0, -41628(%rbp)
	jmp	.L21
.L23:
	movl	-41628(%rbp), %eax
	movslq	%eax, %rcx
	movl	-41632(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-40016(%rbp,%rax,4), %ecx
	movl	-41636(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41632(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movl	-40016(%rbp,%rax,4), %esi
	movl	-41628(%rbp), %eax
	movslq	%eax, %rdi
	movl	-41636(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdi, %rax
	movl	-40016(%rbp,%rax,4), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jle	.L22
	movl	-41636(%rbp), %eax
	movslq	%eax, %rcx
	movl	-41632(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-40016(%rbp,%rax,4), %ecx
	movl	-41628(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41636(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movl	-40016(%rbp,%rax,4), %eax
	addl	%eax, %ecx
	movl	-41628(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41632(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movl	%ecx, -40016(%rbp,%rax,4)
.L22:
	addl	$1, -41628(%rbp)
.L21:
	movl	-41640(%rbp), %eax
	cmpl	%eax, -41628(%rbp)
	jl	.L23
	addl	$1, -41632(%rbp)
.L20:
	movl	-41640(%rbp), %eax
	cmpl	%eax, -41632(%rbp)
	jl	.L24
	addl	$1, -41636(%rbp)
.L19:
	movl	-41640(%rbp), %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L25
	movl	$0, -41620(%rbp)
	movl	-41620(%rbp), %eax
	movl	%eax, -41636(%rbp)
	jmp	.L26
.L28:
	movl	-41636(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -41620(%rbp)
	jge	.L27
	movl	-41636(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	movl	%eax, -41620(%rbp)
.L27:
	addl	$1, -41636(%rbp)
.L26:
	movl	-41640(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L28
	movl	-41624(%rbp), %eax
	addl	%eax, %eax
	subl	-41620(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-41640(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-41640(%rbp), %eax
	testl	%eax, %eax
	jne	.L29
	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
.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 %d %d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-40960(%rsp), %r11
	.cfi_def_cfa 11, 41016
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$792, %rsp
	.cfi_def_cfa_offset 41808
	movq	%fs:40, %rax
	movq	%rax, 41736(%rsp)
	xorl	%eax, %eax
	leaq	124(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	928(%rsp), %rax
	movq	%rax, 88(%rsp)
.L2:
	movq	104(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	124(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L31
	js	.L33
	movslq	%ebx, %rax
	leaq	1328(%rsp), %rdi
	xorl	%esi, %esi
	leaq	4(,%rax,4), %rdx
	call	memset@PLT
.L33:
	leal	-1(%rbx), %eax
	movl	%eax, 96(%rsp)
	testl	%eax, %eax
	jle	.L3
	movq	88(%rsp), %rbx
	xorl	%ebp, %ebp
	xorl	%r14d, %r14d
	leaq	528(%rsp), %r13
	leaq	128(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	0(%r13,%rbp), %rdx
	leaq	(%rbx,%rbp), %rcx
	xorl	%eax, %eax
	addl	$1, %r14d
	leaq	(%r12,%rbp), %rsi
	leaq	.LC0(%rip), %rdi
	movq	%rbx, %r15
	call	__isoc99_scanf@PLT
	movslq	(%r12,%rbp), %rax
	addl	$1, 1328(%rsp,%rax,4)
	movslq	0(%r13,%rbp), %rax
	addq	$4, %rbp
	addl	$1, 1328(%rsp,%rax,4)
	movl	124(%rsp), %eax
	leal	-1(%rax), %edx
	cmpl	%r14d, %edx
	jg	.L4
	addl	$1, 1332(%rsp)
	movl	%eax, %ebx
	movl	%edx, 96(%rsp)
	testl	%edx, %edx
	jle	.L5
	leal	-2(%rax), %esi
	movq	88(%rsp), %rdi
	movl	%edx, %ecx
	xorl	%eax, %eax
	jmp	.L8
.L70:
	movslq	0(%r13,%rax,4), %rdx
	cmpl	$1, 1328(%rsp,%rdx,4)
	je	.L6
	addq	$1, %rax
	cmpq	%rcx, %rax
	je	.L69
.L8:
	movslq	(%r12,%rax,4), %rdx
	cmpl	$1, 1328(%rsp,%rdx,4)
	jne	.L70
.L6:
	movl	$0, (%rdi,%rax,4)
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L8
.L69:
	cmpl	$2, %esi
	jbe	.L39
	movl	96(%rsp), %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	leal	-1(%rax), %edx
	movq	88(%rsp), %rax
	salq	$4, %rdx
	addq	$16, %rax
	addq	%rax, %rdx
	jmp	.L10
.L71:
	addq	$16, %rax
.L10:
	paddd	(%r15), %xmm0
	movq	%rax, %r15
	cmpq	%rdx, %rax
	jne	.L71
	movdqa	%xmm0, %xmm1
	movl	96(%rsp), %edi
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movl	%edi, %edx
	movdqa	%xmm0, %xmm1
	andl	$-4, %edx
	andl	$3, %edi
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	je	.L11
.L9:
	movslq	%edx, %rcx
	movl	96(%rsp), %edi
	addl	928(%rsp,%rcx,4), %eax
	leal	1(%rdx), %ecx
	cmpl	%ecx, %edi
	jle	.L11
	movslq	%ecx, %rcx
	addl	$2, %edx
	addl	928(%rsp,%rcx,4), %eax
	cmpl	%edx, %edi
	jle	.L11
	movslq	%edx, %rdx
	addl	928(%rsp,%rdx,4), %eax
.L11:
	addl	%eax, %eax
	movl	%eax, 100(%rsp)
.L36:
	movl	%ebx, %esi
	xorl	%ecx, %ecx
	imull	%ebx, %esi
	testl	%esi, %esi
	je	.L15
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%ecx, %eax
	addl	$1, %ecx
	cltd
	idivl	%ebx
	cltq
	movslq	%edx, %rdx
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	(%rdx,%rax,4), %rax
	movl	$1000000000, 1728(%rsp,%rax,4)
	cmpl	%esi, %ecx
	jne	.L12
.L15:
	testl	%ebx, %ebx
	jle	.L72
	movl	96(%rsp), %edx
	leaq	1728(%rsp), %rax
	movq	%rax, 80(%rsp)
	imulq	$404, %rdx, %rdx
	leaq	2132(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L16:
	movl	$0, (%rax)
	addq	$404, %rax
	cmpq	%rdx, %rax
	jne	.L16
	movl	96(%rsp), %edx
	testl	%edx, %edx
	jle	.L34
.L37:
	movslq	96(%rsp), %r8
	movq	88(%rsp), %r9
	xorl	%ecx, %ecx
	leaq	528(%rsp), %r13
	leaq	128(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L18:
	movl	0(%r13,%rcx,4), %eax
	movl	(%r12,%rcx,4), %edi
	movl	(%r9,%rcx,4), %esi
	addq	$1, %rcx
	subl	$1, %eax
	leal	-1(%rdi), %edx
	cltq
	movslq	%edx, %rdx
	leaq	(%rax,%rax,4), %rdi
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rdx,%rdi,4), %rdi
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movl	%esi, 1728(%rsp,%rdi,4)
	leaq	(%rax,%rdx,4), %rax
	movl	%esi, 1728(%rsp,%rax,4)
	cmpq	%r8, %rcx
	jne	.L18
	leaq	1728(%rsp), %rax
	movq	%rax, 80(%rsp)
	testl	%ebx, %ebx
	jle	.L35
.L34:
	movl	%ebx, %eax
	movl	$4, %edx
	movq	$0, (%rsp)
	movq	80(%rsp), %r8
	salq	$2, %rax
	testl	%ebx, %ebx
	movl	$0, 76(%rsp)
	cmovg	%rax, %rdx
	movl	$1, %eax
	cmovg	%ebx, %eax
	xorl	%r12d, %r12d
	xorl	%ebp, %ebp
	movq	%rdx, 8(%rsp)
	movl	%eax, %edi
	movl	%eax, 20(%rsp)
	shrl	$2, %eax
	andl	$-4, %edi
	leal	-1(%rax), %r9d
	leal	1(%rdi), %eax
	leal	2(%rdi), %ecx
	movl	%edi, 48(%rsp)
	movslq	%edi, %rdi
	movl	%eax, 52(%rsp)
	cltq
	addq	$1, %r9
	movq	%rax, 40(%rsp)
	movslq	%ecx, %rax
	salq	$4, %r9
	movl	%ecx, 72(%rsp)
	movq	%rdi, 24(%rsp)
	movq	%rax, 64(%rsp)
	.p2align 4,,10
	.p2align 3
.L20:
	movslq	76(%rsp), %rdx
	movq	80(%rsp), %rax
	xorl	%ecx, %ecx
	xorl	%r10d, %r10d
	leaq	4(%r12), %r11
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%r12), %rdi
	leaq	(%rdx,%rdx,4), %rdx
	leaq	0(,%rdx,4), %rsi
	movq	24(%rsp), %rdx
	movq	%rsi, 56(%rsp)
	addq	%rsi, %rdx
	addq	40(%rsp), %rsi
	movq	%rdx, 32(%rsp)
	movq	%rsi, %r13
	.p2align 4,,10
	.p2align 3
.L25:
	movq	8(%rsp), %rsi
	leaq	(%rcx,%r12), %rdx
	addq	%rcx, %rsi
	cmpq	%rdx, %rsi
	leaq	(%r11,%rcx), %rdx
	setle	%sil
	cmpq	%rdx, %rcx
	setge	%dl
	orb	%sil, %dl
	je	.L41
	movq	(%rsp), %rsi
	leaq	-4(%rcx,%rsi), %rdx
	cmpq	$8, %rdx
	seta	%sil
	cmpl	$3, %ebx
	setg	%dl
	testb	%dl, %sil
	je	.L41
	movd	(%rdi), %xmm3
	xorl	%edx, %edx
	pshufd	$0, %xmm3, %xmm2
	.p2align 4,,10
	.p2align 3
.L22:
	movdqa	(%r8,%rdx), %xmm1
	movdqa	(%rax,%rdx), %xmm0
	paddd	%xmm2, %xmm1
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	(%rax,%rdx), %xmm0
	por	%xmm1, %xmm0
	movaps	%xmm0, (%rax,%rdx)
	addq	$16, %rdx
	cmpq	%rdx, %r9
	jne	.L22
	movl	48(%rsp), %edx
	cmpl	%edx, 20(%rsp)
	je	.L24
	movslq	%r10d, %rdx
	movq	24(%rsp), %rsi
	movq	32(%rsp), %r15
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	salq	$2, %rdx
	leaq	(%rdx,%rsi), %r14
	movl	(%rdi), %esi
	addl	1728(%rsp,%r15,4), %esi
	movl	1728(%rsp,%r14,4), %r15d
	cmpl	%r15d, %esi
	cmovg	%r15d, %esi
	movl	%esi, 1728(%rsp,%r14,4)
	cmpl	52(%rsp), %ebx
	jle	.L24
	movq	40(%rsp), %rsi
	leaq	(%rdx,%rsi), %r14
	movl	1728(%rsp,%r13,4), %esi
	addl	(%rdi), %esi
	movl	1728(%rsp,%r14,4), %r15d
	cmpl	%r15d, %esi
	cmovg	%r15d, %esi
	movl	%esi, 1728(%rsp,%r14,4)
	cmpl	72(%rsp), %ebx
	jle	.L24
	movq	64(%rsp), %r14
	movq	56(%rsp), %rsi
	addq	%r14, %rdx
	addq	%r14, %rsi
	movl	1728(%rsp,%rdx,4), %r14d
	movl	1728(%rsp,%rsi,4), %esi
	addl	(%rdi), %esi
	cmpl	%r14d, %esi
	cmovg	%r14d, %esi
	movl	%esi, 1728(%rsp,%rdx,4)
.L24:
	addl	$1, %r10d
	addq	$400, %rcx
	addq	$400, %rax
	addq	$400, %rdi
	cmpl	%r10d, %ebx
	jg	.L25
	addl	$1, 76(%rsp)
	movl	76(%rsp), %eax
	addq	$400, %rbp
	addq	$400, %r8
	subq	$400, (%rsp)
	cmpl	%eax, %ebx
	jle	.L26
	movq	%r11, %r12
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L41:
	movq	%rax, %rsi
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%rsi, %r15
	movl	(%rdi), %edx
	subq	%rcx, %r15
	addl	(%r15,%rbp), %edx
	movl	(%rsi), %r15d
	cmpl	%r15d, %edx
	cmovg	%r15d, %edx
	addl	$1, %r14d
	addq	$4, %rsi
	movl	%edx, -4(%rsi)
	cmpl	%r14d, %ebx
	jg	.L21
	jmp	.L24
.L26:
	movl	96(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L27
.L35:
	movl	96(%rsp), %eax
	movl	$1, %ecx
	testl	%eax, %eax
	cmovg	%eax, %ecx
	cmpl	$3, %eax
	jle	.L42
	leaq	1728(%rsp), %rax
	pxor	%xmm0, %xmm0
	movl	%ecx, %edx
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	1744(%rsp,%rdx), %rdx
.L29:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	pcmpgtd	-16(%rax), %xmm1
	pand	%xmm1, %xmm0
	pandn	-16(%rax), %xmm1
	por	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L29
	movdqa	%xmm0, %xmm2
	movl	%ecx, %edx
	psrldq	$8, %xmm2
	andl	$-4, %edx
	andl	$3, %ecx
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movdqa	%xmm1, %xmm2
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %eax
	je	.L30
.L28:
	movslq	%edx, %rcx
	movl	96(%rsp), %ebx
	movl	1728(%rsp,%rcx,4), %ecx
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	leal	1(%rdx), %ecx
	cmpl	%ecx, %ebx
	jle	.L30
	movslq	%ecx, %rcx
	movl	1728(%rsp,%rcx,4), %ecx
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	addl	$2, %edx
	cmpl	%edx, %ebx
	jle	.L30
	movslq	%edx, %rdx
	movl	1728(%rsp,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovl	%edx, %eax
.L30:
	subl	%eax, 100(%rsp)
.L27:
	movl	100(%rsp), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L72:
	movl	96(%rsp), %eax
	testl	%eax, %eax
	jg	.L37
	jmp	.L27
.L3:
	addl	$1, 1332(%rsp)
.L5:
	movl	$0, 100(%rsp)
	jmp	.L36
.L31:
	movq	41736(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L73
	addq	$41752, %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
.L42:
	.cfi_restore_state
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L28
.L39:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L9
.L73:
	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 %d %d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-40960(%rsp), %r11
	.cfi_def_cfa 11, 41016
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$792, %rsp
	.cfi_def_cfa_offset 41808
	movq	%fs:40, %rax
	movq	%rax, 41736(%rsp)
	xorl	%eax, %eax
	leaq	124(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	928(%rsp), %rax
	movq	%rax, 88(%rsp)
.L2:
	movq	104(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	124(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L31
	js	.L33
	movslq	%ebx, %rax
	leaq	1328(%rsp), %rdi
	xorl	%esi, %esi
	leaq	4(,%rax,4), %rdx
	call	memset@PLT
.L33:
	leal	-1(%rbx), %eax
	movl	%eax, 96(%rsp)
	testl	%eax, %eax
	jle	.L3
	movq	88(%rsp), %rbx
	xorl	%ebp, %ebp
	xorl	%r14d, %r14d
	leaq	528(%rsp), %r13
	leaq	128(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	0(%r13,%rbp), %rdx
	leaq	(%rbx,%rbp), %rcx
	xorl	%eax, %eax
	addl	$1, %r14d
	leaq	(%r12,%rbp), %rsi
	leaq	.LC0(%rip), %rdi
	movq	%rbx, %r15
	call	__isoc99_scanf@PLT
	movslq	(%r12,%rbp), %rax
	addl	$1, 1328(%rsp,%rax,4)
	movslq	0(%r13,%rbp), %rax
	addq	$4, %rbp
	addl	$1, 1328(%rsp,%rax,4)
	movl	124(%rsp), %eax
	leal	-1(%rax), %edx
	cmpl	%r14d, %edx
	jg	.L4
	addl	$1, 1332(%rsp)
	movl	%eax, %ebx
	movl	%edx, 96(%rsp)
	testl	%edx, %edx
	jle	.L5
	leal	-2(%rax), %esi
	movq	88(%rsp), %rdi
	movl	%edx, %ecx
	xorl	%eax, %eax
	jmp	.L8
.L70:
	movslq	0(%r13,%rax,4), %rdx
	cmpl	$1, 1328(%rsp,%rdx,4)
	je	.L6
	addq	$1, %rax
	cmpq	%rcx, %rax
	je	.L69
.L8:
	movslq	(%r12,%rax,4), %rdx
	cmpl	$1, 1328(%rsp,%rdx,4)
	jne	.L70
.L6:
	movl	$0, (%rdi,%rax,4)
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L8
.L69:
	cmpl	$2, %esi
	jbe	.L39
	movl	96(%rsp), %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	leal	-1(%rax), %edx
	movq	88(%rsp), %rax
	salq	$4, %rdx
	addq	$16, %rax
	addq	%rax, %rdx
	jmp	.L10
.L71:
	addq	$16, %rax
.L10:
	paddd	(%r15), %xmm0
	movq	%rax, %r15
	cmpq	%rdx, %rax
	jne	.L71
	movdqa	%xmm0, %xmm1
	movl	96(%rsp), %edi
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movl	%edi, %edx
	movdqa	%xmm0, %xmm1
	andl	$-4, %edx
	andl	$3, %edi
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	je	.L11
.L9:
	movslq	%edx, %rcx
	movl	96(%rsp), %edi
	addl	928(%rsp,%rcx,4), %eax
	leal	1(%rdx), %ecx
	cmpl	%ecx, %edi
	jle	.L11
	movslq	%ecx, %rcx
	addl	$2, %edx
	addl	928(%rsp,%rcx,4), %eax
	cmpl	%edx, %edi
	jle	.L11
	movslq	%edx, %rdx
	addl	928(%rsp,%rdx,4), %eax
.L11:
	addl	%eax, %eax
	movl	%eax, 100(%rsp)
.L36:
	movl	%ebx, %esi
	xorl	%ecx, %ecx
	imull	%ebx, %esi
	testl	%esi, %esi
	je	.L15
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%ecx, %eax
	addl	$1, %ecx
	cltd
	idivl	%ebx
	cltq
	movslq	%edx, %rdx
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	(%rdx,%rax,4), %rax
	movl	$1000000000, 1728(%rsp,%rax,4)
	cmpl	%esi, %ecx
	jne	.L12
.L15:
	testl	%ebx, %ebx
	jle	.L72
	movl	96(%rsp), %edx
	leaq	1728(%rsp), %rax
	movq	%rax, 80(%rsp)
	imulq	$404, %rdx, %rdx
	leaq	2132(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L16:
	movl	$0, (%rax)
	addq	$404, %rax
	cmpq	%rdx, %rax
	jne	.L16
	movl	96(%rsp), %edx
	testl	%edx, %edx
	jle	.L34
.L37:
	movslq	96(%rsp), %r8
	movq	88(%rsp), %r9
	xorl	%ecx, %ecx
	leaq	528(%rsp), %r13
	leaq	128(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L18:
	movl	0(%r13,%rcx,4), %eax
	movl	(%r12,%rcx,4), %edi
	movl	(%r9,%rcx,4), %esi
	addq	$1, %rcx
	subl	$1, %eax
	leal	-1(%rdi), %edx
	cltq
	movslq	%edx, %rdx
	leaq	(%rax,%rax,4), %rdi
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rdx,%rdi,4), %rdi
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movl	%esi, 1728(%rsp,%rdi,4)
	leaq	(%rax,%rdx,4), %rax
	movl	%esi, 1728(%rsp,%rax,4)
	cmpq	%r8, %rcx
	jne	.L18
	leaq	1728(%rsp), %rax
	movq	%rax, 80(%rsp)
	testl	%ebx, %ebx
	jle	.L35
.L34:
	movl	%ebx, %eax
	movl	$4, %edx
	movq	$0, (%rsp)
	movq	80(%rsp), %r8
	salq	$2, %rax
	testl	%ebx, %ebx
	movl	$0, 76(%rsp)
	cmovg	%rax, %rdx
	movl	$1, %eax
	cmovg	%ebx, %eax
	xorl	%r12d, %r12d
	xorl	%ebp, %ebp
	movq	%rdx, 8(%rsp)
	movl	%eax, %edi
	movl	%eax, 20(%rsp)
	shrl	$2, %eax
	andl	$-4, %edi
	leal	-1(%rax), %r9d
	leal	1(%rdi), %eax
	leal	2(%rdi), %ecx
	movl	%edi, 48(%rsp)
	movslq	%edi, %rdi
	movl	%eax, 52(%rsp)
	cltq
	addq	$1, %r9
	movq	%rax, 40(%rsp)
	movslq	%ecx, %rax
	salq	$4, %r9
	movl	%ecx, 72(%rsp)
	movq	%rdi, 24(%rsp)
	movq	%rax, 64(%rsp)
	.p2align 4,,10
	.p2align 3
.L20:
	movslq	76(%rsp), %rdx
	movq	80(%rsp), %rax
	xorl	%ecx, %ecx
	xorl	%r10d, %r10d
	leaq	4(%r12), %r11
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%r12), %rdi
	leaq	(%rdx,%rdx,4), %rdx
	leaq	0(,%rdx,4), %rsi
	movq	24(%rsp), %rdx
	movq	%rsi, 56(%rsp)
	addq	%rsi, %rdx
	addq	40(%rsp), %rsi
	movq	%rdx, 32(%rsp)
	movq	%rsi, %r13
	.p2align 4,,10
	.p2align 3
.L25:
	movq	8(%rsp), %rsi
	leaq	(%rcx,%r12), %rdx
	addq	%rcx, %rsi
	cmpq	%rdx, %rsi
	leaq	(%r11,%rcx), %rdx
	setle	%sil
	cmpq	%rdx, %rcx
	setge	%dl
	orb	%sil, %dl
	je	.L41
	movq	(%rsp), %rsi
	leaq	-4(%rcx,%rsi), %rdx
	cmpq	$8, %rdx
	seta	%sil
	cmpl	$3, %ebx
	setg	%dl
	testb	%dl, %sil
	je	.L41
	movd	(%rdi), %xmm3
	xorl	%edx, %edx
	pshufd	$0, %xmm3, %xmm2
	.p2align 4,,10
	.p2align 3
.L22:
	movdqa	(%r8,%rdx), %xmm1
	movdqa	(%rax,%rdx), %xmm0
	paddd	%xmm2, %xmm1
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	(%rax,%rdx), %xmm0
	por	%xmm1, %xmm0
	movaps	%xmm0, (%rax,%rdx)
	addq	$16, %rdx
	cmpq	%rdx, %r9
	jne	.L22
	movl	48(%rsp), %edx
	cmpl	%edx, 20(%rsp)
	je	.L24
	movslq	%r10d, %rdx
	movq	24(%rsp), %rsi
	movq	32(%rsp), %r15
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	salq	$2, %rdx
	leaq	(%rdx,%rsi), %r14
	movl	(%rdi), %esi
	addl	1728(%rsp,%r15,4), %esi
	movl	1728(%rsp,%r14,4), %r15d
	cmpl	%r15d, %esi
	cmovg	%r15d, %esi
	movl	%esi, 1728(%rsp,%r14,4)
	cmpl	52(%rsp), %ebx
	jle	.L24
	movq	40(%rsp), %rsi
	leaq	(%rdx,%rsi), %r14
	movl	1728(%rsp,%r13,4), %esi
	addl	(%rdi), %esi
	movl	1728(%rsp,%r14,4), %r15d
	cmpl	%r15d, %esi
	cmovg	%r15d, %esi
	movl	%esi, 1728(%rsp,%r14,4)
	cmpl	72(%rsp), %ebx
	jle	.L24
	movq	64(%rsp), %r14
	movq	56(%rsp), %rsi
	addq	%r14, %rdx
	addq	%r14, %rsi
	movl	1728(%rsp,%rdx,4), %r14d
	movl	1728(%rsp,%rsi,4), %esi
	addl	(%rdi), %esi
	cmpl	%r14d, %esi
	cmovg	%r14d, %esi
	movl	%esi, 1728(%rsp,%rdx,4)
.L24:
	addl	$1, %r10d
	addq	$400, %rcx
	addq	$400, %rax
	addq	$400, %rdi
	cmpl	%r10d, %ebx
	jg	.L25
	addl	$1, 76(%rsp)
	movl	76(%rsp), %eax
	addq	$400, %rbp
	addq	$400, %r8
	subq	$400, (%rsp)
	cmpl	%eax, %ebx
	jle	.L26
	movq	%r11, %r12
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L41:
	movq	%rax, %rsi
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%rsi, %r15
	movl	(%rdi), %edx
	subq	%rcx, %r15
	addl	(%r15,%rbp), %edx
	movl	(%rsi), %r15d
	cmpl	%r15d, %edx
	cmovg	%r15d, %edx
	addl	$1, %r14d
	addq	$4, %rsi
	movl	%edx, -4(%rsi)
	cmpl	%r14d, %ebx
	jg	.L21
	jmp	.L24
.L26:
	movl	96(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L27
.L35:
	movl	96(%rsp), %eax
	movl	$1, %ecx
	testl	%eax, %eax
	cmovg	%eax, %ecx
	cmpl	$3, %eax
	jle	.L42
	leaq	1728(%rsp), %rax
	pxor	%xmm0, %xmm0
	movl	%ecx, %edx
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	1744(%rsp,%rdx), %rdx
.L29:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	pcmpgtd	-16(%rax), %xmm1
	pand	%xmm1, %xmm0
	pandn	-16(%rax), %xmm1
	por	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L29
	movdqa	%xmm0, %xmm2
	movl	%ecx, %edx
	psrldq	$8, %xmm2
	andl	$-4, %edx
	andl	$3, %ecx
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movdqa	%xmm1, %xmm2
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %eax
	je	.L30
.L28:
	movslq	%edx, %rcx
	movl	96(%rsp), %ebx
	movl	1728(%rsp,%rcx,4), %ecx
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	leal	1(%rdx), %ecx
	cmpl	%ecx, %ebx
	jle	.L30
	movslq	%ecx, %rcx
	movl	1728(%rsp,%rcx,4), %ecx
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	addl	$2, %edx
	cmpl	%edx, %ebx
	jle	.L30
	movslq	%edx, %rdx
	movl	1728(%rsp,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovl	%edx, %eax
.L30:
	subl	%eax, 100(%rsp)
.L27:
	movl	100(%rsp), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L72:
	movl	96(%rsp), %eax
	testl	%eax, %eax
	jg	.L37
	jmp	.L27
.L3:
	addl	$1, 1332(%rsp)
.L5:
	movl	$0, 100(%rsp)
	jmp	.L36
.L31:
	movq	41736(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L73
	addq	$41752, %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
.L42:
	.cfi_restore_state
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L28
.L39:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L9
.L73:
	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,i,j,k,a[100],b[100],c[100],d[100],e[100][100],s=0,max=0;
	while(scanf("%d",&n),n){
		for(i=s=0;i<=n;i++)d[i]=0;
		for(i=0;i<n-1;i++){
			scanf("%d %d %d",&a[i],&b[i],&c[i]);
			d[a[i]]++;
			d[b[i]]++;
		}
		d[1]++;
		for(i=0;i<n-1;i++){
			if(d[a[i]]==1||d[b[i]]==1)c[i]=0;
		}
		//for(i=0;i<n-1;i++)printf("%d %d %d\n",a[i],b[i],c[i]);
		for(i=0;i<n-1;i++)s+=c[i];
		for(i=0;i<n*n;i++)e[i/n][i%n]=1e9;
		for(i=0;i<n;i++)e[i][i]=0;
		for(i=0;i<n-1;i++)e[a[i]-1][b[i]-1]=e[b[i]-1][a[i]-1]=c[i];
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				for(k=0;k<n;k++){
					if(e[j][k]>e[j][i]+e[i][k])e[j][k]=e[j][i]+e[i][k];
				}
			}
		}
		for(i=max=0;i<n-1;i++){//printf("%d ",e[0][i]);printf("\n");
			if(max<e[0][i])max=e[0][i];
		}//printf("%d\n",max);
		printf("%d\n",s*2-max);
	}
	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,i,j,k,a[100],b[100],c[100],d[100],e[100][100],s=0,max=0;
	while(scanf("%d",&n),n){
		for(i=s=0;i<=n;i++)d[i]=0;
		for(i=0;i<n-1;i++){
			scanf("%d %d %d",&a[i],&b[i],&c[i]);
			d[a[i]]++;
			d[b[i]]++;
		}
		d[1]++;
		for(i=0;i<n-1;i++){
			if(d[a[i]]==1||d[b[i]]==1)c[i]=0;
		}
		//for(i=0;i<n-1;i++)printf("%d %d %d\n",a[i],b[i],c[i]);
		for(i=0;i<n-1;i++)s+=c[i];
		for(i=0;i<n*n;i++)e[i/n][i%n]=1e9;
		for(i=0;i<n;i++)e[i][i]=0;
		for(i=0;i<n-1;i++)e[a[i]-1][b[i]-1]=e[b[i]-1][a[i]-1]=c[i];
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				for(k=0;k<n;k++){
					if(e[j][k]>e[j][i]+e[i][k])e[j][k]=e[j][i]+e[i][k];
				}
			}
		}
		for(i=max=0;i<n-1;i++){//printf("%d ",e[0][i]);printf("\n");
			if(max<e[0][i])max=e[0][i];
		}//printf("%d\n",max);
		printf("%d\n",s*2-max);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.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
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$688, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -41624(%rbp)
	movl	$0, -41620(%rbp)
	jmp	.L2
.L29:
	movl	$0, -41624(%rbp)
	movl	-41624(%rbp), %eax
	movl	%eax, -41636(%rbp)
	jmp	.L3
.L4:
	movl	-41636(%rbp), %eax
	cltq
	movl	$0, -40416(%rbp,%rax,4)
	addl	$1, -41636(%rbp)
.L3:
	movl	-41640(%rbp), %eax
	cmpl	%eax, -41636(%rbp)
	jle	.L4
	movl	$0, -41636(%rbp)
	jmp	.L5
.L6:
	leaq	-40816(%rbp), %rdx
	movl	-41636(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-41216(%rbp), %rdx
	movl	-41636(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-41616(%rbp), %rsi
	movl	-41636(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-41636(%rbp), %eax
	cltq
	movl	-41616(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movl	-40416(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -40416(%rbp,%rax,4)
	movl	-41636(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movl	-40416(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -40416(%rbp,%rax,4)
	addl	$1, -41636(%rbp)
.L5:
	movl	-41640(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L6
	movl	-40412(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -40412(%rbp)
	movl	$0, -41636(%rbp)
	jmp	.L7
.L10:
	movl	-41636(%rbp), %eax
	cltq
	movl	-41616(%rbp,%rax,4), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	je	.L8
	movl	-41636(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L9
.L8:
	movl	-41636(%rbp), %eax
	cltq
	movl	$0, -40816(%rbp,%rax,4)
.L9:
	addl	$1, -41636(%rbp)
.L7:
	movl	-41640(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L10
	movl	$0, -41636(%rbp)
	jmp	.L11
.L12:
	movl	-41636(%rbp), %eax
	cltq
	movl	-40816(%rbp,%rax,4), %eax
	addl	%eax, -41624(%rbp)
	addl	$1, -41636(%rbp)
.L11:
	movl	-41640(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L12
	movl	$0, -41636(%rbp)
	jmp	.L13
.L14:
	movl	-41640(%rbp), %edi
	movl	-41636(%rbp), %eax
	cltd
	idivl	%edi
	movl	%eax, %esi
	movl	-41640(%rbp), %ecx
	movl	-41636(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	movslq	%eax, %rcx
	movslq	%esi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$1000000000, -40016(%rbp,%rax,4)
	addl	$1, -41636(%rbp)
.L13:
	movl	-41640(%rbp), %edx
	movl	-41640(%rbp), %eax
	imull	%edx, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L14
	movl	$0, -41636(%rbp)
	jmp	.L15
.L16:
	movl	-41636(%rbp), %eax
	cltq
	imulq	$404, %rax, %rax
	addq	%rbp, %rax
	subq	$40016, %rax
	movl	$0, (%rax)
	addl	$1, -41636(%rbp)
.L15:
	movl	-41640(%rbp), %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L16
	movl	$0, -41636(%rbp)
	jmp	.L17
.L18:
	movl	-41636(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-41636(%rbp), %eax
	cltq
	movl	-41616(%rbp,%rax,4), %eax
	leal	-1(%rax), %ecx
	movl	-41636(%rbp), %eax
	cltq
	movl	-40816(%rbp,%rax,4), %esi
	movslq	%ecx, %r8
	movslq	%edx, %rdi
	movq	%rdi, %rax
	salq	$2, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%r8, %rax
	movl	%esi, -40016(%rbp,%rax,4)
	movl	-41636(%rbp), %eax
	cltq
	movl	-41616(%rbp,%rax,4), %eax
	leal	-1(%rax), %esi
	movl	-41636(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %eax
	leal	-1(%rax), %edi
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-40016(%rbp,%rax,4), %edx
	movslq	%edi, %rdi
	movslq	%esi, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdi, %rax
	movl	%edx, -40016(%rbp,%rax,4)
	addl	$1, -41636(%rbp)
.L17:
	movl	-41640(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L18
	movl	$0, -41636(%rbp)
	jmp	.L19
.L25:
	movl	$0, -41632(%rbp)
	jmp	.L20
.L24:
	movl	$0, -41628(%rbp)
	jmp	.L21
.L23:
	movl	-41628(%rbp), %eax
	movslq	%eax, %rcx
	movl	-41632(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-40016(%rbp,%rax,4), %ecx
	movl	-41636(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41632(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movl	-40016(%rbp,%rax,4), %esi
	movl	-41628(%rbp), %eax
	movslq	%eax, %rdi
	movl	-41636(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdi, %rax
	movl	-40016(%rbp,%rax,4), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jle	.L22
	movl	-41636(%rbp), %eax
	movslq	%eax, %rcx
	movl	-41632(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-40016(%rbp,%rax,4), %ecx
	movl	-41628(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41636(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movl	-40016(%rbp,%rax,4), %eax
	addl	%eax, %ecx
	movl	-41628(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41632(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movl	%ecx, -40016(%rbp,%rax,4)
.L22:
	addl	$1, -41628(%rbp)
.L21:
	movl	-41640(%rbp), %eax
	cmpl	%eax, -41628(%rbp)
	jl	.L23
	addl	$1, -41632(%rbp)
.L20:
	movl	-41640(%rbp), %eax
	cmpl	%eax, -41632(%rbp)
	jl	.L24
	addl	$1, -41636(%rbp)
.L19:
	movl	-41640(%rbp), %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L25
	movl	$0, -41620(%rbp)
	movl	-41620(%rbp), %eax
	movl	%eax, -41636(%rbp)
	jmp	.L26
.L28:
	movl	-41636(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -41620(%rbp)
	jge	.L27
	movl	-41636(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	movl	%eax, -41620(%rbp)
.L27:
	addl	$1, -41636(%rbp)
.L26:
	movl	-41640(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L28
	movl	-41624(%rbp), %eax
	addl	%eax, %eax
	subl	-41620(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-41640(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-41640(%rbp), %eax
	testl	%eax, %eax
	jne	.L29
	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
.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 %d %d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.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
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$688, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -41624(%rbp)
	movl	$0, -41620(%rbp)
	jmp	.L2
.L29:
	movl	$0, -41624(%rbp)
	movl	-41624(%rbp), %eax
	movl	%eax, -41636(%rbp)
	jmp	.L3
.L4:
	movl	-41636(%rbp), %eax
	cltq
	movl	$0, -40416(%rbp,%rax,4)
	addl	$1, -41636(%rbp)
.L3:
	movl	-41640(%rbp), %eax
	cmpl	%eax, -41636(%rbp)
	jle	.L4
	movl	$0, -41636(%rbp)
	jmp	.L5
.L6:
	leaq	-40816(%rbp), %rdx
	movl	-41636(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-41216(%rbp), %rdx
	movl	-41636(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-41616(%rbp), %rsi
	movl	-41636(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-41636(%rbp), %eax
	cltq
	movl	-41616(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movl	-40416(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -40416(%rbp,%rax,4)
	movl	-41636(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movl	-40416(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -40416(%rbp,%rax,4)
	addl	$1, -41636(%rbp)
.L5:
	movl	-41640(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L6
	movl	-40412(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -40412(%rbp)
	movl	$0, -41636(%rbp)
	jmp	.L7
.L10:
	movl	-41636(%rbp), %eax
	cltq
	movl	-41616(%rbp,%rax,4), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	je	.L8
	movl	-41636(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %eax
	cltq
	movl	-40416(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L9
.L8:
	movl	-41636(%rbp), %eax
	cltq
	movl	$0, -40816(%rbp,%rax,4)
.L9:
	addl	$1, -41636(%rbp)
.L7:
	movl	-41640(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L10
	movl	$0, -41636(%rbp)
	jmp	.L11
.L12:
	movl	-41636(%rbp), %eax
	cltq
	movl	-40816(%rbp,%rax,4), %eax
	addl	%eax, -41624(%rbp)
	addl	$1, -41636(%rbp)
.L11:
	movl	-41640(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L12
	movl	$0, -41636(%rbp)
	jmp	.L13
.L14:
	movl	-41640(%rbp), %edi
	movl	-41636(%rbp), %eax
	cltd
	idivl	%edi
	movl	%eax, %esi
	movl	-41640(%rbp), %ecx
	movl	-41636(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	movslq	%eax, %rcx
	movslq	%esi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$1000000000, -40016(%rbp,%rax,4)
	addl	$1, -41636(%rbp)
.L13:
	movl	-41640(%rbp), %edx
	movl	-41640(%rbp), %eax
	imull	%edx, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L14
	movl	$0, -41636(%rbp)
	jmp	.L15
.L16:
	movl	-41636(%rbp), %eax
	cltq
	imulq	$404, %rax, %rax
	addq	%rbp, %rax
	subq	$40016, %rax
	movl	$0, (%rax)
	addl	$1, -41636(%rbp)
.L15:
	movl	-41640(%rbp), %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L16
	movl	$0, -41636(%rbp)
	jmp	.L17
.L18:
	movl	-41636(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-41636(%rbp), %eax
	cltq
	movl	-41616(%rbp,%rax,4), %eax
	leal	-1(%rax), %ecx
	movl	-41636(%rbp), %eax
	cltq
	movl	-40816(%rbp,%rax,4), %esi
	movslq	%ecx, %r8
	movslq	%edx, %rdi
	movq	%rdi, %rax
	salq	$2, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%r8, %rax
	movl	%esi, -40016(%rbp,%rax,4)
	movl	-41636(%rbp), %eax
	cltq
	movl	-41616(%rbp,%rax,4), %eax
	leal	-1(%rax), %esi
	movl	-41636(%rbp), %eax
	cltq
	movl	-41216(%rbp,%rax,4), %eax
	leal	-1(%rax), %edi
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-40016(%rbp,%rax,4), %edx
	movslq	%edi, %rdi
	movslq	%esi, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdi, %rax
	movl	%edx, -40016(%rbp,%rax,4)
	addl	$1, -41636(%rbp)
.L17:
	movl	-41640(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L18
	movl	$0, -41636(%rbp)
	jmp	.L19
.L25:
	movl	$0, -41632(%rbp)
	jmp	.L20
.L24:
	movl	$0, -41628(%rbp)
	jmp	.L21
.L23:
	movl	-41628(%rbp), %eax
	movslq	%eax, %rcx
	movl	-41632(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-40016(%rbp,%rax,4), %ecx
	movl	-41636(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41632(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movl	-40016(%rbp,%rax,4), %esi
	movl	-41628(%rbp), %eax
	movslq	%eax, %rdi
	movl	-41636(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdi, %rax
	movl	-40016(%rbp,%rax,4), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jle	.L22
	movl	-41636(%rbp), %eax
	movslq	%eax, %rcx
	movl	-41632(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-40016(%rbp,%rax,4), %ecx
	movl	-41628(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41636(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movl	-40016(%rbp,%rax,4), %eax
	addl	%eax, %ecx
	movl	-41628(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41632(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movl	%ecx, -40016(%rbp,%rax,4)
.L22:
	addl	$1, -41628(%rbp)
.L21:
	movl	-41640(%rbp), %eax
	cmpl	%eax, -41628(%rbp)
	jl	.L23
	addl	$1, -41632(%rbp)
.L20:
	movl	-41640(%rbp), %eax
	cmpl	%eax, -41632(%rbp)
	jl	.L24
	addl	$1, -41636(%rbp)
.L19:
	movl	-41640(%rbp), %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L25
	movl	$0, -41620(%rbp)
	movl	-41620(%rbp), %eax
	movl	%eax, -41636(%rbp)
	jmp	.L26
.L28:
	movl	-41636(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -41620(%rbp)
	jge	.L27
	movl	-41636(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	movl	%eax, -41620(%rbp)
.L27:
	addl	$1, -41636(%rbp)
.L26:
	movl	-41640(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -41636(%rbp)
	jl	.L28
	movl	-41624(%rbp), %eax
	addl	%eax, %eax
	subl	-41620(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-41640(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-41640(%rbp), %eax
	testl	%eax, %eax
	jne	.L29
	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
.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:
