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

```c
// AOJ 0290: Microorganism Power Generation
// 2017.10.27 bal4u@uu

#include <stdio.h>
#include <string.h>

int bm[14], bw[14], m, w;
int tbl[14][14];
int dp[14][4100];

int main()
{
	int i, j, k, d, x, lim;

	while (scanf("%d%d", &m, &w) && m > 0) {
		for (i = 0; i < m; i++) scanf("%d", bm + i);
		for (j = 0; j < w; j++) scanf("%d", bw + j);

		memset(tbl, 0, sizeof(tbl));
		for (i = 0; i < m; i++) for (j = 0; j < w; j++) {
			d = bm[i] - bw[j]; if (d < 0) d = -d;
			x = d * (d - 30) * (d - 30);
			tbl[i][j] = x;
		}

		memset(dp, -1, sizeof(dp));
		dp[0][0] = 0;
		lim = 1 << w;
		for (i = 0; i < m; i++) {
			for (k = 0; k < lim; k++) if (dp[i][k] >= 0) {
				if (dp[i+1][k] < dp[i][k]) dp[i+1][k] = dp[i][k];
				for (j = 0; j < w; j++) {
					if (k & (1<<j)) continue;
					d = k | (1<<j);
					x = dp[i][k] + tbl[i][j];
					if (dp[i+1][d] < x) dp[i+1][d] = x;
				}
			}
		}

		for (x = 0, i = 0; i < lim; i++) if (dp[m][i] > x) x = dp[m][i];
		printf("%d\n", x);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	bm
	.bss
	.align 32
	.type	bm, @object
	.size	bm, 56
bm:
	.zero	56
	.globl	bw
	.align 32
	.type	bw, @object
	.size	bw, 56
bw:
	.zero	56
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 784
tbl:
	.zero	784
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 229600
dp:
	.zero	229600
	.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
	jmp	.L2
.L26:
	movl	$0, -24(%rbp)
	jmp	.L3
.L4:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bm(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L3:
	movl	m(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L4
	movl	$0, -20(%rbp)
	jmp	.L5
.L6:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bw(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -20(%rbp)
.L5:
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L6
	movl	$784, %edx
	movl	$0, %esi
	leaq	tbl(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -24(%rbp)
	jmp	.L7
.L11:
	movl	$0, -20(%rbp)
	jmp	.L8
.L10:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bm(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	bw(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -12(%rbp)
	cmpl	$0, -12(%rbp)
	jns	.L9
	negl	-12(%rbp)
.L9:
	movl	-12(%rbp), %eax
	subl	$30, %eax
	imull	-12(%rbp), %eax
	movl	-12(%rbp), %edx
	subl	$30, %edx
	imull	%edx, %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L8:
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L10
	addl	$1, -24(%rbp)
.L7:
	movl	m(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L11
	movl	$229600, %edx
	movl	$-1, %esi
	leaq	dp(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, dp(%rip)
	movl	w(%rip), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L12
.L21:
	movl	$0, -16(%rbp)
	jmp	.L13
.L20:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L14
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jge	.L15
	movl	-24(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rcx
	movq	%rcx, %rax
	salq	$10, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L15:
	movl	$0, -20(%rbp)
	jmp	.L16
.L19:
	movl	-20(%rbp), %eax
	movl	-16(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L28
	movl	-20(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	orl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -8(%rbp)
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L18
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L18
.L28:
	nop
.L18:
	addl	$1, -20(%rbp)
.L16:
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L19
.L14:
	addl	$1, -16(%rbp)
.L13:
	movl	-16(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L20
	addl	$1, -24(%rbp)
.L12:
	movl	m(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L21
	movl	$0, -8(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L22
.L24:
	movl	m(%rip), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L23
	movl	m(%rip), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
.L23:
	addl	$1, -24(%rbp)
.L22:
	movl	-24(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L24
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	w(%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
	testl	%eax, %eax
	je	.L25
	movl	m(%rip), %eax
	testl	%eax, %eax
	jg	.L26
.L25:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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
	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	$24, %rsp
	.cfi_def_cfa_offset 80
.L2:
	xorl	%eax, %eax
	leaq	w(%rip), %rdx
	leaq	m(%rip), %rsi
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L40
	movl	m(%rip), %edx
	testl	%edx, %edx
	jle	.L40
	leaq	bm(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC0(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	m(%rip), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	movl	w(%rip), %ebx
	movl	%eax, 4(%rsp)
	testl	%ebx, %ebx
	jle	.L4
	leaq	bw(%rip), %r12
	xorl	%ebp, %ebp
	movq	%r12, %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	w(%rip), %ebx
	addq	$4, %r14
	cmpl	%ebp, %ebx
	jg	.L5
	leaq	tbl(%rip), %r9
	movl	m(%rip), %esi
	movl	$98, %ecx
	xorl	%eax, %eax
	movq	%r9, %rdi
	movl	$1, %ebp
	rep stosq
	movl	%ebx, %ecx
	movl	%esi, 4(%rsp)
	sall	%cl, %ebp
	testl	%esi, %esi
	jle	.L6
	testl	%ebx, %ebx
	jle	.L7
	leal	-1(%rbx), %eax
	movl	%ebx, %r11d
	movl	%ebp, 12(%rsp)
	movq	%r9, %r10
	movl	%eax, 8(%rsp)
	movl	%ebx, %eax
	movslq	%esi, %r15
	andl	$-4, %r11d
	shrl	$2, %eax
	xorl	%r8d, %r8d
	pxor	%xmm3, %xmm3
	movl	%eax, %ebp
	.p2align 4,,10
	.p2align 3
.L15:
	leaq	bm(%rip), %rax
	cmpl	$2, 8(%rsp)
	movslq	%r8d, %rdi
	movl	(%rax,%r8,4), %eax
	jbe	.L35
	movd	%eax, %xmm6
	movdqa	%xmm3, %xmm0
	movdqa	(%r12), %xmm1
	pshufd	$0, %xmm6, %xmm2
	movdqa	%xmm2, %xmm4
	psubd	(%r12), %xmm4
	psubd	%xmm2, %xmm1
	pcmpgtd	%xmm4, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm4, %xmm0
	movdqa	.LC1(%rip), %xmm4
	por	%xmm1, %xmm0
	paddd	%xmm0, %xmm4
	movdqa	%xmm0, %xmm1
	psrlq	$32, %xmm0
	pmuludq	%xmm4, %xmm1
	movdqa	%xmm4, %xmm5
	psrlq	$32, %xmm5
	pmuludq	%xmm5, %xmm0
	pshufd	$8, %xmm1, %xmm1
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	pmuludq	%xmm1, %xmm4
	psrlq	$32, %xmm1
	pmuludq	%xmm5, %xmm1
	pshufd	$8, %xmm4, %xmm4
	pshufd	$8, %xmm1, %xmm0
	punpckldq	%xmm0, %xmm4
	movups	%xmm4, (%r10)
	cmpl	$1, %ebp
	jbe	.L9
	movdqa	%xmm2, %xmm4
	psubd	16+bw(%rip), %xmm4
	movdqa	%xmm3, %xmm0
	movdqa	16+bw(%rip), %xmm1
	pcmpgtd	%xmm4, %xmm0
	psubd	%xmm2, %xmm1
	pand	%xmm0, %xmm1
	pandn	%xmm4, %xmm0
	movdqa	.LC1(%rip), %xmm4
	por	%xmm1, %xmm0
	paddd	%xmm0, %xmm4
	movdqa	%xmm0, %xmm1
	psrlq	$32, %xmm0
	pmuludq	%xmm4, %xmm1
	movdqa	%xmm4, %xmm5
	psrlq	$32, %xmm5
	pmuludq	%xmm5, %xmm0
	pshufd	$8, %xmm1, %xmm1
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	pmuludq	%xmm1, %xmm4
	psrlq	$32, %xmm1
	pmuludq	%xmm5, %xmm1
	pshufd	$8, %xmm4, %xmm4
	pshufd	$8, %xmm1, %xmm0
	punpckldq	%xmm0, %xmm4
	movups	%xmm4, 16(%r10)
	cmpl	$2, %ebp
	je	.L9
	movdqa	%xmm2, %xmm4
	psubd	32+bw(%rip), %xmm4
	movdqa	%xmm3, %xmm0
	movdqa	32+bw(%rip), %xmm1
	pcmpgtd	%xmm4, %xmm0
	psubd	%xmm2, %xmm1
	movdqa	.LC1(%rip), %xmm2
	pand	%xmm0, %xmm1
	pandn	%xmm4, %xmm0
	por	%xmm1, %xmm0
	paddd	%xmm0, %xmm2
	movdqa	%xmm0, %xmm1
	psrlq	$32, %xmm0
	pmuludq	%xmm2, %xmm1
	movdqa	%xmm2, %xmm4
	psrlq	$32, %xmm4
	pmuludq	%xmm4, %xmm0
	pshufd	$8, %xmm1, %xmm1
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	pmuludq	%xmm1, %xmm2
	psrlq	$32, %xmm1
	pmuludq	%xmm4, %xmm1
	pshufd	$8, %xmm2, %xmm2
	pshufd	$8, %xmm1, %xmm0
	punpckldq	%xmm0, %xmm2
	movups	%xmm2, 32(%r10)
.L9:
	movl	%r11d, %esi
	cmpl	%r11d, %ebx
	je	.L10
.L8:
	movslq	%esi, %r13
	movl	%eax, %ecx
	movl	(%r12,%r13,4), %edx
	movl	%edx, %r14d
	subl	%eax, %r14d
	subl	%edx, %ecx
	leaq	0(,%rdi,8), %rdx
	cmovs	%r14d, %ecx
	subq	%rdi, %rdx
	leal	1(%rsi), %edi
	addq	%rdx, %rdx
	leal	-30(%rcx), %r14d
	addq	%rdx, %r13
	imull	%r14d, %ecx
	imull	%r14d, %ecx
	movl	%ecx, (%r9,%r13,4)
	cmpl	%edi, %ebx
	jle	.L10
	movslq	%edi, %rdi
	movl	%eax, %ecx
	movl	(%r12,%rdi,4), %r13d
	movl	%r13d, %r14d
	subl	%eax, %r14d
	subl	%r13d, %ecx
	cmovs	%r14d, %ecx
	addq	%rdx, %rdi
	addl	$2, %esi
	leal	-30(%rcx), %r13d
	imull	%r13d, %ecx
	imull	%r13d, %ecx
	movl	%ecx, (%r9,%rdi,4)
	cmpl	%esi, %ebx
	jle	.L10
	movslq	%esi, %rsi
	movl	(%r12,%rsi,4), %ecx
	movl	%ecx, %edi
	subl	%eax, %edi
	subl	%ecx, %eax
	cmovs	%edi, %eax
	addq	%rsi, %rdx
	leal	-30(%rax), %ecx
	imull	%ecx, %eax
	imull	%ecx, %eax
	movl	%eax, (%r9,%rdx,4)
.L10:
	addq	$1, %r8
	addq	$56, %r10
	cmpq	%r15, %r8
	jne	.L15
	movl	12(%rsp), %ebp
.L7:
	leaq	dp(%rip), %r10
	movl	$229600, %edx
	movl	$-1, %esi
	movq	%r10, %rdi
	call	memset@PLT
	movl	$0, dp(%rip)
	movq	%rax, %r10
	testl	%ebp, %ebp
	jle	.L37
.L34:
	leaq	tbl(%rip), %r13
	xorl	%r9d, %r9d
	xorl	%r15d, %r15d
	movslq	%ebx, %r11
	movq	$-16400, %r14
	.p2align 4,,10
	.p2align 3
.L31:
	leaq	16400+dp(%rip), %rax
	addl	$1, %r15d
	xorl	%ecx, %ecx
	leaq	(%rax,%r9), %r8
	movslq	%r15d, %rax
	movq	%rax, %r12
	salq	$10, %r12
	addq	%rax, %r12
	salq	$2, %r12
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L20:
	addl	$1, %ecx
	addq	$4, %r8
	cmpl	%ebp, %ecx
	je	.L56
.L17:
	leaq	(%r8,%r14), %rdi
	movl	(%rdi,%r9), %eax
	testl	%eax, %eax
	js	.L20
	cmpl	(%r8), %eax
	jle	.L19
	movl	%eax, (%r8)
.L19:
	testl	%ebx, %ebx
	jle	.L20
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L22:
	btl	%eax, %ecx
	jc	.L21
	movl	%ecx, %edx
	movl	0(%r13,%rax,4), %esi
	addl	(%rdi,%r9), %esi
	btsl	%eax, %edx
	movslq	%edx, %rdx
	addq	%r12, %rdx
	cmpl	%esi, (%r10,%rdx,4)
	jge	.L21
	movl	%esi, (%r10,%rdx,4)
.L21:
	addq	$1, %rax
	cmpq	%rax, %r11
	jne	.L22
	addl	$1, %ecx
	addq	$4, %r8
	cmpl	%ebp, %ecx
	jne	.L17
.L56:
	subq	$16400, %r14
	addq	$16400, %r9
	addq	$56, %r13
	cmpl	4(%rsp), %r15d
	jne	.L31
.L23:
	leal	-1(%rbp), %eax
	cmpl	$2, %eax
	jbe	.L36
	movslq	4(%rsp), %r15
	movl	%ebp, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	movq	%r15, %rdx
	leal	-1(%rax), %ecx
	salq	$10, %rdx
	salq	$4, %rcx
	addq	%r15, %rdx
	salq	$4, %rdx
	addq	%r10, %rdx
	leaq	16(%rdx), %rax
	addq	%rax, %rcx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L57:
	addq	$16, %rax
.L25:
	movdqa	(%rdx), %xmm2
	movdqa	%xmm0, %xmm1
	movq	%rax, %rdx
	pcmpgtd	%xmm2, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rcx, %rax
	jne	.L57
	movdqa	%xmm0, %xmm2
	movl	%ebp, %ecx
	psrldq	$8, %xmm2
	andl	$-4, %ecx
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %edx
	testb	$3, %bpl
	je	.L27
.L24:
	movq	%r15, %rax
	movslq	%ecx, %rsi
	salq	$10, %rax
	addq	%r15, %rax
	salq	$2, %rax
	addq	%rax, %rsi
	movl	(%r10,%rsi,4), %esi
	cmpl	%esi, %edx
	cmovl	%esi, %edx
	leal	1(%rcx), %esi
	cmpl	%ebp, %esi
	jge	.L27
	movslq	%esi, %rsi
	addq	%rax, %rsi
	movl	(%r10,%rsi,4), %esi
	cmpl	%esi, %edx
	cmovl	%esi, %edx
	addl	$2, %ecx
	cmpl	%ebp, %ecx
	jge	.L27
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	movl	(%r10,%rax,4), %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
.L27:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L35:
	xorl	%esi, %esi
	jmp	.L8
.L40:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L6:
	.cfi_restore_state
	leaq	dp(%rip), %r10
	movl	$229600, %edx
	movl	$-1, %esi
	movq	%r10, %rdi
	call	memset@PLT
	movl	$0, dp(%rip)
	movq	%rax, %r10
	testl	%ebp, %ebp
	jg	.L23
.L37:
	xorl	%edx, %edx
	jmp	.L27
.L4:
	leaq	tbl(%rip), %r9
	xorl	%eax, %eax
	movl	$98, %ecx
	movl	$229600, %edx
	movq	%r9, %rdi
	leaq	dp(%rip), %r10
	movl	$-1, %esi
	rep stosq
	movl	4(%rsp), %eax
	movq	%r10, %rdi
	testl	%eax, %eax
	jle	.L33
	call	memset@PLT
	movl	$1, %ebp
	movl	$0, dp(%rip)
	movq	%rax, %r10
	jmp	.L34
.L36:
	movslq	4(%rsp), %r15
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	.L24
.L33:
	call	memset@PLT
	movl	$1, %ebp
	movl	$0, dp(%rip)
	movq	%rax, %r10
	jmp	.L23
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 229600
dp:
	.zero	229600
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 784
tbl:
	.zero	784
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	bw
	.align 32
	.type	bw, @object
	.size	bw, 56
bw:
	.zero	56
	.globl	bm
	.align 32
	.type	bm, @object
	.size	bm, 56
bm:
	.zero	56
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	-30
	.long	-30
	.long	-30
	.long	-30
	.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"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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
	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	$24, %rsp
	.cfi_def_cfa_offset 80
.L2:
	xorl	%eax, %eax
	leaq	w(%rip), %rdx
	leaq	m(%rip), %rsi
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L40
	movl	m(%rip), %edx
	testl	%edx, %edx
	jle	.L40
	leaq	bm(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC0(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	m(%rip), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	movl	w(%rip), %ebx
	movl	%eax, 4(%rsp)
	testl	%ebx, %ebx
	jle	.L4
	leaq	bw(%rip), %r12
	xorl	%ebp, %ebp
	movq	%r12, %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	w(%rip), %ebx
	addq	$4, %r14
	cmpl	%ebp, %ebx
	jg	.L5
	leaq	tbl(%rip), %r9
	movl	m(%rip), %esi
	movl	$98, %ecx
	xorl	%eax, %eax
	movq	%r9, %rdi
	movl	$1, %ebp
	rep stosq
	movl	%ebx, %ecx
	movl	%esi, 4(%rsp)
	sall	%cl, %ebp
	testl	%esi, %esi
	jle	.L6
	testl	%ebx, %ebx
	jle	.L7
	leal	-1(%rbx), %eax
	movl	%ebx, %r11d
	movl	%ebp, 12(%rsp)
	movq	%r9, %r10
	movl	%eax, 8(%rsp)
	movl	%ebx, %eax
	movslq	%esi, %r15
	andl	$-4, %r11d
	shrl	$2, %eax
	xorl	%r8d, %r8d
	pxor	%xmm3, %xmm3
	movl	%eax, %ebp
	.p2align 4,,10
	.p2align 3
.L15:
	leaq	bm(%rip), %rax
	cmpl	$2, 8(%rsp)
	movslq	%r8d, %rdi
	movl	(%rax,%r8,4), %eax
	jbe	.L35
	movd	%eax, %xmm6
	movdqa	%xmm3, %xmm0
	movdqa	(%r12), %xmm1
	pshufd	$0, %xmm6, %xmm2
	movdqa	%xmm2, %xmm4
	psubd	(%r12), %xmm4
	psubd	%xmm2, %xmm1
	pcmpgtd	%xmm4, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm4, %xmm0
	movdqa	.LC1(%rip), %xmm4
	por	%xmm1, %xmm0
	paddd	%xmm0, %xmm4
	movdqa	%xmm0, %xmm1
	psrlq	$32, %xmm0
	pmuludq	%xmm4, %xmm1
	movdqa	%xmm4, %xmm5
	psrlq	$32, %xmm5
	pmuludq	%xmm5, %xmm0
	pshufd	$8, %xmm1, %xmm1
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	pmuludq	%xmm1, %xmm4
	psrlq	$32, %xmm1
	pmuludq	%xmm5, %xmm1
	pshufd	$8, %xmm4, %xmm4
	pshufd	$8, %xmm1, %xmm0
	punpckldq	%xmm0, %xmm4
	movups	%xmm4, (%r10)
	cmpl	$1, %ebp
	jbe	.L9
	movdqa	%xmm2, %xmm4
	psubd	16+bw(%rip), %xmm4
	movdqa	%xmm3, %xmm0
	movdqa	16+bw(%rip), %xmm1
	pcmpgtd	%xmm4, %xmm0
	psubd	%xmm2, %xmm1
	pand	%xmm0, %xmm1
	pandn	%xmm4, %xmm0
	movdqa	.LC1(%rip), %xmm4
	por	%xmm1, %xmm0
	paddd	%xmm0, %xmm4
	movdqa	%xmm0, %xmm1
	psrlq	$32, %xmm0
	pmuludq	%xmm4, %xmm1
	movdqa	%xmm4, %xmm5
	psrlq	$32, %xmm5
	pmuludq	%xmm5, %xmm0
	pshufd	$8, %xmm1, %xmm1
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	pmuludq	%xmm1, %xmm4
	psrlq	$32, %xmm1
	pmuludq	%xmm5, %xmm1
	pshufd	$8, %xmm4, %xmm4
	pshufd	$8, %xmm1, %xmm0
	punpckldq	%xmm0, %xmm4
	movups	%xmm4, 16(%r10)
	cmpl	$2, %ebp
	je	.L9
	movdqa	%xmm2, %xmm4
	psubd	32+bw(%rip), %xmm4
	movdqa	%xmm3, %xmm0
	movdqa	32+bw(%rip), %xmm1
	pcmpgtd	%xmm4, %xmm0
	psubd	%xmm2, %xmm1
	movdqa	.LC1(%rip), %xmm2
	pand	%xmm0, %xmm1
	pandn	%xmm4, %xmm0
	por	%xmm1, %xmm0
	paddd	%xmm0, %xmm2
	movdqa	%xmm0, %xmm1
	psrlq	$32, %xmm0
	pmuludq	%xmm2, %xmm1
	movdqa	%xmm2, %xmm4
	psrlq	$32, %xmm4
	pmuludq	%xmm4, %xmm0
	pshufd	$8, %xmm1, %xmm1
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	pmuludq	%xmm1, %xmm2
	psrlq	$32, %xmm1
	pmuludq	%xmm4, %xmm1
	pshufd	$8, %xmm2, %xmm2
	pshufd	$8, %xmm1, %xmm0
	punpckldq	%xmm0, %xmm2
	movups	%xmm2, 32(%r10)
.L9:
	movl	%r11d, %esi
	cmpl	%r11d, %ebx
	je	.L10
.L8:
	movslq	%esi, %r13
	movl	%eax, %ecx
	movl	(%r12,%r13,4), %edx
	movl	%edx, %r14d
	subl	%eax, %r14d
	subl	%edx, %ecx
	leaq	0(,%rdi,8), %rdx
	cmovs	%r14d, %ecx
	subq	%rdi, %rdx
	leal	1(%rsi), %edi
	addq	%rdx, %rdx
	leal	-30(%rcx), %r14d
	addq	%rdx, %r13
	imull	%r14d, %ecx
	imull	%r14d, %ecx
	movl	%ecx, (%r9,%r13,4)
	cmpl	%edi, %ebx
	jle	.L10
	movslq	%edi, %rdi
	movl	%eax, %ecx
	movl	(%r12,%rdi,4), %r13d
	movl	%r13d, %r14d
	subl	%eax, %r14d
	subl	%r13d, %ecx
	cmovs	%r14d, %ecx
	addq	%rdx, %rdi
	addl	$2, %esi
	leal	-30(%rcx), %r13d
	imull	%r13d, %ecx
	imull	%r13d, %ecx
	movl	%ecx, (%r9,%rdi,4)
	cmpl	%esi, %ebx
	jle	.L10
	movslq	%esi, %rsi
	movl	(%r12,%rsi,4), %ecx
	movl	%ecx, %edi
	subl	%eax, %edi
	subl	%ecx, %eax
	cmovs	%edi, %eax
	addq	%rsi, %rdx
	leal	-30(%rax), %ecx
	imull	%ecx, %eax
	imull	%ecx, %eax
	movl	%eax, (%r9,%rdx,4)
.L10:
	addq	$1, %r8
	addq	$56, %r10
	cmpq	%r15, %r8
	jne	.L15
	movl	12(%rsp), %ebp
.L7:
	leaq	dp(%rip), %r10
	movl	$229600, %edx
	movl	$-1, %esi
	movq	%r10, %rdi
	call	memset@PLT
	movl	$0, dp(%rip)
	movq	%rax, %r10
	testl	%ebp, %ebp
	jle	.L37
.L34:
	leaq	tbl(%rip), %r13
	xorl	%r9d, %r9d
	xorl	%r15d, %r15d
	movslq	%ebx, %r11
	movq	$-16400, %r14
	.p2align 4,,10
	.p2align 3
.L31:
	leaq	16400+dp(%rip), %rax
	addl	$1, %r15d
	xorl	%ecx, %ecx
	leaq	(%rax,%r9), %r8
	movslq	%r15d, %rax
	movq	%rax, %r12
	salq	$10, %r12
	addq	%rax, %r12
	salq	$2, %r12
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L20:
	addl	$1, %ecx
	addq	$4, %r8
	cmpl	%ebp, %ecx
	je	.L56
.L17:
	leaq	(%r8,%r14), %rdi
	movl	(%rdi,%r9), %eax
	testl	%eax, %eax
	js	.L20
	cmpl	(%r8), %eax
	jle	.L19
	movl	%eax, (%r8)
.L19:
	testl	%ebx, %ebx
	jle	.L20
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L22:
	btl	%eax, %ecx
	jc	.L21
	movl	%ecx, %edx
	movl	0(%r13,%rax,4), %esi
	addl	(%rdi,%r9), %esi
	btsl	%eax, %edx
	movslq	%edx, %rdx
	addq	%r12, %rdx
	cmpl	%esi, (%r10,%rdx,4)
	jge	.L21
	movl	%esi, (%r10,%rdx,4)
.L21:
	addq	$1, %rax
	cmpq	%rax, %r11
	jne	.L22
	addl	$1, %ecx
	addq	$4, %r8
	cmpl	%ebp, %ecx
	jne	.L17
.L56:
	subq	$16400, %r14
	addq	$16400, %r9
	addq	$56, %r13
	cmpl	4(%rsp), %r15d
	jne	.L31
.L23:
	leal	-1(%rbp), %eax
	cmpl	$2, %eax
	jbe	.L36
	movslq	4(%rsp), %r15
	movl	%ebp, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	movq	%r15, %rdx
	leal	-1(%rax), %ecx
	salq	$10, %rdx
	salq	$4, %rcx
	addq	%r15, %rdx
	salq	$4, %rdx
	addq	%r10, %rdx
	leaq	16(%rdx), %rax
	addq	%rax, %rcx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L57:
	addq	$16, %rax
.L25:
	movdqa	(%rdx), %xmm2
	movdqa	%xmm0, %xmm1
	movq	%rax, %rdx
	pcmpgtd	%xmm2, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rcx, %rax
	jne	.L57
	movdqa	%xmm0, %xmm2
	movl	%ebp, %ecx
	psrldq	$8, %xmm2
	andl	$-4, %ecx
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %edx
	testb	$3, %bpl
	je	.L27
.L24:
	movq	%r15, %rax
	movslq	%ecx, %rsi
	salq	$10, %rax
	addq	%r15, %rax
	salq	$2, %rax
	addq	%rax, %rsi
	movl	(%r10,%rsi,4), %esi
	cmpl	%esi, %edx
	cmovl	%esi, %edx
	leal	1(%rcx), %esi
	cmpl	%ebp, %esi
	jge	.L27
	movslq	%esi, %rsi
	addq	%rax, %rsi
	movl	(%r10,%rsi,4), %esi
	cmpl	%esi, %edx
	cmovl	%esi, %edx
	addl	$2, %ecx
	cmpl	%ebp, %ecx
	jge	.L27
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	movl	(%r10,%rax,4), %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
.L27:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L35:
	xorl	%esi, %esi
	jmp	.L8
.L40:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L6:
	.cfi_restore_state
	leaq	dp(%rip), %r10
	movl	$229600, %edx
	movl	$-1, %esi
	movq	%r10, %rdi
	call	memset@PLT
	movl	$0, dp(%rip)
	movq	%rax, %r10
	testl	%ebp, %ebp
	jg	.L23
.L37:
	xorl	%edx, %edx
	jmp	.L27
.L4:
	leaq	tbl(%rip), %r9
	xorl	%eax, %eax
	movl	$98, %ecx
	movl	$229600, %edx
	movq	%r9, %rdi
	leaq	dp(%rip), %r10
	movl	$-1, %esi
	rep stosq
	movl	4(%rsp), %eax
	movq	%r10, %rdi
	testl	%eax, %eax
	jle	.L33
	call	memset@PLT
	movl	$1, %ebp
	movl	$0, dp(%rip)
	movq	%rax, %r10
	jmp	.L34
.L36:
	movslq	4(%rsp), %r15
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	.L24
.L33:
	call	memset@PLT
	movl	$1, %ebp
	movl	$0, dp(%rip)
	movq	%rax, %r10
	jmp	.L23
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 229600
dp:
	.zero	229600
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 784
tbl:
	.zero	784
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	bw
	.align 32
	.type	bw, @object
	.size	bw, 56
bw:
	.zero	56
	.globl	bm
	.align 32
	.type	bm, @object
	.size	bm, 56
bm:
	.zero	56
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	-30
	.long	-30
	.long	-30
	.long	-30
	.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:

// AOJ 0290: Microorganism Power Generation
// 2017.10.27 bal4u@uu

#include <stdio.h>
#include <string.h>

int bm[14], bw[14], m, w;
int tbl[14][14];
int dp[14][4100];

int main()
{
	int i, j, k, d, x, lim;

	while (scanf("%d%d", &m, &w) && m > 0) {
		for (i = 0; i < m; i++) scanf("%d", bm + i);
		for (j = 0; j < w; j++) scanf("%d", bw + j);

		memset(tbl, 0, sizeof(tbl));
		for (i = 0; i < m; i++) for (j = 0; j < w; j++) {
			d = bm[i] - bw[j]; if (d < 0) d = -d;
			x = d * (d - 30) * (d - 30);
			tbl[i][j] = x;
		}

		memset(dp, -1, sizeof(dp));
		dp[0][0] = 0;
		lim = 1 << w;
		for (i = 0; i < m; i++) {
			for (k = 0; k < lim; k++) if (dp[i][k] >= 0) {
				if (dp[i+1][k] < dp[i][k]) dp[i+1][k] = dp[i][k];
				for (j = 0; j < w; j++) {
					if (k & (1<<j)) continue;
					d = k | (1<<j);
					x = dp[i][k] + tbl[i][j];
					if (dp[i+1][d] < x) dp[i+1][d] = x;
				}
			}
		}

		for (x = 0, i = 0; i < lim; i++) if (dp[m][i] > x) x = dp[m][i];
		printf("%d\n", x);
	}
	return 0;
}
3 3
0 20 30
10 20 30
10 10
32 10 15 8 20 10 6 45 50 41
18 0 37 25 45 11 25 21 32 27
7 3
23 14 39 6 47 16 23
19 37 8
0 0

12000
53906
11629

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

```c
// AOJ 0290: Microorganism Power Generation
// 2017.10.27 bal4u@uu

