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

```c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define MOD 1000000007
#define INF ((1LL<<62)-(1LL<<31))

int main(void) {
	int n,a[401];
	//dp[j][j+i]:a[j]~a[j+i]をまとめるためのmin
	long dp[402][402] = {0};
	long tmp;
	long sum;
	scanf("%d",&n);
	for (int i=0;i<n;i++)scanf("%d",&a[i]);
	

	for (int i=1;i<n;i++){
	    for (int j=0;j<n-i;j++){
	        tmp = INF;
	        sum = 0;
	        for (int k=j;k<j+i;k++){
	            tmp = min(tmp,dp[j][k]+dp[k+1][j+i]);
	            sum += a[k];
	        }
	        sum += a[j+i];
	        dp[j][j+i] = tmp+sum;
	    }
	}

	printf("%lld\n",dp[0][n-1]);

	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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:
.LFB51:
	.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
	leaq	-1294336(%rsp), %r11
	.cfi_def_cfa 11, 1294392
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$168, %rsp
	.cfi_def_cfa_offset 1294560
	movl	$1292832, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	xorl	%ebp, %ebp
	movq	%fs:40, %rax
	movq	%rax, 1294488(%rsp)
	xorl	%eax, %eax
	leaq	1648(%rsp), %rax
	leaq	32(%rsp), %rbx
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	movq	%rbx, %r12
	call	memset@PLT
	leaq	28(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r15d
	testl	%r15d, %r15d
	jle	.L21
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r15d
	addq	$4, %r12
	cmpl	%ebp, %r15d
	jg	.L3
	leal	-1(%r15), %eax
	movl	%eax, 12(%rsp)
	cmpl	$1, %r15d
	jle	.L8
	movl	%eax, %r12d
	movl	%r15d, 8(%rsp)
	leaq	1656(%rsp), %rax
	leaq	36(%rsp), %r13
	movl	$1, %r14d
	movq	%rax, %r15
	.p2align 4,,10
	.p2align 3
.L4:
	testl	%r12d, %r12d
	jle	.L6
	movq	(%rsp), %r9
	movl	%r14d, %r8d
	movq	%r15, %rbp
	xorl	%r11d, %r11d
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L9:
	movabsq	$4611686016279904256, %rcx
	xorl	%edi, %edi
	cmpl	%r10d, %r8d
	jle	.L7
	movq	%rbp, %rsi
	movq	%r11, %rax
	xorl	%edi, %edi
	movabsq	$4611686016279904256, %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	3216(%rsi), %rdx
	addq	(%r9,%rax,8), %rdx
	cmpq	%rdx, %rcx
	cmovg	%rdx, %rcx
	movslq	(%rbx,%rax,4), %rdx
	addq	$1, %rax
	addq	$3216, %rsi
	addq	%rdx, %rdi
	cmpl	%eax, %r8d
	jg	.L5
.L7:
	movslq	0(%r13,%r11,4), %rax
	addl	$1, %r10d
	addq	$1, %r11
	addl	$1, %r8d
	addq	$3224, %rbp
	addq	$3216, %r9
	addq	%rdi, %rax
	addq	%rcx, %rax
	movq	%rax, -3224(%rbp)
	cmpl	%r12d, %r10d
	jne	.L9
.L6:
	addl	$1, %r14d
	subl	$1, %r12d
	addq	$4, %r13
	addq	$8, %r15
	cmpl	%r14d, 8(%rsp)
	jne	.L4
.L8:
	movslq	12(%rsp), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movq	1648(%rsp,%rax,8), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	1294488(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$1294504, %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
.L21:
	.cfi_restore_state
	leal	-1(%r15), %eax
	movl	%eax, 12(%rsp)
	jmp	.L8
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.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:
.LFB51:
	.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
	leaq	-1294336(%rsp), %r11
	.cfi_def_cfa 11, 1294392
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$168, %rsp
	.cfi_def_cfa_offset 1294560
	movl	$1292832, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	xorl	%ebp, %ebp
	movq	%fs:40, %rax
	movq	%rax, 1294488(%rsp)
	xorl	%eax, %eax
	leaq	1648(%rsp), %rax
	leaq	32(%rsp), %rbx
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	movq	%rbx, %r12
	call	memset@PLT
	leaq	28(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r15d
	testl	%r15d, %r15d
	jle	.L21
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r15d
	addq	$4, %r12
	cmpl	%ebp, %r15d
	jg	.L3
	leal	-1(%r15), %eax
	movl	%eax, 12(%rsp)
	cmpl	$1, %r15d
	jle	.L8
	movl	%eax, %r12d
	movl	%r15d, 8(%rsp)
	leaq	1656(%rsp), %rax
	leaq	36(%rsp), %r13
	movl	$1, %r14d
	movq	%rax, %r15
	.p2align 4,,10
	.p2align 3
.L4:
	testl	%r12d, %r12d
	jle	.L6
	movq	(%rsp), %r9
	movl	%r14d, %r8d
	movq	%r15, %rbp
	xorl	%r11d, %r11d
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L9:
	movabsq	$4611686016279904256, %rcx
	xorl	%edi, %edi
	cmpl	%r10d, %r8d
	jle	.L7
	movq	%rbp, %rsi
	movq	%r11, %rax
	xorl	%edi, %edi
	movabsq	$4611686016279904256, %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	3216(%rsi), %rdx
	addq	(%r9,%rax,8), %rdx
	cmpq	%rdx, %rcx
	cmovg	%rdx, %rcx
	movslq	(%rbx,%rax,4), %rdx
	addq	$1, %rax
	addq	$3216, %rsi
	addq	%rdx, %rdi
	cmpl	%eax, %r8d
	jg	.L5
.L7:
	movslq	0(%r13,%r11,4), %rax
	addl	$1, %r10d
	addq	$1, %r11
	addl	$1, %r8d
	addq	$3224, %rbp
	addq	$3216, %r9
	addq	%rdi, %rax
	addq	%rcx, %rax
	movq	%rax, -3224(%rbp)
	cmpl	%r12d, %r10d
	jne	.L9
.L6:
	addl	$1, %r14d
	subl	$1, %r12d
	addq	$4, %r13
	addq	$8, %r15
	cmpl	%r14d, 8(%rsp)
	jne	.L4
.L8:
	movslq	12(%rsp), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movq	1648(%rsp,%rax,8), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	1294488(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$1294504, %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
.L21:
	.cfi_restore_state
	leal	-1(%r15), %eax
	movl	%eax, 12(%rsp)
	jmp	.L8
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:
```
rule
```assembly
	.file	"temp.c"
	.text
	.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:
.LFB51:
	.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
	leaq	-1294336(%rsp), %r11
	.cfi_def_cfa 11, 1294392
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$168, %rsp
	.cfi_def_cfa_offset 1294560
	movl	$1292832, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	xorl	%ebp, %ebp
	movq	%fs:40, %rax
	movq	%rax, 1294488(%rsp)
	xorl	%eax, %eax
	leaq	1648(%rsp), %rax
	leaq	32(%rsp), %rbx
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	movq	%rbx, %r12
	call	memset@PLT
	leaq	28(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r15d
	testl	%r15d, %r15d
	jle	.L21
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r15d
	addq	$4, %r12
	cmpl	%ebp, %r15d
	jg	.L3
	leal	-1(%r15), %eax
	movl	%eax, 12(%rsp)
	cmpl	$1, %r15d
	jle	.L8
	movl	%eax, %r12d
	movl	%r15d, 8(%rsp)
	leaq	1656(%rsp), %rax
	leaq	36(%rsp), %r13
	movl	$1, %r14d
	movq	%rax, %r15
	.p2align 4,,10
	.p2align 3
.L4:
	testl	%r12d, %r12d
	jle	.L6
	movq	(%rsp), %r9
	movl	%r14d, %r8d
	movq	%r15, %rbp
	xorl	%r11d, %r11d
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L9:
	movabsq	$4611686016279904256, %rcx
	xorl	%edi, %edi
	cmpl	%r10d, %r8d
	jle	.L7
	movq	%rbp, %rsi
	movq	%r11, %rax
	xorl	%edi, %edi
	movabsq	$4611686016279904256, %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	3216(%rsi), %rdx
	addq	(%r9,%rax,8), %rdx
	cmpq	%rdx, %rcx
	cmovg	%rdx, %rcx
	movslq	(%rbx,%rax,4), %rdx
	addq	$1, %rax
	addq	$3216, %rsi
	addq	%rdx, %rdi
	cmpl	%eax, %r8d
	jg	.L5
.L7:
	movslq	0(%r13,%r11,4), %rax
	addl	$1, %r10d
	addq	$1, %r11
	addl	$1, %r8d
	addq	$3224, %rbp
	addq	$3216, %r9
	addq	%rdi, %rax
	addq	%rcx, %rax
	movq	%rax, -3224(%rbp)
	cmpl	%r12d, %r10d
	jne	.L9
.L6:
	addl	$1, %r14d
	subl	$1, %r12d
	addq	$4, %r13
	addq	$8, %r15
	cmpl	%r14d, 8(%rsp)
	jne	.L4
.L8:
	movslq	12(%rsp), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movq	1648(%rsp,%rax,8), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	1294488(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$1294504, %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
.L21:
	.cfi_restore_state
	leal	-1(%r15), %eax
	movl	%eax, 12(%rsp)
	jmp	.L8
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:
```
```c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define MOD 1000000007
#define INF ((1LL<<62)-(1LL<<31))

int main(void) {
	int n,a[401];
	//dp[j][j+i]:a[j]~a[j+i]をまとめるためのmin
	long dp[402][402] = {0};
	long tmp;
	long sum;
	scanf("%d",&n);
	for (int i=0;i<n;i++)scanf("%d",&a[i]);
	

	for (int i=1;i<n;i++){
	    for (int j=0;j<n-i;j++){
	        tmp = INF;
	        sum = 0;
	        for (int k=j;k<j+i;k++){
	            tmp = min(tmp,dp[j][k]+dp[k+1][j+i]);
	            sum += a[k];
	        }
	        sum += a[j+i];
	        dp[j][j+i] = tmp+sum;
	    }
	}

	printf("%lld\n",dp[0][n-1]);

	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define MOD 1000000007
#define INF ((1LL<<62)-(1LL<<31))

int main(void) {
	int n,a[401];
	//dp[j][j+i]:a[j]~a[j+i]をまとめるためのmin
	long dp[402][402] = {0};
	long tmp;
	long sum;
	scanf("%d",&n);
	for (int i=0;i<n;i++)scanf("%d",&a[i]);
	

	for (int i=1;i<n;i++){
	    for (int j=0;j<n-i;j++){
	        tmp = INF;
	        sum = 0;
	        for (int k=j;k<j+i;k++){
	            tmp = min(tmp,dp[j][k]+dp[k+1][j+i]);
	            sum += a[k];
	        }
	        sum += a[j+i];
	        dp[j][j+i] = tmp+sum;
	    }
	}

	printf("%lld\n",dp[0][n-1]);

	return 0;
}```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define MOD 1000000007
#define INF ((1LL<<62)-(1LL<<31))

