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>
#include <math.h>
#include <stdlib.h>

#define MAX(a,b) ( (a)>(b) ? (a) : (b) )

int i,j,k,n,m,cases[50][150],wid,www;

int main(){
	while(scanf("%d %d",&m,&n)*m*n){
	for(i=1;i<=n;i++){
		scanf("%d",&cases[1][i]);
		cases[1][i]+=cases[1][i-1];
	}

	for(i=2;i<=m;i++){
		for(j=1;j<=n;j++){
			wid=9999999;
			for(k=1;k<=j;k++){
				www=MAX(cases[i-1][k],cases[1][j]-cases[1][k]);
				if(www<wid)wid=www;
			}
			cases[i][j]=wid;
		}
	}

	printf("%d\n",cases[m][n]);

	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	cases
	.align 32
	.type	cases, @object
	.size	cases, 30000
cases:
	.zero	30000
	.globl	wid
	.align 4
	.type	wid, @object
	.size	wid, 4
wid:
	.zero	4
	.globl	www
	.align 4
	.type	www, @object
	.size	www, 4
www:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L2
.L12:
	movl	$1, i(%rip)
	jmp	.L3
.L4:
	movl	i(%rip), %eax
	cltq
	addq	$150, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	cltq
	addq	$150, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	subl	$1, %eax
	cltq
	addq	$150, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	i(%rip), %eax
	addl	%edx, %ecx
	cltq
	addq	$150, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L4
	movl	$2, i(%rip)
	jmp	.L5
.L11:
	movl	$1, j(%rip)
	jmp	.L6
.L10:
	movl	$9999999, wid(%rip)
	movl	$1, k(%rip)
	jmp	.L7
.L9:
	movl	j(%rip), %eax
	cltq
	addq	$150, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	k(%rip), %edx
	movslq	%edx, %rdx
	addq	$150, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cases(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	i(%rip), %eax
	leal	-1(%rax), %ecx
	movl	k(%rip), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$150, %rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	cases(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, www(%rip)
	movl	www(%rip), %edx
	movl	wid(%rip), %eax
	cmpl	%eax, %edx
	jge	.L8
	movl	www(%rip), %eax
	movl	%eax, wid(%rip)
.L8:
	movl	k(%rip), %eax
	addl	$1, %eax
	movl	%eax, k(%rip)
.L7:
	movl	k(%rip), %edx
	movl	j(%rip), %eax
	cmpl	%eax, %edx
	jle	.L9
	movl	i(%rip), %edx
	movl	j(%rip), %ecx
	movl	wid(%rip), %eax
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	imulq	$150, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cases(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L6:
	movl	j(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L10
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L5:
	movl	i(%rip), %edx
	movl	m(%rip), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	m(%rip), %eax
	movl	n(%rip), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$150, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %edx
	imull	%eax, %edx
	movl	n(%rip), %eax
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L12
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	cases(%rip), %r14
	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
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
.L2:
	leaq	n(%rip), %rdx
	leaq	m(%rip), %rsi
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	m(%rip), %esi
	movl	n(%rip), %edx
	movdqa	.LC0(%rip), %xmm4
	imull	%esi, %eax
	movl	%esi, 24(%rsp)
	movl	%edx, 20(%rsp)
	imull	%edx, %eax
	testl	%eax, %eax
	je	.L31
	movl	$1, i(%rip)
	movl	20(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L3
	movl	$1, %eax
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	movq	%rbp, %rdi
	leaq	600(%r14,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	i(%rip), %rcx
	movdqa	.LC0(%rip), %xmm4
	leal	-1(%rcx), %edx
	movq	%rcx, %rax
	movslq	%edx, %rdx
	addl	$1, %eax
	movl	600(%r14,%rdx,4), %edx
	addl	%edx, 600(%r14,%rcx,4)
	movl	n(%rip), %edx
	movl	%eax, i(%rip)
	cmpl	%edx, %eax
	jle	.L4
	movl	m(%rip), %eax
	movl	%edx, 20(%rsp)
	movl	%eax, 24(%rsp)
.L3:
	movl	$2, i(%rip)
	cmpl	$1, 24(%rsp)
	jle	.L6
	movl	20(%rsp), %edx
	leaq	1200+cases(%rip), %r12
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	leaq	-596(%r12), %r8
	movl	$1, 16(%rsp)
	movl	wid(%rip), %eax
	movl	%ebx, %r10d
	addl	$1, %edx
	movq	%r8, %rdi
	leaq	-4(%r8), %r13
	movl	%edx, 28(%rsp)
	movq	%rdx, 8(%rsp)
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jle	.L16
	.p2align 4,,10
	.p2align 3
.L33:
	movslq	16(%rsp), %rbp
	movl	$1, %edx
	imulq	$150, %rbp, %rbp
	.p2align 4,,10
	.p2align 3
.L11:
	testl	%edx, %edx
	movl	$1, %r9d
	movl	0(%r13,%rdx,4), %esi
	movl	%edx, %r10d
	cmovg	%edx, %r9d
	movl	%edx, %ebx
	cmpq	$3, %rdx
	jbe	.L17
	movl	%r9d, %ecx
	movd	%esi, %xmm5
	xorl	%eax, %eax
	shrl	$2, %ecx
	pshufd	$0, %xmm5, %xmm5
	movdqa	%xmm4, %xmm2
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	(%r8,%rax), %xmm6
	movdqa	%xmm5, %xmm1
	movdqu	(%rdi,%rax), %xmm7
	addq	$16, %rax
	psubd	%xmm6, %xmm1
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm7, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm7, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm3
	pand	%xmm1, %xmm3
	pandn	%xmm2, %xmm1
	movdqa	%xmm1, %xmm2
	por	%xmm3, %xmm2
	cmpq	%rax, %rcx
	jne	.L9
	movdqa	%xmm2, %xmm3
	movl	%r9d, %r11d
	pshufd	$255, %xmm0, %xmm0
	psrldq	$8, %xmm3
	andl	$-4, %r11d
	movd	%xmm0, %r15d
	movdqa	%xmm3, %xmm1
	leal	1(%r11), %ecx
	pcmpgtd	%xmm2, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm3, %xmm1
	por	%xmm2, %xmm1
	movdqa	%xmm1, %xmm3
	psrldq	$4, %xmm3
	movdqa	%xmm3, %xmm2
	pcmpgtd	%xmm1, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm3, %xmm2
	por	%xmm1, %xmm2
	movd	%xmm2, %eax
	cmpl	%r11d, %r9d
	je	.L10
.L8:
	movslq	%ecx, %r9
	movl	%esi, %r15d
	subl	600(%r14,%r9,4), %r15d
	addq	%rbp, %r9
	movl	(%r14,%r9,4), %r9d
	cmpl	%r9d, %r15d
	cmovl	%r9d, %r15d
	leal	1(%rcx), %r9d
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
	cmpl	%r9d, %ebx
	jl	.L10
	movslq	%r9d, %r9
	movl	%esi, %r15d
	subl	600(%r14,%r9,4), %r15d
	addq	%rbp, %r9
	movl	(%r14,%r9,4), %r9d
	cmpl	%r9d, %r15d
	cmovl	%r9d, %r15d
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
	addl	$2, %ecx
	cmpl	%ebx, %ecx
	jg	.L10
	movslq	%ecx, %rcx
	subl	600(%r14,%rcx,4), %esi
	addq	%rbp, %rcx
	movl	(%r14,%rcx,4), %r15d
	cmpl	%r15d, %esi
	cmovge	%esi, %r15d
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
.L10:
	movl	%eax, (%r12,%rdx,4)
	addl	$1, %r10d
	addq	$1, %rdx
	cmpq	8(%rsp), %rdx
	jne	.L11
	movl	28(%rsp), %r9d
	movl	$1, %esi
	movl	$1, %ecx
.L7:
	movl	16(%rsp), %ebx
	addq	$600, %r12
	addq	$600, %rdi
	leal	1(%rbx), %edx
	cmpl	%edx, 24(%rsp)
	je	.L32
	movl	%edx, 16(%rsp)
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jg	.L33
.L16:
	movl	$1, %r9d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L17:
	movl	$9999999, %eax
	movl	$1, %ecx
	jmp	.L8
.L32:
	movl	%ebx, %edx
	movl	%r9d, j(%rip)
	movl	%r10d, %ebx
	addl	$2, %edx
	movl	%edx, i(%rip)
	testb	%sil, %sil
	je	.L13
	movl	%r10d, k(%rip)
	movl	%eax, wid(%rip)
.L13:
	testb	%cl, %cl
	je	.L6
	movl	%r15d, www(%rip)
.L6:
	movslq	24(%rsp), %rax
	movslq	20(%rsp), %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	imulq	$150, %rax, %rax
	addq	%rdx, %rax
	movl	(%r14,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L31:
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	www
	.bss
	.align 4
	.type	www, @object
	.size	www, 4
www:
	.zero	4
	.globl	wid
	.align 4
	.type	wid, @object
	.size	wid, 4
wid:
	.zero	4
	.globl	cases
	.align 32
	.type	cases, @object
	.size	cases, 30000
cases:
	.zero	30000
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	9999999
	.long	9999999
	.long	9999999
	.long	9999999
	.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
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	cases(%rip), %r14
	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
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
.L2:
	leaq	n(%rip), %rdx
	leaq	m(%rip), %rsi
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	m(%rip), %esi
	movl	n(%rip), %edx
	movdqa	.LC0(%rip), %xmm4
	imull	%esi, %eax
	movl	%esi, 24(%rsp)
	movl	%edx, 20(%rsp)
	imull	%edx, %eax
	testl	%eax, %eax
	je	.L31
	movl	$1, i(%rip)
	movl	20(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L3
	movl	$1, %eax
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	movq	%rbp, %rdi
	leaq	600(%r14,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	i(%rip), %rcx
	movdqa	.LC0(%rip), %xmm4
	leal	-1(%rcx), %edx
	movq	%rcx, %rax
	movslq	%edx, %rdx
	addl	$1, %eax
	movl	600(%r14,%rdx,4), %edx
	addl	%edx, 600(%r14,%rcx,4)
	movl	n(%rip), %edx
	movl	%eax, i(%rip)
	cmpl	%edx, %eax
	jle	.L4
	movl	m(%rip), %eax
	movl	%edx, 20(%rsp)
	movl	%eax, 24(%rsp)
.L3:
	movl	$2, i(%rip)
	cmpl	$1, 24(%rsp)
	jle	.L6
	movl	20(%rsp), %edx
	leaq	1200+cases(%rip), %r12
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	leaq	-596(%r12), %r8
	movl	$1, 16(%rsp)
	movl	wid(%rip), %eax
	movl	%ebx, %r10d
	addl	$1, %edx
	movq	%r8, %rdi
	leaq	-4(%r8), %r13
	movl	%edx, 28(%rsp)
	movq	%rdx, 8(%rsp)
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jle	.L16
	.p2align 4,,10
	.p2align 3
.L33:
	movslq	16(%rsp), %rbp
	movl	$1, %edx
	imulq	$150, %rbp, %rbp
	.p2align 4,,10
	.p2align 3
.L11:
	testl	%edx, %edx
	movl	$1, %r9d
	movl	0(%r13,%rdx,4), %esi
	movl	%edx, %r10d
	cmovg	%edx, %r9d
	movl	%edx, %ebx
	cmpq	$3, %rdx
	jbe	.L17
	movl	%r9d, %ecx
	movd	%esi, %xmm5
	xorl	%eax, %eax
	shrl	$2, %ecx
	pshufd	$0, %xmm5, %xmm5
	movdqa	%xmm4, %xmm2
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	(%r8,%rax), %xmm6
	movdqa	%xmm5, %xmm1
	movdqu	(%rdi,%rax), %xmm7
	addq	$16, %rax
	psubd	%xmm6, %xmm1
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm7, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm7, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm3
	pand	%xmm1, %xmm3
	pandn	%xmm2, %xmm1
	movdqa	%xmm1, %xmm2
	por	%xmm3, %xmm2
	cmpq	%rax, %rcx
	jne	.L9
	movdqa	%xmm2, %xmm3
	movl	%r9d, %r11d
	pshufd	$255, %xmm0, %xmm0
	psrldq	$8, %xmm3
	andl	$-4, %r11d
	movd	%xmm0, %r15d
	movdqa	%xmm3, %xmm1
	leal	1(%r11), %ecx
	pcmpgtd	%xmm2, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm3, %xmm1
	por	%xmm2, %xmm1
	movdqa	%xmm1, %xmm3
	psrldq	$4, %xmm3
	movdqa	%xmm3, %xmm2
	pcmpgtd	%xmm1, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm3, %xmm2
	por	%xmm1, %xmm2
	movd	%xmm2, %eax
	cmpl	%r11d, %r9d
	je	.L10
.L8:
	movslq	%ecx, %r9
	movl	%esi, %r15d
	subl	600(%r14,%r9,4), %r15d
	addq	%rbp, %r9
	movl	(%r14,%r9,4), %r9d
	cmpl	%r9d, %r15d
	cmovl	%r9d, %r15d
	leal	1(%rcx), %r9d
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
	cmpl	%r9d, %ebx
	jl	.L10
	movslq	%r9d, %r9
	movl	%esi, %r15d
	subl	600(%r14,%r9,4), %r15d
	addq	%rbp, %r9
	movl	(%r14,%r9,4), %r9d
	cmpl	%r9d, %r15d
	cmovl	%r9d, %r15d
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
	addl	$2, %ecx
	cmpl	%ebx, %ecx
	jg	.L10
	movslq	%ecx, %rcx
	subl	600(%r14,%rcx,4), %esi
	addq	%rbp, %rcx
	movl	(%r14,%rcx,4), %r15d
	cmpl	%r15d, %esi
	cmovge	%esi, %r15d
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
.L10:
	movl	%eax, (%r12,%rdx,4)
	addl	$1, %r10d
	addq	$1, %rdx
	cmpq	8(%rsp), %rdx
	jne	.L11
	movl	28(%rsp), %r9d
	movl	$1, %esi
	movl	$1, %ecx
.L7:
	movl	16(%rsp), %ebx
	addq	$600, %r12
	addq	$600, %rdi
	leal	1(%rbx), %edx
	cmpl	%edx, 24(%rsp)
	je	.L32
	movl	%edx, 16(%rsp)
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jg	.L33
.L16:
	movl	$1, %r9d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L17:
	movl	$9999999, %eax
	movl	$1, %ecx
	jmp	.L8
.L32:
	movl	%ebx, %edx
	movl	%r9d, j(%rip)
	movl	%r10d, %ebx
	addl	$2, %edx
	movl	%edx, i(%rip)
	testb	%sil, %sil
	je	.L13
	movl	%r10d, k(%rip)
	movl	%eax, wid(%rip)
.L13:
	testb	%cl, %cl
	je	.L6
	movl	%r15d, www(%rip)
.L6:
	movslq	24(%rsp), %rax
	movslq	20(%rsp), %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	imulq	$150, %rax, %rax
	addq	%rdx, %rax
	movl	(%r14,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L31:
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	www
	.bss
	.align 4
	.type	www, @object
	.size	www, 4
www:
	.zero	4
	.globl	wid
	.align 4
	.type	wid, @object
	.size	wid, 4
wid:
	.zero	4
	.globl	cases
	.align 32
	.type	cases, @object
	.size	cases, 30000
cases:
	.zero	30000
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	9999999
	.long	9999999
	.long	9999999
	.long	9999999
	.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>
#include <math.h>
#include <stdlib.h>

#define MAX(a,b) ( (a)>(b) ? (a) : (b) )

int i,j,k,n,m,cases[50][150],wid,www;

int main(){
	while(scanf("%d %d",&m,&n)*m*n){
	for(i=1;i<=n;i++){
		scanf("%d",&cases[1][i]);
		cases[1][i]+=cases[1][i-1];
	}

	for(i=2;i<=m;i++){
		for(j=1;j<=n;j++){
			wid=9999999;
			for(k=1;k<=j;k++){
				www=MAX(cases[i-1][k],cases[1][j]-cases[1][k]);
				if(www<wid)wid=www;
			}
			cases[i][j]=wid;
		}
	}

	printf("%d\n",cases[m][n]);

	}
	return 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
#include <stdio.h>
#include <math.h>
#include <stdlib.h>

#define MAX(a,b) ( (a)>(b) ? (a) : (b) )

int i,j,k,n,m,cases[50][150],wid,www;

int main(){
	while(scanf("%d %d",&m,&n)*m*n){
	for(i=1;i<=n;i++){
		scanf("%d",&cases[1][i]);
		cases[1][i]+=cases[1][i-1];
	}

	for(i=2;i<=m;i++){
		for(j=1;j<=n;j++){
			wid=9999999;
			for(k=1;k<=j;k++){
				www=MAX(cases[i-1][k],cases[1][j]-cases[1][k]);
				if(www<wid)wid=www;
			}
			cases[i][j]=wid;
		}
	}

	printf("%d\n",cases[m][n]);

	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	cases
	.align 32
	.type	cases, @object
	.size	cases, 30000
cases:
	.zero	30000
	.globl	wid
	.align 4
	.type	wid, @object
	.size	wid, 4
wid:
	.zero	4
	.globl	www
	.align 4
	.type	www, @object
	.size	www, 4
www:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L2
.L12:
	movl	$1, i(%rip)
	jmp	.L3
.L4:
	movl	i(%rip), %eax
	cltq
	addq	$150, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	cltq
	addq	$150, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	subl	$1, %eax
	cltq
	addq	$150, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	i(%rip), %eax
	addl	%edx, %ecx
	cltq
	addq	$150, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L4
	movl	$2, i(%rip)
	jmp	.L5
.L11:
	movl	$1, j(%rip)
	jmp	.L6
.L10:
	movl	$9999999, wid(%rip)
	movl	$1, k(%rip)
	jmp	.L7
.L9:
	movl	j(%rip), %eax
	cltq
	addq	$150, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	k(%rip), %edx
	movslq	%edx, %rdx
	addq	$150, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cases(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	i(%rip), %eax
	leal	-1(%rax), %ecx
	movl	k(%rip), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$150, %rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	cases(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, www(%rip)
	movl	www(%rip), %edx
	movl	wid(%rip), %eax
	cmpl	%eax, %edx
	jge	.L8
	movl	www(%rip), %eax
	movl	%eax, wid(%rip)
.L8:
	movl	k(%rip), %eax
	addl	$1, %eax
	movl	%eax, k(%rip)
.L7:
	movl	k(%rip), %edx
	movl	j(%rip), %eax
	cmpl	%eax, %edx
	jle	.L9
	movl	i(%rip), %edx
	movl	j(%rip), %ecx
	movl	wid(%rip), %eax
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	imulq	$150, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cases(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L6:
	movl	j(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L10
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L5:
	movl	i(%rip), %edx
	movl	m(%rip), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	m(%rip), %eax
	movl	n(%rip), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$150, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %edx
	imull	%eax, %edx
	movl	n(%rip), %eax
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L12
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	cases
	.align 32
	.type	cases, @object
	.size	cases, 30000
cases:
	.zero	30000
	.globl	wid
	.align 4
	.type	wid, @object
	.size	wid, 4
wid:
	.zero	4
	.globl	www
	.align 4
	.type	www, @object
	.size	www, 4
www:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L2
.L12:
	movl	$1, i(%rip)
	jmp	.L3
.L4:
	movl	i(%rip), %eax
	cltq
	addq	$150, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	cltq
	addq	$150, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	subl	$1, %eax
	cltq
	addq	$150, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	i(%rip), %eax
	addl	%edx, %ecx
	cltq
	addq	$150, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L4
	movl	$2, i(%rip)
	jmp	.L5
.L11:
	movl	$1, j(%rip)
	jmp	.L6
.L10:
	movl	$9999999, wid(%rip)
	movl	$1, k(%rip)
	jmp	.L7
.L9:
	movl	j(%rip), %eax
	cltq
	addq	$150, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	k(%rip), %edx
	movslq	%edx, %rdx
	addq	$150, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cases(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	i(%rip), %eax
	leal	-1(%rax), %ecx
	movl	k(%rip), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$150, %rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	cases(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, www(%rip)
	movl	www(%rip), %edx
	movl	wid(%rip), %eax
	cmpl	%eax, %edx
	jge	.L8
	movl	www(%rip), %eax
	movl	%eax, wid(%rip)
.L8:
	movl	k(%rip), %eax
	addl	$1, %eax
	movl	%eax, k(%rip)
.L7:
	movl	k(%rip), %edx
	movl	j(%rip), %eax
	cmpl	%eax, %edx
	jle	.L9
	movl	i(%rip), %edx
	movl	j(%rip), %ecx
	movl	wid(%rip), %eax
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	imulq	$150, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cases(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L6:
	movl	j(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L10
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L5:
	movl	i(%rip), %edx
	movl	m(%rip), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	m(%rip), %eax
	movl	n(%rip), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$150, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cases(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %edx
	imull	%eax, %edx
	movl	n(%rip), %eax
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L12
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
