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>
#define ll long long
#define max(p,q)((p)>(q)?(p):(q))

ll a[100010];
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)scanf("%lld",a+i);
	ll ans=0;
	for(int d=1;d*2<n-1;d++){
		int s=0,g=n-1;
		ll crr=0;
		while(1){
			int ns=s+d;
			int ng=g-d;
			if(ng<=d||ns==ng||ns==g)break;
			s=ns;
			g=ng;
			crr+=a[s]+a[g];
			ans=max(ans,crr);
		}
	}
	printf("%lld",ans);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edi
	testl	%edi, %edi
	jle	.L2
	leaq	a(%rip), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edi
	addq	$8, %rbp
	cmpl	%ebx, %edi
	jg	.L3
.L2:
	leal	-1(%rdi), %eax
	movl	%eax, 4(%rsp)
	cmpl	$2, %eax
	jle	.L13
	subl	$2, %edi
	movl	$1, %ecx
	movl	$2, %r13d
	xorl	%edx, %edx
	leaq	-8+a(%rip), %r8
	leaq	8(%r8), %rax
	movq	%r8, %rbp
	leaq	16(%r8), %r10
	addq	%rax, %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ecx, %r12d
	movl	%ecx, %r14d
	cmpl	%ecx, 4(%rsp)
	je	.L25
	cmpl	%ecx, %edi
	jle	.L25
	cmpl	$1, %r12d
	jne	.L27
	subl	$1, %edi
	movl	$2, %esi
	xorl	%r11d, %r11d
	movslq	%edi, %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movq	(%r8,%rsi,8), %r9
	addq	(%r10,%rax,8), %r9
	addq	%r9, %r11
	cmpq	%r11, %rdx
	cmovl	%r11, %rdx
	cmpl	%esi, %eax
	sete	%r9b
	cmpl	$1, %eax
	setle	%bl
	orl	%ebx, %r9d
	leal	1(%rax), %ebx
	cmpl	%esi, %ebx
	sete	%bl
	subq	$1, %rax
	addq	$1, %rsi
	orb	%bl, %r9b
	je	.L9
.L10:
	addq	$2, %r13
	subq	$8, %rbp
	addq	$1, %rcx
	cmpl	%r13d, 4(%rsp)
	jg	.L5
.L4:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	movl	4(%rsp), %eax
	movq	8(%rsp), %r15
	movq	%r13, %rsi
	xorl	%r9d, %r9d
	subl	%r13d, %eax
	subq	%rbp, %r15
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	movq	(%r15,%rax,8), %r11
	addq	0(%rbp,%rsi,8), %r11
	addq	%r11, %r9
	cmpq	%r9, %rdx
	cmovl	%r9, %rdx
	cmpl	%r14d, %eax
	setle	%r11b
	cmpl	%eax, %esi
	sete	%bl
	orl	%ebx, %r11d
	leal	(%r12,%rax), %ebx
	cmpl	%esi, %ebx
	sete	%bl
	addq	%rcx, %rsi
	subq	%rcx, %rax
	orb	%r11b, %bl
	je	.L8
.L25:
	subl	$1, %edi
	jmp	.L10
.L13:
	xorl	%edx, %edx
	jmp	.L4
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800080
a:
	.zero	800080
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edi
	testl	%edi, %edi
	jle	.L2
	leaq	a(%rip), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edi
	addq	$8, %rbp
	cmpl	%ebx, %edi
	jg	.L3