int main(void) {
	int n,a[401];
	//dp[j][j+i]:a[j]~a[j+i]をまとめるためのmin
	long dp[402][402] = {0};
	long tmp;
	long sum;
	scanf("%d",&n);
	for (int i=0;i<n;i++)scanf("%d",&a[i]);
	

	for (int i=1;i<n;i++){
	    for (int j=0;j<n-i;j++){
	        tmp = INF;
	        sum = 0;
	        for (int k=j;k<j+i;k++){
	            tmp = min(tmp,dp[j][k]+dp[k+1][j+i]);
	            sum += a[k];
	        }
	        sum += a[j+i];
	        dp[j][j+i] = tmp+sum;
	    }
	}

	printf("%lld\n",dp[0][n-1]);

	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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:
.LFB51:
	.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
	leaq	-1294336(%rsp), %r11
	.cfi_def_cfa 11, 1294392
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$168, %rsp
	.cfi_def_cfa_offset 1294560
	movl	$1292832, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	xorl	%ebp, %ebp
	movq	%fs:40, %rax
	movq	%rax, 1294488(%rsp)
	xorl	%eax, %eax
	leaq	1648(%rsp), %rax
	leaq	32(%rsp), %rbx
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	movq	%rbx, %r12
	call	memset@PLT
	leaq	28(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r15d
	testl	%r15d, %r15d
	jle	.L21
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r15d
	addq	$4, %r12
	cmpl	%ebp, %r15d
	jg	.L3
	leal	-1(%r15), %eax
	movl	%eax, 12(%rsp)
	cmpl	$1, %r15d
	jle	.L8
	movl	%eax, %r12d
	movl	%r15d, 8(%rsp)
	leaq	1656(%rsp), %rax
	leaq	36(%rsp), %r13
	movl	$1, %r14d
	movq	%rax, %r15
	.p2align 4,,10
	.p2align 3
.L4:
	testl	%r12d, %r12d
	jle	.L6
	movq	(%rsp), %r9
	movl	%r14d, %r8d
	movq	%r15, %rbp
	xorl	%r11d, %r11d
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L9:
	movabsq	$4611686016279904256, %rcx
	xorl	%edi, %edi
	cmpl	%r10d, %r8d
	jle	.L7
	movq	%rbp, %rsi
	movq	%r11, %rax
	xorl	%edi, %edi
	movabsq	$4611686016279904256, %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	3216(%rsi), %rdx
	addq	(%r9,%rax,8), %rdx
	cmpq	%rdx, %rcx
	cmovg	%rdx, %rcx
	movslq	(%rbx,%rax,4), %rdx
	addq	$1, %rax
	addq	$3216, %rsi
	addq	%rdx, %rdi
	cmpl	%eax, %r8d
	jg	.L5
.L7:
	movslq	0(%r13,%r11,4), %rax
	addl	$1, %r10d
	addq	$1, %r11
	addl	$1, %r8d
	addq	$3224, %rbp
	addq	$3216, %r9
	addq	%rdi, %rax
	addq	%rcx, %rax
	movq	%rax, -3224(%rbp)
	cmpl	%r12d, %r10d
	jne	.L9
.L6:
	addl	$1, %r14d
	subl	$1, %r12d
	addq	$4, %r13
	addq	$8, %r15
	cmpl	%r14d, 8(%rsp)
	jne	.L4
.L8:
	movslq	12(%rsp), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movq	1648(%rsp,%rax,8), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	1294488(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$1294504, %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
.L21:
	.cfi_restore_state
	leal	-1(%r15), %eax
	movl	%eax, 12(%rsp)
	jmp	.L8
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.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:
.LFB51:
	.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
	leaq	-1294336(%rsp), %r11
	.cfi_def_cfa 11, 1294392
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$168, %rsp
	.cfi_def_cfa_offset 1294560
	movl	$1292832, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	xorl	%ebp, %ebp
	movq	%fs:40, %rax
	movq	%rax, 1294488(%rsp)
	xorl	%eax, %eax
	leaq	1648(%rsp), %rax
	leaq	32(%rsp), %rbx
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	movq	%rbx, %r12
	call	memset@PLT
	leaq	28(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r15d
	testl	%r15d, %r15d
	jle	.L21
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r15d
	addq	$4, %r12
	cmpl	%ebp, %r15d
	jg	.L3
	leal	-1(%r15), %eax
	movl	%eax, 12(%rsp)
	cmpl	$1, %r15d
	jle	.L8
	movl	%eax, %r12d
	movl	%r15d, 8(%rsp)
	leaq	1656(%rsp), %rax
	leaq	36(%rsp), %r13
	movl	$1, %r14d
	movq	%rax, %r15
	.p2align 4,,10
	.p2align 3
.L4:
	testl	%r12d, %r12d
	jle	.L6
	movq	(%rsp), %r9
	movl	%r14d, %r8d
	movq	%r15, %rbp
	xorl	%r11d, %r11d
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L9:
	movabsq	$4611686016279904256, %rcx
	xorl	%edi, %edi
	cmpl	%r10d, %r8d
	jle	.L7
	movq	%rbp, %rsi
	movq	%r11, %rax
	xorl	%edi, %edi
	movabsq	$4611686016279904256, %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	3216(%rsi), %rdx
	addq	(%r9,%rax,8), %rdx
	cmpq	%rdx, %rcx
	cmovg	%rdx, %rcx
	movslq	(%rbx,%rax,4), %rdx
	addq	$1, %rax
	addq	$3216, %rsi
	addq	%rdx, %rdi
	cmpl	%eax, %r8d
	jg	.L5
.L7:
	movslq	0(%r13,%r11,4), %rax
	addl	$1, %r10d
	addq	$1, %r11
	addl	$1, %r8d
	addq	$3224, %rbp
	addq	$3216, %r9
	addq	%rdi, %rax
	addq	%rcx, %rax
	movq	%rax, -3224(%rbp)
	cmpl	%r12d, %r10d
	jne	.L9
.L6:
	addl	$1, %r14d
	subl	$1, %r12d
	addq	$4, %r13
	addq	$8, %r15
	cmpl	%r14d, 8(%rsp)
	jne	.L4
.L8:
	movslq	12(%rsp), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movq	1648(%rsp,%rax,8), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	1294488(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$1294504, %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
.L21:
	.cfi_restore_state
	leal	-1(%r15), %eax
	movl	%eax, 12(%rsp)
	jmp	.L8
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:
```