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

```c
//#include "pch.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

#define llong long long
#define fr(i,l,r) for(i=(l);i<(r);i++)
#define min(p,q) ((p)<(q)?(p):(q))
#define max(p,q) ((p)>(q)?(p):(q))
#define INF 1000000000000//10^12

int main(void)
{
	//変数の宣言
	llong int l;
	static llong int a[200010];
	static llong int even[200010];
	static llong int odd[200010];
	static llong int sum[200010];
	static llong int left1[200010];
	static llong int left2[200010];
	static llong int left3[200010];
	static llong int left4[200010];
	llong int temp;


	llong int ans;
	llong int i;
	llong int flag;

	//データの読み込み

	scanf("%lld", &l);
//	scanf_s("%lld", &l);


	for (i = 0;i < l;i++) {
		scanf("%lld", &a[i]);
	}
//	for (i = 0;i < l;i++) {
//		scanf_s("%lld", &a[i]);
//	}

	//	printf("nは%dです\n", n);
	//	printf("データの読み込み終了\n");
		//実際の処理

		//累積和even[k]を作る
	for (i = 0;i < l;i++) {
		if (a[i] < 2) {
			even[i] = 2 - a[i];
		}
		else {
			even[i] = a[i] % 2;
		}
	}
	//oddを作る
	for (i = 0;i < l;i++) {
		odd[i] = (a[i] + 1) % 2;
		
	}

	//sumを作る
	for (i = 0;i < l;i++) {
		if (i == 0) {
			sum[i] = a[i];
		}
		else {
			sum[i] = sum[i - 1] + a[i];
		}
	}

	for (i = 0;i < l;i++) {
		if (i == 0) {
			left1[i] = min(even[0], a[0]);
		}else{
			left1[i] = min(left1[i - 1] + even[i], sum[i]);
		}
	}

	for (i = 0;i < l;i++) {
		if (i == 0) {
			left2[i] = min(left1[0], odd[0]);
		}
		else {
			left2[i] = min(left2[i - 1] + odd[i], left1[i]);
		}
	}

	for (i = 0;i < l;i++) {
		if (i == 0) {
			left3[i] = min(left2[0], even[0]);
		}
		else {
			left3[i] = min(left3[i - 1] + even[i], left2[i]);
		}
	}

	for (i = 0;i < l;i++) {
		if (i == 0) {
			left4[i] = min(left3[0], sum[0]);
		}
		else {
			left4[i] = min(left4[i - 1] + a[i], left3[i]);
		}
	}

	//	printf("計算部分終了\n");

		//出力
	printf("%lld", left4[l-1]);
/*
	for (i = 0;i < l;i++) {
		printf("i=%lld,left1[i]=%lld\n", i, left1[i]);
	}

	for (i = 0;i < l;i++) {
		printf("i=%lld,left2[i]=%lld\n", i, left2[i]);
	}

	for (i = 0;i < l;i++) {
		printf("i=%lld,left3[i]=%lld\n", i, left3[i]);
	}

	for (i = 0;i < l;i++) {
		printf("i=%lld,left4[i]=%lld\n", i, left4[i]);
	}
*/
	//	printf("結果の出力終了\n");

	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -16(%rbp)
	jmp	.L2
.L3:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -16(%rbp)
.L2:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L3
	movq	$0, -16(%rbp)
	jmp	.L4
.L7:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	$1, %rax
	jg	.L5
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	$2, %edx
	movq	%rdx, %rcx
	subq	%rax, %rcx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	even.6(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	jmp	.L6
.L5:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	even.6(%rip), %rax
	movq	%rcx, (%rdx,%rax)
.L6:
	addq	$1, -16(%rbp)
.L4:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L7
	movq	$0, -16(%rbp)
	jmp	.L8
.L9:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	$1, %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	odd.5(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addq	$1, -16(%rbp)
.L8:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L9
	movq	$0, -16(%rbp)
	jmp	.L10
.L13:
	cmpq	$0, -16(%rbp)
	jne	.L11
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sum.4(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L12
.L11:
	movq	-16(%rbp), %rax
	subq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	sum.4(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	sum.4(%rip), %rax
	movq	%rcx, (%rdx,%rax)
.L12:
	addq	$1, -16(%rbp)
.L10:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L13
	movq	$0, -16(%rbp)
	jmp	.L14
.L17:
	cmpq	$0, -16(%rbp)
	jne	.L15
	movq	a.7(%rip), %rdx
	movq	even.6(%rip), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left1.3(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L16
.L15:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	sum.4(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	subq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left1.3(%rip), %rdx
	movq	(%rcx,%rdx), %rsi
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	even.6(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	addq	%rsi, %rdx
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left1.3(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L16:
	addq	$1, -16(%rbp)
.L14:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L17
	movq	$0, -16(%rbp)
	jmp	.L18
.L21:
	cmpq	$0, -16(%rbp)
	jne	.L19
	movq	odd.5(%rip), %rdx
	movq	left1.3(%rip), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left2.2(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L20
.L19:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	left1.3(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	subq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left2.2(%rip), %rdx
	movq	(%rcx,%rdx), %rsi
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	odd.5(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	addq	%rsi, %rdx
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left2.2(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L20:
	addq	$1, -16(%rbp)
.L18:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L21
	movq	$0, -16(%rbp)
	jmp	.L22
.L25:
	cmpq	$0, -16(%rbp)
	jne	.L23
	movq	even.6(%rip), %rdx
	movq	left2.2(%rip), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left3.1(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L24
.L23:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	left2.2(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	subq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left3.1(%rip), %rdx
	movq	(%rcx,%rdx), %rsi
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	even.6(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	addq	%rsi, %rdx
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left3.1(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L24:
	addq	$1, -16(%rbp)
.L22:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L25
	movq	$0, -16(%rbp)
	jmp	.L26
.L29:
	cmpq	$0, -16(%rbp)
	jne	.L27
	movq	sum.4(%rip), %rdx
	movq	left3.1(%rip), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left4.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L28
.L27:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	left3.1(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	subq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left4.0(%rip), %rdx
	movq	(%rcx,%rdx), %rsi
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	a.7(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	addq	%rsi, %rdx
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left4.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L28:
	addq	$1, -16(%rbp)
.L26:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L29
	movq	-24(%rbp), %rax
	subq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	left4.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.local	a.7
	.comm	a.7,1600080,32
	.local	even.6
	.comm	even.6,1600080,32
	.local	odd.5
	.comm	odd.5,1600080,32
	.local	sum.4
	.comm	sum.4,1600080,32
	.local	left1.3
	.comm	left1.3,1600080,32
	.local	left2.2
	.comm	left2.2,1600080,32
	.local	left3.1
	.comm	left3.1,1600080,32
	.local	left4.0
	.comm	left4.0,1600080,32
	.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	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rbp, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rdx
	testq	%rdx, %rdx
	jle	.L2
	leaq	a.7(%rip), %rbx
	xorl	%r12d, %r12d
	movq	%rbx, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %r12
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rdx
	addq	$8, %r13
	cmpq	%r12, %rdx
	jg	.L3
	testq	%rdx, %rdx
	jle	.L2
	xorl	%eax, %eax
	leaq	even.6(%rip), %rsi
	movl	$2, %r9d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	(%rbx,%rax,8), %rdi
	movq	%r9, %r8
	movq	%rdi, %rcx
	subq	%rdi, %r8
	andl	$1, %ecx
	cmpq	$1, %rdi
	cmovle	%r8, %rcx
	movq	%rcx, (%rsi,%rax,8)
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L6
	xorl	%ecx, %ecx
	leaq	odd.5(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rbx,%rcx,8), %rax
	addq	$1, %rax
	movq	%rax, %r8
	shrq	$63, %r8
	addq	%r8, %rax
	andl	$1, %eax
	subq	%r8, %rax
	movq	%rax, (%rdi,%rcx,8)
	addq	$1, %rcx
	cmpq	%rcx, %rdx
	jne	.L7
	leaq	sum.4(%rip), %r8
	movq	(%rbx), %r9
	xorl	%eax, %eax
	leaq	-8(%r8), %r10
	.p2align 4,,10
	.p2align 3
.L10:
	testq	%rax, %rax
	jne	.L8
	movq	%r9, (%r8)
	cmpq	$1, %rdx
	je	.L9
	movl	$1, %eax
.L8:
	movq	(%rbx,%rax,8), %rcx
	addq	(%r10,%rax,8), %rcx
	movq	%rcx, (%r8,%rax,8)
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L10
.L9:
	movq	even.6(%rip), %r10
	cmpq	%r10, %r9
	cmovg	%r10, %r9
	xorl	%eax, %eax
	movq	%r9, %r12
	leaq	left1.3(%rip), %r9
	leaq	-8(%r9), %r13
	.p2align 4,,10
	.p2align 3
.L13:
	testq	%rax, %rax
	jne	.L11
	movq	%r12, (%r9)
	cmpq	$1, %rdx
	je	.L12
	movl	$1, %eax
.L11:
	movq	(%r8,%rax,8), %r11
	movq	(%rsi,%rax,8), %rcx
	addq	0(%r13,%rax,8), %rcx
	cmpq	%r11, %rcx
	cmovg	%r11, %rcx
	movq	%rcx, (%r9,%rax,8)
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L13
.L12:
	movq	left1.3(%rip), %rax
	movq	odd.5(%rip), %r12
	leaq	left2.2(%rip), %r8
	leaq	-8(%r8), %r13
	cmpq	%rax, %r12
	cmovg	%rax, %r12
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L16:
	testq	%rax, %rax
	jne	.L14
	movq	%r12, (%r8)
	cmpq	$1, %rdx
	je	.L15
	movl	$1, %eax
.L14:
	movq	(%r9,%rax,8), %r11
	movq	(%rdi,%rax,8), %rcx
	addq	0(%r13,%rax,8), %rcx
	cmpq	%r11, %rcx
	cmovg	%r11, %rcx
	movq	%rcx, (%r8,%rax,8)
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L16
.L15:
	movq	left2.2(%rip), %rax
	leaq	left3.1(%rip), %rdi
	leaq	-8(%rdi), %r11
	cmpq	%rax, %r10
	cmovg	%rax, %r10
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L19:
	testq	%rax, %rax
	jne	.L17
	movq	%r10, (%rdi)
	cmpq	$1, %rdx
	je	.L18
	movl	$1, %eax
.L17:
	movq	(%r8,%rax,8), %r9
	movq	(%rsi,%rax,8), %rcx
	addq	(%r11,%rax,8), %rcx
	cmpq	%r9, %rcx
	cmovg	%r9, %rcx
	movq	%rcx, (%rdi,%rax,8)
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L19
.L18:
	movq	left3.1(%rip), %rax
	movq	sum.4(%rip), %r9
	leaq	left4.0(%rip), %r8
	leaq	-8(%r8), %r10
	cmpq	%rax, %r9
	cmovg	%rax, %r9
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L22:
	testq	%rax, %rax
	jne	.L20
	movq	%r9, (%r8)
	movl	$1, %eax
	cmpq	$1, %rdx
	je	.L21
.L20:
	movq	(%rdi,%rax,8), %rsi
	movq	(%rbx,%rax,8), %rcx
	addq	(%r10,%rax,8), %rcx
	cmpq	%rsi, %rcx
	cmovg	%rsi, %rcx
	movq	%rcx, (%r8,%rax,8)
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L22
.L21:
	movq	-8(%r8,%rax,8), %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L48
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	movq	%rdx, %rax
	leaq	left4.0(%rip), %r8
	jmp	.L21
.L48:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.local	left4.0
	.comm	left4.0,1600080,32
	.local	left3.1
	.comm	left3.1,1600080,32
	.local	left2.2
	.comm	left2.2,1600080,32
	.local	left1.3
	.comm	left1.3,1600080,32
	.local	sum.4
	.comm	sum.4,1600080,32
	.local	odd.5
	.comm	odd.5,1600080,32
	.local	even.6
	.comm	even.6,1600080,32
	.local	a.7
	.comm	a.7,1600080,32
	.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	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rbp, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rdx
	testq	%rdx, %rdx
	jle	.L2
	leaq	a.7(%rip), %rbx
	xorl	%r12d, %r12d
	movq	%rbx, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %r12
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rdx
	addq	$8, %r13
	cmpq	%r12, %rdx
	jg	.L3
	testq	%rdx, %rdx
	jle	.L2
	xorl	%eax, %eax
	leaq	even.6(%rip), %rsi
	movl	$2, %r9d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	(%rbx,%rax,8), %rdi
	movq	%r9, %r8
	movq	%rdi, %rcx
	subq	%rdi, %r8
	andl	$1, %ecx
	cmpq	$1, %rdi
	cmovle	%r8, %rcx
	movq	%rcx, (%rsi,%rax,8)
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L6
	xorl	%ecx, %ecx
	leaq	odd.5(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rbx,%rcx,8), %rax
	addq	$1, %rax
	movq	%rax, %r8
	shrq	$63, %r8
	addq	%r8, %rax
	andl	$1, %eax
	subq	%r8, %rax
	movq	%rax, (%rdi,%rcx,8)
	addq	$1, %rcx
	cmpq	%rcx, %rdx
	jne	.L7
	leaq	sum.4(%rip), %r8
	movq	(%rbx), %r9
	xorl	%eax, %eax
	leaq	-8(%r8), %r10
	.p2align 4,,10
	.p2align 3
.L10:
	testq	%rax, %rax
	jne	.L8
	movq	%r9, (%r8)
	cmpq	$1, %rdx
	je	.L9
	movl	$1, %eax
.L8:
	movq	(%rbx,%rax,8), %rcx
	addq	(%r10,%rax,8), %rcx
	movq	%rcx, (%r8,%rax,8)
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L10
.L9:
	movq	even.6(%rip), %r10
	cmpq	%r10, %r9
	cmovg	%r10, %r9
	xorl	%eax, %eax
	movq	%r9, %r12
	leaq	left1.3(%rip), %r9
	leaq	-8(%r9), %r13
	.p2align 4,,10
	.p2align 3
.L13:
	testq	%rax, %rax
	jne	.L11
	movq	%r12, (%r9)
	cmpq	$1, %rdx
	je	.L12
	movl	$1, %eax
.L11:
	movq	(%r8,%rax,8), %r11
	movq	(%rsi,%rax,8), %rcx
	addq	0(%r13,%rax,8), %rcx
	cmpq	%r11, %rcx
	cmovg	%r11, %rcx
	movq	%rcx, (%r9,%rax,8)
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L13
.L12:
	movq	left1.3(%rip), %rax
	movq	odd.5(%rip), %r12
	leaq	left2.2(%rip), %r8
	leaq	-8(%r8), %r13
	cmpq	%rax, %r12
	cmovg	%rax, %r12
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L16:
	testq	%rax, %rax
	jne	.L14
	movq	%r12, (%r8)
	cmpq	$1, %rdx
	je	.L15
	movl	$1, %eax
.L14:
	movq	(%r9,%rax,8), %r11
	movq	(%rdi,%rax,8), %rcx
	addq	0(%r13,%rax,8), %rcx
	cmpq	%r11, %rcx
	cmovg	%r11, %rcx
	movq	%rcx, (%r8,%rax,8)
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L16
.L15:
	movq	left2.2(%rip), %rax
	leaq	left3.1(%rip), %rdi
	leaq	-8(%rdi), %r11
	cmpq	%rax, %r10
	cmovg	%rax, %r10
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L19:
	testq	%rax, %rax
	jne	.L17
	movq	%r10, (%rdi)
	cmpq	$1, %rdx
	je	.L18
	movl	$1, %eax
.L17:
	movq	(%r8,%rax,8), %r9
	movq	(%rsi,%rax,8), %rcx
	addq	(%r11,%rax,8), %rcx
	cmpq	%r9, %rcx
	cmovg	%r9, %rcx
	movq	%rcx, (%rdi,%rax,8)
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L19
.L18:
	movq	left3.1(%rip), %rax
	movq	sum.4(%rip), %r9
	leaq	left4.0(%rip), %r8
	leaq	-8(%r8), %r10
	cmpq	%rax, %r9
	cmovg	%rax, %r9
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L22:
	testq	%rax, %rax
	jne	.L20
	movq	%r9, (%r8)
	movl	$1, %eax
	cmpq	$1, %rdx
	je	.L21
.L20:
	movq	(%rdi,%rax,8), %rsi
	movq	(%rbx,%rax,8), %rcx
	addq	(%r10,%rax,8), %rcx
	cmpq	%rsi, %rcx
	cmovg	%rsi, %rcx
	movq	%rcx, (%r8,%rax,8)
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L22
.L21:
	movq	-8(%r8,%rax,8), %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L48
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	movq	%rdx, %rax
	leaq	left4.0(%rip), %r8
	jmp	.L21
.L48:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.local	left4.0
	.comm	left4.0,1600080,32
	.local	left3.1
	.comm	left3.1,1600080,32
	.local	left2.2
	.comm	left2.2,1600080,32
	.local	left1.3
	.comm	left1.3,1600080,32
	.local	sum.4
	.comm	sum.4,1600080,32
	.local	odd.5
	.comm	odd.5,1600080,32
	.local	even.6
	.comm	even.6,1600080,32
	.local	a.7
	.comm	a.7,1600080,32
	.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 "pch.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

#define llong long long
#define fr(i,l,r) for(i=(l);i<(r);i++)
#define min(p,q) ((p)<(q)?(p):(q))
#define max(p,q) ((p)>(q)?(p):(q))
#define INF 1000000000000//10^12

int main(void)
{
	//変数の宣言
	llong int l;
	static llong int a[200010];
	static llong int even[200010];
	static llong int odd[200010];
	static llong int sum[200010];
	static llong int left1[200010];
	static llong int left2[200010];
	static llong int left3[200010];
	static llong int left4[200010];
	llong int temp;


	llong int ans;
	llong int i;
	llong int flag;

	//データの読み込み

	scanf("%lld", &l);
//	scanf_s("%lld", &l);


	for (i = 0;i < l;i++) {
		scanf("%lld", &a[i]);
	}
//	for (i = 0;i < l;i++) {
//		scanf_s("%lld", &a[i]);
//	}

	//	printf("nは%dです\n", n);
	//	printf("データの読み込み終了\n");
		//実際の処理

		//累積和even[k]を作る
	for (i = 0;i < l;i++) {
		if (a[i] < 2) {
			even[i] = 2 - a[i];
		}
		else {
			even[i] = a[i] % 2;
		}
	}
	//oddを作る
	for (i = 0;i < l;i++) {
		odd[i] = (a[i] + 1) % 2;
		
	}

	//sumを作る
	for (i = 0;i < l;i++) {
		if (i == 0) {
			sum[i] = a[i];
		}
		else {
			sum[i] = sum[i - 1] + a[i];
		}
	}

	for (i = 0;i < l;i++) {
		if (i == 0) {
			left1[i] = min(even[0], a[0]);
		}else{
			left1[i] = min(left1[i - 1] + even[i], sum[i]);
		}
	}

	for (i = 0;i < l;i++) {
		if (i == 0) {
			left2[i] = min(left1[0], odd[0]);
		}
		else {
			left2[i] = min(left2[i - 1] + odd[i], left1[i]);
		}
	}

	for (i = 0;i < l;i++) {
		if (i == 0) {
			left3[i] = min(left2[0], even[0]);
		}
		else {
			left3[i] = min(left3[i - 1] + even[i], left2[i]);
		}
	}

	for (i = 0;i < l;i++) {
		if (i == 0) {
			left4[i] = min(left3[0], sum[0]);
		}
		else {
			left4[i] = min(left4[i - 1] + a[i], left3[i]);
		}
	}

	//	printf("計算部分終了\n");

		//出力
	printf("%lld", left4[l-1]);
/*
	for (i = 0;i < l;i++) {
		printf("i=%lld,left1[i]=%lld\n", i, left1[i]);
	}

	for (i = 0;i < l;i++) {
		printf("i=%lld,left2[i]=%lld\n", i, left2[i]);
	}

	for (i = 0;i < l;i++) {
		printf("i=%lld,left3[i]=%lld\n", i, left3[i]);
	}

	for (i = 0;i < l;i++) {
		printf("i=%lld,left4[i]=%lld\n", i, left4[i]);
	}
*/
	//	printf("結果の出力終了\n");

	return 0;
}


4
1
0
4
3
 8
2
0
0
2
0
3
4
1
 4
0
0
4
3
 8
2
0
1
2
0
1
0
1
 8
2
0
1
2
0
1
0
0
 8
4
0
0
2
0
1
2
1
 7
314159265
429733551
846264338
327950288
419716939
937510582
0
 8
2
0
0
2
0
0
4
1
 7
314159265
429733551
846264338
327950288
419716939
937510582
-1
 4
0
1
4
3

1 4 0 3 2 5 1 4 0 1
Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
//#include "pch.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

#define llong long long
#define fr(i,l,r) for(i=(l);i<(r);i++)
#define min(p,q) ((p)<(q)?(p):(q))
#define max(p,q) ((p)>(q)?(p):(q))
#define INF 1000000000000//10^12

int main(void)
{
	//変数の宣言
	llong int l;
	static llong int a[200010];
	static llong int even[200010];
	static llong int odd[200010];
	static llong int sum[200010];
	static llong int left1[200010];
	static llong int left2[200010];
	static llong int left3[200010];
	static llong int left4[200010];
	llong int temp;


	llong int ans;
	llong int i;
	llong int flag;

	//データの読み込み

	scanf("%lld", &l);
//	scanf_s("%lld", &l);


	for (i = 0;i < l;i++) {
		scanf("%lld", &a[i]);
	}
//	for (i = 0;i < l;i++) {
//		scanf_s("%lld", &a[i]);
//	}

	//	printf("nは%dです\n", n);
	//	printf("データの読み込み終了\n");
		//実際の処理

		//累積和even[k]を作る
	for (i = 0;i < l;i++) {
		if (a[i] < 2) {
			even[i] = 2 - a[i];
		}
		else {
			even[i] = a[i] % 2;
		}
	}
	//oddを作る
	for (i = 0;i < l;i++) {
		odd[i] = (a[i] + 1) % 2;
		
	}

	//sumを作る
	for (i = 0;i < l;i++) {
		if (i == 0) {
			sum[i] = a[i];
		}
		else {
			sum[i] = sum[i - 1] + a[i];
		}
	}

	for (i = 0;i < l;i++) {
		if (i == 0) {
			left1[i] = min(even[0], a[0]);
		}else{
			left1[i] = min(left1[i - 1] + even[i], sum[i]);
		}
	}

	for (i = 0;i < l;i++) {
		if (i == 0) {
			left2[i] = min(left1[0], odd[0]);
		}
		else {
			left2[i] = min(left2[i - 1] + odd[i], left1[i]);
		}
	}

	for (i = 0;i < l;i++) {
		if (i == 0) {
			left3[i] = min(left2[0], even[0]);
		}
		else {
			left3[i] = min(left3[i - 1] + even[i], left2[i]);
		}
	}

	for (i = 0;i < l;i++) {
		if (i == 0) {
			left4[i] = min(left3[0], sum[0]);
		}
		else {
			left4[i] = min(left4[i - 1] + a[i], left3[i]);
		}
	}

	//	printf("計算部分終了\n");

		//出力
	printf("%lld", left4[l-1]);
/*
	for (i = 0;i < l;i++) {
		printf("i=%lld,left1[i]=%lld\n", i, left1[i]);
	}

	for (i = 0;i < l;i++) {
		printf("i=%lld,left2[i]=%lld\n", i, left2[i]);
	}

	for (i = 0;i < l;i++) {
		printf("i=%lld,left3[i]=%lld\n", i, left3[i]);
	}

	for (i = 0;i < l;i++) {
		printf("i=%lld,left4[i]=%lld\n", i, left4[i]);
	}
*/
	//	printf("結果の出力終了\n");

	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -16(%rbp)
	jmp	.L2
.L3:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -16(%rbp)
.L2:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L3
	movq	$0, -16(%rbp)
	jmp	.L4
.L7:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	$1, %rax
	jg	.L5
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	$2, %edx
	movq	%rdx, %rcx
	subq	%rax, %rcx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	even.6(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	jmp	.L6
.L5:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	even.6(%rip), %rax
	movq	%rcx, (%rdx,%rax)
.L6:
	addq	$1, -16(%rbp)
.L4:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L7
	movq	$0, -16(%rbp)
	jmp	.L8
.L9:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	$1, %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	odd.5(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addq	$1, -16(%rbp)
.L8:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L9
	movq	$0, -16(%rbp)
	jmp	.L10
.L13:
	cmpq	$0, -16(%rbp)
	jne	.L11
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sum.4(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L12
.L11:
	movq	-16(%rbp), %rax
	subq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	sum.4(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	sum.4(%rip), %rax
	movq	%rcx, (%rdx,%rax)
.L12:
	addq	$1, -16(%rbp)
.L10:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L13
	movq	$0, -16(%rbp)
	jmp	.L14
.L17:
	cmpq	$0, -16(%rbp)
	jne	.L15
	movq	a.7(%rip), %rdx
	movq	even.6(%rip), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left1.3(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L16
.L15:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	sum.4(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	subq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left1.3(%rip), %rdx
	movq	(%rcx,%rdx), %rsi
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	even.6(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	addq	%rsi, %rdx
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left1.3(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L16:
	addq	$1, -16(%rbp)
.L14:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L17
	movq	$0, -16(%rbp)
	jmp	.L18
.L21:
	cmpq	$0, -16(%rbp)
	jne	.L19
	movq	odd.5(%rip), %rdx
	movq	left1.3(%rip), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left2.2(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L20
.L19:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	left1.3(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	subq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left2.2(%rip), %rdx
	movq	(%rcx,%rdx), %rsi
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	odd.5(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	addq	%rsi, %rdx
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left2.2(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L20:
	addq	$1, -16(%rbp)
.L18:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L21
	movq	$0, -16(%rbp)
	jmp	.L22
.L25:
	cmpq	$0, -16(%rbp)
	jne	.L23
	movq	even.6(%rip), %rdx
	movq	left2.2(%rip), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left3.1(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L24
.L23:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	left2.2(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	subq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left3.1(%rip), %rdx
	movq	(%rcx,%rdx), %rsi
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	even.6(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	addq	%rsi, %rdx
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left3.1(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L24:
	addq	$1, -16(%rbp)
.L22:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L25
	movq	$0, -16(%rbp)
	jmp	.L26
.L29:
	cmpq	$0, -16(%rbp)
	jne	.L27
	movq	sum.4(%rip), %rdx
	movq	left3.1(%rip), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left4.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L28
.L27:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	left3.1(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	subq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left4.0(%rip), %rdx
	movq	(%rcx,%rdx), %rsi
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	a.7(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	addq	%rsi, %rdx
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left4.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L28:
	addq	$1, -16(%rbp)
.L26:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L29
	movq	-24(%rbp), %rax
	subq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	left4.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.local	a.7
	.comm	a.7,1600080,32
	.local	even.6
	.comm	even.6,1600080,32
	.local	odd.5
	.comm	odd.5,1600080,32
	.local	sum.4
	.comm	sum.4,1600080,32
	.local	left1.3
	.comm	left1.3,1600080,32
	.local	left2.2
	.comm	left2.2,1600080,32
	.local	left3.1
	.comm	left3.1,1600080,32
	.local	left4.0
	.comm	left4.0,1600080,32
	.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
	.section	.rodata
.LC0:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -16(%rbp)
	jmp	.L2
.L3:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -16(%rbp)
.L2:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L3
	movq	$0, -16(%rbp)
	jmp	.L4
.L7:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	$1, %rax
	jg	.L5
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	$2, %edx
	movq	%rdx, %rcx
	subq	%rax, %rcx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	even.6(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	jmp	.L6
.L5:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	even.6(%rip), %rax
	movq	%rcx, (%rdx,%rax)
.L6:
	addq	$1, -16(%rbp)
.L4:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L7
	movq	$0, -16(%rbp)
	jmp	.L8
.L9:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	$1, %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	odd.5(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addq	$1, -16(%rbp)
.L8:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L9
	movq	$0, -16(%rbp)
	jmp	.L10
.L13:
	cmpq	$0, -16(%rbp)
	jne	.L11
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sum.4(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L12
.L11:
	movq	-16(%rbp), %rax
	subq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	sum.4(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a.7(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	sum.4(%rip), %rax
	movq	%rcx, (%rdx,%rax)
.L12:
	addq	$1, -16(%rbp)
.L10:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L13
	movq	$0, -16(%rbp)
	jmp	.L14
.L17:
	cmpq	$0, -16(%rbp)
	jne	.L15
	movq	a.7(%rip), %rdx
	movq	even.6(%rip), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left1.3(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L16
.L15:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	sum.4(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	subq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left1.3(%rip), %rdx
	movq	(%rcx,%rdx), %rsi
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	even.6(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	addq	%rsi, %rdx
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left1.3(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L16:
	addq	$1, -16(%rbp)
.L14:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L17
	movq	$0, -16(%rbp)
	jmp	.L18
.L21:
	cmpq	$0, -16(%rbp)
	jne	.L19
	movq	odd.5(%rip), %rdx
	movq	left1.3(%rip), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left2.2(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L20
.L19:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	left1.3(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	subq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left2.2(%rip), %rdx
	movq	(%rcx,%rdx), %rsi
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	odd.5(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	addq	%rsi, %rdx
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left2.2(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L20:
	addq	$1, -16(%rbp)
.L18:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L21
	movq	$0, -16(%rbp)
	jmp	.L22
.L25:
	cmpq	$0, -16(%rbp)
	jne	.L23
	movq	even.6(%rip), %rdx
	movq	left2.2(%rip), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left3.1(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L24
.L23:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	left2.2(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	subq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left3.1(%rip), %rdx
	movq	(%rcx,%rdx), %rsi
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	even.6(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	addq	%rsi, %rdx
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left3.1(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L24:
	addq	$1, -16(%rbp)
.L22:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L25
	movq	$0, -16(%rbp)
	jmp	.L26
.L29:
	cmpq	$0, -16(%rbp)
	jne	.L27
	movq	sum.4(%rip), %rdx
	movq	left3.1(%rip), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left4.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L28
.L27:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	left3.1(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	subq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left4.0(%rip), %rdx
	movq	(%rcx,%rdx), %rsi
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	a.7(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	addq	%rsi, %rdx
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	movq	-16(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	left4.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L28:
	addq	$1, -16(%rbp)
.L26:
	movq	-24(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L29
	movq	-24(%rbp), %rax
	subq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	left4.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.local	a.7
	.comm	a.7,1600080,32
	.local	even.6
	.comm	even.6,1600080,32
	.local	odd.5
	.comm	odd.5,1600080,32
	.local	sum.4
	.comm	sum.4,1600080,32
	.local	left1.3
	.comm	left1.3,1600080,32
	.local	left2.2
	.comm	left2.2,1600080,32
	.local	left3.1
	.comm	left3.1,1600080,32
	.local	left4.0
	.comm	left4.0,1600080,32
	.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:
