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>

int N, a[401];
long long dp[401][401] = {}, sum[401];
const long long sup = (long long)1 << 60;

long long recursion(int l, int r)
{
	if (dp[l][r] != 0 || l == r) return dp[l][r];
	else dp[l][r] = sup;
	
	int k;
	long long tmp;
	for (k = l + 1; k <= r; k++) {
		tmp = recursion(l, k - 1) + recursion(k, r);
		if (tmp < dp[l][r]) dp[l][r] = tmp;
	}
	dp[l][r] += sum[r] - sum[l-1];
	return dp[l][r];
}

int main()
{
	int i;
	scanf("%d", &N);
	for (i = 1; i <= N; i++) scanf("%d", &(a[i]));
	for (i = 1, sum[0] = 0; i <= N; i++) sum[i] = sum[i-1] + a[i];
	printf("%lld\n", recursion(1, N));
	fflush(stdout);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1604
a:
	.zero	1604
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 1286408
dp:
	.zero	1286408
	.globl	sum
	.align 32
	.type	sum, @object
	.size	sum, 3208
sum:
	.zero	3208
	.globl	sup
	.section	.rodata
	.align 8
	.type	sup, @object
	.size	sup, 8
sup:
	.quad	1152921504606846976
	.text
	.globl	recursion
	.type	recursion, @function
recursion:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	jne	.L2
	movl	-36(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jne	.L3
.L2:
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	jmp	.L4
.L3:
	movabsq	$1152921504606846976, %rcx
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -28(%rbp)
	jmp	.L5
.L7:
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	recursion
	movq	%rax, %rbx
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	recursion
	addq	%rbx, %rax
	movq	%rax, -24(%rbp)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -24(%rbp)
	jge	.L6
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp(%rip), %rdx
	movq	-24(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
.L6:
	addl	$1, -28(%rbp)
.L5:
	movl	-28(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jle	.L7
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-36(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sum(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	leaq	(%rsi,%rax), %rcx
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
.L4:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	recursion, .-recursion
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -4(%rbp)
	jmp	.L9
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L9:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L10
	movl	$1, -4(%rbp)
	movq	$0, sum(%rip)
	jmp	.L11
.L12:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rax, %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	movl	N(%rip), %eax
	movl	%eax, %esi
	movl	$1, %edi
	call	recursion
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.type	recursion.part.0, @function
recursion.part.0:
.LFB25:
	.cfi_startproc
	movslq	%edi, %rdi
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %rdx
	leaq	dp(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	imulq	$401, %rdi, %r8
	movabsq	$1152921504606846976, %rax
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	addq	%rdx, %r8
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leal	1(%rdi), %ebx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%rax, (%r15,%r8,8)
	movq	%rdi, 8(%rsp)
	cmpl	%ebx, %edx
	jl	.L2
	imulq	$3208, %rdi, %r9
	movq	%rdx, %rcx
	leaq	(%r15,%r8,8), %r14
	movslq	%ebx, %rbx
	leaq	(%r15,%r9), %r12
.L7:
	movq	-8(%r12,%rbx,8), %rbp
	movl	%ebx, %r10d
	leal	-1(%rbx), %esi
	testq	%rbp, %rbp
	jne	.L3
	cmpl	%esi, %r13d
	je	.L3
	movl	%r13d, %edi
	movq	%rdx, 40(%rsp)
	movq	%r8, 32(%rsp)
	movl	%ecx, 24(%rsp)
	movl	%ebx, 20(%rsp)
	call	recursion.part.0
	movq	40(%rsp), %rdx
	movq	32(%rsp), %r8
	movl	24(%rsp), %ecx
	movl	20(%rsp), %r10d
	movq	%rax, %rbp
.L3:
	movq	3208(%r14), %rax
	testq	%rax, %rax
	jne	.L12
	cmpl	%ebx, %ecx
	je	.L5
	movl	%ecx, %esi
	movl	%r10d, %edi
	movq	%rdx, 32(%rsp)
	movq	%r8, 24(%rsp)
	movl	%ecx, 20(%rsp)
	call	recursion.part.0
	movq	32(%rsp), %rdx
	movq	24(%rsp), %r8
	movl	20(%rsp), %ecx
	addq	%rax, %rbp
.L5:
	movq	(%r15,%r8,8), %rax
	cmpq	%rbp, %rax
	jle	.L6
	movq	%rbp, (%r15,%r8,8)
	movq	%rbp, %rax
.L6:
	addq	$1, %rbx
	addq	$3208, %r14
	cmpl	%ebx, %ecx
	jge	.L7
.L2:
	imulq	$401, 8(%rsp), %r12
	subl	$1, %r13d
	leaq	sum(%rip), %rcx
	movslq	%r13d, %r13
	addq	(%rcx,%rdx,8), %rax
	subq	(%rcx,%r13,8), %rax
	addq	%rdx, %r12
	movq	%rax, (%r15,%r12,8)
	addq	$56, %rsp
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	addq	%rax, %rbp
	jmp	.L5
	.cfi_endproc
.LFE25:
	.size	recursion.part.0, .-recursion.part.0
	.p2align 4
	.globl	recursion
	.type	recursion, @function
recursion:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%edi, %rax
	movslq	%esi, %rdx
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	dp(%rip), %rdx
	movq	(%rdx,%rax,8), %rax
	testq	%rax, %rax
	jne	.L13
	cmpl	%esi, %edi
	je	.L13
	jmp	recursion.part.0
	.p2align 4,,10
	.p2align 3
.L13:
	ret
	.cfi_endproc
.LFE23:
	.size	recursion, .-recursion
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	__isoc99_scanf@PLT
	movl	N(%rip), %esi
	testl	%esi, %esi
	jle	.L16
	leaq	4+a(%rip), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	N(%rip), %esi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jge	.L17
	movq	$0, sum(%rip)
	testl	%esi, %esi
	jle	.L18
	leal	1(%rsi), %r9d
	movl	$1, %eax
	xorl	%edx, %edx
	leaq	a(%rip), %r8
	leaq	sum(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L19:
	movslq	(%r8,%rax,4), %rcx
	addq	%rcx, %rdx
	movq	%rdx, (%rdi,%rax,8)
	addq	$1, %rax
	cmpq	%rax, %r9
	jne	.L19
.L18:
	movslq	%esi, %rax
	leaq	dp(%rip), %rdx
	movq	3208(%rdx,%rax,8), %rdx
	testq	%rdx, %rdx
	jne	.L20
	cmpl	$1, %esi
	je	.L20
.L21:
	movl	$1, %edi
	call	recursion.part.0
	movq	%rax, %rdx
.L20:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	movslq	%esi, %rax
	leaq	dp(%rip), %rdx
	movq	$0, sum(%rip)
	movq	3208(%rdx,%rax,8), %rdx
	testq	%rdx, %rdx
	je	.L21
	jmp	.L20
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	sup
	.section	.rodata
	.align 8
	.type	sup, @object
	.size	sup, 8
sup:
	.quad	1152921504606846976
	.globl	sum
	.bss
	.align 32
	.type	sum, @object
	.size	sum, 3208
sum:
	.zero	3208
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 1286408
dp:
	.zero	1286408
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1604
a:
	.zero	1604
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.type	recursion.part.0, @function
recursion.part.0:
.LFB25:
	.cfi_startproc
	movslq	%edi, %rdi
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %rdx
	leaq	dp(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	imulq	$401, %rdi, %r8
	movabsq	$1152921504606846976, %rax
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	addq	%rdx, %r8
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leal	1(%rdi), %ebx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%rax, (%r15,%r8,8)
	movq	%rdi, 8(%rsp)
	cmpl	%ebx, %edx
	jl	.L2
	imulq	$3208, %rdi, %r9
	movq	%rdx, %rcx
	leaq	(%r15,%r8,8), %r14
	movslq	%ebx, %rbx
	leaq	(%r15,%r9), %r12
.L7:
	movq	-8(%r12,%rbx,8), %rbp
	movl	%ebx, %r10d
	leal	-1(%rbx), %esi
	testq	%rbp, %rbp
	jne	.L3
	cmpl	%esi, %r13d
	je	.L3
	movl	%r13d, %edi
	movq	%rdx, 40(%rsp)
	movq	%r8, 32(%rsp)
	movl	%ecx, 24(%rsp)
	movl	%ebx, 20(%rsp)
	call	recursion.part.0
	movq	40(%rsp), %rdx
	movq	32(%rsp), %r8
	movl	24(%rsp), %ecx
	movl	20(%rsp), %r10d
	movq	%rax, %rbp
.L3:
	movq	3208(%r14), %rax
	testq	%rax, %rax
	jne	.L12
	cmpl	%ebx, %ecx
	je	.L5
	movl	%ecx, %esi
	movl	%r10d, %edi
	movq	%rdx, 32(%rsp)
	movq	%r8, 24(%rsp)
	movl	%ecx, 20(%rsp)
	call	recursion.part.0
	movq	32(%rsp), %rdx
	movq	24(%rsp), %r8
	movl	20(%rsp), %ecx
	addq	%rax, %rbp
.L5:
	movq	(%r15,%r8,8), %rax
	cmpq	%rbp, %rax
	jle	.L6
	movq	%rbp, (%r15,%r8,8)
	movq	%rbp, %rax
.L6:
	addq	$1, %rbx
	addq	$3208, %r14
	cmpl	%ebx, %ecx
	jge	.L7
.L2:
	imulq	$401, 8(%rsp), %r12
	subl	$1, %r13d
	leaq	sum(%rip), %rcx
	movslq	%r13d, %r13
	addq	(%rcx,%rdx,8), %rax
	subq	(%rcx,%r13,8), %rax
	addq	%rdx, %r12
	movq	%rax, (%r15,%r12,8)
	addq	$56, %rsp
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	addq	%rax, %rbp
	jmp	.L5
	.cfi_endproc
.LFE25:
	.size	recursion.part.0, .-recursion.part.0
	.p2align 4
	.globl	recursion
	.type	recursion, @function
recursion:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%edi, %rax
	movslq	%esi, %rdx
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	dp(%rip), %rdx
	movq	(%rdx,%rax,8), %rax
	testq	%rax, %rax
	jne	.L13
	cmpl	%esi, %edi
	je	.L13
	jmp	recursion.part.0
	.p2align 4,,10
	.p2align 3
.L13:
	ret
	.cfi_endproc
.LFE23:
	.size	recursion, .-recursion
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	__isoc99_scanf@PLT
	movl	N(%rip), %esi
	testl	%esi, %esi
	jle	.L16
	leaq	4+a(%rip), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	N(%rip), %esi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jge	.L17
	movq	$0, sum(%rip)
	testl	%esi, %esi
	jle	.L18
	leal	1(%rsi), %r9d
	movl	$1, %eax
	xorl	%edx, %edx
	leaq	a(%rip), %r8
	leaq	sum(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L19:
	movslq	(%r8,%rax,4), %rcx
	addq	%rcx, %rdx
	movq	%rdx, (%rdi,%rax,8)
	addq	$1, %rax
	cmpq	%rax, %r9
	jne	.L19
.L18:
	movslq	%esi, %rax
	leaq	dp(%rip), %rdx
	movq	3208(%rdx,%rax,8), %rdx
	testq	%rdx, %rdx
	jne	.L20
	cmpl	$1, %esi
	je	.L20
.L21:
	movl	$1, %edi
	call	recursion.part.0
	movq	%rax, %rdx
.L20:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	movslq	%esi, %rax
	leaq	dp(%rip), %rdx
	movq	$0, sum(%rip)
	movq	3208(%rdx,%rax,8), %rdx
	testq	%rdx, %rdx
	je	.L21
	jmp	.L20
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	sup
	.section	.rodata
	.align 8
	.type	sup, @object
	.size	sup, 8
sup:
	.quad	1152921504606846976
	.globl	sum
	.bss
	.align 32
	.type	sum, @object
	.size	sum, 3208
sum:
	.zero	3208
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 1286408
dp:
	.zero	1286408
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1604
a:
	.zero	1604
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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>

int N, a[401];
long long dp[401][401] = {}, sum[401];
const long long sup = (long long)1 << 60;

long long recursion(int l, int r)
{
	if (dp[l][r] != 0 || l == r) return dp[l][r];
	else dp[l][r] = sup;
	
	int k;
	long long tmp;
	for (k = l + 1; k <= r; k++) {
		tmp = recursion(l, k - 1) + recursion(k, r);
		if (tmp < dp[l][r]) dp[l][r] = tmp;
	}
	dp[l][r] += sum[r] - sum[l-1];
	return dp[l][r];
}

int main()
{
	int i;
	scanf("%d", &N);
	for (i = 1; i <= N; i++) scanf("%d", &(a[i]));
	for (i = 1, sum[0] = 0; i <= N; i++) sum[i] = sum[i-1] + a[i];
	printf("%lld\n", recursion(1, N));
	fflush(stdout);
	return 0;
}
6
7 9 8 6 1 1
 5
10 8 10 10 10
 3
1001000000 1000000000 1000000000
 4
10 20 30 46
 6
7 9 13 6 1 1
 5
19 8 10 10 10
 3
1001000000 1000000001 1000000000
 4
10 5 30 46
 6
7 9 13 6 1 2
 5
19 8 10 10 1

74
 114
 5001000000
 196
 84
 132
 5001000002
 151
 88
 106

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>

int N, a[401];
long long dp[401][401] = {}, sum[401];
const long long sup = (long long)1 << 60;

long long recursion(int l, int r)
{
	if (dp[l][r] != 0 || l == r) return dp[l][r];
	else dp[l][r] = sup;
	
	int k;
	long long tmp;
	for (k = l + 1; k <= r; k++) {
		tmp = recursion(l, k - 1) + recursion(k, r);
		if (tmp < dp[l][r]) dp[l][r] = tmp;
	}
	dp[l][r] += sum[r] - sum[l-1];
	return dp[l][r];
}

int main()
{
	int i;
	scanf("%d", &N);
	for (i = 1; i <= N; i++) scanf("%d", &(a[i]));
	for (i = 1, sum[0] = 0; i <= N; i++) sum[i] = sum[i-1] + a[i];
	printf("%lld\n", recursion(1, N));
	fflush(stdout);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1604
a:
	.zero	1604
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 1286408
dp:
	.zero	1286408
	.globl	sum
	.align 32
	.type	sum, @object
	.size	sum, 3208
sum:
	.zero	3208
	.globl	sup
	.section	.rodata
	.align 8
	.type	sup, @object
	.size	sup, 8
sup:
	.quad	1152921504606846976
	.text
	.globl	recursion
	.type	recursion, @function
recursion:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	jne	.L2
	movl	-36(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jne	.L3
.L2:
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	jmp	.L4
.L3:
	movabsq	$1152921504606846976, %rcx
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -28(%rbp)
	jmp	.L5
.L7:
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	recursion
	movq	%rax, %rbx
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	recursion
	addq	%rbx, %rax
	movq	%rax, -24(%rbp)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -24(%rbp)
	jge	.L6
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp(%rip), %rdx
	movq	-24(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
.L6:
	addl	$1, -28(%rbp)
.L5:
	movl	-28(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jle	.L7
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-36(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sum(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	leaq	(%rsi,%rax), %rcx
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
.L4:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	recursion, .-recursion
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -4(%rbp)
	jmp	.L9
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L9:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L10
	movl	$1, -4(%rbp)
	movq	$0, sum(%rip)
	jmp	.L11
.L12:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rax, %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	movl	N(%rip), %eax
	movl	%eax, %esi
	movl	$1, %edi
	call	recursion
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1604
a:
	.zero	1604
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 1286408
dp:
	.zero	1286408
	.globl	sum
	.align 32
	.type	sum, @object
	.size	sum, 3208
sum:
	.zero	3208
	.globl	sup
	.section	.rodata
	.align 8
	.type	sup, @object
	.size	sup, 8
sup:
	.quad	1152921504606846976
	.text
	.globl	recursion
	.type	recursion, @function
recursion:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	jne	.L2
	movl	-36(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jne	.L3
.L2:
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	jmp	.L4
.L3:
	movabsq	$1152921504606846976, %rcx
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -28(%rbp)
	jmp	.L5
.L7:
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	recursion
	movq	%rax, %rbx
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	recursion
	addq	%rbx, %rax
	movq	%rax, -24(%rbp)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -24(%rbp)
	jge	.L6
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp(%rip), %rdx
	movq	-24(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
.L6:
	addl	$1, -28(%rbp)
.L5:
	movl	-28(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jle	.L7
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-36(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sum(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	leaq	(%rsi,%rax), %rcx
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
.L4:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	recursion, .-recursion
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -4(%rbp)
	jmp	.L9
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L9:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L10
	movl	$1, -4(%rbp)
	movq	$0, sum(%rip)
	jmp	.L11
.L12:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rax, %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	movl	N(%rip), %eax
	movl	%eax, %esi
	movl	$1, %edi
	call	recursion
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