.L2:
	leal	-1(%rdi), %eax
	movl	%eax, 4(%rsp)
	cmpl	$2, %eax
	jle	.L13
	subl	$2, %edi
	movl	$1, %ecx
	movl	$2, %r13d
	xorl	%edx, %edx
	leaq	-8+a(%rip), %r8
	leaq	8(%r8), %rax
	movq	%r8, %rbp
	leaq	16(%r8), %r10
	addq	%rax, %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ecx, %r12d
	movl	%ecx, %r14d
	cmpl	%ecx, 4(%rsp)
	je	.L25
	cmpl	%ecx, %edi
	jle	.L25
	cmpl	$1, %r12d
	jne	.L27
	subl	$1, %edi
	movl	$2, %esi
	xorl	%r11d, %r11d
	movslq	%edi, %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movq	(%r8,%rsi,8), %r9
	addq	(%r10,%rax,8), %r9
	addq	%r9, %r11
	cmpq	%r11, %rdx
	cmovl	%r11, %rdx
	cmpl	%esi, %eax
	sete	%r9b
	cmpl	$1, %eax
	setle	%bl
	orl	%ebx, %r9d
	leal	1(%rax), %ebx
	cmpl	%esi, %ebx
	sete	%bl
	subq	$1, %rax
	addq	$1, %rsi
	orb	%bl, %r9b
	je	.L9
.L10:
	addq	$2, %r13
	subq	$8, %rbp
	addq	$1, %rcx
	cmpl	%r13d, 4(%rsp)
	jg	.L5
.L4:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	movl	4(%rsp), %eax
	movq	8(%rsp), %r15
	movq	%r13, %rsi
	xorl	%r9d, %r9d
	subl	%r13d, %eax
	subq	%rbp, %r15
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	movq	(%r15,%rax,8), %r11
	addq	0(%rbp,%rsi,8), %r11
	addq	%r11, %r9
	cmpq	%r9, %rdx
	cmovl	%r9, %rdx
	cmpl	%r14d, %eax
	setle	%r11b
	cmpl	%eax, %esi
	sete	%bl
	orl	%ebx, %r11d
	leal	(%r12,%rax), %ebx
	cmpl	%esi, %ebx
	sete	%bl
	addq	%rcx, %rsi
	subq	%rcx, %rax
	orb	%r11b, %bl
	je	.L8
.L25:
	subl	$1, %edi
	jmp	.L10
.L13:
	xorl	%edx, %edx
	jmp	.L4
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800080
a:
	.zero	800080
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edi
	testl	%edi, %edi
	jle	.L2
	leaq	a(%rip), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edi
	addq	$8, %rbp
	cmpl	%ebx, %edi
	jg	.L3
.L2:
	leal	-1(%rdi), %eax
	movl	%eax, 4(%rsp)
	cmpl	$2, %eax
	jle	.L13
	subl	$2, %edi
	movl	$1, %ecx
	movl	$2, %r13d
	xorl	%edx, %edx
	leaq	-8+a(%rip), %r8
	leaq	8(%r8), %rax
	movq	%r8, %rbp
	leaq	16(%r8), %r10
	addq	%rax, %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ecx, %r12d
	movl	%ecx, %r14d
	cmpl	%ecx, 4(%rsp)
	je	.L25
	cmpl	%ecx, %edi
	jle	.L25
	cmpl	$1, %r12d
	jne	.L27
	subl	$1, %edi
	movl	$2, %esi
	xorl	%r11d, %r11d
	movslq	%edi, %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movq	(%r8,%rsi,8), %r9
	addq	(%r10,%rax,8), %r9
	addq	%r9, %r11
	cmpq	%r11, %rdx
	cmovl	%r11, %rdx
	cmpl	%esi, %eax
	sete	%r9b
	cmpl	$1, %eax
	setle	%bl
	orl	%ebx, %r9d
	leal	1(%rax), %ebx
	cmpl	%esi, %ebx
	sete	%bl
	subq	$1, %rax
	addq	$1, %rsi
	orb	%bl, %r9b
	je	.L9
.L10:
	addq	$2, %r13
	subq	$8, %rbp
	addq	$1, %rcx
	cmpl	%r13d, 4(%rsp)
	jg	.L5
.L4:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	movl	4(%rsp), %eax
	movq	8(%rsp), %r15
	movq	%r13, %rsi
	xorl	%r9d, %r9d
	subl	%r13d, %eax
	subq	%rbp, %r15
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	movq	(%r15,%rax,8), %r11
	addq	0(%rbp,%rsi,8), %r11
	addq	%r11, %r9
	cmpq	%r9, %rdx
	cmovl	%r9, %rdx
	cmpl	%r14d, %eax
	setle	%r11b
	cmpl	%eax, %esi
	sete	%bl
	orl	%ebx, %r11d
	leal	(%r12,%rax), %ebx
	cmpl	%esi, %ebx
	sete	%bl
	addq	%rcx, %rsi
	subq	%rcx, %rax
	orb	%r11b, %bl
	je	.L8
.L25:
	subl	$1, %edi
	jmp	.L10
.L13:
	xorl	%edx, %edx
	jmp	.L4
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800080
a:
	.zero	800080
	.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>
#define ll long long
#define max(p,q)((p)>(q)?(p):(q))

ll a[100010];
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)scanf("%lld",a+i);
	ll ans=0;
	for(int d=1;d*2<n-1;d++){
		int s=0,g=n-1;
		ll crr=0;
		while(1){
			int ns=s+d;
			int ng=g-d;
			if(ng<=d||ns==ng||ns==g)break;
			s=ns;
			g=ng;
			crr+=a[s]+a[g];
			ans=max(ans,crr);
		}
	}
	printf("%lld",ans);
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#define ll long long
#define max(p,q)((p)>(q)?(p):(q))

ll a[100010];
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)scanf("%lld",a+i);
	ll ans=0;
	for(int d=1;d*2<n-1;d++){
		int s=0,g=n-1;
		ll crr=0;
		while(1){
			int ns=s+d;
			int ng=g-d;
			if(ng<=d||ns==ng||ns==g)break;
			s=ns;
			g=ng;
			crr+=a[s]+a[g];
			ans=max(ans,crr);
		}
	}
	printf("%lld",ans);
}```

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
0 10 -7 -4 -5 0
 5
0 2 5 0 0
 11
0 -4 0 -99 31 14 -15 -39 43 24 0
 6
0 2 -7 -1 -5 0
 11
0 -4 0 -99 31 13 -15 -39 64 24 0
 6
0 4 -7 -1 -3 0
 6
0 4 -7 -1 -1 0
 6
0 5 -7 -2 -1 0
 11
0 -4 0 -99 31 14 -24 -39 43 18 0
 6
0 10 -7 -4 0 0

5 2 63 0 84 1 3 4 57 10
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>
#define ll long long
#define max(p,q)((p)>(q)?(p):(q))

ll a[100010];
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)scanf("%lld",a+i);
	ll ans=0;
	for(int d=1;d*2<n-1;d++){
		int s=0,g=n-1;
		ll crr=0;
		while(1){
			int ns=s+d;
			int ng=g-d;
			if(ng<=d||ns==ng||ns==g)break;
			s=ns;
			g=ng;
			crr+=a[s]+a[g];
			ans=max(ans,crr);
		}
	}
	printf("%lld",ans);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edi
	testl	%edi, %edi
	jle	.L2
	leaq	a(%rip), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edi
	addq	$8, %rbp
	cmpl	%ebx, %edi
	jg	.L3
.L2:
	leal	-1(%rdi), %eax
	movl	%eax, 4(%rsp)
	cmpl	$2, %eax
	jle	.L13
	subl	$2, %edi
	movl	$1, %ecx
	movl	$2, %r13d
	xorl	%edx, %edx
	leaq	-8+a(%rip), %r8
	leaq	8(%r8), %rax
	movq	%r8, %rbp
	leaq	16(%r8), %r10
	addq	%rax, %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ecx, %r12d
	movl	%ecx, %r14d
	cmpl	%ecx, 4(%rsp)
	je	.L25
	cmpl	%ecx, %edi
	jle	.L25
	cmpl	$1, %r12d
	jne	.L27
	subl	$1, %edi
	movl	$2, %esi
	xorl	%r11d, %r11d
	movslq	%edi, %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movq	(%r8,%rsi,8), %r9
	addq	(%r10,%rax,8), %r9
	addq	%r9, %r11
	cmpq	%r11, %rdx
	cmovl	%r11, %rdx
	cmpl	%esi, %eax
	sete	%r9b
	cmpl	$1, %eax
	setle	%bl
	orl	%ebx, %r9d
	leal	1(%rax), %ebx
	cmpl	%esi, %ebx
	sete	%bl
	subq	$1, %rax
	addq	$1, %rsi
	orb	%bl, %r9b
	je	.L9
.L10:
	addq	$2, %r13
	subq	$8, %rbp
	addq	$1, %rcx
	cmpl	%r13d, 4(%rsp)
	jg	.L5
.L4:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	movl	4(%rsp), %eax
	movq	8(%rsp), %r15
	movq	%r13, %rsi
	xorl	%r9d, %r9d
	subl	%r13d, %eax
	subq	%rbp, %r15
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	movq	(%r15,%rax,8), %r11
	addq	0(%rbp,%rsi,8), %r11
	addq	%r11, %r9
	cmpq	%r9, %rdx
	cmovl	%r9, %rdx
	cmpl	%r14d, %eax
	setle	%r11b
	cmpl	%eax, %esi
	sete	%bl
	orl	%ebx, %r11d
	leal	(%r12,%rax), %ebx
	cmpl	%esi, %ebx
	sete	%bl
	addq	%rcx, %rsi
	subq	%rcx, %rax
	orb	%r11b, %bl
	je	.L8
.L25:
	subl	$1, %edi
	jmp	.L10
.L13:
	xorl	%edx, %edx
	jmp	.L4
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800080
a:
	.zero	800080
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edi
	testl	%edi, %edi
	jle	.L2
	leaq	a(%rip), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edi
	addq	$8, %rbp
	cmpl	%ebx, %edi
	jg	.L3
.L2:
	leal	-1(%rdi), %eax
	movl	%eax, 4(%rsp)
	cmpl	$2, %eax
	jle	.L13
	subl	$2, %edi
	movl	$1, %ecx
	movl	$2, %r13d
	xorl	%edx, %edx
	leaq	-8+a(%rip), %r8
	leaq	8(%r8), %rax
	movq	%r8, %rbp
	leaq	16(%r8), %r10
	addq	%rax, %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ecx, %r12d
	movl	%ecx, %r14d
	cmpl	%ecx, 4(%rsp)
	je	.L25
	cmpl	%ecx, %edi
	jle	.L25
	cmpl	$1, %r12d
	jne	.L27
	subl	$1, %edi
	movl	$2, %esi
	xorl	%r11d, %r11d
	movslq	%edi, %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movq	(%r8,%rsi,8), %r9
	addq	(%r10,%rax,8), %r9
	addq	%r9, %r11
	cmpq	%r11, %rdx
	cmovl	%r11, %rdx
	cmpl	%esi, %eax
	sete	%r9b
	cmpl	$1, %eax
	setle	%bl
	orl	%ebx, %r9d
	leal	1(%rax), %ebx
	cmpl	%esi, %ebx
	sete	%bl
	subq	$1, %rax
	addq	$1, %rsi
	orb	%bl, %r9b
	je	.L9
.L10:
	addq	$2, %r13
	subq	$8, %rbp
	addq	$1, %rcx
	cmpl	%r13d, 4(%rsp)
	jg	.L5
.L4:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	movl	4(%rsp), %eax
	movq	8(%rsp), %r15
	movq	%r13, %rsi
	xorl	%r9d, %r9d
	subl	%r13d, %eax
	subq	%rbp, %r15
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	movq	(%r15,%rax,8), %r11
	addq	0(%rbp,%rsi,8), %r11
	addq	%r11, %r9
	cmpq	%r9, %rdx
	cmovl	%r9, %rdx
	cmpl	%r14d, %eax
	setle	%r11b
	cmpl	%eax, %esi
	sete	%bl
	orl	%ebx, %r11d
	leal	(%r12,%rax), %ebx
	cmpl	%esi, %ebx
	sete	%bl
	addq	%rcx, %rsi
	subq	%rcx, %rax
	orb	%r11b, %bl
	je	.L8
.L25:
	subl	$1, %edi
	jmp	.L10
.L13:
	xorl	%edx, %edx
	jmp	.L4
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800080
a:
	.zero	800080
	.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:
```