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

```c
M[99][99],C[99][99];main(n,m,i,j,k,x){for(;scanf("%d%d",&m,&n),n;printf("%d\n",M[n][m])){
for(i=0;i<n;i++)scanf("%d",C[i]+i);
for(i=0;i<n;i++)for(j=i+1;j<n;j++)C[i][j]=C[i][j-1]+C[j][j];
memset(M,11,sizeof(M));
for(i=1;i<=n;i++)for(j=1;j<=m;j++)for(k=0;k<i;k++)if(!k){
	if(M[i][j]>C[k][i-1])M[i][j]=C[k][i-1];
}else{
	if(M[i][j]>(x=M[k][j-1]>C[k][i-1]?M[k][j-1]:C[k][i-1]))M[i][j]=x;
}
}exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	M
	.bss
	.align 32
	.type	M, @object
	.size	M, 39204
M:
	.zero	39204
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 39204
C:
	.zero	39204
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	movl	%r8d, -20(%rbp)
	movl	%r9d, -24(%rbp)
	jmp	.L2
.L17:
	movl	$0, -12(%rbp)
	jmp	.L3
.L4:
	movl	-12(%rbp), %eax
	cltq
	imulq	$396, %rax, %rax
	leaq	C(%rip), %rdx
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	addl	$1, -12(%rbp)
.L3:
	movl	-4(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L4
	movl	$0, -12(%rbp)
	jmp	.L5
.L8:
	movl	-12(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -16(%rbp)
	jmp	.L6
.L7:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L6:
	movl	-4(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L7
	addl	$1, -12(%rbp)
.L5:
	movl	-4(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L8
	movl	$39204, %edx
	movl	$11, %esi
	leaq	M(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -12(%rbp)
	jmp	.L9
.L16:
	movl	$1, -16(%rbp)
	jmp	.L10
.L15:
	movl	$0, -20(%rbp)
	jmp	.L11
.L14:
	cmpl	$0, -20(%rbp)
	jne	.L12
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	M(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jle	.L13
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movq	%rax, %rcx
	salq	$5, %rcx
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	M(%rip), %rax
	movl	%edx, (%rcx,%rax)
	jmp	.L13
.L12:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	M(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdi
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	salq	$5, %rsi
	addq	%rsi, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rsi
	leaq	M(%rip), %rax
	movl	(%rsi,%rax), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -24(%rbp)
	cmpl	%ecx, -24(%rbp)
	jge	.L13
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	M(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L13:
	addl	$1, -20(%rbp)
.L11:
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L14
	addl	$1, -16(%rbp)
.L10:
	movl	-8(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L15
	addl	$1, -12(%rbp)
.L9:
	movl	-4(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L16
	movl	-4(%rbp), %eax
	movl	-8(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	M(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-4(%rbp), %rdx
	leaq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %eax
	testl	%eax, %eax
	jne	.L17
	movl	$0, %edi
	call	exit@PLT
	.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	"%d\n"
.LC2:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	M(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	leaq	28(%rsp), %rax
	movl	%edi, 28(%rsp)
	movq	%rax, 8(%rsp)
	leaq	24(%rsp), %rax
	movl	%esi, 24(%rsp)
	movq	%rax, (%rsp)
.L2:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	28(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L14
	leaq	C(%rip), %r12
	movl	$0, %ebp
	movq	%r12, %r13
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	scanf@PLT
	movl	28(%rsp), %r10d
	addq	$400, %r13
	cmpl	%ebp, %r10d
	jg	.L3
	testl	%r10d, %r10d
	jle	.L4
	movl	$1, %r13d
	cmpl	$1, %r10d
	je	.L5
	leaq	400+C(%rip), %r8
	movslq	%r10d, %r13
	movl	$1, %edi
	leaq	-400(%r8), %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movl	-400(%r8), %ecx
	movq	%r8, %rdx
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L7:
	addl	(%rdx), %ecx
	addq	$400, %rdx
	movl	%ecx, (%rsi,%rax,4)
	addq	$1, %rax
	cmpl	%eax, %r10d
	jg	.L7
	addq	$1, %rdi
	addq	$400, %r8
	addq	$396, %rsi
	cmpq	%r13, %rdi
	jne	.L6
.L5:
	movl	$39204, %edx
	movl	$11, %esi
	movq	%r15, %rdi
	movl	%r10d, 20(%rsp)
	call	memset@PLT
	movl	24(%rsp), %eax
	movl	%eax, 16(%rsp)
	testl	%eax, %eax
	jle	.L16
	movl	20(%rsp), %r10d
	leaq	400+M(%rip), %r14
	subl	$1, %eax
	movl	$1, %ebp
	leaq	-396(%r14), %rsi
	addl	$1, %r10d
	leaq	(%rsi,%rax,4), %r11
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r15, %r8
	movq	%r14, %rdi
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L11:
	movl	(%rdi), %esi
	testl	%eax, %eax
	je	.L33
	movl	(%r12,%rcx), %edx
	movl	(%r8,%rcx), %r9d
	cmpl	%r9d, %edx
	cmovl	%r9d, %edx
	cmpl	%esi, %edx
	jge	.L10
	movl	%edx, (%rdi)
.L10:
	addl	$1, %eax
	addq	$396, %rcx
	cmpl	%ebp, %eax
	jne	.L11
	addq	$4, %r8
	addq	$4, %rdi
	cmpq	%r11, %r8
	jne	.L12
	addl	$1, %ebp
	addq	$4, %r12
	addq	$396, %r14
	cmpl	%r10d, %ebp
	jne	.L17
.L16:
	leaq	0(%r13,%r13,2), %rax
	movslq	16(%rsp), %rdx
	leaq	.LC1(%rip), %rdi
	movq	%rax, %rcx
	salq	$5, %rcx
	addq	%rcx, %rax
	addq	%rdx, %rax
	movl	(%r15,%rax,4), %esi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L33:
	movl	(%r12), %edx
	cmpl	%esi, %edx
	jge	.L10
	movl	%edx, (%rdi)
	jmp	.L10
.L4:
	movl	$39204, %edx
	movl	$11, %esi
	movq	%r15, %rdi
	movl	%r10d, 20(%rsp)
	call	memset@PLT
	movl	24(%rsp), %eax
	movslq	20(%rsp), %r13
	movl	%eax, 16(%rsp)
	jmp	.L16
.L14:
	xorl	%edi, %edi
	call	exit@PLT
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	C
	.bss
	.align 32
	.type	C, @object
	.size	C, 39204
C:
	.zero	39204
	.globl	M
	.align 32
	.type	M, @object
	.size	M, 39204
M:
	.zero	39204
	.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	"%d\n"
.LC2:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	M(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	leaq	28(%rsp), %rax
	movl	%edi, 28(%rsp)
	movq	%rax, 8(%rsp)
	leaq	24(%rsp), %rax
	movl	%esi, 24(%rsp)
	movq	%rax, (%rsp)
.L2:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	28(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L14
	leaq	C(%rip), %r12
	movl	$0, %ebp
	movq	%r12, %r13
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	scanf@PLT
	movl	28(%rsp), %r10d
	addq	$400, %r13
	cmpl	%ebp, %r10d
	jg	.L3
	testl	%r10d, %r10d
	jle	.L4
	movl	$1, %r13d
	cmpl	$1, %r10d
	je	.L5
	leaq	400+C(%rip), %r8
	movslq	%r10d, %r13
	movl	$1, %edi
	leaq	-400(%r8), %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movl	-400(%r8), %ecx
	movq	%r8, %rdx
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L7:
	addl	(%rdx), %ecx
	addq	$400, %rdx
	movl	%ecx, (%rsi,%rax,4)
	addq	$1, %rax
	cmpl	%eax, %r10d
	jg	.L7
	addq	$1, %rdi
	addq	$400, %r8
	addq	$396, %rsi
	cmpq	%r13, %rdi
	jne	.L6
.L5:
	movl	$39204, %edx
	movl	$11, %esi
	movq	%r15, %rdi
	movl	%r10d, 20(%rsp)
	call	memset@PLT
	movl	24(%rsp), %eax
	movl	%eax, 16(%rsp)
	testl	%eax, %eax
	jle	.L16
	movl	20(%rsp), %r10d
	leaq	400+M(%rip), %r14
	subl	$1, %eax
	movl	$1, %ebp
	leaq	-396(%r14), %rsi
	addl	$1, %r10d
	leaq	(%rsi,%rax,4), %r11
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r15, %r8
	movq	%r14, %rdi
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L11:
	movl	(%rdi), %esi
	testl	%eax, %eax
	je	.L33
	movl	(%r12,%rcx), %edx
	movl	(%r8,%rcx), %r9d
	cmpl	%r9d, %edx
	cmovl	%r9d, %edx
	cmpl	%esi, %edx
	jge	.L10
	movl	%edx, (%rdi)
.L10:
	addl	$1, %eax
	addq	$396, %rcx
	cmpl	%ebp, %eax
	jne	.L11
	addq	$4, %r8
	addq	$4, %rdi
	cmpq	%r11, %r8
	jne	.L12
	addl	$1, %ebp
	addq	$4, %r12
	addq	$396, %r14
	cmpl	%r10d, %ebp
	jne	.L17
.L16:
	leaq	0(%r13,%r13,2), %rax
	movslq	16(%rsp), %rdx
	leaq	.LC1(%rip), %rdi
	movq	%rax, %rcx
	salq	$5, %rcx
	addq	%rcx, %rax
	addq	%rdx, %rax
	movl	(%r15,%rax,4), %esi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L33:
	movl	(%r12), %edx
	cmpl	%esi, %edx
	jge	.L10
	movl	%edx, (%rdi)
	jmp	.L10
.L4:
	movl	$39204, %edx
	movl	$11, %esi
	movq	%r15, %rdi
	movl	%r10d, 20(%rsp)
	call	memset@PLT
	movl	24(%rsp), %eax
	movslq	20(%rsp), %r13
	movl	%eax, 16(%rsp)
	jmp	.L16
.L14:
	xorl	%edi, %edi
	call	exit@PLT
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	C
	.bss
	.align 32
	.type	C, @object
	.size	C, 39204
C:
	.zero	39204
	.globl	M
	.align 32
	.type	M, @object
	.size	M, 39204
M:
	.zero	39204
	.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:

M[99][99],C[99][99];main(n,m,i,j,k,x){for(;scanf("%d%d",&m,&n),n;printf("%d\n",M[n][m])){
for(i=0;i<n;i++)scanf("%d",C[i]+i);
for(i=0;i<n;i++)for(j=i+1;j<n;j++)C[i][j]=C[i][j-1]+C[j][j];
memset(M,11,sizeof(M));
for(i=1;i<=n;i++)for(j=1;j<=m;j++)for(k=0;k<i;k++)if(!k){
	if(M[i][j]>C[k][i-1])M[i][j]=C[k][i-1];
}else{
	if(M[i][j]>(x=M[k][j-1]>C[k][i-1]?M[k][j-1]:C[k][i-1]))M[i][j]=x;
}
}exit(0);}
3 9
500
300
800
200
100
600
900
700
400
4 3
1000
1000
1010
0 0
 3 9
500
311
800
335
100
600
900
700
400
4 3
1000
1000
1010
0 0
 3 9
559
311
800
335
100
563
900
700
400
4 3
1000
1000
1010
0 0
 3 9
500
300
800
200
100
600
900
1032
400
4 3
1000
1000
1000
0 0
 3 9
500
300
800
200
000
600
900
700
400
4 3
1000
1000
1010
0 0
 3 9
500
253
800
335
100
600
900
700
400
4 3
1000
1000
1010
0 0
 3 9
559
311
800
335
110
600
900
700
400
4 3
1000
1000
1010
0 0
 3 9
559
311
656
335
100
563
900
700
400
4 3
1000
1000
1010
0 0
 3 9
500
300
800
200
100
871
900
1032
400
4 3
1000
1000
1000
0 0
 3 9
500
300
800
200
001
600
900
700
400
4 3
1000
1000
1010
0 0

1800
1010
 1935
1010
 1898
1010
 1800
1000
 1700
1010
 1888
1010
 1945
1010
 1861
1010
 1871
1000
 1701
1010

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

```c
M[99][99],C[99][99];main(n,m,i,j,k,x){for(;scanf("%d%d",&m,&n),n;printf("%d\n",M[n][m])){
for(i=0;i<n;i++)scanf("%d",C[i]+i);
for(i=0;i<n;i++)for(j=i+1;j<n;j++)C[i][j]=C[i][j-1]+C[j][j];
memset(M,11,sizeof(M));
for(i=1;i<=n;i++)for(j=1;j<=m;j++)for(k=0;k<i;k++)if(!k){
	if(M[i][j]>C[k][i-1])M[i][j]=C[k][i-1];
}else{
	if(M[i][j]>(x=M[k][j-1]>C[k][i-1]?M[k][j-1]:C[k][i-1]))M[i][j]=x;
}
}exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	M
	.bss
	.align 32
	.type	M, @object
	.size	M, 39204
M:
	.zero	39204
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 39204
C:
	.zero	39204
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	movl	%r8d, -20(%rbp)
	movl	%r9d, -24(%rbp)
	jmp	.L2
.L17:
	movl	$0, -12(%rbp)
	jmp	.L3
.L4:
	movl	-12(%rbp), %eax
	cltq
	imulq	$396, %rax, %rax
	leaq	C(%rip), %rdx
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	addl	$1, -12(%rbp)
.L3:
	movl	-4(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L4
	movl	$0, -12(%rbp)
	jmp	.L5
.L8:
	movl	-12(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -16(%rbp)
	jmp	.L6
.L7:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L6:
	movl	-4(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L7
	addl	$1, -12(%rbp)
.L5:
	movl	-4(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L8
	movl	$39204, %edx
	movl	$11, %esi
	leaq	M(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -12(%rbp)
	jmp	.L9
.L16:
	movl	$1, -16(%rbp)
	jmp	.L10
.L15:
	movl	$0, -20(%rbp)
	jmp	.L11
.L14:
	cmpl	$0, -20(%rbp)
	jne	.L12
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	M(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jle	.L13
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movq	%rax, %rcx
	salq	$5, %rcx
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	M(%rip), %rax
	movl	%edx, (%rcx,%rax)
	jmp	.L13
.L12:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	M(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdi
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	salq	$5, %rsi
	addq	%rsi, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rsi
	leaq	M(%rip), %rax
	movl	(%rsi,%rax), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -24(%rbp)
	cmpl	%ecx, -24(%rbp)
	jge	.L13
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	M(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L13:
	addl	$1, -20(%rbp)
.L11:
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L14
	addl	$1, -16(%rbp)
.L10:
	movl	-8(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L15
	addl	$1, -12(%rbp)
.L9:
	movl	-4(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L16
	movl	-4(%rbp), %eax
	movl	-8(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	M(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-4(%rbp), %rdx
	leaq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %eax
	testl	%eax, %eax
	jne	.L17
	movl	$0, %edi
	call	exit@PLT
	.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
	.globl	M
	.bss
	.align 32
	.type	M, @object
	.size	M, 39204
M:
	.zero	39204
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 39204
C:
	.zero	39204
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	movl	%r8d, -20(%rbp)
	movl	%r9d, -24(%rbp)
	jmp	.L2
.L17:
	movl	$0, -12(%rbp)
	jmp	.L3
.L4:
	movl	-12(%rbp), %eax
	cltq
	imulq	$396, %rax, %rax
	leaq	C(%rip), %rdx
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	addl	$1, -12(%rbp)
.L3:
	movl	-4(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L4
	movl	$0, -12(%rbp)
	jmp	.L5
.L8:
	movl	-12(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -16(%rbp)
	jmp	.L6
.L7:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L6:
	movl	-4(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L7
	addl	$1, -12(%rbp)
.L5:
	movl	-4(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L8
	movl	$39204, %edx
	movl	$11, %esi
	leaq	M(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -12(%rbp)
	jmp	.L9
.L16:
	movl	$1, -16(%rbp)
	jmp	.L10
.L15:
	movl	$0, -20(%rbp)
	jmp	.L11
.L14:
	cmpl	$0, -20(%rbp)
	jne	.L12
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	M(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jle	.L13
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movq	%rax, %rcx
	salq	$5, %rcx
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	M(%rip), %rax
	movl	%edx, (%rcx,%rax)
	jmp	.L13
.L12:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	M(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdi
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	salq	$5, %rsi
	addq	%rsi, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rsi
	leaq	M(%rip), %rax
	movl	(%rsi,%rax), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -24(%rbp)
	cmpl	%ecx, -24(%rbp)
	jge	.L13
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	M(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L13:
	addl	$1, -20(%rbp)
.L11:
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L14
	addl	$1, -16(%rbp)
.L10:
	movl	-8(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L15
	addl	$1, -12(%rbp)
.L9:
	movl	-4(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L16
	movl	-4(%rbp), %eax
	movl	-8(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$5, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	M(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-4(%rbp), %rdx
	leaq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %eax
	testl	%eax, %eax
	jne	.L17
	movl	$0, %edi
	call	exit@PLT
	.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:
