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>
#define INF 1001001001
typedef long long ll;
int min(int x, int y) {
	return x > y ? y : x;
}
int max(int x, int y) {
	return x < y ? y : x;
}
int main() {
	int h, w, dp[10][10];
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			dp[i][j] = INF;
		}
	}
	scanf("%d%d", &h, &w);
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			scanf("%d", &dp[i][j]);
		}
	}
	for (int k = 0; k < 10; k++) {
		for (int i = 0; i < 10; i++) {
			for (int j = 0; j < 10; j++) {
				dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
			}
		}
	}
	int num[10] = {0};
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			int a;
			scanf("%d", &a);
			if (a != -1)
				num[a]++;
		}
	}
	ll ans = 0;
	for (int i = 0; i < 10; i++) {
		ans += (ll)dp[i][1] * num[i];
	}
	printf("%lld\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	min
	.type	min, @function
min:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.globl	max
	.type	max, @function
max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max, .-max
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$528, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -512(%rbp)
	jmp	.L6
.L9:
	movl	$0, -508(%rbp)
	jmp	.L7
.L8:
	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	$1001001001, -416(%rbp,%rax,4)
	addl	$1, -508(%rbp)
.L7:
	cmpl	$9, -508(%rbp)
	jle	.L8
	addl	$1, -512(%rbp)
.L6:
	cmpl	$9, -512(%rbp)
	jle	.L9
	leaq	-520(%rbp), %rdx
	leaq	-524(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -504(%rbp)
	jmp	.L10
.L13:
	movl	$0, -500(%rbp)
	jmp	.L11
.L12:
	leaq	-416(%rbp), %rcx
	movl	-500(%rbp), %eax
	movslq	%eax, %rsi
	movl	-504(%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, -500(%rbp)
.L11:
	cmpl	$9, -500(%rbp)
	jle	.L12
	addl	$1, -504(%rbp)
.L10:
	cmpl	$9, -504(%rbp)
	jle	.L13
	movl	$0, -496(%rbp)
	jmp	.L14
.L19:
	movl	$0, -492(%rbp)
	jmp	.L15
.L18:
	movl	$0, -488(%rbp)
	jmp	.L16
.L17:
	movl	-496(%rbp), %eax
	movslq	%eax, %rcx
	movl	-492(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-416(%rbp,%rax,4), %ecx
	movl	-488(%rbp), %eax
	movslq	%eax, %rsi
	movl	-496(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-416(%rbp,%rax,4), %eax
	leal	(%rcx,%rax), %edx
	movl	-488(%rbp), %eax
	movslq	%eax, %rsi
	movl	-492(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-416(%rbp,%rax,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, %edx
	movl	-488(%rbp), %eax
	movslq	%eax, %rsi
	movl	-492(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -488(%rbp)
.L16:
	cmpl	$9, -488(%rbp)
	jle	.L17
	addl	$1, -492(%rbp)
.L15:
	cmpl	$9, -492(%rbp)
	jle	.L18
	addl	$1, -496(%rbp)
.L14:
	cmpl	$9, -496(%rbp)
	jle	.L19
	movq	$0, -464(%rbp)
	movq	$0, -456(%rbp)
	movq	$0, -448(%rbp)
	movq	$0, -440(%rbp)
	movq	$0, -432(%rbp)
	movl	$0, -484(%rbp)
	jmp	.L20
.L24:
	movl	$0, -480(%rbp)
	jmp	.L21
.L23:
	leaq	-516(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-516(%rbp), %eax
	cmpl	$-1, %eax
	je	.L22
	movl	-516(%rbp), %eax
	movslq	%eax, %rdx
	movl	-464(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -464(%rbp,%rax,4)
.L22:
	addl	$1, -480(%rbp)
.L21:
	movl	-520(%rbp), %eax
	cmpl	%eax, -480(%rbp)
	jl	.L23
	addl	$1, -484(%rbp)
.L20:
	movl	-524(%rbp), %eax
	cmpl	%eax, -484(%rbp)
	jl	.L24
	movq	$0, -472(%rbp)
	movl	$0, -476(%rbp)
	jmp	.L25
.L26:
	movl	-476(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$412, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-476(%rbp), %eax
	cltq
	movl	-464(%rbp,%rax,4), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -472(%rbp)
	addl	$1, -476(%rbp)
.L25:
	cmpl	$9, -476(%rbp)
	jle	.L26
	movq	-472(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC2(%rip), %rbx
	subq	$480, %rsp
	.cfi_def_cfa_offset 528
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 472(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	movaps	%xmm0, 64(%rsp)
	leaq	64(%rsp), %rbp
	leaq	104(%rsp), %r13
	movaps	%xmm0, 80(%rsp)
	leaq	504(%rsp), %r14
	movaps	%xmm0, 96(%rsp)
	movaps	%xmm0, 112(%rsp)
	movaps	%xmm0, 128(%rsp)
	movaps	%xmm0, 144(%rsp)
	movaps	%xmm0, 160(%rsp)
	movaps	%xmm0, 176(%rsp)
	movaps	%xmm0, 192(%rsp)
	movaps	%xmm0, 208(%rsp)
	movaps	%xmm0, 224(%rsp)
	movaps	%xmm0, 240(%rsp)
	movaps	%xmm0, 256(%rsp)
	movaps	%xmm0, 272(%rsp)
	movaps	%xmm0, 288(%rsp)
	movaps	%xmm0, 304(%rsp)
	movaps	%xmm0, 320(%rsp)
	movaps	%xmm0, 336(%rsp)
	movaps	%xmm0, 352(%rsp)
	movaps	%xmm0, 368(%rsp)
	movaps	%xmm0, 384(%rsp)
	movaps	%xmm0, 400(%rsp)
	movaps	%xmm0, 416(%rsp)
	movaps	%xmm0, 432(%rsp)
	movaps	%xmm0, 448(%rsp)
	call	__isoc99_scanf@PLT
.L5:
	leaq	-40(%r13), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r12
	call	__isoc99_scanf@PLT
	cmpq	%r13, %r12
	jne	.L6
	leaq	40(%r12), %r13
	cmpq	%r13, %r14
	jne	.L5
	leaq	400(%rbp), %rdi
	movq	%rbp, %rcx
	movq	%rbp, %r8
.L7:
	movq	%rbp, %rax
	movq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	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	%rax, %rdi
	jne	.L8
	addq	$40, %rcx
	addq	$4, %r8
	cmpq	%rdi, %rcx
	jne	.L7
	movl	4(%rsp), %eax
	pxor	%xmm0, %xmm0
	movq	$0, 48(%rsp)
	movaps	%xmm0, 16(%rsp)
	movaps	%xmm0, 32(%rsp)
	testl	%eax, %eax
	jle	.L10
	movl	8(%rsp), %eax
	xorl	%r13d, %r13d
	leaq	12(%rsp), %r12
.L11:
	testl	%eax, %eax
	jle	.L10
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	cmpl	$-1, %eax
	je	.L12
	addl	$1, 16(%rsp,%rax,4)
	movl	8(%rsp), %eax
	addl	$1, %ebp
	cmpl	%eax, %ebp
	jl	.L15
	addl	$1, %r13d
	cmpl	%r13d, 4(%rsp)
	jg	.L11
.L10:
	movd	68(%rsp), %xmm2
	pxor	%xmm1, %xmm1
	movd	188(%rsp), %xmm7
	leaq	.LC3(%rip), %rsi
	movdqa	%xmm1, %xmm5
	movdqa	%xmm1, %xmm6
	movd	148(%rsp), %xmm0
	movslq	48(%rsp), %rax
	movslq	388(%rsp), %rdx
	movslq	428(%rsp), %rcx
	movl	$1, %edi
	punpckldq	%xmm7, %xmm0
	movd	108(%rsp), %xmm7
	imulq	%rax, %rdx
	punpckldq	%xmm7, %xmm2
	movd	348(%rsp), %xmm7
	punpcklqdq	%xmm0, %xmm2
	movdqa	16(%rsp), %xmm0
	movdqa	%xmm2, %xmm4
	movdqa	%xmm0, %xmm3
	punpckhdq	%xmm2, %xmm4
	punpckldq	%xmm2, %xmm2
	punpckhdq	%xmm0, %xmm3
	pcmpgtd	%xmm4, %xmm6
	punpckldq	%xmm0, %xmm0
	pcmpgtd	%xmm3, %xmm5
	pmuludq	%xmm3, %xmm6
	pmuludq	%xmm4, %xmm5
	pmuludq	%xmm3, %xmm4
	movdqa	%xmm1, %xmm3
	pcmpgtd	%xmm0, %xmm3
	pmuludq	%xmm2, %xmm3
	paddq	%xmm6, %xmm5
	movdqa	%xmm1, %xmm6
	psllq	$32, %xmm5
	paddq	%xmm5, %xmm4
	movdqa	%xmm1, %xmm5
	pcmpgtd	%xmm2, %xmm5
	pmuludq	%xmm0, %xmm5
	pmuludq	%xmm2, %xmm0
	movd	228(%rsp), %xmm2
	paddq	%xmm5, %xmm3
	movdqa	%xmm1, %xmm5
	psllq	$32, %xmm3
	paddq	%xmm3, %xmm0
	paddq	%xmm0, %xmm4
	movd	308(%rsp), %xmm0
	punpckldq	%xmm7, %xmm0
	movd	268(%rsp), %xmm7
	punpckldq	%xmm7, %xmm2
	punpcklqdq	%xmm0, %xmm2
	movdqa	32(%rsp), %xmm0
	movdqa	%xmm2, %xmm7
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm2, %xmm7
	punpckhdq	%xmm2, %xmm2
	punpckldq	%xmm0, %xmm3
	pcmpgtd	%xmm7, %xmm6
	punpckhdq	%xmm0, %xmm0
	pcmpgtd	%xmm3, %xmm5
	pmuludq	%xmm3, %xmm6
	pmuludq	%xmm7, %xmm3
	pmuludq	%xmm7, %xmm5
	paddq	%xmm6, %xmm5
	psllq	$32, %xmm5
	paddq	%xmm5, %xmm3
	paddq	%xmm4, %xmm3
	movdqa	%xmm1, %xmm4
	pcmpgtd	%xmm0, %xmm4
	pcmpgtd	%xmm2, %xmm1
	pmuludq	%xmm2, %xmm4
	pmuludq	%xmm0, %xmm1
	pmuludq	%xmm2, %xmm0
	paddq	%xmm1, %xmm4
	psllq	$32, %xmm4
	paddq	%xmm4, %xmm0
	paddq	%xmm3, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddq	%xmm1, %xmm0
	movq	%xmm0, %rax
	addq	%rdx, %rax
	movslq	52(%rsp), %rdx
	imulq	%rcx, %rdx
	addq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	472(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$480, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	movl	8(%rsp), %eax
	addl	$1, %ebp
	cmpl	%ebp, %eax
	jg	.L15
	addl	$1, %r13d
	cmpl	%r13d, 4(%rsp)
	jg	.L11
	jmp	.L10
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1001001001
	.long	1001001001
	.long	1001001001
	.long	1001001001
	.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
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC2(%rip), %rbx
	subq	$480, %rsp
	.cfi_def_cfa_offset 528
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 472(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	movaps	%xmm0, 64(%rsp)
	leaq	64(%rsp), %rbp
	leaq	104(%rsp), %r13
	movaps	%xmm0, 80(%rsp)
	leaq	504(%rsp), %r14
	movaps	%xmm0, 96(%rsp)
	movaps	%xmm0, 112(%rsp)
	movaps	%xmm0, 128(%rsp)
	movaps	%xmm0, 144(%rsp)
	movaps	%xmm0, 160(%rsp)
	movaps	%xmm0, 176(%rsp)
	movaps	%xmm0, 192(%rsp)
	movaps	%xmm0, 208(%rsp)
	movaps	%xmm0, 224(%rsp)
	movaps	%xmm0, 240(%rsp)
	movaps	%xmm0, 256(%rsp)
	movaps	%xmm0, 272(%rsp)
	movaps	%xmm0, 288(%rsp)
	movaps	%xmm0, 304(%rsp)
	movaps	%xmm0, 320(%rsp)
	movaps	%xmm0, 336(%rsp)
	movaps	%xmm0, 352(%rsp)
	movaps	%xmm0, 368(%rsp)
	movaps	%xmm0, 384(%rsp)
	movaps	%xmm0, 400(%rsp)
	movaps	%xmm0, 416(%rsp)
	movaps	%xmm0, 432(%rsp)
	movaps	%xmm0, 448(%rsp)
	call	__isoc99_scanf@PLT
.L5:
	leaq	-40(%r13), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r12
	call	__isoc99_scanf@PLT
	cmpq	%r13, %r12
	jne	.L6
	leaq	40(%r12), %r13
	cmpq	%r13, %r14
	jne	.L5
	leaq	400(%rbp), %rdi
	movq	%rbp, %rcx
	movq	%rbp, %r8
.L7:
	movq	%rbp, %rax
	movq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	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	%rax, %rdi
	jne	.L8
	addq	$40, %rcx
	addq	$4, %r8
	cmpq	%rdi, %rcx
	jne	.L7
	movl	4(%rsp), %eax
	pxor	%xmm0, %xmm0
	movq	$0, 48(%rsp)
	movaps	%xmm0, 16(%rsp)
	movaps	%xmm0, 32(%rsp)
	testl	%eax, %eax
	jle	.L10
	movl	8(%rsp), %eax
	xorl	%r13d, %r13d
	leaq	12(%rsp), %r12
.L11:
	testl	%eax, %eax
	jle	.L10
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	cmpl	$-1, %eax
	je	.L12
	addl	$1, 16(%rsp,%rax,4)
	movl	8(%rsp), %eax
	addl	$1, %ebp
	cmpl	%eax, %ebp
	jl	.L15
	addl	$1, %r13d
	cmpl	%r13d, 4(%rsp)
	jg	.L11
.L10:
	movd	68(%rsp), %xmm2
	pxor	%xmm1, %xmm1
	movd	188(%rsp), %xmm7
	leaq	.LC3(%rip), %rsi
	movdqa	%xmm1, %xmm5
	movdqa	%xmm1, %xmm6
	movd	148(%rsp), %xmm0
	movslq	48(%rsp), %rax
	movslq	388(%rsp), %rdx
	movslq	428(%rsp), %rcx
	movl	$1, %edi
	punpckldq	%xmm7, %xmm0
	movd	108(%rsp), %xmm7
	imulq	%rax, %rdx
	punpckldq	%xmm7, %xmm2
	movd	348(%rsp), %xmm7
	punpcklqdq	%xmm0, %xmm2
	movdqa	16(%rsp), %xmm0
	movdqa	%xmm2, %xmm4
	movdqa	%xmm0, %xmm3
	punpckhdq	%xmm2, %xmm4
	punpckldq	%xmm2, %xmm2
	punpckhdq	%xmm0, %xmm3
	pcmpgtd	%xmm4, %xmm6
	punpckldq	%xmm0, %xmm0
	pcmpgtd	%xmm3, %xmm5
	pmuludq	%xmm3, %xmm6
	pmuludq	%xmm4, %xmm5
	pmuludq	%xmm3, %xmm4
	movdqa	%xmm1, %xmm3
	pcmpgtd	%xmm0, %xmm3
	pmuludq	%xmm2, %xmm3
	paddq	%xmm6, %xmm5
	movdqa	%xmm1, %xmm6
	psllq	$32, %xmm5
	paddq	%xmm5, %xmm4
	movdqa	%xmm1, %xmm5
	pcmpgtd	%xmm2, %xmm5
	pmuludq	%xmm0, %xmm5
	pmuludq	%xmm2, %xmm0
	movd	228(%rsp), %xmm2
	paddq	%xmm5, %xmm3
	movdqa	%xmm1, %xmm5
	psllq	$32, %xmm3
	paddq	%xmm3, %xmm0
	paddq	%xmm0, %xmm4
	movd	308(%rsp), %xmm0
	punpckldq	%xmm7, %xmm0
	movd	268(%rsp), %xmm7
	punpckldq	%xmm7, %xmm2
	punpcklqdq	%xmm0, %xmm2
	movdqa	32(%rsp), %xmm0
	movdqa	%xmm2, %xmm7
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm2, %xmm7
	punpckhdq	%xmm2, %xmm2
	punpckldq	%xmm0, %xmm3
	pcmpgtd	%xmm7, %xmm6
	punpckhdq	%xmm0, %xmm0
	pcmpgtd	%xmm3, %xmm5
	pmuludq	%xmm3, %xmm6
	pmuludq	%xmm7, %xmm3
	pmuludq	%xmm7, %xmm5
	paddq	%xmm6, %xmm5
	psllq	$32, %xmm5
	paddq	%xmm5, %xmm3
	paddq	%xmm4, %xmm3
	movdqa	%xmm1, %xmm4
	pcmpgtd	%xmm0, %xmm4
	pcmpgtd	%xmm2, %xmm1
	pmuludq	%xmm2, %xmm4
	pmuludq	%xmm0, %xmm1
	pmuludq	%xmm2, %xmm0
	paddq	%xmm1, %xmm4
	psllq	$32, %xmm4
	paddq	%xmm4, %xmm0
	paddq	%xmm3, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddq	%xmm1, %xmm0
	movq	%xmm0, %rax
	addq	%rdx, %rax
	movslq	52(%rsp), %rdx
	imulq	%rcx, %rdx
	addq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	472(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$480, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	movl	8(%rsp), %eax
	addl	$1, %ebp
	cmpl	%ebp, %eax
	jg	.L15
	addl	$1, %r13d
	cmpl	%r13d, 4(%rsp)
	jg	.L11
	jmp	.L10
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1001001001
	.long	1001001001
	.long	1001001001
	.long	1001001001
	.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>
#define INF 1001001001
typedef long long ll;
int min(int x, int y) {
	return x > y ? y : x;
}
int max(int x, int y) {
	return x < y ? y : x;
}
int main() {
	int h, w, dp[10][10];
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			dp[i][j] = INF;
		}
	}
	scanf("%d%d", &h, &w);
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			scanf("%d", &dp[i][j]);
		}
	}
	for (int k = 0; k < 10; k++) {
		for (int i = 0; i < 10; i++) {
			for (int j = 0; j < 10; j++) {
				dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
			}
		}
	}
	int num[10] = {0};
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			int a;
			scanf("%d", &a);
			if (a != -1)
				num[a]++;
		}
	}
	ll ans = 0;
	for (int i = 0; i < 10; i++) {
		ans += (ll)dp[i][1] * num[i];
	}
	printf("%lld\n", 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>
#define INF 1001001001
typedef long long ll;
int min(int x, int y) {
	return x > y ? y : x;
}
int max(int x, int y) {
	return x < y ? y : x;
}
int main() {
	int h, w, dp[10][10];
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			dp[i][j] = INF;
		}
	}
	scanf("%d%d", &h, &w);
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			scanf("%d", &dp[i][j]);
		}
	}
	for (int k = 0; k < 10; k++) {
		for (int i = 0; i < 10; i++) {
			for (int j = 0; j < 10; j++) {
				dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
			}
		}
	}
	int num[10] = {0};
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			int a;
			scanf("%d", &a);
			if (a != -1)
				num[a]++;
		}
	}
	ll ans = 0;
	for (int i = 0; i < 10; i++) {
		ans += (ll)dp[i][1] * num[i];
	}
	printf("%lld\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	min
	.type	min, @function
min:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.globl	max
	.type	max, @function
max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max, .-max
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$528, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -512(%rbp)
	jmp	.L6
.L9:
	movl	$0, -508(%rbp)
	jmp	.L7
.L8:
	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	$1001001001, -416(%rbp,%rax,4)
	addl	$1, -508(%rbp)
.L7:
	cmpl	$9, -508(%rbp)
	jle	.L8
	addl	$1, -512(%rbp)
.L6:
	cmpl	$9, -512(%rbp)
	jle	.L9
	leaq	-520(%rbp), %rdx
	leaq	-524(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -504(%rbp)
	jmp	.L10
.L13:
	movl	$0, -500(%rbp)
	jmp	.L11
.L12:
	leaq	-416(%rbp), %rcx
	movl	-500(%rbp), %eax
	movslq	%eax, %rsi
	movl	-504(%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, -500(%rbp)
.L11:
	cmpl	$9, -500(%rbp)
	jle	.L12
	addl	$1, -504(%rbp)
.L10:
	cmpl	$9, -504(%rbp)
	jle	.L13
	movl	$0, -496(%rbp)
	jmp	.L14
.L19:
	movl	$0, -492(%rbp)
	jmp	.L15
.L18:
	movl	$0, -488(%rbp)
	jmp	.L16
.L17:
	movl	-496(%rbp), %eax
	movslq	%eax, %rcx
	movl	-492(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-416(%rbp,%rax,4), %ecx
	movl	-488(%rbp), %eax
	movslq	%eax, %rsi
	movl	-496(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-416(%rbp,%rax,4), %eax
	leal	(%rcx,%rax), %edx
	movl	-488(%rbp), %eax
	movslq	%eax, %rsi
	movl	-492(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-416(%rbp,%rax,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, %edx
	movl	-488(%rbp), %eax
	movslq	%eax, %rsi
	movl	-492(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -488(%rbp)
.L16:
	cmpl	$9, -488(%rbp)
	jle	.L17
	addl	$1, -492(%rbp)
.L15:
	cmpl	$9, -492(%rbp)
	jle	.L18
	addl	$1, -496(%rbp)
.L14:
	cmpl	$9, -496(%rbp)
	jle	.L19
	movq	$0, -464(%rbp)
	movq	$0, -456(%rbp)
	movq	$0, -448(%rbp)
	movq	$0, -440(%rbp)
	movq	$0, -432(%rbp)
	movl	$0, -484(%rbp)
	jmp	.L20
.L24:
	movl	$0, -480(%rbp)
	jmp	.L21
.L23:
	leaq	-516(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-516(%rbp), %eax
	cmpl	$-1, %eax
	je	.L22
	movl	-516(%rbp), %eax
	movslq	%eax, %rdx
	movl	-464(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -464(%rbp,%rax,4)
.L22:
	addl	$1, -480(%rbp)
.L21:
	movl	-520(%rbp), %eax
	cmpl	%eax, -480(%rbp)
	jl	.L23
	addl	$1, -484(%rbp)
.L20:
	movl	-524(%rbp), %eax
	cmpl	%eax, -484(%rbp)
	jl	.L24
	movq	$0, -472(%rbp)
	movl	$0, -476(%rbp)
	jmp	.L25
.L26:
	movl	-476(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$412, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-476(%rbp), %eax
	cltq
	movl	-464(%rbp,%rax,4), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -472(%rbp)
	addl	$1, -476(%rbp)
.L25:
	cmpl	$9, -476(%rbp)
	jle	.L26
	movq	-472(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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
	.globl	min
	.type	min, @function
min:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.globl	max
	.type	max, @function
max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max, .-max
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$528, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -512(%rbp)
	jmp	.L6
.L9:
	movl	$0, -508(%rbp)
	jmp	.L7
.L8:
	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	$1001001001, -416(%rbp,%rax,4)
	addl	$1, -508(%rbp)
.L7:
	cmpl	$9, -508(%rbp)
	jle	.L8
	addl	$1, -512(%rbp)
.L6:
	cmpl	$9, -512(%rbp)
	jle	.L9
	leaq	-520(%rbp), %rdx
	leaq	-524(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -504(%rbp)
	jmp	.L10
.L13:
	movl	$0, -500(%rbp)
	jmp	.L11
.L12:
	leaq	-416(%rbp), %rcx
	movl	-500(%rbp), %eax
	movslq	%eax, %rsi
	movl	-504(%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, -500(%rbp)
.L11:
	cmpl	$9, -500(%rbp)
	jle	.L12
	addl	$1, -504(%rbp)
.L10:
	cmpl	$9, -504(%rbp)
	jle	.L13
	movl	$0, -496(%rbp)
	jmp	.L14
.L19:
	movl	$0, -492(%rbp)
	jmp	.L15
.L18:
	movl	$0, -488(%rbp)
	jmp	.L16
.L17:
	movl	-496(%rbp), %eax
	movslq	%eax, %rcx
	movl	-492(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-416(%rbp,%rax,4), %ecx
	movl	-488(%rbp), %eax
	movslq	%eax, %rsi
	movl	-496(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-416(%rbp,%rax,4), %eax
	leal	(%rcx,%rax), %edx
	movl	-488(%rbp), %eax
	movslq	%eax, %rsi
	movl	-492(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-416(%rbp,%rax,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, %edx
	movl	-488(%rbp), %eax
	movslq	%eax, %rsi
	movl	-492(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -488(%rbp)
.L16:
	cmpl	$9, -488(%rbp)
	jle	.L17
	addl	$1, -492(%rbp)
.L15:
	cmpl	$9, -492(%rbp)
	jle	.L18
	addl	$1, -496(%rbp)
.L14:
	cmpl	$9, -496(%rbp)
	jle	.L19
	movq	$0, -464(%rbp)
	movq	$0, -456(%rbp)
	movq	$0, -448(%rbp)
	movq	$0, -440(%rbp)
	movq	$0, -432(%rbp)
	movl	$0, -484(%rbp)
	jmp	.L20
.L24:
	movl	$0, -480(%rbp)
	jmp	.L21
.L23:
	leaq	-516(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-516(%rbp), %eax
	cmpl	$-1, %eax
	je	.L22
	movl	-516(%rbp), %eax
	movslq	%eax, %rdx
	movl	-464(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -464(%rbp,%rax,4)
.L22:
	addl	$1, -480(%rbp)
.L21:
	movl	-520(%rbp), %eax
	cmpl	%eax, -480(%rbp)
	jl	.L23
	addl	$1, -484(%rbp)
.L20:
	movl	-524(%rbp), %eax
	cmpl	%eax, -484(%rbp)
	jl	.L24
	movq	$0, -472(%rbp)
	movl	$0, -476(%rbp)
	jmp	.L25
.L26:
	movl	-476(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$412, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-476(%rbp), %eax
	cltq
	movl	-464(%rbp,%rax,4), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -472(%rbp)
	addl	$1, -476(%rbp)
.L25:
	cmpl	$9, -476(%rbp)
	jle	.L26
	movq	-472(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