#include <stdio.h>
#include <string.h>

int bm[14], bw[14], m, w;
int tbl[14][14];
int dp[14][4100];

int main()
{
	int i, j, k, d, x, lim;

	while (scanf("%d%d", &m, &w) && m > 0) {
		for (i = 0; i < m; i++) scanf("%d", bm + i);
		for (j = 0; j < w; j++) scanf("%d", bw + j);

		memset(tbl, 0, sizeof(tbl));
		for (i = 0; i < m; i++) for (j = 0; j < w; j++) {
			d = bm[i] - bw[j]; if (d < 0) d = -d;
			x = d * (d - 30) * (d - 30);
			tbl[i][j] = x;
		}

		memset(dp, -1, sizeof(dp));
		dp[0][0] = 0;
		lim = 1 << w;
		for (i = 0; i < m; i++) {
			for (k = 0; k < lim; k++) if (dp[i][k] >= 0) {
				if (dp[i+1][k] < dp[i][k]) dp[i+1][k] = dp[i][k];
				for (j = 0; j < w; j++) {
					if (k & (1<<j)) continue;
					d = k | (1<<j);
					x = dp[i][k] + tbl[i][j];
					if (dp[i+1][d] < x) dp[i+1][d] = x;
				}
			}
		}

		for (x = 0, i = 0; i < lim; i++) if (dp[m][i] > x) x = dp[m][i];
		printf("%d\n", x);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	bm
	.bss
	.align 32
	.type	bm, @object
	.size	bm, 56
bm:
	.zero	56
	.globl	bw
	.align 32
	.type	bw, @object
	.size	bw, 56
bw:
	.zero	56
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 784
tbl:
	.zero	784
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 229600
dp:
	.zero	229600
	.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
	jmp	.L2
.L26:
	movl	$0, -24(%rbp)
	jmp	.L3
.L4:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bm(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L3:
	movl	m(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L4
	movl	$0, -20(%rbp)
	jmp	.L5
.L6:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bw(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -20(%rbp)
.L5:
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L6
	movl	$784, %edx
	movl	$0, %esi
	leaq	tbl(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -24(%rbp)
	jmp	.L7
.L11:
	movl	$0, -20(%rbp)
	jmp	.L8
.L10:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bm(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	bw(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -12(%rbp)
	cmpl	$0, -12(%rbp)
	jns	.L9
	negl	-12(%rbp)
.L9:
	movl	-12(%rbp), %eax
	subl	$30, %eax
	imull	-12(%rbp), %eax
	movl	-12(%rbp), %edx
	subl	$30, %edx
	imull	%edx, %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L8:
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L10
	addl	$1, -24(%rbp)
.L7:
	movl	m(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L11
	movl	$229600, %edx
	movl	$-1, %esi
	leaq	dp(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, dp(%rip)
	movl	w(%rip), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L12
.L21:
	movl	$0, -16(%rbp)
	jmp	.L13
.L20:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L14
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jge	.L15
	movl	-24(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rcx
	movq	%rcx, %rax
	salq	$10, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L15:
	movl	$0, -20(%rbp)
	jmp	.L16
.L19:
	movl	-20(%rbp), %eax
	movl	-16(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L28
	movl	-20(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	orl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -8(%rbp)
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L18
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L18
.L28:
	nop
.L18:
	addl	$1, -20(%rbp)
.L16:
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L19
.L14:
	addl	$1, -16(%rbp)
.L13:
	movl	-16(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L20
	addl	$1, -24(%rbp)
.L12:
	movl	m(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L21
	movl	$0, -8(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L22
.L24:
	movl	m(%rip), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L23
	movl	m(%rip), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
.L23:
	addl	$1, -24(%rbp)
.L22:
	movl	-24(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L24
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	w(%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
	testl	%eax, %eax
	je	.L25
	movl	m(%rip), %eax
	testl	%eax, %eax
	jg	.L26
.L25:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	bm
	.bss
	.align 32
	.type	bm, @object
	.size	bm, 56
bm:
	.zero	56
	.globl	bw
	.align 32
	.type	bw, @object
	.size	bw, 56
bw:
	.zero	56
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 784
tbl:
	.zero	784
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 229600
dp:
	.zero	229600
	.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
	jmp	.L2
.L26:
	movl	$0, -24(%rbp)
	jmp	.L3
.L4:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bm(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L3:
	movl	m(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L4
	movl	$0, -20(%rbp)
	jmp	.L5
.L6:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bw(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -20(%rbp)
.L5:
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L6
	movl	$784, %edx
	movl	$0, %esi
	leaq	tbl(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -24(%rbp)
	jmp	.L7
.L11:
	movl	$0, -20(%rbp)
	jmp	.L8
.L10:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bm(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	bw(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -12(%rbp)
	cmpl	$0, -12(%rbp)
	jns	.L9
	negl	-12(%rbp)
.L9:
	movl	-12(%rbp), %eax
	subl	$30, %eax
	imull	-12(%rbp), %eax
	movl	-12(%rbp), %edx
	subl	$30, %edx
	imull	%edx, %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L8:
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L10
	addl	$1, -24(%rbp)
.L7:
	movl	m(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L11
	movl	$229600, %edx
	movl	$-1, %esi
	leaq	dp(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, dp(%rip)
	movl	w(%rip), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L12
.L21:
	movl	$0, -16(%rbp)
	jmp	.L13
.L20:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L14
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jge	.L15
	movl	-24(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rcx
	movq	%rcx, %rax
	salq	$10, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L15:
	movl	$0, -20(%rbp)
	jmp	.L16
.L19:
	movl	-20(%rbp), %eax
	movl	-16(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L28
	movl	-20(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	orl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -8(%rbp)
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L18
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L18
.L28:
	nop
.L18:
	addl	$1, -20(%rbp)
.L16:
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L19
.L14:
	addl	$1, -16(%rbp)
.L13:
	movl	-16(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L20
	addl	$1, -24(%rbp)
.L12:
	movl	m(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L21
	movl	$0, -8(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L22
.L24:
	movl	m(%rip), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L23
	movl	m(%rip), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$10, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
.L23:
	addl	$1, -24(%rbp)
.L22:
	movl	-24(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L24
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	w(%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
	testl	%eax, %eax
	je	.L25
	movl	m(%rip), %eax
	testl	%eax, %eax
	jg	.L26
.L25:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
