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>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

ll n;
ll a[200010];
ll dp[200010][6];
int main(){
	scanf("%lld",&n);
	rep(i,0,n)scanf("%lld",a+i);
	rep(i,0,n){
		dp[i+1][0]=a[i]              +dp[i][0];
		dp[i+1][1]=(a[i]==0?2:a[i]%2)+min(dp[i][0],dp[i][1]);
		dp[i+1][2]=(a[i]+1)%2        +min(dp[i][0],min(dp[i][1],dp[i][2]));
		dp[i+1][3]=(a[i]==0?2:a[i]%2)+min(dp[i][0],min(dp[i][1],min(dp[i][2],dp[i][3])));
		dp[i+1][4]=a[i]              +min(dp[i][0],min(dp[i][1],min(dp[i][2],min(dp[i][3],dp[i][4]))));
		rep(j,0,5)dp[i+1][j]=min(dp[i+1][j],INF);
	}
	printf("%lld",min(dp[n][0],min(dp[n][1],min(dp[n][2],min(dp[n][3],dp[n][4])))));
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	upll
	.type	upll, @function
upll:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jl	.L2
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	setg	%al
	movzbl	%al, %eax
	jmp	.L4
.L2:
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	upll, .-upll
	.globl	downll
	.type	downll, @function
downll:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jl	.L6
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L7
	movl	$-1, %eax
	jmp	.L10
.L7:
	movl	$0, %eax
	jmp	.L10
.L6:
	movl	$1, %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	downll, .-downll
	.globl	sortup
	.type	sortup, @function
sortup:
.LFB8:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-8(%rbp), %rax
	leaq	upll(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sortup, .-sortup
	.globl	sortdown
	.type	sortdown, @function
sortdown:
.LFB9:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-8(%rbp), %rax
	leaq	downll(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	sortdown, .-sortdown
	.globl	pom
	.type	pom, @function
pom:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movq	$1, -8(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	jmp	.L14
.L17:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L16
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8(%rbp)
.L16:
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -32(%rbp)
.L14:
	cmpq	$0, -32(%rbp)
	jne	.L17
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	pom, .-pom
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600080
a:
	.zero	1600080
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 9600480
dp:
	.zero	9600480
	.section	.rodata
.LC0:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.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
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -24(%rbp)
	jmp	.L20
.L21:
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %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
	addq	$1, -24(%rbp)
.L20:
	movq	n(%rip), %rax
	cmpq	%rax, -24(%rbp)
	jl	.L21
	movq	$0, -16(%rbp)
	jmp	.L22
.L29:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	addq	%rsi, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	je	.L23
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, %rsi
	jmp	.L24
.L23:
	movl	$2, %esi
.L24:
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	addq	%rsi, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	$1, %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, %rsi
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	16+dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	addq	%rsi, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	16+dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	je	.L25
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, %rsi
	jmp	.L26
.L25:
	movl	$2, %esi
.L26:
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	24+dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	16+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	addq	%rsi, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	24+dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	32+dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	24+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	16+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	addq	%rsi, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	32+dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	$0, -8(%rbp)
	jmp	.L27
.L28:
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	-8(%rbp), %rdx
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	leaq	1(%rdx), %rcx
	movabsq	$4611686016279904256, %rdx
	cmpq	%rdx, %rax
	cmovle	%rax, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	movq	-8(%rbp), %rcx
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	addq	$1, -8(%rbp)
.L27:
	cmpq	$4, -8(%rbp)
	jle	.L28
	addq	$1, -16(%rbp)
.L22:
	movq	n(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L29
	movq	n(%rip), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	32+dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	n(%rip), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	24+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	n(%rip), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	16+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	n(%rip), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	n(%rip), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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
	.globl	upll
	.type	upll, @function
upll:
.LFB51:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	cmpq	%rax, (%rdi)
	movl	$-1, %edx
	setg	%al
	movzbl	%al, %eax
	cmovl	%edx, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	upll, .-upll
	.p2align 4
	.globl	downll
	.type	downll, @function
downll:
.LFB52:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rdi)
	jl	.L5
	setg	%al
	movzbl	%al, %eax
	negl	%eax
.L5:
	ret
	.cfi_endproc
.LFE52:
	.size	downll, .-downll
	.p2align 4
	.globl	sortup
	.type	sortup, @function
sortup:
.LFB53:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	leaq	upll(%rip), %rcx
	movl	$8, %edx
	jmp	qsort@PLT
	.cfi_endproc
.LFE53:
	.size	sortup, .-sortup
	.p2align 4
	.globl	sortdown
	.type	sortdown, @function
sortdown:
.LFB54:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	leaq	downll(%rip), %rcx
	movl	$8, %edx
	jmp	qsort@PLT
	.cfi_endproc
.LFE54:
	.size	sortdown, .-sortdown
	.p2align 4
	.globl	pom
	.type	pom, @function
pom:
.LFB55:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movslq	%edx, %r8
	movl	$1, %r9d
	cqto
	idivq	%r8
	movq	%rdx, %rcx
	testq	%rsi, %rsi
	je	.L10
	.p2align 4,,10
	.p2align 3
.L13:
	testb	$1, %sil
	je	.L12
	movq	%r9, %rax
	imulq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
.L12:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rsi, %rax
	shrq	$63, %rax
	addq	%rax, %rsi
	sarq	%rsi
	movq	%rdx, %rcx
	jne	.L13
.L10:
	movq	%r9, %rax
	ret
	.cfi_endproc
.LFE55:
	.size	pom, .-pom
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB56:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	__isoc99_scanf@PLT
	movq	n(%rip), %r15
	testq	%r15, %r15
	jle	.L20
	leaq	a(%rip), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	n(%rip), %r15
	addq	$8, %rbp
	cmpq	%rbx, %r15
	jg	.L21
	testq	%r15, %r15
	jle	.L20
	leaq	(%r12,%r15,8), %rbx
	movq	%r15, 8(%rsp)
	movq	32+dp(%rip), %rax
	leaq	48+dp(%rip), %rbp
	movq	%rbx, (%rsp)
	movq	24+dp(%rip), %r9
	movq	16+dp(%rip), %r8
	movq	8+dp(%rip), %rdi
	movq	dp(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L23:
	movq	(%r12), %r10
	movl	$2, %ebx
	leaq	(%rcx,%r10), %r15
	testq	%r10, %r10
	je	.L22
	movq	%r10, %rdx
	shrq	$63, %rdx
	leaq	(%r10,%rdx), %rbx
	andl	$1, %ebx
	subq	%rdx, %rbx
.L22:
	cmpq	%rdi, %rcx
	movq	%rdi, %r11
	leaq	1(%r10), %rdx
	cmovle	%rcx, %r11
	cmpq	%rcx, %r8
	movq	%rdx, %rsi
	cmovle	%r8, %rcx
	leaq	(%r11,%rbx), %r14
	cmpq	%rdi, %rcx
	movq	%r14, %xmm1
	cmovg	%rdi, %rcx
	shrq	$63, %rsi
	movabsq	$4611686016279904256, %rdi
	addq	%rsi, %rdx
	andl	$1, %edx
	subq	%rsi, %rdx
	movq	%r9, %rsi
	addq	%rcx, %rdx
	cmpq	%r9, %r8
	movabsq	$4611686016279904256, %rcx
	cmovle	%r8, %rsi
	movabsq	$4611686016279904256, %r8
	cmpq	%rsi, %r11
	movq	%rsi, %r9
	cmovle	%r11, %r9
	addq	%rbx, %r9
	cmpq	%rcx, %r15
	cmovle	%r15, %rcx
	cmpq	%rdi, %r14
	cmovle	%r14, %rdi
	cmpq	%r8, %rdx
	cmovle	%rdx, %r8
	movq	%rcx, %xmm0
	movabsq	$4611686016279904256, %rdx
	cmpq	%rdx, %r9
	punpcklqdq	%xmm1, %xmm0
	cmovg	%rdx, %r9
	cmpq	%rax, %rsi
	movaps	%xmm0, 0(%rbp)
	movq	%r8, %xmm2
	cmovg	%rax, %rsi
	movq	%rdi, %xmm0
	punpcklqdq	%xmm2, %xmm0
	cmpq	%r11, %rsi
	movups	%xmm0, 8(%rbp)
	movq	%r9, %xmm0
	cmovg	%r11, %rsi
	leaq	(%rsi,%r10), %rax
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	addq	$8, %r12
	addq	$48, %rbp
	movq	%rax, %xmm3
	punpcklqdq	%xmm3, %xmm0
	movups	%xmm0, -24(%rbp)
	cmpq	(%rsp), %r12
	jne	.L23
	movq	8(%rsp), %r15
.L20:
	leaq	(%r15,%r15,2), %rdx
	leaq	dp(%rip), %rax
	movq	%r13, %rsi
	movl	$1, %edi
	salq	$4, %rdx
	addq	%rdx, %rax
	movq	24(%rax), %rcx
	movq	32(%rax), %rdx
	cmpq	%rcx, %rdx
	cmovg	%rcx, %rdx
	movq	16(%rax), %rcx
	cmpq	%rcx, %rdx
	cmovg	%rcx, %rdx
	movq	8(%rax), %rcx
	movq	(%rax), %rax
	cmpq	%rcx, %rdx
	cmovg	%rcx, %rdx
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$24, %rsp
	.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
	.cfi_endproc
.LFE56:
	.size	main, .-main
	.globl	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 9600480
dp:
	.zero	9600480
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600080
a:
	.zero	1600080
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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
	.globl	upll
	.type	upll, @function
upll:
.LFB51:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	cmpq	%rax, (%rdi)
	movl	$-1, %edx
	setg	%al
	movzbl	%al, %eax
	cmovl	%edx, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	upll, .-upll
	.p2align 4
	.globl	downll
	.type	downll, @function
downll:
.LFB52:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rdi)
	jl	.L5
	setg	%al
	movzbl	%al, %eax
	negl	%eax
.L5:
	ret
	.cfi_endproc
.LFE52:
	.size	downll, .-downll
	.p2align 4
	.globl	sortup
	.type	sortup, @function
sortup:
.LFB53:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	leaq	upll(%rip), %rcx
	movl	$8, %edx
	jmp	qsort@PLT
	.cfi_endproc
.LFE53:
	.size	sortup, .-sortup
	.p2align 4
	.globl	sortdown
	.type	sortdown, @function
sortdown:
.LFB54:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	leaq	downll(%rip), %rcx
	movl	$8, %edx
	jmp	qsort@PLT
	.cfi_endproc
.LFE54:
	.size	sortdown, .-sortdown
	.p2align 4
	.globl	pom
	.type	pom, @function
pom:
.LFB55:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movslq	%edx, %r8
	movl	$1, %r9d
	cqto
	idivq	%r8
	movq	%rdx, %rcx
	testq	%rsi, %rsi
	je	.L10
	.p2align 4,,10
	.p2align 3
.L13:
	testb	$1, %sil
	je	.L12
	movq	%r9, %rax
	imulq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
.L12:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rsi, %rax
	shrq	$63, %rax
	addq	%rax, %rsi
	sarq	%rsi
	movq	%rdx, %rcx
	jne	.L13
.L10:
	movq	%r9, %rax
	ret
	.cfi_endproc
.LFE55:
	.size	pom, .-pom
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB56:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	__isoc99_scanf@PLT
	movq	n(%rip), %r15
	testq	%r15, %r15
	jle	.L20
	leaq	a(%rip), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	n(%rip), %r15
	addq	$8, %rbp
	cmpq	%rbx, %r15
	jg	.L21
	testq	%r15, %r15
	jle	.L20
	leaq	(%r12,%r15,8), %rbx
	movq	%r15, 8(%rsp)
	movq	32+dp(%rip), %rax
	leaq	48+dp(%rip), %rbp
	movq	%rbx, (%rsp)
	movq	24+dp(%rip), %r9
	movq	16+dp(%rip), %r8
	movq	8+dp(%rip), %rdi
	movq	dp(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L23:
	movq	(%r12), %r10
	movl	$2, %ebx
	leaq	(%rcx,%r10), %r15
	testq	%r10, %r10
	je	.L22
	movq	%r10, %rdx
	shrq	$63, %rdx
	leaq	(%r10,%rdx), %rbx
	andl	$1, %ebx
	subq	%rdx, %rbx
.L22:
	cmpq	%rdi, %rcx
	movq	%rdi, %r11
	leaq	1(%r10), %rdx
	cmovle	%rcx, %r11
	cmpq	%rcx, %r8
	movq	%rdx, %rsi
	cmovle	%r8, %rcx
	leaq	(%r11,%rbx), %r14
	cmpq	%rdi, %rcx
	movq	%r14, %xmm1
	cmovg	%rdi, %rcx
	shrq	$63, %rsi
	movabsq	$4611686016279904256, %rdi
	addq	%rsi, %rdx
	andl	$1, %edx
	subq	%rsi, %rdx
	movq	%r9, %rsi
	addq	%rcx, %rdx
	cmpq	%r9, %r8
	movabsq	$4611686016279904256, %rcx
	cmovle	%r8, %rsi
	movabsq	$4611686016279904256, %r8
	cmpq	%rsi, %r11
	movq	%rsi, %r9
	cmovle	%r11, %r9
	addq	%rbx, %r9
	cmpq	%rcx, %r15
	cmovle	%r15, %rcx
	cmpq	%rdi, %r14
	cmovle	%r14, %rdi
	cmpq	%r8, %rdx
	cmovle	%rdx, %r8
	movq	%rcx, %xmm0
	movabsq	$4611686016279904256, %rdx
	cmpq	%rdx, %r9
	punpcklqdq	%xmm1, %xmm0
	cmovg	%rdx, %r9
	cmpq	%rax, %rsi
	movaps	%xmm0, 0(%rbp)
	movq	%r8, %xmm2
	cmovg	%rax, %rsi
	movq	%rdi, %xmm0
	punpcklqdq	%xmm2, %xmm0
	cmpq	%r11, %rsi
	movups	%xmm0, 8(%rbp)
	movq	%r9, %xmm0
	cmovg	%r11, %rsi
	leaq	(%rsi,%r10), %rax
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	addq	$8, %r12
	addq	$48, %rbp
	movq	%rax, %xmm3
	punpcklqdq	%xmm3, %xmm0
	movups	%xmm0, -24(%rbp)
	cmpq	(%rsp), %r12
	jne	.L23
	movq	8(%rsp), %r15
.L20:
	leaq	(%r15,%r15,2), %rdx
	leaq	dp(%rip), %rax
	movq	%r13, %rsi
	movl	$1, %edi
	salq	$4, %rdx
	addq	%rdx, %rax
	movq	24(%rax), %rcx
	movq	32(%rax), %rdx
	cmpq	%rcx, %rdx
	cmovg	%rcx, %rdx
	movq	16(%rax), %rcx
	cmpq	%rcx, %rdx
	cmovg	%rcx, %rdx
	movq	8(%rax), %rcx
	movq	(%rax), %rax
	cmpq	%rcx, %rdx
	cmovg	%rcx, %rdx
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$24, %rsp
	.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
	.cfi_endproc
.LFE56:
	.size	main, .-main
	.globl	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 9600480
dp:
	.zero	9600480
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600080
a:
	.zero	1600080
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

ll n;
ll a[200010];
ll dp[200010][6];
int main(){
	scanf("%lld",&n);
	rep(i,0,n)scanf("%lld",a+i);
	rep(i,0,n){
		dp[i+1][0]=a[i]              +dp[i][0];
		dp[i+1][1]=(a[i]==0?2:a[i]%2)+min(dp[i][0],dp[i][1]);
		dp[i+1][2]=(a[i]+1)%2        +min(dp[i][0],min(dp[i][1],dp[i][2]));
		dp[i+1][3]=(a[i]==0?2:a[i]%2)+min(dp[i][0],min(dp[i][1],min(dp[i][2],dp[i][3])));
		dp[i+1][4]=a[i]              +min(dp[i][0],min(dp[i][1],min(dp[i][2],min(dp[i][3],dp[i][4]))));
		rep(j,0,5)dp[i+1][j]=min(dp[i+1][j],INF);
	}
	printf("%lld",min(dp[n][0],min(dp[n][1],min(dp[n][2],min(dp[n][3],dp[n][4])))));
}
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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

ll n;
ll a[200010];
ll dp[200010][6];
int main(){
	scanf("%lld",&n);
	rep(i,0,n)scanf("%lld",a+i);
	rep(i,0,n){
		dp[i+1][0]=a[i]              +dp[i][0];
		dp[i+1][1]=(a[i]==0?2:a[i]%2)+min(dp[i][0],dp[i][1]);
		dp[i+1][2]=(a[i]+1)%2        +min(dp[i][0],min(dp[i][1],dp[i][2]));
		dp[i+1][3]=(a[i]==0?2:a[i]%2)+min(dp[i][0],min(dp[i][1],min(dp[i][2],dp[i][3])));
		dp[i+1][4]=a[i]              +min(dp[i][0],min(dp[i][1],min(dp[i][2],min(dp[i][3],dp[i][4]))));
		rep(j,0,5)dp[i+1][j]=min(dp[i+1][j],INF);
	}
	printf("%lld",min(dp[n][0],min(dp[n][1],min(dp[n][2],min(dp[n][3],dp[n][4])))));
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	upll
	.type	upll, @function
upll:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jl	.L2
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	setg	%al
	movzbl	%al, %eax
	jmp	.L4
.L2:
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	upll, .-upll
	.globl	downll
	.type	downll, @function
downll:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jl	.L6
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L7
	movl	$-1, %eax
	jmp	.L10
.L7:
	movl	$0, %eax
	jmp	.L10
.L6:
	movl	$1, %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	downll, .-downll
	.globl	sortup
	.type	sortup, @function
sortup:
.LFB8:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-8(%rbp), %rax
	leaq	upll(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sortup, .-sortup
	.globl	sortdown
	.type	sortdown, @function
sortdown:
.LFB9:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-8(%rbp), %rax
	leaq	downll(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	sortdown, .-sortdown
	.globl	pom
	.type	pom, @function
pom:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movq	$1, -8(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	jmp	.L14
.L17:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L16
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8(%rbp)
.L16:
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -32(%rbp)
.L14:
	cmpq	$0, -32(%rbp)
	jne	.L17
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	pom, .-pom
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600080
a:
	.zero	1600080
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 9600480
dp:
	.zero	9600480
	.section	.rodata
.LC0:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.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
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -24(%rbp)
	jmp	.L20
.L21:
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %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
	addq	$1, -24(%rbp)
.L20:
	movq	n(%rip), %rax
	cmpq	%rax, -24(%rbp)
	jl	.L21
	movq	$0, -16(%rbp)
	jmp	.L22
.L29:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	addq	%rsi, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	je	.L23
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, %rsi
	jmp	.L24
.L23:
	movl	$2, %esi
.L24:
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	addq	%rsi, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	$1, %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, %rsi
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	16+dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	addq	%rsi, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	16+dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	je	.L25
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, %rsi
	jmp	.L26
.L25:
	movl	$2, %esi
.L26:
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	24+dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	16+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	addq	%rsi, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	24+dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	32+dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	24+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	16+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	addq	%rsi, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	32+dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	$0, -8(%rbp)
	jmp	.L27
.L28:
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	-8(%rbp), %rdx
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	leaq	1(%rdx), %rcx
	movabsq	$4611686016279904256, %rdx
	cmpq	%rdx, %rax
	cmovle	%rax, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	movq	-8(%rbp), %rcx
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	addq	$1, -8(%rbp)
.L27:
	cmpq	$4, -8(%rbp)
	jle	.L28
	addq	$1, -16(%rbp)
.L22:
	movq	n(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L29
	movq	n(%rip), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	32+dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	n(%rip), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	24+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	n(%rip), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	16+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	n(%rip), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	n(%rip), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	upll
	.type	upll, @function
upll:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jl	.L2
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	setg	%al
	movzbl	%al, %eax
	jmp	.L4
.L2:
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	upll, .-upll
	.globl	downll
	.type	downll, @function
downll:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jl	.L6
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L7
	movl	$-1, %eax
	jmp	.L10
.L7:
	movl	$0, %eax
	jmp	.L10
.L6:
	movl	$1, %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	downll, .-downll
	.globl	sortup
	.type	sortup, @function
sortup:
.LFB8:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-8(%rbp), %rax
	leaq	upll(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sortup, .-sortup
	.globl	sortdown
	.type	sortdown, @function
sortdown:
.LFB9:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-8(%rbp), %rax
	leaq	downll(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	sortdown, .-sortdown
	.globl	pom
	.type	pom, @function
pom:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movq	$1, -8(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	jmp	.L14
.L17:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L16
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8(%rbp)
.L16:
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -32(%rbp)
.L14:
	cmpq	$0, -32(%rbp)
	jne	.L17
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	pom, .-pom
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600080
a:
	.zero	1600080
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 9600480
dp:
	.zero	9600480
	.section	.rodata
.LC0:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.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
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -24(%rbp)
	jmp	.L20
.L21:
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %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
	addq	$1, -24(%rbp)
.L20:
	movq	n(%rip), %rax
	cmpq	%rax, -24(%rbp)
	jl	.L21
	movq	$0, -16(%rbp)
	jmp	.L22
.L29:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	addq	%rsi, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	je	.L23
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, %rsi
	jmp	.L24
.L23:
	movl	$2, %esi
.L24:
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	addq	%rsi, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	$1, %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, %rsi
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	16+dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	addq	%rsi, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	16+dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	je	.L25
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, %rsi
	jmp	.L26
.L25:
	movl	$2, %esi
.L26:
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	24+dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	16+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	addq	%rsi, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	24+dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	32+dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	24+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	16+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	addq	%rsi, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	32+dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	movq	$0, -8(%rbp)
	jmp	.L27
.L28:
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	-8(%rbp), %rdx
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	leaq	1(%rdx), %rcx
	movabsq	$4611686016279904256, %rdx
	cmpq	%rdx, %rax
	cmovle	%rax, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	movq	-8(%rbp), %rcx
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp(%rip), %rax
	movq	%rdx, (%rcx,%rax)
	addq	$1, -8(%rbp)
.L27:
	cmpq	$4, -8(%rbp)
	jle	.L28
	addq	$1, -16(%rbp)
.L22:
	movq	n(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L29
	movq	n(%rip), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	32+dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	n(%rip), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	24+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	n(%rip), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	16+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	n(%rip), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	n(%rip), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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:
