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(void){
    int n;
    scanf("%d",&n);
    long long a[n][n],b[n][n],c[n][n],ans=0;
    for (int i=0; i<n; i++){
        for (int j=0; j<n; j++){
            scanf("%lld",&a[i][j]);
            b[i][j]=a[i][j];
            c[i][j]=1;
        }
    }
    for (int k=0; k<n; k++){
        for (int i=0; i<n; i++){
            for (int j=0; j<n; j++){
                if (b[i][j]>b[i][k]+b[k][j]){
                    b[i][j]=b[i][k]+b[k][j];
                }
            }
        }
    }
    for (int i=0; i<n; i++){
        for (int j=0; j<n; j++){
            if (a[i][j]!=b[i][j]){
                printf("-1\n");
                return 0;
            }
        }
    }
    for (int i=0; i<n; i++){
        for (int j=0; j<n; j++){
            for (int k=0; k<n; k++){
                if (i!=j && i!=k && j!=k){
                    if (a[i][j]==a[i][k]+a[k][j]){
                        c[i][j]=0;
                    }
                }
            }
        }
    }
    for (int i=0; i<n; i++){
        for (int j=0; j<n; j++){
            if (c[i][j]==1){
                ans+=a[i][j];
            }
        }
    }
    printf("%lld\n",ans/2);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"-1"
.LC3:
	.string	"%lld\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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$376, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -408(%rbp)
	leaq	-188(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-188(%rbp), %esi
	movl	-188(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -128(%rbp)
	movslq	%esi, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movslq	%esi, %rax
	salq	$3, %rax
	movq	%rax, -208(%rbp)
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -120(%rbp)
	movslq	%esi, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%edi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edi, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	-224(%rbp), %r9
	movq	-216(%rbp), %r10
	movq	%r10, %rdx
	movq	-240(%rbp), %r11
	movq	-232(%rbp), %r12
	imulq	%r11, %rdx
	movq	%r12, %rax
	imulq	%r9, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r9, %rax
	mulq	%r11
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L2:
	cmpq	%rcx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L4
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -112(%rbp)
	movl	-188(%rbp), %esi
	movl	-188(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%esi, %rax
	movq	%rax, -384(%rbp)
	movq	$0, -376(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,8), %r12
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -96(%rbp)
	movslq	%esi, %rax
	movq	%rax, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%edi, %rax
	movq	%rax, -272(%rbp)
	movq	$0, -264(%rbp)
	movq	-256(%rbp), %r8
	movq	-248(%rbp), %r9
	movq	%r9, %rdx
	movq	-272(%rbp), %r10
	movq	-264(%rbp), %r11
	imulq	%r10, %rdx
	movq	%r11, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r10
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -288(%rbp)
	movq	$0, -280(%rbp)
	movslq	%edi, %rax
	movq	%rax, -304(%rbp)
	movq	$0, -296(%rbp)
	movq	-288(%rbp), %r9
	movq	-280(%rbp), %r10
	movq	%r10, %rdx
	movq	-304(%rbp), %r14
	movq	-296(%rbp), %r15
	imulq	%r14, %rdx
	movq	%r15, %rax
	imulq	%r9, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r9, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L7
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -88(%rbp)
	movl	-188(%rbp), %esi
	movl	-188(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -80(%rbp)
	movslq	%esi, %rax
	movq	%rax, -400(%rbp)
	movq	$0, -392(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,8), %rbx
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%esi, %rax
	movq	%rax, -320(%rbp)
	movq	$0, -312(%rbp)
	movslq	%edi, %rax
	movq	%rax, -336(%rbp)
	movq	$0, -328(%rbp)
	movq	-320(%rbp), %r10
	movq	-312(%rbp), %r11
	movq	%r11, %rdx
	movq	-336(%rbp), %r8
	movq	-328(%rbp), %r9
	imulq	%r8, %rdx
	movq	%r9, %rax
	imulq	%r10, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r10, %rax
	mulq	%r8
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -352(%rbp)
	movq	$0, -344(%rbp)
	movslq	%edi, %rax
	movq	%rax, -368(%rbp)
	movq	$0, -360(%rbp)
	movq	-352(%rbp), %r8
	movq	-344(%rbp), %r9
	movq	%r9, %rdx
	movq	-368(%rbp), %r14
	movq	-360(%rbp), %r15
	imulq	%r14, %rdx
	movq	%r15, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -136(%rbp)
	movl	$0, -184(%rbp)
	jmp	.L11
.L14:
	movl	$0, -180(%rbp)
	jmp	.L12
.L13:
	movq	-208(%rbp), %r14
	movq	%r14, %rdx
	shrq	$3, %rdx
	movl	-180(%rbp), %eax
	movslq	%eax, %rcx
	movl	-184(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	movq	-112(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	%r14, %rcx
	shrq	$3, %rcx
	movq	%r12, %rsi
	shrq	$3, %rsi
	movq	-112(%rbp), %rax
	movl	-180(%rbp), %edx
	movslq	%edx, %rdi
	movl	-184(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rdi, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	-88(%rbp), %rax
	movl	-180(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-184(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movq	%rdx, (%rax,%rcx,8)
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-64(%rbp), %rax
	movl	-180(%rbp), %edx
	movslq	%edx, %rsi
	movl	-184(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	$1, (%rax,%rdx,8)
	addl	$1, -180(%rbp)
.L12:
	movl	-188(%rbp), %eax
	cmpl	%eax, -180(%rbp)
	jl	.L13
	addl	$1, -184(%rbp)
.L11:
	movl	-188(%rbp), %eax
	cmpl	%eax, -184(%rbp)
	jl	.L14
	movl	$0, -176(%rbp)
	jmp	.L15
.L21:
	movl	$0, -172(%rbp)
	jmp	.L16
.L20:
	movl	$0, -168(%rbp)
	jmp	.L17
.L19:
	movq	%r12, %rcx
	shrq	$3, %rcx
	movq	-88(%rbp), %rax
	movl	-168(%rbp), %edx
	movslq	%edx, %rsi
	movl	-172(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%r12, %rsi
	shrq	$3, %rsi
	movq	-88(%rbp), %rax
	movl	-176(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-172(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movq	(%rax,%rcx,8), %rdi
	movq	%r12, %rsi
	shrq	$3, %rsi
	movq	-88(%rbp), %rax
	movl	-168(%rbp), %ecx
	movslq	%ecx, %r8
	movl	-176(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%r8, %rcx
	movq	(%rax,%rcx,8), %rax
	addq	%rdi, %rax
	cmpq	%rax, %rdx
	jle	.L18
	movq	%r12, %rcx
	shrq	$3, %rcx
	movq	-88(%rbp), %rax
	movl	-176(%rbp), %edx
	movslq	%edx, %rsi
	movl	-172(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rdi
	movq	%r12, %rcx
	shrq	$3, %rcx
	movq	-88(%rbp), %rax
	movl	-168(%rbp), %edx
	movslq	%edx, %rsi
	movl	-176(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%r12, %rsi
	shrq	$3, %rsi
	leaq	(%rdi,%rax), %rcx
	movq	-88(%rbp), %rax
	movl	-168(%rbp), %edx
	movslq	%edx, %rdi
	movl	-172(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rsi, %rdx
	addq	%rdi, %rdx
	movq	%rcx, (%rax,%rdx,8)
.L18:
	addl	$1, -168(%rbp)
.L17:
	movl	-188(%rbp), %eax
	cmpl	%eax, -168(%rbp)
	jl	.L19
	addl	$1, -172(%rbp)
.L16:
	movl	-188(%rbp), %eax
	cmpl	%eax, -172(%rbp)
	jl	.L20
	addl	$1, -176(%rbp)
.L15:
	movl	-188(%rbp), %eax
	cmpl	%eax, -176(%rbp)
	jl	.L21
	movl	$0, -164(%rbp)
	jmp	.L22
.L27:
	movl	$0, -160(%rbp)
	jmp	.L23
.L26:
	movq	-208(%rbp), %rcx
	shrq	$3, %rcx
	movq	-112(%rbp), %rax
	movl	-160(%rbp), %edx
	movslq	%edx, %rsi
	movl	-164(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%r12, %rsi
	shrq	$3, %rsi
	movq	-88(%rbp), %rax
	movl	-160(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-164(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movq	(%rax,%rcx,8), %rax
	cmpq	%rax, %rdx
	je	.L24
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L25
.L24:
	addl	$1, -160(%rbp)
.L23:
	movl	-188(%rbp), %eax
	cmpl	%eax, -160(%rbp)
	jl	.L26
	addl	$1, -164(%rbp)
.L22:
	movl	-188(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L27
	movl	$0, -156(%rbp)
	jmp	.L28
.L34:
	movl	$0, -152(%rbp)
	jmp	.L29
.L33:
	movl	$0, -148(%rbp)
	jmp	.L30
.L32:
	movl	-156(%rbp), %eax
	cmpl	-152(%rbp), %eax
	je	.L31
	movl	-156(%rbp), %eax
	cmpl	-148(%rbp), %eax
	je	.L31
	movl	-152(%rbp), %eax
	cmpl	-148(%rbp), %eax
	je	.L31
	movq	-208(%rbp), %r15
	movq	%r15, %rcx
	shrq	$3, %rcx
	movq	-112(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rsi
	movl	-156(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%r15, %rsi
	shrq	$3, %rsi
	movq	-112(%rbp), %rax
	movl	-148(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-156(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movq	(%rax,%rcx,8), %rdi
	movq	%r15, %rsi
	shrq	$3, %rsi
	movq	-112(%rbp), %rax
	movl	-152(%rbp), %ecx
	movslq	%ecx, %r8
	movl	-148(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%r8, %rcx
	movq	(%rax,%rcx,8), %rax
	addq	%rdi, %rax
	cmpq	%rax, %rdx
	jne	.L31
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-64(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rsi
	movl	-156(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	$0, (%rax,%rdx,8)
.L31:
	addl	$1, -148(%rbp)
.L30:
	movl	-188(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	jl	.L32
	addl	$1, -152(%rbp)
.L29:
	movl	-188(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L33
	addl	$1, -156(%rbp)
.L28:
	movl	-188(%rbp), %eax
	cmpl	%eax, -156(%rbp)
	jl	.L34
	movl	$0, -144(%rbp)
	jmp	.L35
.L39:
	movl	$0, -140(%rbp)
	jmp	.L36
.L38:
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-64(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rsi
	movl	-144(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	$1, %rax
	jne	.L37
	movq	-208(%rbp), %rcx
	shrq	$3, %rcx
	movq	-112(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rsi
	movl	-144(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -136(%rbp)
.L37:
	addl	$1, -140(%rbp)
.L36:
	movl	-188(%rbp), %eax
	cmpl	%eax, -140(%rbp)
	jl	.L38
	addl	$1, -144(%rbp)
.L35:
	movl	-188(%rbp), %eax
	cmpl	%eax, -144(%rbp)
	jl	.L39
	movq	-136(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L25:
	movq	-408(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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	"%lld"
.LC2:
	.string	"-1"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rax
	movq	%rsp, %rcx
	leaq	0(,%rax,8), %rbx
	movq	%rax, %rsi
	imulq	%rax, %rax
	movq	%rbx, -88(%rbp)
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rcx
	cmpq	%rcx, %rsp
	je	.L3
.L67:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L67
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L68
.L4:
	movq	%rax, %rdi
	movq	%rsp, -96(%rbp)
	movq	%rax, %rdx
	movq	%rsp, %rcx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L68:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L69
.L7:
	movq	%rax, %rcx
	movq	%rsp, %rdi
	andq	$-4096, %rax
	movq	%rsp, %r14
	andq	$-16, %rcx
	subq	%rax, %rdi
.L8:
	cmpq	%rdi, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L69:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L9:
	movq	%rcx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L10
	orq	$0, -8(%rsp,%rax)
.L10:
	movq	%rsp, %r12
	movq	%r12, -120(%rbp)
	testl	%esi, %esi
	jle	.L11
	movq	-88(%rbp), %r15
	movq	-96(%rbp), %rax
	movq	%r12, -112(%rbp)
	movq	%r14, %rbx
	movl	$0, -72(%rbp)
	leaq	.LC1(%rip), %r13
	shrq	$3, %r15
	movq	%rax, -104(%rbp)
	movq	%rax, -80(%rbp)
	movq	%r15, -128(%rbp)
	movq	%r14, -136(%rbp)
	.p2align 4,,10
	.p2align 3
.L12:
	movq	-80(%rbp), %r15
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$8, %r15
	call	__isoc99_scanf@PLT
	movq	-8(%r15), %rax
	movl	-60(%rbp), %r9d
	movq	$1, (%r12,%r14,8)
	movq	%rax, (%rbx,%r14,8)
	addq	$1, %r14
	cmpl	%r14d, %r9d
	jg	.L13
	addl	$1, -72(%rbp)
	movl	-72(%rbp), %eax
	cmpl	%eax, %r9d
	jle	.L70
	movq	-88(%rbp), %rax
	addq	%rax, -80(%rbp)
	addq	%rax, %rbx
	addq	%rax, %r12
	jmp	.L12
.L70:
	movq	-128(%rbp), %r15
	movq	-136(%rbp), %r14
	testl	%r9d, %r9d
	jle	.L11
	leal	-1(%r9), %eax
	movl	%r9d, %r8d
	movq	-88(%rbp), %r13
	xorl	%edx, %edx
	salq	$3, %rax
	movq	%r8, -72(%rbp)
	xorl	%r12d, %r12d
	leaq	8(%r14,%rax), %rbx
	movq	%rbx, -80(%rbp)
	movq	$-8, %rbx
	subq	%rax, %rbx
	.p2align 4,,10
	.p2align 3
.L19:
	movq	-80(%rbp), %r8
	movq	%rdx, %r10
	xorl	%ecx, %ecx
	movslq	%r12d, %r11
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%ecx, %rdi
	leaq	(%rbx,%r8), %rax
	imulq	%r15, %rdi
	addq	%r11, %rdi
	.p2align 4,,10
	.p2align 3
.L17:
	movq	(%rax,%r10,8), %rsi
	addq	(%r14,%rdi,8), %rsi
	cmpq	%rsi, (%rax)
	jle	.L16
	movq	%rsi, (%rax)
.L16:
	addq	$8, %rax
	cmpq	%r8, %rax
	jne	.L17
	leal	1(%rcx), %esi
	addq	%r13, %r8
	subq	%r15, %r10
	cmpl	%esi, %r9d
	je	.L18
	movl	%esi, %ecx
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L18:
	addq	$1, %r12
	addq	%r15, %rdx
	cmpq	-72(%rbp), %r12
	jne	.L19
	movq	-72(%rbp), %r8
	movq	-96(%rbp), %rdx
	xorl	%r9d, %r9d
	leaq	0(,%r8,8), %rdi
.L20:
	leaq	(%rbx,%rdi), %rax
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L22:
	addq	$8, %rax
	cmpq	%rdi, %rax
	je	.L71
.L24:
	movq	(%r14,%rax), %r11
	cmpq	%r11, (%rdx,%rax)
	je	.L22
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L23:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L72
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L71:
	.cfi_restore_state
	leal	1(%r9), %eax
	addq	-88(%rbp), %rdi
	cmpl	%ecx, %r9d
	je	.L37
	movl	%eax, %r9d
	jmp	.L20
.L11:
	xorl	%eax, %eax
.L33:
	movl	$2, %ecx
	cqto
	movl	$1, %edi
	idivq	%rcx
	leaq	.LC3(%rip), %rsi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L23
.L37:
	movq	-96(%rbp), %r12
	movq	-120(%rbp), %r14
	movl	%esi, -80(%rbp)
	xorl	%r11d, %r11d
	movl	%ecx, -72(%rbp)
	movq	%r12, %r13
.L25:
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L30:
	cmpl	%r9d, %r11d
	movslq	%r9d, %rdi
	setne	%sil
	movq	%rdi, %rcx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L27:
	cmpl	%ecx, %eax
	movslq	%eax, %rdx
	setne	%bl
	cmpl	%r11d, %eax
	setne	%r10b
	testb	%r10b, %bl
	je	.L26
	testb	%sil, %sil
	je	.L26
	imulq	%r15, %rdx
	addq	%rdi, %rdx
	movq	(%r12,%rdx,8), %rdx
	addq	0(%r13,%rax,8), %rdx
	cmpq	%rdx, 0(%r13,%r9,8)
	jne	.L26
	movq	$0, (%r14,%r9,8)
	.p2align 4,,10
	.p2align 3
.L26:
	addq	$1, %rax
	cmpq	%r8, %rax
	jne	.L27
	addq	$1, %r9
	cmpq	%r8, %r9
	jne	.L30
	movq	-88(%rbp), %rbx
	leal	1(%r11), %eax
	addq	%rbx, %r14
	addq	%rbx, %r13
	cmpl	-72(%rbp), %r11d
	je	.L38
	movl	%eax, %r11d
	jmp	.L25
.L38:
	movl	-80(%rbp), %esi
	movl	-72(%rbp), %ecx
	xorl	%edi, %edi
	xorl	%eax, %eax
	movq	-88(%rbp), %r10
	movq	-104(%rbp), %r9
	movq	-112(%rbp), %r8
.L29:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L32:
	cmpq	$1, (%r8,%rdx,8)
	jne	.L31
	addq	(%r9,%rdx,8), %rax
.L31:
	addq	$1, %rdx
	cmpl	%edx, %esi
	jg	.L32
	leal	1(%rdi), %edx
	addq	%r10, %r8
	addq	%r10, %r9
	cmpl	%ecx, %edi
	jge	.L33
	movl	%edx, %edi
	jmp	.L29
.L72:
	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	"%lld"
.LC2:
	.string	"-1"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rax
	movq	%rsp, %rcx
	leaq	0(,%rax,8), %rbx
	movq	%rax, %rsi
	imulq	%rax, %rax
	movq	%rbx, -88(%rbp)
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rcx
	cmpq	%rcx, %rsp
	je	.L3
.L67:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L67
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L68
.L4:
	movq	%rax, %rdi
	movq	%rsp, -96(%rbp)
	movq	%rax, %rdx
	movq	%rsp, %rcx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L68:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L69
.L7:
	movq	%rax, %rcx
	movq	%rsp, %rdi
	andq	$-4096, %rax
	movq	%rsp, %r14
	andq	$-16, %rcx
	subq	%rax, %rdi
.L8:
	cmpq	%rdi, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L69:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L9:
	movq	%rcx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L10
	orq	$0, -8(%rsp,%rax)
.L10:
	movq	%rsp, %r12
	movq	%r12, -120(%rbp)
	testl	%esi, %esi
	jle	.L11
	movq	-88(%rbp), %r15
	movq	-96(%rbp), %rax
	movq	%r12, -112(%rbp)
	movq	%r14, %rbx
	movl	$0, -72(%rbp)
	leaq	.LC1(%rip), %r13
	shrq	$3, %r15
	movq	%rax, -104(%rbp)
	movq	%rax, -80(%rbp)
	movq	%r15, -128(%rbp)
	movq	%r14, -136(%rbp)
	.p2align 4,,10
	.p2align 3
.L12:
	movq	-80(%rbp), %r15
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$8, %r15
	call	__isoc99_scanf@PLT
	movq	-8(%r15), %rax
	movl	-60(%rbp), %r9d
	movq	$1, (%r12,%r14,8)
	movq	%rax, (%rbx,%r14,8)
	addq	$1, %r14
	cmpl	%r14d, %r9d
	jg	.L13
	addl	$1, -72(%rbp)
	movl	-72(%rbp), %eax
	cmpl	%eax, %r9d
	jle	.L70
	movq	-88(%rbp), %rax
	addq	%rax, -80(%rbp)
	addq	%rax, %rbx
	addq	%rax, %r12
	jmp	.L12
.L70:
	movq	-128(%rbp), %r15
	movq	-136(%rbp), %r14
	testl	%r9d, %r9d
	jle	.L11
	leal	-1(%r9), %eax
	movl	%r9d, %r8d
	movq	-88(%rbp), %r13
	xorl	%edx, %edx
	salq	$3, %rax
	movq	%r8, -72(%rbp)
	xorl	%r12d, %r12d
	leaq	8(%r14,%rax), %rbx
	movq	%rbx, -80(%rbp)
	movq	$-8, %rbx
	subq	%rax, %rbx
	.p2align 4,,10
	.p2align 3
.L19:
	movq	-80(%rbp), %r8
	movq	%rdx, %r10
	xorl	%ecx, %ecx
	movslq	%r12d, %r11
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%ecx, %rdi
	leaq	(%rbx,%r8), %rax
	imulq	%r15, %rdi
	addq	%r11, %rdi
	.p2align 4,,10
	.p2align 3
.L17:
	movq	(%rax,%r10,8), %rsi
	addq	(%r14,%rdi,8), %rsi
	cmpq	%rsi, (%rax)
	jle	.L16
	movq	%rsi, (%rax)
.L16:
	addq	$8, %rax
	cmpq	%r8, %rax
	jne	.L17
	leal	1(%rcx), %esi
	addq	%r13, %r8
	subq	%r15, %r10
	cmpl	%esi, %r9d
	je	.L18
	movl	%esi, %ecx
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L18:
	addq	$1, %r12
	addq	%r15, %rdx
	cmpq	-72(%rbp), %r12
	jne	.L19
	movq	-72(%rbp), %r8
	movq	-96(%rbp), %rdx
	xorl	%r9d, %r9d
	leaq	0(,%r8,8), %rdi
.L20:
	leaq	(%rbx,%rdi), %rax
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L22:
	addq	$8, %rax
	cmpq	%rdi, %rax
	je	.L71
.L24:
	movq	(%r14,%rax), %r11
	cmpq	%r11, (%rdx,%rax)
	je	.L22
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L23:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L72
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L71:
	.cfi_restore_state
	leal	1(%r9), %eax
	addq	-88(%rbp), %rdi
	cmpl	%ecx, %r9d
	je	.L37
	movl	%eax, %r9d
	jmp	.L20
.L11:
	xorl	%eax, %eax
.L33:
	movl	$2, %ecx
	cqto
	movl	$1, %edi
	idivq	%rcx
	leaq	.LC3(%rip), %rsi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L23
.L37:
	movq	-96(%rbp), %r12
	movq	-120(%rbp), %r14
	movl	%esi, -80(%rbp)
	xorl	%r11d, %r11d
	movl	%ecx, -72(%rbp)
	movq	%r12, %r13
.L25:
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L30:
	cmpl	%r9d, %r11d
	movslq	%r9d, %rdi
	setne	%sil
	movq	%rdi, %rcx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L27:
	cmpl	%ecx, %eax
	movslq	%eax, %rdx
	setne	%bl
	cmpl	%r11d, %eax
	setne	%r10b
	testb	%r10b, %bl
	je	.L26
	testb	%sil, %sil
	je	.L26
	imulq	%r15, %rdx
	addq	%rdi, %rdx
	movq	(%r12,%rdx,8), %rdx
	addq	0(%r13,%rax,8), %rdx
	cmpq	%rdx, 0(%r13,%r9,8)
	jne	.L26
	movq	$0, (%r14,%r9,8)
	.p2align 4,,10
	.p2align 3
.L26:
	addq	$1, %rax
	cmpq	%r8, %rax
	jne	.L27
	addq	$1, %r9
	cmpq	%r8, %r9
	jne	.L30
	movq	-88(%rbp), %rbx
	leal	1(%r11), %eax
	addq	%rbx, %r14
	addq	%rbx, %r13
	cmpl	-72(%rbp), %r11d
	je	.L38
	movl	%eax, %r11d
	jmp	.L25
.L38:
	movl	-80(%rbp), %esi
	movl	-72(%rbp), %ecx
	xorl	%edi, %edi
	xorl	%eax, %eax
	movq	-88(%rbp), %r10
	movq	-104(%rbp), %r9
	movq	-112(%rbp), %r8
.L29:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L32:
	cmpq	$1, (%r8,%rdx,8)
	jne	.L31
	addq	(%r9,%rdx,8), %rax
.L31:
	addq	$1, %rdx
	cmpl	%edx, %esi
	jg	.L32
	leal	1(%rdi), %edx
	addq	%r10, %r8
	addq	%r10, %r9
	cmpl	%ecx, %edi
	jge	.L33
	movl	%edx, %edi
	jmp	.L29
.L72:
	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(void){
    int n;
    scanf("%d",&n);
    long long a[n][n],b[n][n],c[n][n],ans=0;
    for (int i=0; i<n; i++){
        for (int j=0; j<n; j++){
            scanf("%lld",&a[i][j]);
            b[i][j]=a[i][j];
            c[i][j]=1;
        }
    }
    for (int k=0; k<n; k++){
        for (int i=0; i<n; i++){
            for (int j=0; j<n; j++){
                if (b[i][j]>b[i][k]+b[k][j]){
                    b[i][j]=b[i][k]+b[k][j];
                }
            }
        }
    }
    for (int i=0; i<n; i++){
        for (int j=0; j<n; j++){
            if (a[i][j]!=b[i][j]){
                printf("-1\n");
                return 0;
            }
        }
    }
    for (int i=0; i<n; i++){
        for (int j=0; j<n; j++){
            for (int k=0; k<n; k++){
                if (i!=j && i!=k && j!=k){
                    if (a[i][j]==a[i][k]+a[k][j]){
                        c[i][j]=0;
                    }
                }
            }
        }
    }
    for (int i=0; i<n; i++){
        for (int j=0; j<n; j++){
            if (c[i][j]==1){
                ans+=a[i][j];
            }
        }
    }
    printf("%lld\n",ans/2);
    return 0;
}
3
0 1 3
1 0 1
3 0 0
 3
-1 1 3
1 0 1
3 0 0
 3
-1 1 3
1 0 1
5 0 0
 3
0 1 3
1 0 1
5 0 0
 3
0 0 3
1 0 1
3 1 0
 3
0 1 5
1 0 1
3 0 0
 3
0 1 3
1 0 1
5 0 -1
 3
0 0 3
1 -1 1
3 1 0
 3
1 1 3
1 0 1
5 0 -1
 3
0 0 3
1 -1 1
3 0 0

-1
 -1
 -1
 -1
 -1
 -1
 -1
 -1
 -1
 -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 main(void){
    int n;
    scanf("%d",&n);
    long long a[n][n],b[n][n],c[n][n],ans=0;
    for (int i=0; i<n; i++){
        for (int j=0; j<n; j++){
            scanf("%lld",&a[i][j]);
            b[i][j]=a[i][j];
            c[i][j]=1;
        }
    }
    for (int k=0; k<n; k++){
        for (int i=0; i<n; i++){
            for (int j=0; j<n; j++){
                if (b[i][j]>b[i][k]+b[k][j]){
                    b[i][j]=b[i][k]+b[k][j];
                }
            }
        }
    }
    for (int i=0; i<n; i++){
        for (int j=0; j<n; j++){
            if (a[i][j]!=b[i][j]){
                printf("-1\n");
                return 0;
            }
        }
    }
    for (int i=0; i<n; i++){
        for (int j=0; j<n; j++){
            for (int k=0; k<n; k++){
                if (i!=j && i!=k && j!=k){
                    if (a[i][j]==a[i][k]+a[k][j]){
                        c[i][j]=0;
                    }
                }
            }
        }
    }
    for (int i=0; i<n; i++){
        for (int j=0; j<n; j++){
            if (c[i][j]==1){
                ans+=a[i][j];
            }
        }
    }
    printf("%lld\n",ans/2);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"-1"
.LC3:
	.string	"%lld\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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$376, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -408(%rbp)
	leaq	-188(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-188(%rbp), %esi
	movl	-188(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -128(%rbp)
	movslq	%esi, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movslq	%esi, %rax
	salq	$3, %rax
	movq	%rax, -208(%rbp)
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -120(%rbp)
	movslq	%esi, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%edi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edi, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	-224(%rbp), %r9
	movq	-216(%rbp), %r10
	movq	%r10, %rdx
	movq	-240(%rbp), %r11
	movq	-232(%rbp), %r12
	imulq	%r11, %rdx
	movq	%r12, %rax
	imulq	%r9, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r9, %rax
	mulq	%r11
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L2:
	cmpq	%rcx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L4
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -112(%rbp)
	movl	-188(%rbp), %esi
	movl	-188(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%esi, %rax
	movq	%rax, -384(%rbp)
	movq	$0, -376(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,8), %r12
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -96(%rbp)
	movslq	%esi, %rax
	movq	%rax, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%edi, %rax
	movq	%rax, -272(%rbp)
	movq	$0, -264(%rbp)
	movq	-256(%rbp), %r8
	movq	-248(%rbp), %r9
	movq	%r9, %rdx
	movq	-272(%rbp), %r10
	movq	-264(%rbp), %r11
	imulq	%r10, %rdx
	movq	%r11, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r10
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -288(%rbp)
	movq	$0, -280(%rbp)
	movslq	%edi, %rax
	movq	%rax, -304(%rbp)
	movq	$0, -296(%rbp)
	movq	-288(%rbp), %r9
	movq	-280(%rbp), %r10
	movq	%r10, %rdx
	movq	-304(%rbp), %r14
	movq	-296(%rbp), %r15
	imulq	%r14, %rdx
	movq	%r15, %rax
	imulq	%r9, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r9, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L7
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -88(%rbp)
	movl	-188(%rbp), %esi
	movl	-188(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -80(%rbp)
	movslq	%esi, %rax
	movq	%rax, -400(%rbp)
	movq	$0, -392(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,8), %rbx
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%esi, %rax
	movq	%rax, -320(%rbp)
	movq	$0, -312(%rbp)
	movslq	%edi, %rax
	movq	%rax, -336(%rbp)
	movq	$0, -328(%rbp)
	movq	-320(%rbp), %r10
	movq	-312(%rbp), %r11
	movq	%r11, %rdx
	movq	-336(%rbp), %r8
	movq	-328(%rbp), %r9
	imulq	%r8, %rdx
	movq	%r9, %rax
	imulq	%r10, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r10, %rax
	mulq	%r8
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -352(%rbp)
	movq	$0, -344(%rbp)
	movslq	%edi, %rax
	movq	%rax, -368(%rbp)
	movq	$0, -360(%rbp)
	movq	-352(%rbp), %r8
	movq	-344(%rbp), %r9
	movq	%r9, %rdx
	movq	-368(%rbp), %r14
	movq	-360(%rbp), %r15
	imulq	%r14, %rdx
	movq	%r15, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -136(%rbp)
	movl	$0, -184(%rbp)
	jmp	.L11
.L14:
	movl	$0, -180(%rbp)
	jmp	.L12
.L13:
	movq	-208(%rbp), %r14
	movq	%r14, %rdx
	shrq	$3, %rdx
	movl	-180(%rbp), %eax
	movslq	%eax, %rcx
	movl	-184(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	movq	-112(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	%r14, %rcx
	shrq	$3, %rcx
	movq	%r12, %rsi
	shrq	$3, %rsi
	movq	-112(%rbp), %rax
	movl	-180(%rbp), %edx
	movslq	%edx, %rdi
	movl	-184(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rdi, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	-88(%rbp), %rax
	movl	-180(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-184(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movq	%rdx, (%rax,%rcx,8)
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-64(%rbp), %rax
	movl	-180(%rbp), %edx
	movslq	%edx, %rsi
	movl	-184(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	$1, (%rax,%rdx,8)
	addl	$1, -180(%rbp)
.L12:
	movl	-188(%rbp), %eax
	cmpl	%eax, -180(%rbp)
	jl	.L13
	addl	$1, -184(%rbp)
.L11:
	movl	-188(%rbp), %eax
	cmpl	%eax, -184(%rbp)
	jl	.L14
	movl	$0, -176(%rbp)
	jmp	.L15
.L21:
	movl	$0, -172(%rbp)
	jmp	.L16
.L20:
	movl	$0, -168(%rbp)
	jmp	.L17
.L19:
	movq	%r12, %rcx
	shrq	$3, %rcx
	movq	-88(%rbp), %rax
	movl	-168(%rbp), %edx
	movslq	%edx, %rsi
	movl	-172(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%r12, %rsi
	shrq	$3, %rsi
	movq	-88(%rbp), %rax
	movl	-176(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-172(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movq	(%rax,%rcx,8), %rdi
	movq	%r12, %rsi
	shrq	$3, %rsi
	movq	-88(%rbp), %rax
	movl	-168(%rbp), %ecx
	movslq	%ecx, %r8
	movl	-176(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%r8, %rcx
	movq	(%rax,%rcx,8), %rax
	addq	%rdi, %rax
	cmpq	%rax, %rdx
	jle	.L18
	movq	%r12, %rcx
	shrq	$3, %rcx
	movq	-88(%rbp), %rax
	movl	-176(%rbp), %edx
	movslq	%edx, %rsi
	movl	-172(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rdi
	movq	%r12, %rcx
	shrq	$3, %rcx
	movq	-88(%rbp), %rax
	movl	-168(%rbp), %edx
	movslq	%edx, %rsi
	movl	-176(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%r12, %rsi
	shrq	$3, %rsi
	leaq	(%rdi,%rax), %rcx
	movq	-88(%rbp), %rax
	movl	-168(%rbp), %edx
	movslq	%edx, %rdi
	movl	-172(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rsi, %rdx
	addq	%rdi, %rdx
	movq	%rcx, (%rax,%rdx,8)
.L18:
	addl	$1, -168(%rbp)
.L17:
	movl	-188(%rbp), %eax
	cmpl	%eax, -168(%rbp)
	jl	.L19
	addl	$1, -172(%rbp)
.L16:
	movl	-188(%rbp), %eax
	cmpl	%eax, -172(%rbp)
	jl	.L20
	addl	$1, -176(%rbp)
.L15:
	movl	-188(%rbp), %eax
	cmpl	%eax, -176(%rbp)
	jl	.L21
	movl	$0, -164(%rbp)
	jmp	.L22
.L27:
	movl	$0, -160(%rbp)
	jmp	.L23
.L26:
	movq	-208(%rbp), %rcx
	shrq	$3, %rcx
	movq	-112(%rbp), %rax
	movl	-160(%rbp), %edx
	movslq	%edx, %rsi
	movl	-164(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%r12, %rsi
	shrq	$3, %rsi
	movq	-88(%rbp), %rax
	movl	-160(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-164(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movq	(%rax,%rcx,8), %rax
	cmpq	%rax, %rdx
	je	.L24
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L25
.L24:
	addl	$1, -160(%rbp)
.L23:
	movl	-188(%rbp), %eax
	cmpl	%eax, -160(%rbp)
	jl	.L26
	addl	$1, -164(%rbp)
.L22:
	movl	-188(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L27
	movl	$0, -156(%rbp)
	jmp	.L28
.L34:
	movl	$0, -152(%rbp)
	jmp	.L29
.L33:
	movl	$0, -148(%rbp)
	jmp	.L30
.L32:
	movl	-156(%rbp), %eax
	cmpl	-152(%rbp), %eax
	je	.L31
	movl	-156(%rbp), %eax
	cmpl	-148(%rbp), %eax
	je	.L31
	movl	-152(%rbp), %eax
	cmpl	-148(%rbp), %eax
	je	.L31
	movq	-208(%rbp), %r15
	movq	%r15, %rcx
	shrq	$3, %rcx
	movq	-112(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rsi
	movl	-156(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%r15, %rsi
	shrq	$3, %rsi
	movq	-112(%rbp), %rax
	movl	-148(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-156(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movq	(%rax,%rcx,8), %rdi
	movq	%r15, %rsi
	shrq	$3, %rsi
	movq	-112(%rbp), %rax
	movl	-152(%rbp), %ecx
	movslq	%ecx, %r8
	movl	-148(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%r8, %rcx
	movq	(%rax,%rcx,8), %rax
	addq	%rdi, %rax
	cmpq	%rax, %rdx
	jne	.L31
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-64(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rsi
	movl	-156(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	$0, (%rax,%rdx,8)
.L31:
	addl	$1, -148(%rbp)
.L30:
	movl	-188(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	jl	.L32
	addl	$1, -152(%rbp)
.L29:
	movl	-188(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L33
	addl	$1, -156(%rbp)
.L28:
	movl	-188(%rbp), %eax
	cmpl	%eax, -156(%rbp)
	jl	.L34
	movl	$0, -144(%rbp)
	jmp	.L35
.L39:
	movl	$0, -140(%rbp)
	jmp	.L36
.L38:
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-64(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rsi
	movl	-144(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	$1, %rax
	jne	.L37
	movq	-208(%rbp), %rcx
	shrq	$3, %rcx
	movq	-112(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rsi
	movl	-144(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -136(%rbp)
.L37:
	addl	$1, -140(%rbp)
.L36:
	movl	-188(%rbp), %eax
	cmpl	%eax, -140(%rbp)
	jl	.L38
	addl	$1, -144(%rbp)
.L35:
	movl	-188(%rbp), %eax
	cmpl	%eax, -144(%rbp)
	jl	.L39
	movq	-136(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L25:
	movq	-408(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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	"%lld"
.LC2:
	.string	"-1"
.LC3:
	.string	"%lld\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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$376, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -408(%rbp)
	leaq	-188(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-188(%rbp), %esi
	movl	-188(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -128(%rbp)
	movslq	%esi, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movslq	%esi, %rax
	salq	$3, %rax
	movq	%rax, -208(%rbp)
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -120(%rbp)
	movslq	%esi, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%edi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edi, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	-224(%rbp), %r9
	movq	-216(%rbp), %r10
	movq	%r10, %rdx
	movq	-240(%rbp), %r11
	movq	-232(%rbp), %r12
	imulq	%r11, %rdx
	movq	%r12, %rax
	imulq	%r9, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r9, %rax
	mulq	%r11
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L2:
	cmpq	%rcx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L4
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -112(%rbp)
	movl	-188(%rbp), %esi
	movl	-188(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%esi, %rax
	movq	%rax, -384(%rbp)
	movq	$0, -376(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,8), %r12
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -96(%rbp)
	movslq	%esi, %rax
	movq	%rax, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%edi, %rax
	movq	%rax, -272(%rbp)
	movq	$0, -264(%rbp)
	movq	-256(%rbp), %r8
	movq	-248(%rbp), %r9
	movq	%r9, %rdx
	movq	-272(%rbp), %r10
	movq	-264(%rbp), %r11
	imulq	%r10, %rdx
	movq	%r11, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r10
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -288(%rbp)
	movq	$0, -280(%rbp)
	movslq	%edi, %rax
	movq	%rax, -304(%rbp)
	movq	$0, -296(%rbp)
	movq	-288(%rbp), %r9
	movq	-280(%rbp), %r10
	movq	%r10, %rdx
	movq	-304(%rbp), %r14
	movq	-296(%rbp), %r15
	imulq	%r14, %rdx
	movq	%r15, %rax
	imulq	%r9, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r9, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L7
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -88(%rbp)
	movl	-188(%rbp), %esi
	movl	-188(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -80(%rbp)
	movslq	%esi, %rax
	movq	%rax, -400(%rbp)
	movq	$0, -392(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,8), %rbx
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%esi, %rax
	movq	%rax, -320(%rbp)
	movq	$0, -312(%rbp)
	movslq	%edi, %rax
	movq	%rax, -336(%rbp)
	movq	$0, -328(%rbp)
	movq	-320(%rbp), %r10
	movq	-312(%rbp), %r11
	movq	%r11, %rdx
	movq	-336(%rbp), %r8
	movq	-328(%rbp), %r9
	imulq	%r8, %rdx
	movq	%r9, %rax
	imulq	%r10, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r10, %rax
	mulq	%r8
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -352(%rbp)
	movq	$0, -344(%rbp)
	movslq	%edi, %rax
	movq	%rax, -368(%rbp)
	movq	$0, -360(%rbp)
	movq	-352(%rbp), %r8
	movq	-344(%rbp), %r9
	movq	%r9, %rdx
	movq	-368(%rbp), %r14
	movq	-360(%rbp), %r15
	imulq	%r14, %rdx
	movq	%r15, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -136(%rbp)
	movl	$0, -184(%rbp)
	jmp	.L11
.L14:
	movl	$0, -180(%rbp)
	jmp	.L12
.L13:
	movq	-208(%rbp), %r14
	movq	%r14, %rdx
	shrq	$3, %rdx
	movl	-180(%rbp), %eax
	movslq	%eax, %rcx
	movl	-184(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	movq	-112(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	%r14, %rcx
	shrq	$3, %rcx
	movq	%r12, %rsi
	shrq	$3, %rsi
	movq	-112(%rbp), %rax
	movl	-180(%rbp), %edx
	movslq	%edx, %rdi
	movl	-184(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rdi, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	-88(%rbp), %rax
	movl	-180(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-184(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movq	%rdx, (%rax,%rcx,8)
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-64(%rbp), %rax
	movl	-180(%rbp), %edx
	movslq	%edx, %rsi
	movl	-184(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	$1, (%rax,%rdx,8)
	addl	$1, -180(%rbp)
.L12:
	movl	-188(%rbp), %eax
	cmpl	%eax, -180(%rbp)
	jl	.L13
	addl	$1, -184(%rbp)
.L11:
	movl	-188(%rbp), %eax
	cmpl	%eax, -184(%rbp)
	jl	.L14
	movl	$0, -176(%rbp)
	jmp	.L15
.L21:
	movl	$0, -172(%rbp)
	jmp	.L16
.L20:
	movl	$0, -168(%rbp)
	jmp	.L17
.L19:
	movq	%r12, %rcx
	shrq	$3, %rcx
	movq	-88(%rbp), %rax
	movl	-168(%rbp), %edx
	movslq	%edx, %rsi
	movl	-172(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%r12, %rsi
	shrq	$3, %rsi
	movq	-88(%rbp), %rax
	movl	-176(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-172(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movq	(%rax,%rcx,8), %rdi
	movq	%r12, %rsi
	shrq	$3, %rsi
	movq	-88(%rbp), %rax
	movl	-168(%rbp), %ecx
	movslq	%ecx, %r8
	movl	-176(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%r8, %rcx
	movq	(%rax,%rcx,8), %rax
	addq	%rdi, %rax
	cmpq	%rax, %rdx
	jle	.L18
	movq	%r12, %rcx
	shrq	$3, %rcx
	movq	-88(%rbp), %rax
	movl	-176(%rbp), %edx
	movslq	%edx, %rsi
	movl	-172(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rdi
	movq	%r12, %rcx
	shrq	$3, %rcx
	movq	-88(%rbp), %rax
	movl	-168(%rbp), %edx
	movslq	%edx, %rsi
	movl	-176(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%r12, %rsi
	shrq	$3, %rsi
	leaq	(%rdi,%rax), %rcx
	movq	-88(%rbp), %rax
	movl	-168(%rbp), %edx
	movslq	%edx, %rdi
	movl	-172(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rsi, %rdx
	addq	%rdi, %rdx
	movq	%rcx, (%rax,%rdx,8)
.L18:
	addl	$1, -168(%rbp)
.L17:
	movl	-188(%rbp), %eax
	cmpl	%eax, -168(%rbp)
	jl	.L19
	addl	$1, -172(%rbp)
.L16:
	movl	-188(%rbp), %eax
	cmpl	%eax, -172(%rbp)
	jl	.L20
	addl	$1, -176(%rbp)
.L15:
	movl	-188(%rbp), %eax
	cmpl	%eax, -176(%rbp)
	jl	.L21
	movl	$0, -164(%rbp)
	jmp	.L22
.L27:
	movl	$0, -160(%rbp)
	jmp	.L23
.L26:
	movq	-208(%rbp), %rcx
	shrq	$3, %rcx
	movq	-112(%rbp), %rax
	movl	-160(%rbp), %edx
	movslq	%edx, %rsi
	movl	-164(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%r12, %rsi
	shrq	$3, %rsi
	movq	-88(%rbp), %rax
	movl	-160(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-164(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movq	(%rax,%rcx,8), %rax
	cmpq	%rax, %rdx
	je	.L24
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L25
.L24:
	addl	$1, -160(%rbp)
.L23:
	movl	-188(%rbp), %eax
	cmpl	%eax, -160(%rbp)
	jl	.L26
	addl	$1, -164(%rbp)
.L22:
	movl	-188(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L27
	movl	$0, -156(%rbp)
	jmp	.L28
.L34:
	movl	$0, -152(%rbp)
	jmp	.L29
.L33:
	movl	$0, -148(%rbp)
	jmp	.L30
.L32:
	movl	-156(%rbp), %eax
	cmpl	-152(%rbp), %eax
	je	.L31
	movl	-156(%rbp), %eax
	cmpl	-148(%rbp), %eax
	je	.L31
	movl	-152(%rbp), %eax
	cmpl	-148(%rbp), %eax
	je	.L31
	movq	-208(%rbp), %r15
	movq	%r15, %rcx
	shrq	$3, %rcx
	movq	-112(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rsi
	movl	-156(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%r15, %rsi
	shrq	$3, %rsi
	movq	-112(%rbp), %rax
	movl	-148(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-156(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movq	(%rax,%rcx,8), %rdi
	movq	%r15, %rsi
	shrq	$3, %rsi
	movq	-112(%rbp), %rax
	movl	-152(%rbp), %ecx
	movslq	%ecx, %r8
	movl	-148(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%r8, %rcx
	movq	(%rax,%rcx,8), %rax
	addq	%rdi, %rax
	cmpq	%rax, %rdx
	jne	.L31
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-64(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rsi
	movl	-156(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	$0, (%rax,%rdx,8)
.L31:
	addl	$1, -148(%rbp)
.L30:
	movl	-188(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	jl	.L32
	addl	$1, -152(%rbp)
.L29:
	movl	-188(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L33
	addl	$1, -156(%rbp)
.L28:
	movl	-188(%rbp), %eax
	cmpl	%eax, -156(%rbp)
	jl	.L34
	movl	$0, -144(%rbp)
	jmp	.L35
.L39:
	movl	$0, -140(%rbp)
	jmp	.L36
.L38:
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-64(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rsi
	movl	-144(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	$1, %rax
	jne	.L37
	movq	-208(%rbp), %rcx
	shrq	$3, %rcx
	movq	-112(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rsi
	movl	-144(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -136(%rbp)
.L37:
	addl	$1, -140(%rbp)
.L36:
	movl	-188(%rbp), %eax
	cmpl	%eax, -140(%rbp)
	jl	.L38
	addl	$1, -144(%rbp)
.L35:
	movl	-188(%rbp), %eax
	cmpl	%eax, -144(%rbp)
	jl	.L39
	movq	-136(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L25:
	movq	-408(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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:
