Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<stdlib.h>

#define MIN(a,b) ((a)<(b)?(a):(b))

void run(void){
  int h,w;
  scanf("%d%d",&h,&w);
  int c[100];
  const int f=10;
  int i,j,k;
  for(i=0;i<f*f;i++) scanf("%d",c+i);
  for(k=0;k<f;k++){
    for(i=0;i<f;i++){
      for(j=0;j<f;j++){
	c[i*f+j]=MIN(c[i*f+j],c[i*f+k]+c[k*f+j]);
      }
    }
  }
  int ans=0;
  for(i=0;i<h*w;i++){
    int a;
    scanf("%d",&a);
    if(a<0) continue;
    ans+=c[a*f+1];
  }
  printf("%d\n",ans);
}

int main(void){
  run();
  return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	leaq	16(%rsp), %r12
	leaq	416(%rsp), %rbx
	movq	%r12, %r13
	call	__isoc99_scanf@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %r13
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r13
	jne	.L2
	movq	%r12, %rcx
	movq	%r12, %r8
	xorl	%edi, %edi
.L3:
	movq	%r12, %rax
	movq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%rax), %r9d
	movl	(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	4(%rax), %r9d
	movl	%esi, (%rax)
	movl	4(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	8(%rax), %r9d
	movl	%esi, 4(%rax)
	movl	8(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	12(%rax), %r9d
	movl	%esi, 8(%rax)
	movl	12(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	16(%rax), %r9d
	movl	%esi, 12(%rax)
	movl	16(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	20(%rax), %r9d
	movl	%esi, 16(%rax)
	movl	20(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	24(%rax), %r9d
	movl	%esi, 20(%rax)
	movl	24(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	28(%rax), %r9d
	movl	%esi, 24(%rax)
	movl	28(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	%esi, 28(%rax)
	movl	32(%rcx), %esi
	movl	32(%rax), %r9d
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	36(%rax), %r9d
	movl	%esi, 32(%rax)
	movl	36(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	addq	$40, %rax
	addq	$40, %rdx
	movl	%esi, -4(%rax)
	cmpq	%rbx, %rax
	jne	.L4
	addl	$1, %edi
	addq	$4, %r8
	addq	$40, %rcx
	cmpl	$10, %edi
	jne	.L3
	movl	8(%rsp), %eax
	imull	4(%rsp), %eax
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	leaq	12(%rsp), %rbx
	testl	%eax, %eax
	jle	.L6
.L5:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	js	.L7
	leal	(%rax,%rax,4), %eax
	leal	1(%rax,%rax), %eax
	cltq
	addl	16(%rsp,%rax,4), %r12d
.L7:
	movl	4(%rsp), %eax
	imull	8(%rsp), %eax
	addl	$1, %r13d
	cmpl	%r13d, %eax
	jg	.L5
.L6:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	leaq	16(%rsp), %r12
	leaq	416(%rsp), %rbx
	movq	%r12, %r13
	call	__isoc99_scanf@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %r13
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r13
	jne	.L2
	movq	%r12, %rcx
	movq	%r12, %r8
	xorl	%edi, %edi
.L3:
	movq	%r12, %rax
	movq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%rax), %r9d
	movl	(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	4(%rax), %r9d
	movl	%esi, (%rax)
	movl	4(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	8(%rax), %r9d
	movl	%esi, 4(%rax)
	movl	8(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	12(%rax), %r9d
	movl	%esi, 8(%rax)
	movl	12(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	16(%rax), %r9d
	movl	%esi, 12(%rax)
	movl	16(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	20(%rax), %r9d
	movl	%esi, 16(%rax)
	movl	20(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	24(%rax), %r9d
	movl	%esi, 20(%rax)
	movl	24(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	28(%rax), %r9d
	movl	%esi, 24(%rax)
	movl	28(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	%esi, 28(%rax)
	movl	32(%rcx), %esi
	movl	32(%rax), %r9d
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	36(%rax), %r9d
	movl	%esi, 32(%rax)
	movl	36(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	addq	$40, %rax
	addq	$40, %rdx
	movl	%esi, -4(%rax)
	cmpq	%rbx, %rax
	jne	.L4
	addl	$1, %edi
	addq	$4, %r8
	addq	$40, %rcx
	cmpl	$10, %edi
	jne	.L3
	movl	8(%rsp), %eax
	imull	4(%rsp), %eax
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	leaq	12(%rsp), %rbx
	testl	%eax, %eax
	jle	.L6
.L5:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	js	.L7
	leal	(%rax,%rax,4), %eax
	leal	1(%rax,%rax), %eax
	cltq
	addl	16(%rsp,%rax,4), %r12d
.L7:
	movl	4(%rsp), %eax
	imull	8(%rsp), %eax
	addl	$1, %r13d
	cmpl	%r13d, %eax
	jg	.L5
.L6:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	leaq	16(%rsp), %r12
	leaq	416(%rsp), %rbx
	movq	%r12, %r13
	call	__isoc99_scanf@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %r13
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r13
	jne	.L2
	movq	%r12, %rcx
	movq	%r12, %r8
	xorl	%edi, %edi
.L3:
	movq	%r12, %rax
	movq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%rax), %r9d
	movl	(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	4(%rax), %r9d
	movl	%esi, (%rax)
	movl	4(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	8(%rax), %r9d
	movl	%esi, 4(%rax)
	movl	8(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	12(%rax), %r9d
	movl	%esi, 8(%rax)
	movl	12(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	16(%rax), %r9d
	movl	%esi, 12(%rax)
	movl	16(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	20(%rax), %r9d
	movl	%esi, 16(%rax)
	movl	20(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	24(%rax), %r9d
	movl	%esi, 20(%rax)
	movl	24(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	28(%rax), %r9d
	movl	%esi, 24(%rax)
	movl	28(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	%esi, 28(%rax)
	movl	32(%rcx), %esi
	movl	32(%rax), %r9d
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	36(%rax), %r9d
	movl	%esi, 32(%rax)
	movl	36(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	addq	$40, %rax
	addq	$40, %rdx
	movl	%esi, -4(%rax)
	cmpq	%rbx, %rax
	jne	.L4
	addl	$1, %edi
	addq	$4, %r8
	addq	$40, %rcx
	cmpl	$10, %edi
	jne	.L3
	movl	8(%rsp), %eax
	imull	4(%rsp), %eax
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	leaq	12(%rsp), %rbx
	testl	%eax, %eax
	jle	.L6
.L5:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	js	.L7
	leal	(%rax,%rax,4), %eax
	leal	1(%rax,%rax), %eax
	cltq
	addl	16(%rsp,%rax,4), %r12d
.L7:
	movl	4(%rsp), %eax
	imull	8(%rsp), %eax
	addl	$1, %r13d
	cmpl	%r13d, %eax
	jg	.L5
.L6:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.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:
```
```c
#include<stdio.h>
#include<stdlib.h>

#define MIN(a,b) ((a)<(b)?(a):(b))

void run(void){
  int h,w;
  scanf("%d%d",&h,&w);
  int c[100];
  const int f=10;
  int i,j,k;
  for(i=0;i<f*f;i++) scanf("%d",c+i);
  for(k=0;k<f;k++){
    for(i=0;i<f;i++){
      for(j=0;j<f;j++){
	c[i*f+j]=MIN(c[i*f+j],c[i*f+k]+c[k*f+j]);
      }
    }
  }
  int ans=0;
  for(i=0;i<h*w;i++){
    int a;
    scanf("%d",&a);
    if(a<0) continue;
    ans+=c[a*f+1];
  }
  printf("%d\n",ans);
}

int main(void){
  run();
  return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<stdlib.h>

#define MIN(a,b) ((a)<(b)?(a):(b))

void run(void){
  int h,w;
  scanf("%d%d",&h,&w);
  int c[100];
  const int f=10;
  int i,j,k;
  for(i=0;i<f*f;i++) scanf("%d",c+i);
  for(k=0;k<f;k++){
    for(i=0;i<f;i++){
      for(j=0;j<f;j++){
	c[i*f+j]=MIN(c[i*f+j],c[i*f+k]+c[k*f+j]);
      }
    }
  }
  int ans=0;
  for(i=0;i<h*w;i++){
    int a;
    scanf("%d",&a);
    if(a<0) continue;
    ans+=c[a*f+1];
  }
  printf("%d\n",ans);
}

int main(void){
  run();
  return 0;
}
```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<stdlib.h>

#define MIN(a,b) ((a)<(b)?(a):(b))

void run(void){
  int h,w;
  scanf("%d%d",&h,&w);
  int c[100];
  const int f=10;
  int i,j,k;
  for(i=0;i<f*f;i++) scanf("%d",c+i);
  for(k=0;k<f;k++){
    for(i=0;i<f;i++){
      for(j=0;j<f;j++){
	c[i*f+j]=MIN(c[i*f+j],c[i*f+k]+c[k*f+j]);
      }
    }
  }
  int ans=0;
  for(i=0;i<h*w;i++){
    int a;
    scanf("%d",&a);
    if(a<0) continue;
    ans+=c[a*f+1];
  }
  printf("%d\n",ans);
}

int main(void){
  run();
  return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	leaq	16(%rsp), %r12
	leaq	416(%rsp), %rbx
	movq	%r12, %r13
	call	__isoc99_scanf@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %r13
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r13
	jne	.L2
	movq	%r12, %rcx
	movq	%r12, %r8
	xorl	%edi, %edi
.L3:
	movq	%r12, %rax
	movq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%rax), %r9d
	movl	(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	4(%rax), %r9d
	movl	%esi, (%rax)
	movl	4(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	8(%rax), %r9d
	movl	%esi, 4(%rax)
	movl	8(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	12(%rax), %r9d
	movl	%esi, 8(%rax)
	movl	12(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	16(%rax), %r9d
	movl	%esi, 12(%rax)
	movl	16(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	20(%rax), %r9d
	movl	%esi, 16(%rax)
	movl	20(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	24(%rax), %r9d
	movl	%esi, 20(%rax)
	movl	24(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	28(%rax), %r9d
	movl	%esi, 24(%rax)
	movl	28(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	%esi, 28(%rax)
	movl	32(%rcx), %esi
	movl	32(%rax), %r9d
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	36(%rax), %r9d
	movl	%esi, 32(%rax)
	movl	36(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	addq	$40, %rax
	addq	$40, %rdx
	movl	%esi, -4(%rax)
	cmpq	%rbx, %rax
	jne	.L4
	addl	$1, %edi
	addq	$4, %r8
	addq	$40, %rcx
	cmpl	$10, %edi
	jne	.L3
	movl	8(%rsp), %eax
	imull	4(%rsp), %eax
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	leaq	12(%rsp), %rbx
	testl	%eax, %eax
	jle	.L6
.L5:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	js	.L7
	leal	(%rax,%rax,4), %eax
	leal	1(%rax,%rax), %eax
	cltq
	addl	16(%rsp,%rax,4), %r12d
.L7:
	movl	4(%rsp), %eax
	imull	8(%rsp), %eax
	addl	$1, %r13d
	cmpl	%r13d, %eax
	jg	.L5
.L6:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	leaq	16(%rsp), %r12
	leaq	416(%rsp), %rbx
	movq	%r12, %r13
	call	__isoc99_scanf@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %r13
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r13
	jne	.L2
	movq	%r12, %rcx
	movq	%r12, %r8
	xorl	%edi, %edi
.L3:
	movq	%r12, %rax
	movq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%rax), %r9d
	movl	(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	4(%rax), %r9d
	movl	%esi, (%rax)
	movl	4(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	8(%rax), %r9d
	movl	%esi, 4(%rax)
	movl	8(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	12(%rax), %r9d
	movl	%esi, 8(%rax)
	movl	12(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	16(%rax), %r9d
	movl	%esi, 12(%rax)
	movl	16(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	20(%rax), %r9d
	movl	%esi, 16(%rax)
	movl	20(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	24(%rax), %r9d
	movl	%esi, 20(%rax)
	movl	24(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	28(%rax), %r9d
	movl	%esi, 24(%rax)
	movl	28(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	%esi, 28(%rax)
	movl	32(%rcx), %esi
	movl	32(%rax), %r9d
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	36(%rax), %r9d
	movl	%esi, 32(%rax)
	movl	36(%rcx), %esi
	addl	(%rdx), %esi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	addq	$40, %rax
	addq	$40, %rdx
	movl	%esi, -4(%rax)
	cmpq	%rbx, %rax
	jne	.L4
	addl	$1, %edi
	addq	$4, %r8
	addq	$40, %rcx
	cmpl	$10, %edi
	jne	.L3
	movl	8(%rsp), %eax
	imull	4(%rsp), %eax
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	leaq	12(%rsp), %rbx
	testl	%eax, %eax
	jle	.L6
.L5:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	js	.L7
	leal	(%rax,%rax,4), %eax
	leal	1(%rax,%rax), %eax
	cltq
	addl	16(%rsp,%rax,4), %r12d
.L7:
	movl	4(%rsp), %eax
	imull	8(%rsp), %eax
	addl	$1, %r13d
	cmpl	%r13d, %eax
	jg	.L5
.L6:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.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:
```