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)

int cmp(const void*a,const void*b){
	ll aa=*(ll*)a;
	ll bb=*(ll*)b;
	ll aaa=aa&-aa;
	ll bbb=bb&-bb;
	if(aaa<bbb)return -1;
	if(aaa>bbb)return 1;
	if(aa<bb)return -1;
	return 1;
}

ll n,ans;
ll a[200010];
int flag[200010];
int nibutan(int l,int r,int x){
	//x以下の最大のものを[l,r)で探す
	if(a[l]>x)return -1;
	while(r-l>1){
		int m=(l+r)/2;
		if(a[m]<x)l=m;
		else if(a[m]>x)r=m;
		else if(flag[m])r=m;
		else l=m;
	}
	return l;
}

int main(){
	scanf("%lld",&n);
	rep(i,0,n)scanf("%lld",a+i);
	qsort(a,n,sizeof(ll),cmp);
	for(int i=0;i<n;){
		int r=i;
		int t=a[i]&-a[i];
		while((a[r]&-a[r])==t)r++;
		//[i,r)で組にする
		for(int j=r-1;j>i;j--)if(!flag[j]){
			//a[j]と組に出来るものは、a[j]より真に大きい最小の2ベキをXとしてX-a[j]のみ
			//これを[i,j)でにぶたんして探す
			flag[j]=1;
			int x=1;
			while(x<=a[j])x+=x;
			int idx=nibutan(i,r,x-a[j]);
			if(idx!=-1&&a[idx]+a[j]==x&&!flag[idx]){
				ans++;
				flag[idx]=1;
			}
		}
		i=r;
	}
	printf("%lld",ans);
}```

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	cmp
	.type	cmp, @function
cmp:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	-40(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-48(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	-32(%rbp), %rax
	negq	%rax
	andq	-32(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-24(%rbp), %rax
	negq	%rax
	andq	-24(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jge	.L20
	movl	$-1, %eax
	jmp	.L21
.L20:
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jle	.L22
	movl	$1, %eax
	jmp	.L21
.L22:
	movq	-32(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jge	.L23
	movl	$-1, %eax
	jmp	.L21
.L23:
	movl	$1, %eax
.L21:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	cmp, .-cmp
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	ans
	.align 8
	.type	ans, @object
	.size	ans, 8
ans:
	.zero	8
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600080
a:
	.zero	1600080
	.globl	flag
	.align 32
	.type	flag, @object
	.size	flag, 800040
flag:
	.zero	800040
	.text
	.globl	nibutan
	.type	nibutan, @function
nibutan:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jle	.L27
	movl	$-1, %eax
	jmp	.L26
.L31:
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jge	.L28
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L27
.L28:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jle	.L29
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L27
.L29:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L30
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L27
.L30:
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L27:
	movl	-24(%rbp), %eax
	subl	-20(%rbp), %eax
	cmpl	$1, %eax
	jg	.L31
	movl	-20(%rbp), %eax
.L26:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	nibutan, .-nibutan
	.section	.rodata
.LC0:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.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, -8(%rbp)
	jmp	.L33
.L34:
	movq	-8(%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, -8(%rbp)
.L33:
	movq	n(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jl	.L34
	movq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	cmp(%rip), %rax
	movq	%rax, %rcx
	movl	$8, %edx
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -32(%rbp)
	jmp	.L35
.L43:
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	%eax, %ecx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	negl	%eax
	andl	%ecx, %eax
	movl	%eax, -16(%rbp)
	jmp	.L36
.L37:
	addl	$1, -28(%rbp)
.L36:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	negq	%rax
	andq	%rax, %rcx
	movq	%rcx, %rdx
	movl	-16(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	je	.L37
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	jmp	.L38
.L42:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L39
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	$1, -20(%rbp)
	jmp	.L40
.L41:
	sall	-20(%rbp)
.L40:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	a(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jle	.L41
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	a(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-28(%rbp), %ecx
	movl	-32(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	nibutan
	movl	%eax, -12(%rbp)
	cmpl	$-1, -12(%rbp)
	je	.L39
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	(%rcx,%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jne	.L39
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L39
	movq	ans(%rip), %rax
	addq	$1, %rax
	movq	%rax, ans(%rip)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	$1, (%rdx,%rax)
.L39:
	subl	$1, -24(%rbp)
.L38:
	movl	-24(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jg	.L42
	movl	-28(%rbp), %eax
	movl	%eax, -32(%rbp)
.L35:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	n(%rip), %rax
	cmpq	%rax, %rdx
	jl	.L43
	movq	ans(%rip), %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
.LFE13:
	.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	cmp
	.type	cmp, @function
cmp:
.LFB56:
	.cfi_startproc
	endbr64
	movq	%rsi, %r8
	movq	(%rdi), %rsi
	movq	(%r8), %rcx
	movl	$-1, %r8d
	movq	%rsi, %rdx
	movq	%rcx, %rax
	negq	%rdx
	negq	%rax
	andq	%rsi, %rdx
	andq	%rcx, %rax
	cmpq	%rax, %rdx
	jl	.L8
	jne	.L13
	cmpq	%rcx, %rsi
	jl	.L8
.L13:
	movl	$1, %r8d
.L8:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE56:
	.size	cmp, .-cmp
	.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	.L19
	.p2align 4,,10
	.p2align 3
.L22:
	testb	$1, %sil
	je	.L21
	movq	%r9, %rax
	imulq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
.L21:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rsi, %rax
	shrq	$63, %rax
	addq	%rax, %rsi
	sarq	%rsi
	movq	%rdx, %rcx
	jne	.L22
.L19:
	movq	%r9, %rax
	ret
	.cfi_endproc
.LFE55:
	.size	pom, .-pom
	.p2align 4
	.globl	nibutan
	.type	nibutan, @function
nibutan:
.LFB57:
	.cfi_startproc
	endbr64
	movslq	%edi, %rax
	leaq	a(%rip), %rdi
	movslq	%edx, %rdx
	movq	%rax, %r8
	cmpq	%rdx, (%rdi,%rax,8)
	jg	.L32
	movl	%esi, %eax
	subl	%r8d, %eax
	cmpl	$1, %eax
	jle	.L29
	leaq	flag(%rip), %r9
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L37:
	jl	.L34
	movl	(%r9,%rcx,4), %ecx
	testl	%ecx, %ecx
	cmove	%eax, %r8d
	cmovne	%eax, %esi
.L30:
	movl	%esi, %eax
	subl	%r8d, %eax
	cmpl	$1, %eax
	jle	.L29
.L31:
	leal	(%r8,%rsi), %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	movslq	%eax, %rcx
	cmpq	(%rdi,%rcx,8), %rdx
	jle	.L37
	movl	%eax, %r8d
	movl	%esi, %eax
	subl	%r8d, %eax
	cmpl	$1, %eax
	jg	.L31
.L29:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L34:
	movl	%eax, %esi
	jmp	.L30
.L32:
	movl	$-1, %r8d
	jmp	.L29
	.cfi_endproc
.LFE57:
	.size	nibutan, .-nibutan
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB58:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	a(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rsi
	testq	%rsi, %rsi
	jle	.L39
	movq	%rbx, %r12
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L40:
	movq	%r12, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rsi
	addq	$8, %r12
	cmpq	%rbp, %rsi
	jg	.L40
.L39:
	leaq	cmp(%rip), %rcx
	movl	$8, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	movq	n(%rip), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	movq	ans(%rip), %rax
	movq	%rax, 40(%rsp)
	jle	.L42
	movq	%rax, 32(%rsp)
	xorl	%r15d, %r15d
	leaq	flag(%rip), %rbp
	movb	$0, 31(%rsp)
	.p2align 4,,10
	.p2align 3
.L55:
	movslq	%r15d, %rax
	movq	(%rbx,%rax,8), %r13
	movl	%r13d, %r12d
	movq	%r13, %rdx
	negl	%r12d
	negq	%rdx
	andl	%r13d, %r12d
	andq	%r13, %rdx
	movslq	%r12d, %r12
	movq	%rdx, 8(%rsp)
	cmpq	%r12, %rdx
	jne	.L43
	leaq	(%rbx,%rax,8), %rdx
	movl	%r15d, %r11d
	.p2align 4,,10
	.p2align 3
.L44:
	movq	8(%rdx), %rcx
	movl	%r11d, %edi
	addq	$8, %rdx
	addl	$1, %r11d
	movq	%rcx, %rax
	negq	%rax
	andq	%rcx, %rax
	cmpq	%r12, %rax
	je	.L44
.L45:
	cmpl	%edi, %r15d
	jge	.L46
	movl	%r11d, %r14d
	movslq	%edi, %rdi
	subl	%r15d, %r14d
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L47:
	subq	$1, %rdi
	cmpl	%edi, %r15d
	jge	.L46
.L53:
	movl	0(%rbp,%rdi,4), %eax
	testl	%eax, %eax
	jne	.L47
	movq	(%rbx,%rdi,8), %rsi
	movl	$1, 0(%rbp,%rdi,4)
	movl	$1, %eax
	testq	%rsi, %rsi
	jle	.L58
	.p2align 4,,10
	.p2align 3
.L49:
	addl	%eax, %eax
	movslq	%eax, %rcx
	cmpq	%rsi, %rcx
	jle	.L49
.L48:
	subl	%esi, %eax
	movslq	%eax, %rdx
	cmpq	%rdx, %r13
	jg	.L47
	cmpl	$1, %r14d
	jle	.L59
	movl	%r11d, %r9d
	movl	%r15d, %r8d
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L75:
	jl	.L61
	movl	0(%rbp,%r10,4), %r10d
	testl	%r10d, %r10d
	cmovne	%eax, %r9d
	cmove	%eax, %r8d
.L51:
	movl	%r9d, %eax
	subl	%r8d, %eax
	cmpl	$1, %eax
	jle	.L74
.L52:
	leal	(%r8,%r9), %eax
	sarl	%eax
	movslq	%eax, %r10
	cmpq	(%rbx,%r10,8), %rdx
	jle	.L75
	movl	%eax, %r8d
	movl	%r9d, %eax
	subl	%r8d, %eax
	cmpl	$1, %eax
	jg	.L52
.L74:
	movslq	%r8d, %rax
	movq	(%rbx,%rax,8), %rax
.L50:
	addq	%rax, %rsi
	cmpq	%rcx, %rsi
	jne	.L47
	movslq	%r8d, %r8
	movl	0(%rbp,%r8,4), %eax
	testl	%eax, %eax
	jne	.L47
	subq	$1, %rdi
	addq	$1, 32(%rsp)
	movl	$1, 0(%rbp,%r8,4)
	movb	$1, 31(%rsp)
	cmpl	%edi, %r15d
	jl	.L53
	.p2align 4,,10
	.p2align 3
.L46:
	movslq	%r11d, %rax
	cmpq	16(%rsp), %rax
	jge	.L54
	cmpq	%r12, 8(%rsp)
	jne	.L56
	movl	%r11d, %r15d
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L61:
	movl	%eax, %r9d
	jmp	.L51
.L56:
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L58:
	movl	$1, %ecx
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L59:
	movq	%r13, %rax
	movl	%r15d, %r8d
	jmp	.L50
.L54:
	cmpb	$0, 31(%rsp)
	je	.L42
	movq	32(%rsp), %rax
	movq	%rax, ans(%rip)
	movq	%rax, 40(%rsp)
.L42:
	movq	40(%rsp), %rdx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$56, %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
.L43:
	.cfi_restore_state
	leal	-1(%r15), %edi
	movl	%r15d, %r11d
	jmp	.L45
	.cfi_endproc
.LFE58:
	.size	main, .-main
	.globl	flag
	.bss
	.align 32
	.type	flag, @object
	.size	flag, 800040
flag:
	.zero	800040
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600080
a:
	.zero	1600080
	.globl	ans
	.align 8
	.type	ans, @object
	.size	ans, 8
ans:
	.zero	8
	.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	cmp
	.type	cmp, @function
cmp:
.LFB56:
	.cfi_startproc
	endbr64
	movq	%rsi, %r8
	movq	(%rdi), %rsi
	movq	(%r8), %rcx
	movl	$-1, %r8d
	movq	%rsi, %rdx
	movq	%rcx, %rax
	negq	%rdx
	negq	%rax
	andq	%rsi, %rdx
	andq	%rcx, %rax
	cmpq	%rax, %rdx
	jl	.L8
	jne	.L13
	cmpq	%rcx, %rsi
	jl	.L8
.L13:
	movl	$1, %r8d
.L8:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE56:
	.size	cmp, .-cmp
	.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	.L19
	.p2align 4,,10
	.p2align 3
.L22:
	testb	$1, %sil
	je	.L21
	movq	%r9, %rax
	imulq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
.L21:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rsi, %rax
	shrq	$63, %rax
	addq	%rax, %rsi
	sarq	%rsi
	movq	%rdx, %rcx
	jne	.L22
.L19:
	movq	%r9, %rax
	ret
	.cfi_endproc
.LFE55:
	.size	pom, .-pom
	.p2align 4
	.globl	nibutan
	.type	nibutan, @function
nibutan:
.LFB57:
	.cfi_startproc
	endbr64
	movslq	%edi, %rax
	leaq	a(%rip), %rdi
	movslq	%edx, %rdx
	movq	%rax, %r8
	cmpq	%rdx, (%rdi,%rax,8)
	jg	.L32
	movl	%esi, %eax
	subl	%r8d, %eax
	cmpl	$1, %eax
	jle	.L29
	leaq	flag(%rip), %r9
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L37:
	jl	.L34
	movl	(%r9,%rcx,4), %ecx
	testl	%ecx, %ecx
	cmove	%eax, %r8d
	cmovne	%eax, %esi
.L30:
	movl	%esi, %eax
	subl	%r8d, %eax
	cmpl	$1, %eax
	jle	.L29
.L31:
	leal	(%r8,%rsi), %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	movslq	%eax, %rcx
	cmpq	(%rdi,%rcx,8), %rdx
	jle	.L37
	movl	%eax, %r8d
	movl	%esi, %eax
	subl	%r8d, %eax
	cmpl	$1, %eax
	jg	.L31
.L29:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L34:
	movl	%eax, %esi
	jmp	.L30
.L32:
	movl	$-1, %r8d
	jmp	.L29
	.cfi_endproc
.LFE57:
	.size	nibutan, .-nibutan
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB58:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	a(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rsi
	testq	%rsi, %rsi
	jle	.L39
	movq	%rbx, %r12
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L40:
	movq	%r12, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rsi
	addq	$8, %r12
	cmpq	%rbp, %rsi
	jg	.L40
.L39:
	leaq	cmp(%rip), %rcx
	movl	$8, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	movq	n(%rip), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	movq	ans(%rip), %rax
	movq	%rax, 40(%rsp)
	jle	.L42
	movq	%rax, 32(%rsp)
	xorl	%r15d, %r15d
	leaq	flag(%rip), %rbp
	movb	$0, 31(%rsp)
	.p2align 4,,10
	.p2align 3
.L55:
	movslq	%r15d, %rax
	movq	(%rbx,%rax,8), %r13
	movl	%r13d, %r12d
	movq	%r13, %rdx
	negl	%r12d
	negq	%rdx
	andl	%r13d, %r12d
	andq	%r13, %rdx
	movslq	%r12d, %r12
	movq	%rdx, 8(%rsp)
	cmpq	%r12, %rdx
	jne	.L43
	leaq	(%rbx,%rax,8), %rdx
	movl	%r15d, %r11d
	.p2align 4,,10
	.p2align 3
.L44:
	movq	8(%rdx), %rcx
	movl	%r11d, %edi
	addq	$8, %rdx
	addl	$1, %r11d
	movq	%rcx, %rax
	negq	%rax
	andq	%rcx, %rax
	cmpq	%r12, %rax
	je	.L44
.L45:
	cmpl	%edi, %r15d
	jge	.L46
	movl	%r11d, %r14d
	movslq	%edi, %rdi
	subl	%r15d, %r14d
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L47:
	subq	$1, %rdi
	cmpl	%edi, %r15d
	jge	.L46
.L53:
	movl	0(%rbp,%rdi,4), %eax
	testl	%eax, %eax
	jne	.L47
	movq	(%rbx,%rdi,8), %rsi
	movl	$1, 0(%rbp,%rdi,4)
	movl	$1, %eax
	testq	%rsi, %rsi
	jle	.L58
	.p2align 4,,10
	.p2align 3
.L49:
	addl	%eax, %eax
	movslq	%eax, %rcx
	cmpq	%rsi, %rcx
	jle	.L49
.L48:
	subl	%esi, %eax
	movslq	%eax, %rdx
	cmpq	%rdx, %r13
	jg	.L47
	cmpl	$1, %r14d
	jle	.L59
	movl	%r11d, %r9d
	movl	%r15d, %r8d
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L75:
	jl	.L61
	movl	0(%rbp,%r10,4), %r10d
	testl	%r10d, %r10d
	cmovne	%eax, %r9d
	cmove	%eax, %r8d
.L51:
	movl	%r9d, %eax
	subl	%r8d, %eax
	cmpl	$1, %eax
	jle	.L74
.L52:
	leal	(%r8,%r9), %eax
	sarl	%eax
	movslq	%eax, %r10
	cmpq	(%rbx,%r10,8), %rdx
	jle	.L75
	movl	%eax, %r8d
	movl	%r9d, %eax
	subl	%r8d, %eax
	cmpl	$1, %eax
	jg	.L52
.L74:
	movslq	%r8d, %rax
	movq	(%rbx,%rax,8), %rax
.L50:
	addq	%rax, %rsi
	cmpq	%rcx, %rsi
	jne	.L47
	movslq	%r8d, %r8
	movl	0(%rbp,%r8,4), %eax
	testl	%eax, %eax
	jne	.L47
	subq	$1, %rdi
	addq	$1, 32(%rsp)
	movl	$1, 0(%rbp,%r8,4)
	movb	$1, 31(%rsp)
	cmpl	%edi, %r15d
	jl	.L53
	.p2align 4,,10
	.p2align 3
.L46:
	movslq	%r11d, %rax
	cmpq	16(%rsp), %rax
	jge	.L54
	cmpq	%r12, 8(%rsp)
	jne	.L56
	movl	%r11d, %r15d
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L61:
	movl	%eax, %r9d
	jmp	.L51
.L56:
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L58:
	movl	$1, %ecx
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L59:
	movq	%r13, %rax
	movl	%r15d, %r8d
	jmp	.L50
.L54:
	cmpb	$0, 31(%rsp)
	je	.L42
	movq	32(%rsp), %rax
	movq	%rax, ans(%rip)
	movq	%rax, 40(%rsp)
.L42:
	movq	40(%rsp), %rdx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$56, %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
.L43:
	.cfi_restore_state
	leal	-1(%r15), %edi
	movl	%r15d, %r11d
	jmp	.L45
	.cfi_endproc
.LFE58:
	.size	main, .-main
	.globl	flag
	.bss
	.align 32
	.type	flag, @object
	.size	flag, 800040
flag:
	.zero	800040
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600080
a:
	.zero	1600080
	.globl	ans
	.align 8
	.type	ans, @object
	.size	ans, 8
ans:
	.zero	8
	.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)

int cmp(const void*a,const void*b){
	ll aa=*(ll*)a;
	ll bb=*(ll*)b;
	ll aaa=aa&-aa;
	ll bbb=bb&-bb;
	if(aaa<bbb)return -1;
	if(aaa>bbb)return 1;
	if(aa<bb)return -1;
	return 1;
}

ll n,ans;
ll a[200010];
int flag[200010];
int nibutan(int l,int r,int x){
	//x以下の最大のものを[l,r)で探す
	if(a[l]>x)return -1;
	while(r-l>1){
		int m=(l+r)/2;
		if(a[m]<x)l=m;
		else if(a[m]>x)r=m;
		else if(flag[m])r=m;
		else l=m;
	}
	return l;
}

int main(){
	scanf("%lld",&n);
	rep(i,0,n)scanf("%lld",a+i);
	qsort(a,n,sizeof(ll),cmp);
	for(int i=0;i<n;){
		int r=i;
		int t=a[i]&-a[i];
		while((a[r]&-a[r])==t)r++;
		//[i,r)で組にする
		for(int j=r-1;j>i;j--)if(!flag[j]){
			//a[j]と組に出来るものは、a[j]より真に大きい最小の2ベキをXとしてX-a[j]のみ
			//これを[i,j)でにぶたんして探す
			flag[j]=1;
			int x=1;
			while(x<=a[j])x+=x;
			int idx=nibutan(i,r,x-a[j]);
			if(idx!=-1&&a[idx]+a[j]==x&&!flag[idx]){
				ans++;
				flag[idx]=1;
			}
		}
		i=r;
	}
	printf("%lld",ans);
}
5
3 21 14 5 13
 5
2 3 24 6 13
 5
2 3 38 3 10
 5
3 24 14 5 13
 5
3 24 14 10 13
 5
3 24 16 10 13
 5
3 36 16 10 13
 5
3 36 16 14 13
 5
3 3 16 14 13
 5
3 3 24 14 13

1 2 0 1 1 1 1 1 1 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)

int cmp(const void*a,const void*b){
	ll aa=*(ll*)a;
	ll bb=*(ll*)b;
	ll aaa=aa&-aa;
	ll bbb=bb&-bb;
	if(aaa<bbb)return -1;
	if(aaa>bbb)return 1;
	if(aa<bb)return -1;
	return 1;
}

ll n,ans;
ll a[200010];
int flag[200010];
int nibutan(int l,int r,int x){
	//x以下の最大のものを[l,r)で探す
	if(a[l]>x)return -1;
	while(r-l>1){
		int m=(l+r)/2;
		if(a[m]<x)l=m;
		else if(a[m]>x)r=m;
		else if(flag[m])r=m;
		else l=m;
	}
	return l;
}

int main(){
	scanf("%lld",&n);
	rep(i,0,n)scanf("%lld",a+i);
	qsort(a,n,sizeof(ll),cmp);
	for(int i=0;i<n;){
		int r=i;
		int t=a[i]&-a[i];
		while((a[r]&-a[r])==t)r++;
		//[i,r)で組にする
		for(int j=r-1;j>i;j--)if(!flag[j]){
			//a[j]と組に出来るものは、a[j]より真に大きい最小の2ベキをXとしてX-a[j]のみ
			//これを[i,j)でにぶたんして探す
			flag[j]=1;
			int x=1;
			while(x<=a[j])x+=x;
			int idx=nibutan(i,r,x-a[j]);
			if(idx!=-1&&a[idx]+a[j]==x&&!flag[idx]){
				ans++;
				flag[idx]=1;
			}
		}
		i=r;
	}
	printf("%lld",ans);
}```

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	cmp
	.type	cmp, @function
cmp:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	-40(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-48(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	-32(%rbp), %rax
	negq	%rax
	andq	-32(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-24(%rbp), %rax
	negq	%rax
	andq	-24(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jge	.L20
	movl	$-1, %eax
	jmp	.L21
.L20:
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jle	.L22
	movl	$1, %eax
	jmp	.L21
.L22:
	movq	-32(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jge	.L23
	movl	$-1, %eax
	jmp	.L21
.L23:
	movl	$1, %eax
.L21:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	cmp, .-cmp
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	ans
	.align 8
	.type	ans, @object
	.size	ans, 8
ans:
	.zero	8
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600080
a:
	.zero	1600080
	.globl	flag
	.align 32
	.type	flag, @object
	.size	flag, 800040
flag:
	.zero	800040
	.text
	.globl	nibutan
	.type	nibutan, @function
nibutan:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jle	.L27
	movl	$-1, %eax
	jmp	.L26
.L31:
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jge	.L28
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L27
.L28:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jle	.L29
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L27
.L29:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L30
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L27
.L30:
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L27:
	movl	-24(%rbp), %eax
	subl	-20(%rbp), %eax
	cmpl	$1, %eax
	jg	.L31
	movl	-20(%rbp), %eax
.L26:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	nibutan, .-nibutan
	.section	.rodata
.LC0:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.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, -8(%rbp)
	jmp	.L33
.L34:
	movq	-8(%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, -8(%rbp)
.L33:
	movq	n(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jl	.L34
	movq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	cmp(%rip), %rax
	movq	%rax, %rcx
	movl	$8, %edx
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -32(%rbp)
	jmp	.L35
.L43:
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	%eax, %ecx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	negl	%eax
	andl	%ecx, %eax
	movl	%eax, -16(%rbp)
	jmp	.L36
.L37:
	addl	$1, -28(%rbp)
.L36:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	negq	%rax
	andq	%rax, %rcx
	movq	%rcx, %rdx
	movl	-16(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	je	.L37
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	jmp	.L38
.L42:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L39
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	$1, -20(%rbp)
	jmp	.L40
.L41:
	sall	-20(%rbp)
.L40:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	a(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jle	.L41
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	a(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-28(%rbp), %ecx
	movl	-32(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	nibutan
	movl	%eax, -12(%rbp)
	cmpl	$-1, -12(%rbp)
	je	.L39
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	(%rcx,%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jne	.L39
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L39
	movq	ans(%rip), %rax
	addq	$1, %rax
	movq	%rax, ans(%rip)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	$1, (%rdx,%rax)
.L39:
	subl	$1, -24(%rbp)
.L38:
	movl	-24(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jg	.L42
	movl	-28(%rbp), %eax
	movl	%eax, -32(%rbp)
.L35:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	n(%rip), %rax
	cmpq	%rax, %rdx
	jl	.L43
	movq	ans(%rip), %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
.LFE13:
	.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	cmp
	.type	cmp, @function
cmp:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	-40(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-48(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	-32(%rbp), %rax
	negq	%rax
	andq	-32(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-24(%rbp), %rax
	negq	%rax
	andq	-24(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jge	.L20
	movl	$-1, %eax
	jmp	.L21
.L20:
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jle	.L22
	movl	$1, %eax
	jmp	.L21
.L22:
	movq	-32(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jge	.L23
	movl	$-1, %eax
	jmp	.L21
.L23:
	movl	$1, %eax
.L21:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	cmp, .-cmp
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	ans
	.align 8
	.type	ans, @object
	.size	ans, 8
ans:
	.zero	8
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600080
a:
	.zero	1600080
	.globl	flag
	.align 32
	.type	flag, @object
	.size	flag, 800040
flag:
	.zero	800040
	.text
	.globl	nibutan
	.type	nibutan, @function
nibutan:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jle	.L27
	movl	$-1, %eax
	jmp	.L26
.L31:
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jge	.L28
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L27
.L28:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jle	.L29
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L27
.L29:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L30
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L27
.L30:
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L27:
	movl	-24(%rbp), %eax
	subl	-20(%rbp), %eax
	cmpl	$1, %eax
	jg	.L31
	movl	-20(%rbp), %eax
.L26:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	nibutan, .-nibutan
	.section	.rodata
.LC0:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.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, -8(%rbp)
	jmp	.L33
.L34:
	movq	-8(%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, -8(%rbp)
.L33:
	movq	n(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jl	.L34
	movq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	cmp(%rip), %rax
	movq	%rax, %rcx
	movl	$8, %edx
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -32(%rbp)
	jmp	.L35
.L43:
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	%eax, %ecx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	negl	%eax
	andl	%ecx, %eax
	movl	%eax, -16(%rbp)
	jmp	.L36
.L37:
	addl	$1, -28(%rbp)
.L36:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	negq	%rax
	andq	%rax, %rcx
	movq	%rcx, %rdx
	movl	-16(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	je	.L37
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	jmp	.L38
.L42:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L39
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	$1, -20(%rbp)
	jmp	.L40
.L41:
	sall	-20(%rbp)
.L40:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	a(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jle	.L41
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	a(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-28(%rbp), %ecx
	movl	-32(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	nibutan
	movl	%eax, -12(%rbp)
	cmpl	$-1, -12(%rbp)
	je	.L39
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	(%rcx,%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jne	.L39
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L39
	movq	ans(%rip), %rax
	addq	$1, %rax
	movq	%rax, ans(%rip)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	flag(%rip), %rax
	movl	$1, (%rdx,%rax)
.L39:
	subl	$1, -24(%rbp)
.L38:
	movl	-24(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jg	.L42
	movl	-28(%rbp), %eax
	movl	%eax, -32(%rbp)
.L35:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	n(%rip), %rax
	cmpq	%rax, %rdx
	jl	.L43
	movq	ans(%rip), %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
.LFE13:
	.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:
