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 h,w;
    scanf("%d%d",&h,&w);
    int c[10][10];
    int a[h][w];
    
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            scanf("%d",&c[i][j]);
        }
    }
    
    long long ans=0;
    for(int k=0;k<10;k++){
        for(int i=0;i<10;i++){
            for(int j=0;j<10;j++){
                if(c[i][j]>c[i][k]+c[k][j]){
                    c[i][j]=c[i][k]+c[k][j];   
                }
            }
        }
    }
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            scanf("%d",&a[i][j]);
            if(a[i][j]>-1){
                ans+=c[a[i][j]][1];
            }
        }
    }
    printf("%lld",ans);
    
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld"
	.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	$568, %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, -600(%rbp)
	leaq	-528(%rbp), %rdx
	leaq	-532(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-528(%rbp), %ecx
	movl	-532(%rbp), %esi
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -488(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -592(%rbp)
	movq	$0, -584(%rbp)
	movslq	%ecx, %rax
	leaq	0(,%rax,4), %rbx
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -480(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -560(%rbp)
	movq	$0, -552(%rbp)
	movslq	%esi, %rax
	movq	%rax, -576(%rbp)
	movq	$0, -568(%rbp)
	movq	-560(%rbp), %r8
	movq	-552(%rbp), %r9
	movq	%r9, %rdx
	movq	-576(%rbp), %r10
	movq	-568(%rbp), %r11
	imulq	%r10, %rdx
	movq	%r11, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r8, %rax
	mulq	%r10
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%esi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rdx
	movslq	%esi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %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
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -472(%rbp)
	movl	$0, -524(%rbp)
	jmp	.L5
.L8:
	movl	$0, -520(%rbp)
	jmp	.L6
.L7:
	leaq	-464(%rbp), %rcx
	movl	-520(%rbp), %eax
	movslq	%eax, %rsi
	movl	-524(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -520(%rbp)
.L6:
	cmpl	$9, -520(%rbp)
	jle	.L7
	addl	$1, -524(%rbp)
.L5:
	cmpl	$9, -524(%rbp)
	jle	.L8
	movq	$0, -496(%rbp)
	movl	$0, -516(%rbp)
	jmp	.L9
.L15:
	movl	$0, -512(%rbp)
	jmp	.L10
.L14:
	movl	$0, -508(%rbp)
	jmp	.L11
.L13:
	movl	-508(%rbp), %eax
	movslq	%eax, %rcx
	movl	-512(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-464(%rbp,%rax,4), %ecx
	movl	-516(%rbp), %eax
	movslq	%eax, %rsi
	movl	-512(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-464(%rbp,%rax,4), %esi
	movl	-508(%rbp), %eax
	movslq	%eax, %rdi
	movl	-516(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	movl	-464(%rbp,%rax,4), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jle	.L12
	movl	-516(%rbp), %eax
	movslq	%eax, %rcx
	movl	-512(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-464(%rbp,%rax,4), %ecx
	movl	-508(%rbp), %eax
	movslq	%eax, %rsi
	movl	-516(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-464(%rbp,%rax,4), %eax
	addl	%eax, %ecx
	movl	-508(%rbp), %eax
	movslq	%eax, %rsi
	movl	-512(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	%ecx, -464(%rbp,%rax,4)
.L12:
	addl	$1, -508(%rbp)
.L11:
	cmpl	$9, -508(%rbp)
	jle	.L13
	addl	$1, -512(%rbp)
.L10:
	cmpl	$9, -512(%rbp)
	jle	.L14
	addl	$1, -516(%rbp)
.L9:
	cmpl	$9, -516(%rbp)
	jle	.L15
	movl	$0, -504(%rbp)
	jmp	.L16
.L20:
	movl	$0, -500(%rbp)
	jmp	.L17
.L19:
	movq	%rbx, %rdx
	shrq	$2, %rdx
	movl	-500(%rbp), %eax
	movslq	%eax, %rcx
	movl	-504(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-472(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-472(%rbp), %rax
	movl	-500(%rbp), %edx
	movslq	%edx, %rsi
	movl	-504(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	testl	%eax, %eax
	js	.L18
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-472(%rbp), %rax
	movl	-500(%rbp), %edx
	movslq	%edx, %rsi
	movl	-504(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	-48(%rax), %rax
	addq	%rbp, %rax
	subq	$412, %rax
	movl	(%rax), %eax
	cltq
	addq	%rax, -496(%rbp)
.L18:
	addl	$1, -500(%rbp)
.L17:
	movl	-528(%rbp), %eax
	cmpl	%eax, -500(%rbp)
	jl	.L19
	addl	$1, -504(%rbp)
.L16:
	movl	-532(%rbp), %eax
	cmpl	%eax, -504(%rbp)
	jl	.L20
	movq	-496(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-600(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld"
	.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	-468(%rbp), %rdx
	leaq	-472(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$472, %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	-468(%rbp), %rdx
	movq	%rsp, %rcx
	leaq	0(,%rdx,4), %rax
	movq	%rax, -488(%rbp)
	movslq	-472(%rbp), %rax
	imulq	%rdx, %rax
	leaq	15(,%rax,4), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	subq	%rdx, %rcx
	andq	$-16, %rax
	cmpq	%rcx, %rsp
	je	.L3
.L39:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L39
.L3:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L40
.L4:
	movq	%rsp, -504(%rbp)
	leaq	-464(%rbp), %r13
	leaq	-24(%rbp), %r14
	leaq	-424(%rbp), %r12
	leaq	.LC1(%rip), %rbx
.L5:
	leaq	-40(%r12), %r15
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__isoc99_scanf@PLT
	cmpq	%r12, %r15
	jne	.L6
	leaq	40(%r15), %r12
	cmpq	%r14, %r12
	jne	.L5
	leaq	400(%r13), %r8
	movq	%r13, %r9
	movq	%r13, %rcx
.L19:
	movq	%r9, %rsi
	movq	%r13, %rax
	.p2align 4,,10
	.p2align 3
.L18:
	movl	(%rsi), %edx
	movl	(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, (%rax)
	jle	.L8
	movl	%edi, (%rax)
	movl	(%rsi), %edx
.L8:
	movl	4(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, 4(%rax)
	jle	.L9
	movl	%edi, 4(%rax)
	movl	(%rsi), %edx
.L9:
	movl	8(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, 8(%rax)
	jle	.L10
	movl	%edi, 8(%rax)
	movl	(%rsi), %edx
.L10:
	movl	12(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, 12(%rax)
	jle	.L11
	movl	%edi, 12(%rax)
	movl	(%rsi), %edx
.L11:
	movl	16(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, 16(%rax)
	jle	.L12
	movl	%edi, 16(%rax)
	movl	(%rsi), %edx
.L12:
	movl	20(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, 20(%rax)
	jle	.L13
	movl	%edi, 20(%rax)
	movl	(%rsi), %edx
.L13:
	movl	24(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, 24(%rax)
	jle	.L14
	movl	%edi, 24(%rax)
	movl	(%rsi), %edx
.L14:
	movl	28(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, 28(%rax)
	jle	.L15
	movl	%edi, 28(%rax)
	movl	(%rsi), %edx
.L15:
	movl	32(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, 32(%rax)
	jle	.L16
	movl	%edi, 32(%rax)
	movl	(%rsi), %edx
.L16:
	addl	36(%rcx), %edx
	cmpl	%edx, 36(%rax)
	jle	.L17
	movl	%edx, 36(%rax)
.L17:
	addq	$40, %rax
	addq	$40, %rsi
	cmpq	%r8, %rax
	jne	.L18
	addq	$40, %rcx
	addq	$4, %r9
	cmpq	%rax, %rcx
	jne	.L19
	movl	-472(%rbp), %eax
	testl	%eax, %eax
	jle	.L28
	movq	-488(%rbp), %rax
	xorl	%r14d, %r14d
	xorl	%r12d, %r12d
	movl	$0, -488(%rbp)
	shrq	$2, %rax
	movq	%rax, -496(%rbp)
	movl	-468(%rbp), %eax
	testl	%eax, %eax
	jle	.L20
.L25:
	movq	-504(%rbp), %rax
	xorl	%r15d, %r15d
	leaq	(%rax,%r14,4), %r13
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	0(%r13), %rax
	testl	%eax, %eax
	js	.L22
	leaq	(%rax,%rax,4), %rax
	movslq	-460(%rbp,%rax,8), %rax
	addq	%rax, %r12
.L22:
	movl	-468(%rbp), %eax
	addl	$1, %r15d
	addq	$4, %r13
	cmpl	%r15d, %eax
	jg	.L23
	addl	$1, -488(%rbp)
	movl	-488(%rbp), %esi
	cmpl	%esi, -472(%rbp)
	jle	.L20
	addq	-496(%rbp), %r14
	testl	%eax, %eax
	jg	.L25
.L20:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L41
	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
.L40:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rax)
	jmp	.L4
.L28:
	xorl	%r12d, %r12d
	jmp	.L20
.L41:
	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"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld"
	.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	-468(%rbp), %rdx
	leaq	-472(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$472, %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	-468(%rbp), %rdx
	movq	%rsp, %rcx
	leaq	0(,%rdx,4), %rax
	movq	%rax, -488(%rbp)
	movslq	-472(%rbp), %rax
	imulq	%rdx, %rax
	leaq	15(,%rax,4), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	subq	%rdx, %rcx
	andq	$-16, %rax
	cmpq	%rcx, %rsp
	je	.L3
.L39:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L39
.L3:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L40
.L4:
	movq	%rsp, -504(%rbp)
	leaq	-464(%rbp), %r13
	leaq	-24(%rbp), %r14
	leaq	-424(%rbp), %r12
	leaq	.LC1(%rip), %rbx
.L5:
	leaq	-40(%r12), %r15
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__isoc99_scanf@PLT
	cmpq	%r12, %r15
	jne	.L6
	leaq	40(%r15), %r12
	cmpq	%r14, %r12
	jne	.L5
	leaq	400(%r13), %r8
	movq	%r13, %r9
	movq	%r13, %rcx
.L19:
	movq	%r9, %rsi
	movq	%r13, %rax
	.p2align 4,,10
	.p2align 3
.L18:
	movl	(%rsi), %edx
	movl	(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, (%rax)
	jle	.L8
	movl	%edi, (%rax)
	movl	(%rsi), %edx
.L8:
	movl	4(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, 4(%rax)
	jle	.L9
	movl	%edi, 4(%rax)
	movl	(%rsi), %edx
.L9:
	movl	8(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, 8(%rax)
	jle	.L10
	movl	%edi, 8(%rax)
	movl	(%rsi), %edx
.L10:
	movl	12(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, 12(%rax)
	jle	.L11
	movl	%edi, 12(%rax)
	movl	(%rsi), %edx
.L11:
	movl	16(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, 16(%rax)
	jle	.L12
	movl	%edi, 16(%rax)
	movl	(%rsi), %edx
.L12:
	movl	20(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, 20(%rax)
	jle	.L13
	movl	%edi, 20(%rax)
	movl	(%rsi), %edx
.L13:
	movl	24(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, 24(%rax)
	jle	.L14
	movl	%edi, 24(%rax)
	movl	(%rsi), %edx
.L14:
	movl	28(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, 28(%rax)
	jle	.L15
	movl	%edi, 28(%rax)
	movl	(%rsi), %edx
.L15:
	movl	32(%rcx), %edi
	addl	%edx, %edi
	cmpl	%edi, 32(%rax)
	jle	.L16
	movl	%edi, 32(%rax)
	movl	(%rsi), %edx
.L16:
	addl	36(%rcx), %edx
	cmpl	%edx, 36(%rax)
	jle	.L17
	movl	%edx, 36(%rax)
.L17:
	addq	$40, %rax
	addq	$40, %rsi
	cmpq	%r8, %rax
	jne	.L18
	addq	$40, %rcx
	addq	$4, %r9
	cmpq	%rax, %rcx
	jne	.L19
	movl	-472(%rbp), %eax
	testl	%eax, %eax
	jle	.L28
	movq	-488(%rbp), %rax
	xorl	%r14d, %r14d
	xorl	%r12d, %r12d
	movl	$0, -488(%rbp)
	shrq	$2, %rax
	movq	%rax, -496(%rbp)
	movl	-468(%rbp), %eax
	testl	%eax, %eax
	jle	.L20
.L25:
	movq	-504(%rbp), %rax
	xorl	%r15d, %r15d
	leaq	(%rax,%r14,4), %r13
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	0(%r13), %rax
	testl	%eax, %eax
	js	.L22
	leaq	(%rax,%rax,4), %rax
	movslq	-460(%rbp,%rax,8), %rax
	addq	%rax, %r12
.L22:
	movl	-468(%rbp), %eax
	addl	$1, %r15d
	addq	$4, %r13
	cmpl	%r15d, %eax
	jg	.L23
	addl	$1, -488(%rbp)
	movl	-488(%rbp), %esi
	cmpl	%esi, -472(%rbp)
	jle	.L20
	addq	-496(%rbp), %r14
	testl	%eax, %eax
	jg	.L25
.L20:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L41
	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
.L40:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rax)
	jmp	.L4
.L28:
	xorl	%r12d, %r12d
	jmp	.L20
.L41:
	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 h,w;
    scanf("%d%d",&h,&w);
    int c[10][10];
    int a[h][w];
    
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            scanf("%d",&c[i][j]);
        }
    }
    
    long long ans=0;
    for(int k=0;k<10;k++){
        for(int i=0;i<10;i++){
            for(int j=0;j<10;j++){
                if(c[i][j]>c[i][k]+c[k][j]){
                    c[i][j]=c[i][k]+c[k][j];   
                }
            }
        }
    }
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            scanf("%d",&a[i][j]);
            if(a[i][j]>-1){
                ans+=c[a[i][j]][1];
            }
        }
    }
    printf("%lld",ans);
    
    return 0;
}

2 4
0 9 9 9 9 9 9 9 9 9
9 0 9 9 9 9 9 9 9 9
9 9 0 9 9 9 9 9 9 9
9 9 9 0 2 9 9 9 9 9
9 9 9 9 0 9 9 9 9 2
9 9 9 9 9 0 9 9 9 9
9 9 9 9 9 9 0 9 9 9
9 9 9 9 9 9 9 0 9 9
9 9 9 9 2 9 9 9 0 9
9 2 9 9 9 9 9 9 9 0
-1 -1 -1 -1
8 1 1 8
 3 5
0 4 3 6 2 7 2 5 3 3
4 0 5 3 7 5 3 7 2 7
5 7 0 7 2 9 3 2 9 1
3 6 2 0 2 7 6 4 2 3
3 5 7 4 0 6 9 7 6 7
9 8 5 2 2 0 4 7 6 5
5 4 6 3 2 3 0 5 4 3
3 6 2 3 4 2 4 0 8 9
4 6 5 4 3 5 3 2 0 8
2 1 3 4 5 7 8 6 4 0
3 5 2 6 1
2 5 3 2 1
6 9 2 5 6
 5 5
0 999 999 999 999 999 999 999 999 999
999 0 999 999 999 999 999 999 999 999
999 999 0 999 999 999 999 999 999 999
999 999 999 0 999 999 999 999 999 999
999 999 999 999 0 999 999 999 999 999
999 999 999 999 999 0 999 999 999 999
999 999 999 999 999 999 0 999 999 999
999 999 999 999 999 999 999 0 999 1330
999 999 999 999 999 999 999 999 0 999
999 999 999 999 999 999 999 999 999 0
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
 5 5
0 999 999 999 999 999 999 999 999 999
999 0 999 999 999 999 999 999 999 999
999 999 0 999 999 999 999 999 999 999
999 334 999 0 999 999 999 999 999 999
999 999 999 999 0 999 999 999 999 999
999 999 999 999 999 0 999 577 999 999
999 999 999 999 117 999 0 999 999 999
999 999 999 999 999 999 999 0 999 1330
999 999 999 999 999 999 999 999 0 999
999 999 999 999 999 999 999 999 999 0
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 0 1 1 1
1 1 1 1 1
 3 5
0 4 3 6 2 7 2 5 3 0
4 0 5 3 12 5 3 7 2 7
5 7 0 7 2 9 1 2 9 1
3 6 2 0 2 7 6 4 2 3
3 5 7 4 0 6 9 7 6 7
9 8 5 2 2 0 4 7 6 5
5 4 6 3 2 3 0 5 4 3
3 6 2 0 4 2 4 0 8 9
4 6 5 4 3 5 3 2 0 8
2 1 3 4 5 7 8 6 4 0
0 5 2 6 1
2 5 3 2 1
6 9 2 5 6
 2 4
0 9 9 9 9 9 9 9 13 9
9 0 9 9 9 9 9 9 9 9
9 9 0 9 9 9 9 9 9 9
9 9 9 0 2 9 9 9 9 9
9 9 9 9 0 9 9 9 9 2
9 9 9 9 15 0 9 9 9 9
9 9 9 9 9 9 0 9 9 9
9 9 9 9 9 2 9 0 9 9
9 9 9 5 2 9 9 9 0 9
9 2 9 9 9 9 2 9 9 0
-1 -1 -1 -1
0 1 1 8
 3 5
0 4 3 6 2 7 2 5 3 0
4 0 5 3 12 5 3 7 2 7
5 7 0 7 2 9 1 2 9 0
3 6 2 0 2 7 6 4 2 3
3 5 7 4 0 6 9 7 6 7
9 8 5 2 2 0 4 7 6 5
5 4 6 3 2 3 0 5 4 3
3 6 2 0 4 2 4 0 8 9
4 6 5 4 3 5 3 2 0 8
2 1 3 4 5 7 8 6 4 0
0 5 2 6 1
2 5 3 2 1
6 9 2 5 6
 5 5
0 999 999 999 999 999 999 999 999 999
999 0 999 999 999 999 999 999 999 999
999 999 0 999 999 999 999 999 999 999
999 334 999 0 999 999 999 999 999 999
999 999 999 999 0 999 999 202 999 999
999 999 999 999 999 0 999 577 999 999
999 999 999 999 117 999 0 999 999 999
999 999 999 999 999 999 999 0 999 1330
999 999 999 999 999 999 999 999 0 999
999 999 999 999 999 999 999 999 999 0
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 0 1 1 1
1 0 1 1 1
 2 4
0 9 9 9 9 9 9 9 13 9
9 0 9 9 9 9 9 9 9 9
9 9 0 9 9 9 9 9 9 9
9 9 9 0 2 9 9 9 9 9
9 9 9 9 0 9 9 9 9 1
9 9 9 15 15 0 9 9 9 9
9 9 9 9 9 9 0 9 9 9
9 9 9 9 9 2 9 0 9 9
9 9 9 5 2 9 9 9 0 9
9 2 9 9 9 9 2 9 9 0
-1 -1 -1 -1
0 1 1 8
 3 5
0 4 3 6 2 7 2 5 3 0
4 0 5 3 12 5 3 7 2 11
5 7 0 7 2 9 1 2 9 0
3 6 2 0 2 7 6 4 2 3
3 5 7 4 0 6 9 7 6 7
9 8 5 2 2 0 4 7 6 5
5 4 6 3 2 3 0 5 4 3
3 6 2 0 4 2 4 0 8 9
4 6 5 4 3 5 3 2 0 8
2 1 3 4 5 7 8 6 4 0
0 5 2 6 1
2 5 3 2 1
6 9 2 6 6

12 47 0 999 44 15 36 1998 14 35
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 h,w;
    scanf("%d%d",&h,&w);
    int c[10][10];
    int a[h][w];
    
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            scanf("%d",&c[i][j]);
        }
    }
    
    long long ans=0;
    for(int k=0;k<10;k++){
        for(int i=0;i<10;i++){
            for(int j=0;j<10;j++){
                if(c[i][j]>c[i][k]+c[k][j]){
                    c[i][j]=c[i][k]+c[k][j];   
                }
            }
        }
    }
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            scanf("%d",&a[i][j]);
            if(a[i][j]>-1){
                ans+=c[a[i][j]][1];
            }
        }
    }
    printf("%lld",ans);
    
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld"
	.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	$568, %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, -600(%rbp)
	leaq	-528(%rbp), %rdx
	leaq	-532(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-528(%rbp), %ecx
	movl	-532(%rbp), %esi
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -488(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -592(%rbp)
	movq	$0, -584(%rbp)
	movslq	%ecx, %rax
	leaq	0(,%rax,4), %rbx
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -480(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -560(%rbp)
	movq	$0, -552(%rbp)
	movslq	%esi, %rax
	movq	%rax, -576(%rbp)
	movq	$0, -568(%rbp)
	movq	-560(%rbp), %r8
	movq	-552(%rbp), %r9
	movq	%r9, %rdx
	movq	-576(%rbp), %r10
	movq	-568(%rbp), %r11
	imulq	%r10, %rdx
	movq	%r11, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r8, %rax
	mulq	%r10
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%esi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rdx
	movslq	%esi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %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
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -472(%rbp)
	movl	$0, -524(%rbp)
	jmp	.L5
.L8:
	movl	$0, -520(%rbp)
	jmp	.L6
.L7:
	leaq	-464(%rbp), %rcx
	movl	-520(%rbp), %eax
	movslq	%eax, %rsi
	movl	-524(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -520(%rbp)
.L6:
	cmpl	$9, -520(%rbp)
	jle	.L7
	addl	$1, -524(%rbp)
.L5:
	cmpl	$9, -524(%rbp)
	jle	.L8
	movq	$0, -496(%rbp)
	movl	$0, -516(%rbp)
	jmp	.L9
.L15:
	movl	$0, -512(%rbp)
	jmp	.L10
.L14:
	movl	$0, -508(%rbp)
	jmp	.L11
.L13:
	movl	-508(%rbp), %eax
	movslq	%eax, %rcx
	movl	-512(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-464(%rbp,%rax,4), %ecx
	movl	-516(%rbp), %eax
	movslq	%eax, %rsi
	movl	-512(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-464(%rbp,%rax,4), %esi
	movl	-508(%rbp), %eax
	movslq	%eax, %rdi
	movl	-516(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	movl	-464(%rbp,%rax,4), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jle	.L12
	movl	-516(%rbp), %eax
	movslq	%eax, %rcx
	movl	-512(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-464(%rbp,%rax,4), %ecx
	movl	-508(%rbp), %eax
	movslq	%eax, %rsi
	movl	-516(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-464(%rbp,%rax,4), %eax
	addl	%eax, %ecx
	movl	-508(%rbp), %eax
	movslq	%eax, %rsi
	movl	-512(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	%ecx, -464(%rbp,%rax,4)
.L12:
	addl	$1, -508(%rbp)
.L11:
	cmpl	$9, -508(%rbp)
	jle	.L13
	addl	$1, -512(%rbp)
.L10:
	cmpl	$9, -512(%rbp)
	jle	.L14
	addl	$1, -516(%rbp)
.L9:
	cmpl	$9, -516(%rbp)
	jle	.L15
	movl	$0, -504(%rbp)
	jmp	.L16
.L20:
	movl	$0, -500(%rbp)
	jmp	.L17
.L19:
	movq	%rbx, %rdx
	shrq	$2, %rdx
	movl	-500(%rbp), %eax
	movslq	%eax, %rcx
	movl	-504(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-472(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-472(%rbp), %rax
	movl	-500(%rbp), %edx
	movslq	%edx, %rsi
	movl	-504(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	testl	%eax, %eax
	js	.L18
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-472(%rbp), %rax
	movl	-500(%rbp), %edx
	movslq	%edx, %rsi
	movl	-504(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	-48(%rax), %rax
	addq	%rbp, %rax
	subq	$412, %rax
	movl	(%rax), %eax
	cltq
	addq	%rax, -496(%rbp)
.L18:
	addl	$1, -500(%rbp)
.L17:
	movl	-528(%rbp), %eax
	cmpl	%eax, -500(%rbp)
	jl	.L19
	addl	$1, -504(%rbp)
.L16:
	movl	-532(%rbp), %eax
	cmpl	%eax, -504(%rbp)
	jl	.L20
	movq	-496(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-600(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld"
	.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	$568, %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, -600(%rbp)
	leaq	-528(%rbp), %rdx
	leaq	-532(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-528(%rbp), %ecx
	movl	-532(%rbp), %esi
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -488(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -592(%rbp)
	movq	$0, -584(%rbp)
	movslq	%ecx, %rax
	leaq	0(,%rax,4), %rbx
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -480(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -560(%rbp)
	movq	$0, -552(%rbp)
	movslq	%esi, %rax
	movq	%rax, -576(%rbp)
	movq	$0, -568(%rbp)
	movq	-560(%rbp), %r8
	movq	-552(%rbp), %r9
	movq	%r9, %rdx
	movq	-576(%rbp), %r10
	movq	-568(%rbp), %r11
	imulq	%r10, %rdx
	movq	%r11, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r8, %rax
	mulq	%r10
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%esi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rdx
	movslq	%esi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %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
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -472(%rbp)
	movl	$0, -524(%rbp)
	jmp	.L5
.L8:
	movl	$0, -520(%rbp)
	jmp	.L6
.L7:
	leaq	-464(%rbp), %rcx
	movl	-520(%rbp), %eax
	movslq	%eax, %rsi
	movl	-524(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -520(%rbp)
.L6:
	cmpl	$9, -520(%rbp)
	jle	.L7
	addl	$1, -524(%rbp)
.L5:
	cmpl	$9, -524(%rbp)
	jle	.L8
	movq	$0, -496(%rbp)
	movl	$0, -516(%rbp)
	jmp	.L9
.L15:
	movl	$0, -512(%rbp)
	jmp	.L10
.L14:
	movl	$0, -508(%rbp)
	jmp	.L11
.L13:
	movl	-508(%rbp), %eax
	movslq	%eax, %rcx
	movl	-512(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-464(%rbp,%rax,4), %ecx
	movl	-516(%rbp), %eax
	movslq	%eax, %rsi
	movl	-512(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-464(%rbp,%rax,4), %esi
	movl	-508(%rbp), %eax
	movslq	%eax, %rdi
	movl	-516(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	movl	-464(%rbp,%rax,4), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jle	.L12
	movl	-516(%rbp), %eax
	movslq	%eax, %rcx
	movl	-512(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-464(%rbp,%rax,4), %ecx
	movl	-508(%rbp), %eax
	movslq	%eax, %rsi
	movl	-516(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-464(%rbp,%rax,4), %eax
	addl	%eax, %ecx
	movl	-508(%rbp), %eax
	movslq	%eax, %rsi
	movl	-512(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	%ecx, -464(%rbp,%rax,4)
.L12:
	addl	$1, -508(%rbp)
.L11:
	cmpl	$9, -508(%rbp)
	jle	.L13
	addl	$1, -512(%rbp)
.L10:
	cmpl	$9, -512(%rbp)
	jle	.L14
	addl	$1, -516(%rbp)
.L9:
	cmpl	$9, -516(%rbp)
	jle	.L15
	movl	$0, -504(%rbp)
	jmp	.L16
.L20:
	movl	$0, -500(%rbp)
	jmp	.L17
.L19:
	movq	%rbx, %rdx
	shrq	$2, %rdx
	movl	-500(%rbp), %eax
	movslq	%eax, %rcx
	movl	-504(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-472(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-472(%rbp), %rax
	movl	-500(%rbp), %edx
	movslq	%edx, %rsi
	movl	-504(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	testl	%eax, %eax
	js	.L18
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-472(%rbp), %rax
	movl	-500(%rbp), %edx
	movslq	%edx, %rsi
	movl	-504(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	-48(%rax), %rax
	addq	%rbp, %rax
	subq	$412, %rax
	movl	(%rax), %eax
	cltq
	addq	%rax, -496(%rbp)
.L18:
	addl	$1, -500(%rbp)
.L17:
	movl	-528(%rbp), %eax
	cmpl	%eax, -500(%rbp)
	jl	.L19
	addl	$1, -504(%rbp)
.L16:
	movl	-532(%rbp), %eax
	cmpl	%eax, -504(%rbp)
	jl	.L20
	movq	-496(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-600(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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:
