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

```c
p[1<<21]={1};a[999],I,j,A=1e9+7;main(x){while(~scanf("%d",a+j++));for(;I<1<<*a;I++)for(j=0;j<*a;!a[*a*__builtin_popcount(I)+j]|I&x?:(p[x|=I]+=p[I],p[x]%=A))x=1<<j++;printf("%d",p[I-1]);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	p
	.data
	.align 32
	.type	p, @object
	.size	p, 8388608
p:
	.long	1
	.zero	8388604
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 3996
a:
	.zero	3996
	.globl	I
	.align 4
	.type	I, @object
	.size	I, 4
I:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	A
	.data
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.long	1000000007
	.section	.rodata
.LC0:
	.string	"%d"
	.globl	__popcountdi2
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	nop
.L2:
	movl	j(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, j(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L2
	jmp	.L3
.L7:
	movl	$0, j(%rip)
	jmp	.L4
.L6:
	movl	j(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, j(%rip)
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	a(%rip), %ebx
	movl	I(%rip), %eax
	movl	%eax, %eax
	movq	%rax, %rdi
	call	__popcountdi2@PLT
	imull	%eax, %ebx
	movl	%ebx, %edx
	movl	j(%rip), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %edx
	movl	I(%rip), %eax
	andl	-20(%rbp), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L5
	jmp	.L4
.L5:
	movl	I(%rip), %eax
	orl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	(%rcx,%rdx), %esi
	movl	I(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	(%rsi,%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	A(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L4:
	movl	a(%rip), %edx
	movl	j(%rip), %eax
	cmpl	%eax, %edx
	jg	.L6
	movl	I(%rip), %eax
	addl	$1, %eax
	movl	%eax, I(%rip)
.L3:
	movl	a(%rip), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	I(%rip), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	I(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.globl	__popcountdi2
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	a(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.p2align 4,,10
	.p2align 3
.L2:
	movslq	j(%rip), %rax
	leaq	.LC0(%rip), %rdi
	leal	1(%rax), %edx
	leaq	0(%r13,%rax,4), %rsi
	xorl	%eax, %eax
	movl	%edx, j(%rip)
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L2
	movl	0(%r13), %ebp
	movl	$1, %eax
	movl	A(%rip), %edi
	movl	%ebp, %ecx
	movl	%edi, 12(%rsp)
	sall	%cl, %eax
	movl	%eax, 8(%rsp)
	movl	%eax, %esi
	movl	I(%rip), %eax
	movslq	%eax, %rdi
	movq	%rdi, (%rsp)
	cmpl	%esi, %eax
	jge	.L15
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rsp), %r14d
	xorl	%ecx, %ecx
	movq	%r14, %r12
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$1, %ebx
	movq	%r14, %rdi
	leal	1(%rcx), %r15d
	sall	%cl, %ebx
	call	__popcountdi2@PLT
	movl	%ebx, %edx
	movl	%r15d, %ecx
	imull	%ebp, %eax
	addl	%r15d, %eax
	cltq
	movl	0(%r13,%rax,4), %eax
	testl	%eax, %eax
	sete	%al
	andl	%r12d, %edx
	movzbl	%al, %eax
	orl	%edx, %eax
	je	.L16
.L6:
	cmpl	%ecx, %ebp
	jg	.L7
	addq	$1, (%rsp)
	movq	(%rsp), %rax
	cmpl	%eax, 8(%rsp)
	jg	.L8
	movl	8(%rsp), %esi
	movl	%ecx, j(%rip)
	movl	%esi, I(%rip)
	leal	-1(%rsi), %eax
.L4:
	cltq
	leaq	p(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	movl	(%rsi,%rax,4), %esi
	xorl	%eax, %eax
	call	printf@PLT
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	movq	(%rsp), %rax
	orl	%r12d, %ebx
	leaq	p(%rip), %rsi
	movslq	%ebx, %rbx
	movl	(%rsi,%rax,4), %eax
	addl	(%rsi,%rbx,4), %eax
	cltd
	idivl	12(%rsp)
	movl	%edx, (%rsi,%rbx,4)
	jmp	.L6
.L15:
	subl	$1, %eax
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	A
	.data
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.long	1000000007
	.globl	j
	.bss
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	I
	.align 4
	.type	I, @object
	.size	I, 4
I:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 3996
a:
	.zero	3996
	.globl	p
	.data
	.align 32
	.type	p, @object
	.size	p, 8388608
p:
	.long	1
	.zero	8388604
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.globl	__popcountdi2
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	a(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.p2align 4,,10
	.p2align 3
.L2:
	movslq	j(%rip), %rax
	leaq	.LC0(%rip), %rdi
	leal	1(%rax), %edx
	leaq	0(%r13,%rax,4), %rsi
	xorl	%eax, %eax
	movl	%edx, j(%rip)
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L2
	movl	0(%r13), %ebp
	movl	$1, %eax
	movl	A(%rip), %edi
	movl	%ebp, %ecx
	movl	%edi, 12(%rsp)
	sall	%cl, %eax
	movl	%eax, 8(%rsp)
	movl	%eax, %esi
	movl	I(%rip), %eax
	movslq	%eax, %rdi
	movq	%rdi, (%rsp)
	cmpl	%esi, %eax
	jge	.L15
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rsp), %r14d
	xorl	%ecx, %ecx
	movq	%r14, %r12
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$1, %ebx
	movq	%r14, %rdi
	leal	1(%rcx), %r15d
	sall	%cl, %ebx
	call	__popcountdi2@PLT
	movl	%ebx, %edx
	movl	%r15d, %ecx
	imull	%ebp, %eax
	addl	%r15d, %eax
	cltq
	movl	0(%r13,%rax,4), %eax
	testl	%eax, %eax
	sete	%al
	andl	%r12d, %edx
	movzbl	%al, %eax
	orl	%edx, %eax
	je	.L16
.L6:
	cmpl	%ecx, %ebp
	jg	.L7
	addq	$1, (%rsp)
	movq	(%rsp), %rax
	cmpl	%eax, 8(%rsp)
	jg	.L8
	movl	8(%rsp), %esi
	movl	%ecx, j(%rip)
	movl	%esi, I(%rip)
	leal	-1(%rsi), %eax
.L4:
	cltq
	leaq	p(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	movl	(%rsi,%rax,4), %esi
	xorl	%eax, %eax
	call	printf@PLT
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	movq	(%rsp), %rax
	orl	%r12d, %ebx
	leaq	p(%rip), %rsi
	movslq	%ebx, %rbx
	movl	(%rsi,%rax,4), %eax
	addl	(%rsi,%rbx,4), %eax
	cltd
	idivl	12(%rsp)
	movl	%edx, (%rsi,%rbx,4)
	jmp	.L6
.L15:
	subl	$1, %eax
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	A
	.data
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.long	1000000007
	.globl	j
	.bss
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	I
	.align 4
	.type	I, @object
	.size	I, 4
I:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 3996
a:
	.zero	3996
	.globl	p
	.data
	.align 32
	.type	p, @object
	.size	p, 8388608
p:
	.long	1
	.zero	8388604
	.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:

p[1<<21]={1};a[999],I,j,A=1e9+7;main(x){while(~scanf("%d",a+j++));for(;I<1<<*a;I++)for(j=0;j<*a;!a[*a*__builtin_popcount(I)+j]|I&x?:(p[x|=I]+=p[I],p[x]%=A))x=1<<j++;printf("%d",p[I-1]);}
1
1
 21
0 0 0 0 0 0 0 1 1 0 1 1 1 1 0 0 0 1 0 0 1
1 1 1 0 1 1 0 0 0 1 0 0 0 0 1 1 1 0 1 1 0
0 0 1 1 1 1 0 1 1 0 0 1 0 0 1 1 0 0 0 1 1
0 1 1 0 1 1 0 1 0 1 0 0 1 0 0 0 0 0 1 1 0
1 1 0 0 1 0 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0
0 1 1 0 1 1 1 0 1 1 1 0 0 0 1 1 1 1 0 0 1
0 1 0 0 0 1 0 1 0 0 0 1 1 1 0 0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 1 1 0 0 0 1 0 0 1
1 1 1 0 0 1 0 0 0 1 0 0 0 0 1 1 1 0 1 1 0
0 0 1 1 1 1 0 1 1 0 0 1 0 0 1 1 0 0 0 1 1
0 1 1 0 1 1 0 1 0 1 0 0 1 0 0 0 0 0 1 1 0
1 1 0 0 1 0 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0
0 1 1 0 1 1 1 0 1 1 1 0 0 0 1 1 1 1 0 0 1
0 1 0 0 0 1 0 1 0 0 0 1 1 1 0 0 1 1 0 1 0
0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 1 1 1 1 1 1
0 0 1 0 0 1 0 0 1 0 1 1 0 0 1 0 1 0 1 1 1
0 0 0 0 1 1 0 0 1 1 1 0 0 0 0 1 1 0 0 0 1
0 1 1 0 1 1 0 0 1 1 0 0 0 1 1 1 1 0 1 1 0
0 0 1 0 0 1 1 1 1 0 1 1 0 1 1 1 0 0 1 0 1
0 1 1 0 0 1 1 1 1 0 0 0 1 0 1 1 0 1 0 1 1
1 1 1 1 1 0 0 0 0 1 0 0 1 1 0 1 1 1 0 0 1
0 0 0 1 1 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1
1 0 1 1 0 1 0 1 0 0 1 0 0 1 1 0 1 0 1 1 1
0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 0 0 1
0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 0 0 1 1 0 1
0 0 0 0 1 1 1 0 1 0 1 1 1 0 1 1 0 0 1 1 0
1 0 0 1 1 0 0 1 1 0 1 1 0 1 1 1 1 1 0 1 0
1 0 0 1 1 0 1 1 1 1 1 0 1 0 1 1 0 0 0 0 0

1 781575588 0 416994021 2 252921664 166021817 869947220 670448225 394114653
Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
p[1<<21]={1};a[999],I,j,A=1e9+7;main(x){while(~scanf("%d",a+j++));for(;I<1<<*a;I++)for(j=0;j<*a;!a[*a*__builtin_popcount(I)+j]|I&x?:(p[x|=I]+=p[I],p[x]%=A))x=1<<j++;printf("%d",p[I-1]);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	p
	.data
	.align 32
	.type	p, @object
	.size	p, 8388608
p:
	.long	1
	.zero	8388604
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 3996
a:
	.zero	3996
	.globl	I
	.align 4
	.type	I, @object
	.size	I, 4
I:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	A
	.data
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.long	1000000007
	.section	.rodata
.LC0:
	.string	"%d"
	.globl	__popcountdi2
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	nop
.L2:
	movl	j(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, j(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L2
	jmp	.L3
.L7:
	movl	$0, j(%rip)
	jmp	.L4
.L6:
	movl	j(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, j(%rip)
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	a(%rip), %ebx
	movl	I(%rip), %eax
	movl	%eax, %eax
	movq	%rax, %rdi
	call	__popcountdi2@PLT
	imull	%eax, %ebx
	movl	%ebx, %edx
	movl	j(%rip), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %edx
	movl	I(%rip), %eax
	andl	-20(%rbp), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L5
	jmp	.L4
.L5:
	movl	I(%rip), %eax
	orl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	(%rcx,%rdx), %esi
	movl	I(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	(%rsi,%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	A(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L4:
	movl	a(%rip), %edx
	movl	j(%rip), %eax
	cmpl	%eax, %edx
	jg	.L6
	movl	I(%rip), %eax
	addl	$1, %eax
	movl	%eax, I(%rip)
.L3:
	movl	a(%rip), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	I(%rip), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	I(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	p
	.data
	.align 32
	.type	p, @object
	.size	p, 8388608
p:
	.long	1
	.zero	8388604
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 3996
a:
	.zero	3996
	.globl	I
	.align 4
	.type	I, @object
	.size	I, 4
I:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	A
	.data
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.long	1000000007
	.section	.rodata
.LC0:
	.string	"%d"
	.globl	__popcountdi2
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	nop
.L2:
	movl	j(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, j(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L2
	jmp	.L3
.L7:
	movl	$0, j(%rip)
	jmp	.L4
.L6:
	movl	j(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, j(%rip)
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	a(%rip), %ebx
	movl	I(%rip), %eax
	movl	%eax, %eax
	movq	%rax, %rdi
	call	__popcountdi2@PLT
	imull	%eax, %ebx
	movl	%ebx, %edx
	movl	j(%rip), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %edx
	movl	I(%rip), %eax
	andl	-20(%rbp), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L5
	jmp	.L4
.L5:
	movl	I(%rip), %eax
	orl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	(%rcx,%rdx), %esi
	movl	I(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	(%rsi,%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	A(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L4:
	movl	a(%rip), %edx
	movl	j(%rip), %eax
	cmpl	%eax, %edx
	jg	.L6
	movl	I(%rip), %eax
	addl	$1, %eax
	movl	%eax, I(%rip)
.L3:
	movl	a(%rip), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	I(%rip), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	I(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
