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

```c
// AOJ 2449: Connect
// 2018.2.2 bal4u

#include <stdio.h>
#include <string.h>

char s[129][20]; int w[129];
int dp[2][65536], bc[65536];

int bitcount16(int x)
{
	x = ((x & 0xAAAAAA) >>  1) + (x & 0x555555);
	x = ((x & 0xCCCCCC) >>  2) + (x & 0x333333);
	x = ((x & 0xF0F0F0) >>  4) + (x & 0x0F0F0F);
	x = ((x & 0x00FF00) >>  8) + (x & 0xFF00FF);
	return x;
}

int main()
{
	int R, C, r, c, i, k, k1, k2, lim, p, q, x, ans;
	char buf[10], *t;

	fgets(buf, 10, stdin), sscanf(buf, "%d%d", &R, &C);
	for (r = 0; r < R; r++) {
		fgets(t=s[r], 20, stdin);
		while (*t > ' ') t++;
		w[r] = t - s[r];
	}
	lim = 1 << C;
	for (i = 0; i < lim; i++) bc[i] = bitcount16(i);
	
	memset(dp, -1, sizeof(dp));
	dp[0][0] = 0;
	
	k1 = 0, k2 = 1;
	for (r = 0; r < R; r++) for (c = 0; c < C; c++) {
		memset(dp[k2], -1, sizeof(dp[k2]));
		for (k = 0; k < lim; k++) if (dp[k1][k] >= 0) {
			p = bc[k & (1 << c) - 1];
			if (p < w[r]) {
				q = dp[k1][k];
				if (c && (k & (1 << (c-1))) && s[r][p-1] == s[r][p]) q++;
				if (r && (k & (1 << c))     && s[r][p  ] == s[r-1][w[r-1] - bc[k>>c]]) q++;
				x = k | (1 << c);
				if (q > dp[k2][x]) dp[k2][x] = q;
			}
			if (p + C - c > w[r]) {
				x = k & ~(1 << c);
				if (dp[k1][k] > dp[k2][x]) dp[k2][x] = dp[k1][k];
			}
		}
		k1 = k2, k2 = !k2;
	}

	ans = 0;
	for (c = 0; c < lim; c++) if (dp[k1][c] > ans) ans = dp[k1][c];
	printf("%d\n", ans << 1);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 2580
s:
	.zero	2580
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 516
w:
	.zero	516
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 524288
dp:
	.zero	524288
	.globl	bc
	.align 32
	.type	bc, @object
	.size	bc, 262144
bc:
	.zero	262144
	.text
	.globl	bitcount16
	.type	bitcount16, @function
bitcount16:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	sarl	%eax
	andl	$5592405, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$5592405, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	sarl	$2, %eax
	andl	$3355443, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$3355443, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	sarl	$4, %eax
	andl	$986895, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$986895, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	sarl	$8, %eax
	movzbl	%al, %edx
	movl	-4(%rbp), %eax
	andl	$16711935, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	bitcount16, .-bitcount16
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rdx
	leaq	-18(%rbp), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-80(%rbp), %rcx
	leaq	-84(%rbp), %rdx
	leaq	-18(%rbp), %rax
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$0, -76(%rbp)
	jmp	.L4
.L7:
	movq	stdin(%rip), %rdx
	movl	-76(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	leaq	s(%rip), %rcx
	addq	%rcx, %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	movl	$20, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	jmp	.L5
.L6:
	addq	$1, -32(%rbp)
.L5:
	movq	-32(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$32, %al
	jg	.L6
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	s(%rip), %rdx
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	subq	%rdx, %rax
	movl	%eax, %ecx
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -76(%rbp)
.L4:
	movl	-84(%rbp), %eax
	cmpl	%eax, -76(%rbp)
	jl	.L7
	movl	-80(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -44(%rbp)
	movl	$0, -68(%rbp)
	jmp	.L8
.L9:
	movl	-68(%rbp), %eax
	movl	%eax, %edi
	call	bitcount16
	movl	-68(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	bc(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -68(%rbp)
.L8:
	movl	-68(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L9
	movl	$524288, %edx
	movl	$-1, %esi
	leaq	dp(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, dp(%rip)
	movl	$0, -60(%rbp)
	movl	$1, -56(%rbp)
	movl	$0, -76(%rbp)
	jmp	.L10
.L19:
	movl	$0, -72(%rbp)
	jmp	.L11
.L18:
	movl	-56(%rbp), %eax
	cltq
	salq	$18, %rax
	movq	%rax, %rdx
	leaq	dp(%rip), %rax
	addq	%rdx, %rax
	movl	$262144, %edx
	movl	$-1, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -64(%rbp)
	jmp	.L12
.L17:
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L13
	movl	-72(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	subl	$1, %eax
	andl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bc(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -40(%rbp)
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -40(%rbp)
	jge	.L14
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -52(%rbp)
	cmpl	$0, -72(%rbp)
	je	.L15
	movl	-72(%rbp), %eax
	subl	$1, %eax
	movl	-64(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L15
	movl	-40(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %ecx
	movl	-40(%rbp), %eax
	movslq	%eax, %rsi
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rsi), %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %cl
	jne	.L15
	addl	$1, -52(%rbp)
.L15:
	cmpl	$0, -76(%rbp)
	je	.L16
	movl	-72(%rbp), %eax
	movl	-64(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L16
	movl	-40(%rbp), %eax
	movslq	%eax, %rcx
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %esi
	movl	-76(%rbp), %eax
	leal	-1(%rax), %r8d
	movl	-76(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-72(%rbp), %eax
	movl	-64(%rbp), %edi
	movl	%eax, %ecx
	sarl	%cl, %edi
	movl	%edi, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	bc(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movslq	%eax, %rcx
	movslq	%r8d, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %sil
	jne	.L16
	addl	$1, -52(%rbp)
.L16:
	movl	-72(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	orl	-64(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -52(%rbp)
	jle	.L14
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rdx
	movl	-52(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L14:
	movl	-80(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	subl	-72(%rbp), %eax
	movl	%eax, %edx
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	w(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L13
	movl	-72(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	notl	%eax
	andl	-64(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movl	-56(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L13
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	movl	-56(%rbp), %edx
	movslq	%edx, %rdx
	salq	$16, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L13:
	addl	$1, -64(%rbp)
.L12:
	movl	-64(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L17
	movl	-56(%rbp), %eax
	movl	%eax, -60(%rbp)
	cmpl	$0, -56(%rbp)
	sete	%al
	movzbl	%al, %eax
	movl	%eax, -56(%rbp)
	addl	$1, -72(%rbp)
.L11:
	movl	-80(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L18
	addl	$1, -76(%rbp)
.L10:
	movl	-84(%rbp), %eax
	cmpl	%eax, -76(%rbp)
	jl	.L19
	movl	$0, -48(%rbp)
	movl	$0, -72(%rbp)
	jmp	.L20
.L22:
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -48(%rbp)
	jge	.L21
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -48(%rbp)
.L21:
	addl	$1, -72(%rbp)
.L20:
	movl	-72(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L22
	movl	-48(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	bitcount16
	.type	bitcount16, @function
bitcount16:
.LFB35:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	andl	$5592405, %edi
	sarl	%eax
	andl	$5592405, %eax
	addl	%eax, %edi
	movl	%edi, %eax
	andl	$3355443, %edi
	sarl	$2, %eax
	andl	$3355443, %eax
	addl	%edi, %eax
	movl	%eax, %edx
	andl	$986895, %eax
	sarl	$4, %edx
	andl	$986895, %edx
	addl	%eax, %edx
	movzbl	%dh, %eax
	andl	$16711935, %edx
	addl	%edx, %eax
	ret
	.cfi_endproc
.LFE35:
	.size	bitcount16, .-bitcount16
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d"
.LC13:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$10, %esi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	stdin(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	94(%rsp), %rbp
	movq	%rbp, %rdi
	call	fgets@PLT
	leaq	88(%rsp), %rcx
	movq	%rbp, %rdi
	xorl	%eax, %eax
	leaq	84(%rsp), %rdx
	leaq	.LC1(%rip), %rsi
	call	__isoc99_sscanf@PLT
	movl	84(%rsp), %eax
	movl	%eax, 72(%rsp)
	testl	%eax, %eax
	jle	.L4
	leaq	s(%rip), %rbx
	xorl	%ebp, %ebp
	leaq	w(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movq	stdin(%rip), %rdx
	movl	$20, %esi
	movq	%rbx, %rdi
	call	fgets@PLT
	cmpb	$32, (%rbx)
	jle	.L39
	movq	%rbx, %rax
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$1, %rax
	cmpb	$32, (%rax)
	jg	.L6
	subl	%ebx, %eax
.L5:
	movl	%eax, (%r12,%rbp,4)
	movl	84(%rsp), %eax
	addq	$1, %rbp
	addq	$20, %rbx
	cmpl	%ebp, %eax
	jg	.L7
	movl	88(%rsp), %r13d
	movl	%eax, 72(%rsp)
	movl	$1, %eax
	movl	%r13d, %ecx
	sall	%cl, %eax
	movl	%eax, %r14d
	testl	%eax, %eax
	jle	.L8
.L36:
	leal	-1(%r14), %eax
	cmpl	$2, %eax
	jbe	.L40
	movl	%r14d, %edx
	leaq	bc(%rip), %rsi
	movdqa	.LC0(%rip), %xmm2
	movdqa	.LC2(%rip), %xmm8
	shrl	$2, %edx
	leaq	16(%rsi), %rcx
	movdqa	.LC3(%rip), %xmm5
	movdqa	.LC4(%rip), %xmm4
	subl	$1, %edx
	movdqa	.LC5(%rip), %xmm3
	movq	%rsi, %rax
	movdqa	.LC6(%rip), %xmm7
	salq	$4, %rdx
	movdqa	.LC7(%rip), %xmm6
	addq	%rcx, %rdx
.L10:
	movdqa	%xmm2, %xmm1
	addq	$16, %rax
	paddd	%xmm8, %xmm2
	movdqa	%xmm1, %xmm0
	pand	%xmm5, %xmm1
	psrad	$1, %xmm0
	pand	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	pand	%xmm4, %xmm0
	psrad	$2, %xmm1
	pand	%xmm4, %xmm1
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	pand	%xmm3, %xmm1
	psrad	$4, %xmm0
	pand	%xmm3, %xmm0
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	pand	%xmm6, %xmm0
	psrad	$8, %xmm1
	pand	%xmm7, %xmm1
	paddd	%xmm1, %xmm0
	movaps	%xmm0, -16(%rax)
	cmpq	%rax, %rdx
	jne	.L10
	movl	%r14d, %edx
	andl	$-4, %edx
	movl	%edx, %ecx
	cmpl	%edx, %r14d
	je	.L71
.L9:
	movl	%r14d, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	je	.L12
	movq	.LC8(%rip), %xmm2
	leal	1(%rcx), %edi
	movd	%ecx, %xmm1
	movd	%edi, %xmm6
	punpckldq	%xmm6, %xmm1
	movdqa	%xmm1, %xmm0
	pand	%xmm2, %xmm1
	psrad	$1, %xmm0
	pand	%xmm2, %xmm0
	movq	.LC9(%rip), %xmm2
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	pand	%xmm2, %xmm0
	psrad	$2, %xmm1
	pand	%xmm2, %xmm1
	movq	.LC10(%rip), %xmm2
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	pand	%xmm2, %xmm1
	psrad	$4, %xmm0
	pand	%xmm2, %xmm0
	movq	.LC11(%rip), %xmm2
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrad	$8, %xmm1
	pand	%xmm2, %xmm1
	movq	.LC12(%rip), %xmm2
	pand	%xmm2, %xmm0
	paddd	%xmm1, %xmm0
	movq	%xmm0, (%rsi,%rdx,4)
	movl	%eax, %edx
	andl	$-2, %edx
	addl	%edx, %ecx
	cmpl	%edx, %eax
	je	.L13
.L12:
	movl	%ecx, %eax
	movl	%ecx, %edx
	movslq	%ecx, %rcx
	sarl	%eax
	andl	$5592405, %edx
	andl	$5592405, %eax
	addl	%edx, %eax
	movl	%eax, %edx
	andl	$3355443, %eax
	sarl	$2, %edx
	andl	$3355443, %edx
	addl	%eax, %edx
	movl	%edx, %eax
	andl	$986895, %edx
	sarl	$4, %eax
	andl	$986895, %eax
	addl	%edx, %eax
	movzbl	%ah, %edx
	andl	$16711935, %eax
	addl	%edx, %eax
	movl	%eax, (%rsi,%rcx,4)
.L13:
	leaq	dp(%rip), %r12
	movl	$524288, %edx
	movl	$-1, %esi
	xorl	%r15d, %r15d
	movq	%r12, %rdi
	call	memset@PLT
	movl	72(%rsp), %eax
	movl	$0, dp(%rip)
	testl	%eax, %eax
	jle	.L27
.L32:
	leaq	w(%rip), %r11
	movl	$1, 24(%rsp)
	xorl	%r15d, %r15d
	movl	$0, 12(%rsp)
	movl	%r13d, 76(%rsp)
	movl	%r14d, %r13d
	movq	%r11, 56(%rsp)
	movq	%r12, %r11
	.p2align 4,,10
	.p2align 3
.L14:
	movl	76(%rsp), %r12d
	xorl	%r14d, %r14d
	testl	%r12d, %r12d
	jle	.L17
	movl	12(%rsp), %eax
	movq	%r11, %rbx
	subl	$1, %eax
	cltq
	leaq	(%rax,%rax,4), %rax
	movq	%rax, 64(%rsp)
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	24(%rsp), %rbp
	movl	$262144, %edx
	movl	$-1, %esi
	movq	%rbp, %rdi
	salq	$18, %rdi
	addq	%rbx, %rdi
	call	memset@PLT
	testl	%r13d, %r13d
	jle	.L25
	movl	%r14d, %ecx
	movslq	12(%rsp), %rdx
	movl	$1, %eax
	movl	$1, %esi
	sall	%cl, %eax
	leal	-1(%r14), %ecx
	salq	$18, %r15
	movq	56(%rsp), %r8
	sall	%cl, %esi
	leaq	(%rdx,%rdx,4), %rdi
	movq	64(%rsp), %rcx
	movl	%eax, 16(%rsp)
	movq	%rdi, 32(%rsp)
	leaq	s(%rip), %rdi
	leal	-1(%rax), %r10d
	notl	%eax
	leaq	(%rdi,%rcx,4), %rdi
	movl	%esi, 28(%rsp)
	leaq	(%rbx,%r15), %rsi
	movq	%rdi, 40(%rsp)
	movl	%eax, 20(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L24:
	movl	(%rsi), %edi
	testl	%edi, %edi
	js	.L19
	movl	%r10d, %edx
	leaq	bc(%rip), %rcx
	movl	(%r8), %r9d
	andl	%eax, %edx
	movslq	%edx, %rdx
	movl	(%rcx,%rdx,4), %edx
	cmpl	%edx, %r9d
	jle	.L20
	testl	%r14d, %r14d
	je	.L21
	testl	%eax, 28(%rsp)
	je	.L21
	movq	32(%rsp), %r15
	leal	-1(%rdx), %r11d
	leaq	s(%rip), %rcx
	movslq	%r11d, %r11
	leaq	(%rcx,%r15,4), %rcx
	movslq	%edx, %r15
	movzbl	(%rcx,%r15), %r15d
	cmpb	%r15b, (%rcx,%r11)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, %edi
.L21:
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L22
	movl	%r14d, %ecx
	movl	%eax, %r15d
	sarl	%cl, %r15d
	movslq	%r15d, %rcx
	testb	$1, %cl
	je	.L22
	movq	32(%rsp), %r11
	leaq	s(%rip), %r15
	leaq	(%r15,%r11,4), %r15
	movl	-4(%r8), %r11d
	movq	%r15, 48(%rsp)
	leaq	bc(%rip), %r15
	subl	(%r15,%rcx,4), %r11d
	movq	48(%rsp), %r15
	movslq	%r11d, %rcx
	movq	40(%rsp), %r11
	movzbl	(%r11,%rcx), %ecx
	movslq	%edx, %r11
	cmpb	%cl, (%r15,%r11)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, %edi
.L22:
	movl	16(%rsp), %r11d
	movq	%rbp, %rcx
	salq	$16, %rcx
	orl	%eax, %r11d
	movslq	%r11d, %r11
	addq	%r11, %rcx
	cmpl	%edi, (%rbx,%rcx,4)
	jge	.L20
	movl	%edi, (%rbx,%rcx,4)
.L20:
	addl	%r12d, %edx
	subl	%r14d, %edx
	cmpl	%edx, %r9d
	jge	.L19
	movl	20(%rsp), %ecx
	movq	%rbp, %rdx
	movl	(%rsi), %edi
	salq	$16, %rdx
	andl	%eax, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rdx
	cmpl	(%rbx,%rdx,4), %edi
	jle	.L19
	movl	%edi, (%rbx,%rdx,4)
	.p2align 4,,10
	.p2align 3
.L19:
	addl	$1, %eax
	addq	$4, %rsi
	cmpl	%r13d, %eax
	jne	.L24
.L25:
	movslq	24(%rsp), %r15
	addl	$1, %r14d
	movl	%r15d, %eax
	xorl	$1, %eax
	cmpl	%r14d, %r12d
	je	.L72
	movl	%eax, 24(%rsp)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L72:
	movl	%eax, 24(%rsp)
	movq	%rbx, %r11
.L17:
	addl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	addq	$4, 56(%rsp)
	cmpl	%eax, 72(%rsp)
	jg	.L14
	movl	%r13d, %r14d
	movq	%r11, %r12
	testl	%r13d, %r13d
	jle	.L33
.L27:
	testl	%r14d, %r14d
	movl	$1, %edi
	cmovg	%r14d, %edi
	cmpl	$3, %r14d
	jle	.L43
.L34:
	movslq	%r15d, %rcx
	pxor	%xmm0, %xmm0
	movl	%edi, %edx
	movq	%rcx, %rax
	shrl	$2, %edx
	salq	$18, %rax
	salq	$4, %rdx
	addq	%r12, %rax
	addq	%rax, %rdx
.L30:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	pcmpgtd	-16(%rax), %xmm1
	pand	%xmm1, %xmm0
	pandn	-16(%rax), %xmm1
	por	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L30
	movdqa	%xmm0, %xmm2
	movl	%edi, %esi
	psrldq	$8, %xmm2
	andl	$-4, %esi
	andl	$3, %edi
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movd	%xmm0, %eax
	je	.L28
.L29:
	salq	$16, %rcx
	movslq	%esi, %rdi
	movq	%rcx, %rdx
	movq	%rdi, %rcx
	addq	%rdx, %rcx
	movl	(%r12,%rcx,4), %ecx
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	leal	1(%rsi), %ecx
	cmpl	%r14d, %ecx
	jge	.L28
	movslq	%ecx, %rcx
	addq	%rdx, %rcx
	movl	(%r12,%rcx,4), %ecx
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	addl	$2, %esi
	cmpl	%r14d, %esi
	jge	.L28
	movslq	%esi, %rsi
	addq	%rsi, %rdx
	movl	(%r12,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovl	%edx, %eax
.L28:
	leal	(%rax,%rax), %edx
	leaq	.LC13(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L73
	addq	$120, %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
.L39:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L5
.L71:
	leaq	dp(%rip), %r12
	orl	$-1, %esi
	movl	$524288, %edx
	movq	%r12, %rdi
	call	memset@PLT
	cmpl	$0, 72(%rsp)
	movl	$0, dp(%rip)
	jg	.L32
	testl	%r14d, %r14d
	movl	$1, %edi
	cmovg	%r14d, %edi
	xorl	%r15d, %r15d
	jmp	.L34
.L8:
	leaq	dp(%rip), %r12
	orl	$-1, %esi
	movl	$524288, %edx
	movq	%r12, %rdi
	call	memset@PLT
	cmpl	$0, 72(%rsp)
	movl	$0, dp(%rip)
	jg	.L32
.L33:
	xorl	%eax, %eax
	jmp	.L28
.L4:
	movl	88(%rsp), %r13d
	movl	$1, %eax
	movl	%r13d, %ecx
	sall	%cl, %eax
	movl	%eax, %r14d
	testl	%eax, %eax
	jg	.L36
	movl	$524288, %edx
	orl	$-1, %esi
	leaq	dp(%rip), %rdi
	call	memset@PLT
	xorl	%eax, %eax
	movl	$0, dp(%rip)
	jmp	.L28
.L40:
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	leaq	bc(%rip), %rsi
	jmp	.L9
.L43:
	xorl	%eax, %eax
	xorl	%esi, %esi
	movslq	%r15d, %rcx
	jmp	.L29
.L73:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	bc
	.bss
	.align 32
	.type	bc, @object
	.size	bc, 262144
bc:
	.zero	262144
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 524288
dp:
	.zero	524288
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 516
w:
	.zero	516
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 2580
s:
	.zero	2580
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC3:
	.long	5592405
	.long	5592405
	.long	5592405
	.long	5592405
	.align 16
.LC4:
	.long	3355443
	.long	3355443
	.long	3355443
	.long	3355443
	.align 16
.LC5:
	.long	986895
	.long	986895
	.long	986895
	.long	986895
	.align 16
.LC6:
	.long	255
	.long	255
	.long	255
	.long	255
	.align 16
.LC7:
	.long	16711935
	.long	16711935
	.long	16711935
	.long	16711935
	.set	.LC8,.LC3
	.set	.LC9,.LC4
	.set	.LC10,.LC5
	.set	.LC11,.LC6
	.set	.LC12,.LC7
	.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	bitcount16
	.type	bitcount16, @function
bitcount16:
.LFB35:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	andl	$5592405, %edi
	sarl	%eax
	andl	$5592405, %eax
	addl	%eax, %edi
	movl	%edi, %eax
	andl	$3355443, %edi
	sarl	$2, %eax
	andl	$3355443, %eax
	addl	%edi, %eax
	movl	%eax, %edx
	andl	$986895, %eax
	sarl	$4, %edx
	andl	$986895, %edx
	addl	%eax, %edx
	movzbl	%dh, %eax
	andl	$16711935, %edx
	addl	%edx, %eax
	ret
	.cfi_endproc
.LFE35:
	.size	bitcount16, .-bitcount16
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d"
.LC13:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$10, %esi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	stdin(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	94(%rsp), %rbp
	movq	%rbp, %rdi
	call	fgets@PLT
	leaq	88(%rsp), %rcx
	movq	%rbp, %rdi
	xorl	%eax, %eax
	leaq	84(%rsp), %rdx
	leaq	.LC1(%rip), %rsi
	call	__isoc99_sscanf@PLT
	movl	84(%rsp), %eax
	movl	%eax, 72(%rsp)
	testl	%eax, %eax
	jle	.L4
	leaq	s(%rip), %rbx
	xorl	%ebp, %ebp
	leaq	w(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movq	stdin(%rip), %rdx
	movl	$20, %esi
	movq	%rbx, %rdi
	call	fgets@PLT
	cmpb	$32, (%rbx)
	jle	.L39
	movq	%rbx, %rax
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$1, %rax
	cmpb	$32, (%rax)
	jg	.L6
	subl	%ebx, %eax
.L5:
	movl	%eax, (%r12,%rbp,4)
	movl	84(%rsp), %eax
	addq	$1, %rbp
	addq	$20, %rbx
	cmpl	%ebp, %eax
	jg	.L7
	movl	88(%rsp), %r13d
	movl	%eax, 72(%rsp)
	movl	$1, %eax
	movl	%r13d, %ecx
	sall	%cl, %eax
	movl	%eax, %r14d
	testl	%eax, %eax
	jle	.L8
.L36:
	leal	-1(%r14), %eax
	cmpl	$2, %eax
	jbe	.L40
	movl	%r14d, %edx
	leaq	bc(%rip), %rsi
	movdqa	.LC0(%rip), %xmm2
	movdqa	.LC2(%rip), %xmm8
	shrl	$2, %edx
	leaq	16(%rsi), %rcx
	movdqa	.LC3(%rip), %xmm5
	movdqa	.LC4(%rip), %xmm4
	subl	$1, %edx
	movdqa	.LC5(%rip), %xmm3
	movq	%rsi, %rax
	movdqa	.LC6(%rip), %xmm7
	salq	$4, %rdx
	movdqa	.LC7(%rip), %xmm6
	addq	%rcx, %rdx
.L10:
	movdqa	%xmm2, %xmm1
	addq	$16, %rax
	paddd	%xmm8, %xmm2
	movdqa	%xmm1, %xmm0
	pand	%xmm5, %xmm1
	psrad	$1, %xmm0
	pand	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	pand	%xmm4, %xmm0
	psrad	$2, %xmm1
	pand	%xmm4, %xmm1
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	pand	%xmm3, %xmm1
	psrad	$4, %xmm0
	pand	%xmm3, %xmm0
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	pand	%xmm6, %xmm0
	psrad	$8, %xmm1
	pand	%xmm7, %xmm1
	paddd	%xmm1, %xmm0
	movaps	%xmm0, -16(%rax)
	cmpq	%rax, %rdx
	jne	.L10
	movl	%r14d, %edx
	andl	$-4, %edx
	movl	%edx, %ecx
	cmpl	%edx, %r14d
	je	.L71
.L9:
	movl	%r14d, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	je	.L12
	movq	.LC8(%rip), %xmm2
	leal	1(%rcx), %edi
	movd	%ecx, %xmm1
	movd	%edi, %xmm6
	punpckldq	%xmm6, %xmm1
	movdqa	%xmm1, %xmm0
	pand	%xmm2, %xmm1
	psrad	$1, %xmm0
	pand	%xmm2, %xmm0
	movq	.LC9(%rip), %xmm2
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	pand	%xmm2, %xmm0
	psrad	$2, %xmm1
	pand	%xmm2, %xmm1
	movq	.LC10(%rip), %xmm2
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	pand	%xmm2, %xmm1
	psrad	$4, %xmm0
	pand	%xmm2, %xmm0
	movq	.LC11(%rip), %xmm2
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrad	$8, %xmm1
	pand	%xmm2, %xmm1
	movq	.LC12(%rip), %xmm2
	pand	%xmm2, %xmm0
	paddd	%xmm1, %xmm0
	movq	%xmm0, (%rsi,%rdx,4)
	movl	%eax, %edx
	andl	$-2, %edx
	addl	%edx, %ecx
	cmpl	%edx, %eax
	je	.L13
.L12:
	movl	%ecx, %eax
	movl	%ecx, %edx
	movslq	%ecx, %rcx
	sarl	%eax
	andl	$5592405, %edx
	andl	$5592405, %eax
	addl	%edx, %eax
	movl	%eax, %edx
	andl	$3355443, %eax
	sarl	$2, %edx
	andl	$3355443, %edx
	addl	%eax, %edx
	movl	%edx, %eax
	andl	$986895, %edx
	sarl	$4, %eax
	andl	$986895, %eax
	addl	%edx, %eax
	movzbl	%ah, %edx
	andl	$16711935, %eax
	addl	%edx, %eax
	movl	%eax, (%rsi,%rcx,4)
.L13:
	leaq	dp(%rip), %r12
	movl	$524288, %edx
	movl	$-1, %esi
	xorl	%r15d, %r15d
	movq	%r12, %rdi
	call	memset@PLT
	movl	72(%rsp), %eax
	movl	$0, dp(%rip)
	testl	%eax, %eax
	jle	.L27
.L32:
	leaq	w(%rip), %r11
	movl	$1, 24(%rsp)
	xorl	%r15d, %r15d
	movl	$0, 12(%rsp)
	movl	%r13d, 76(%rsp)
	movl	%r14d, %r13d
	movq	%r11, 56(%rsp)
	movq	%r12, %r11
	.p2align 4,,10
	.p2align 3
.L14:
	movl	76(%rsp), %r12d
	xorl	%r14d, %r14d
	testl	%r12d, %r12d
	jle	.L17
	movl	12(%rsp), %eax
	movq	%r11, %rbx
	subl	$1, %eax
	cltq
	leaq	(%rax,%rax,4), %rax
	movq	%rax, 64(%rsp)
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	24(%rsp), %rbp
	movl	$262144, %edx
	movl	$-1, %esi
	movq	%rbp, %rdi
	salq	$18, %rdi
	addq	%rbx, %rdi
	call	memset@PLT
	testl	%r13d, %r13d
	jle	.L25
	movl	%r14d, %ecx
	movslq	12(%rsp), %rdx
	movl	$1, %eax
	movl	$1, %esi
	sall	%cl, %eax
	leal	-1(%r14), %ecx
	salq	$18, %r15
	movq	56(%rsp), %r8
	sall	%cl, %esi
	leaq	(%rdx,%rdx,4), %rdi
	movq	64(%rsp), %rcx
	movl	%eax, 16(%rsp)
	movq	%rdi, 32(%rsp)
	leaq	s(%rip), %rdi
	leal	-1(%rax), %r10d
	notl	%eax
	leaq	(%rdi,%rcx,4), %rdi
	movl	%esi, 28(%rsp)
	leaq	(%rbx,%r15), %rsi
	movq	%rdi, 40(%rsp)
	movl	%eax, 20(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L24:
	movl	(%rsi), %edi
	testl	%edi, %edi
	js	.L19
	movl	%r10d, %edx
	leaq	bc(%rip), %rcx
	movl	(%r8), %r9d
	andl	%eax, %edx
	movslq	%edx, %rdx
	movl	(%rcx,%rdx,4), %edx
	cmpl	%edx, %r9d
	jle	.L20
	testl	%r14d, %r14d
	je	.L21
	testl	%eax, 28(%rsp)
	je	.L21
	movq	32(%rsp), %r15
	leal	-1(%rdx), %r11d
	leaq	s(%rip), %rcx
	movslq	%r11d, %r11
	leaq	(%rcx,%r15,4), %rcx
	movslq	%edx, %r15
	movzbl	(%rcx,%r15), %r15d
	cmpb	%r15b, (%rcx,%r11)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, %edi
.L21:
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L22
	movl	%r14d, %ecx
	movl	%eax, %r15d
	sarl	%cl, %r15d
	movslq	%r15d, %rcx
	testb	$1, %cl
	je	.L22
	movq	32(%rsp), %r11
	leaq	s(%rip), %r15
	leaq	(%r15,%r11,4), %r15
	movl	-4(%r8), %r11d
	movq	%r15, 48(%rsp)
	leaq	bc(%rip), %r15
	subl	(%r15,%rcx,4), %r11d
	movq	48(%rsp), %r15
	movslq	%r11d, %rcx
	movq	40(%rsp), %r11
	movzbl	(%r11,%rcx), %ecx
	movslq	%edx, %r11
	cmpb	%cl, (%r15,%r11)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, %edi
.L22:
	movl	16(%rsp), %r11d
	movq	%rbp, %rcx
	salq	$16, %rcx
	orl	%eax, %r11d
	movslq	%r11d, %r11
	addq	%r11, %rcx
	cmpl	%edi, (%rbx,%rcx,4)
	jge	.L20
	movl	%edi, (%rbx,%rcx,4)
.L20:
	addl	%r12d, %edx
	subl	%r14d, %edx
	cmpl	%edx, %r9d
	jge	.L19
	movl	20(%rsp), %ecx
	movq	%rbp, %rdx
	movl	(%rsi), %edi
	salq	$16, %rdx
	andl	%eax, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rdx
	cmpl	(%rbx,%rdx,4), %edi
	jle	.L19
	movl	%edi, (%rbx,%rdx,4)
	.p2align 4,,10
	.p2align 3
.L19:
	addl	$1, %eax
	addq	$4, %rsi
	cmpl	%r13d, %eax
	jne	.L24
.L25:
	movslq	24(%rsp), %r15
	addl	$1, %r14d
	movl	%r15d, %eax
	xorl	$1, %eax
	cmpl	%r14d, %r12d
	je	.L72
	movl	%eax, 24(%rsp)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L72:
	movl	%eax, 24(%rsp)
	movq	%rbx, %r11
.L17:
	addl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	addq	$4, 56(%rsp)
	cmpl	%eax, 72(%rsp)
	jg	.L14
	movl	%r13d, %r14d
	movq	%r11, %r12
	testl	%r13d, %r13d
	jle	.L33
.L27:
	testl	%r14d, %r14d
	movl	$1, %edi
	cmovg	%r14d, %edi
	cmpl	$3, %r14d
	jle	.L43
.L34:
	movslq	%r15d, %rcx
	pxor	%xmm0, %xmm0
	movl	%edi, %edx
	movq	%rcx, %rax
	shrl	$2, %edx
	salq	$18, %rax
	salq	$4, %rdx
	addq	%r12, %rax
	addq	%rax, %rdx
.L30:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	pcmpgtd	-16(%rax), %xmm1
	pand	%xmm1, %xmm0
	pandn	-16(%rax), %xmm1
	por	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L30
	movdqa	%xmm0, %xmm2
	movl	%edi, %esi
	psrldq	$8, %xmm2
	andl	$-4, %esi
	andl	$3, %edi
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movd	%xmm0, %eax
	je	.L28
.L29:
	salq	$16, %rcx
	movslq	%esi, %rdi
	movq	%rcx, %rdx
	movq	%rdi, %rcx
	addq	%rdx, %rcx
	movl	(%r12,%rcx,4), %ecx
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	leal	1(%rsi), %ecx
	cmpl	%r14d, %ecx
	jge	.L28
	movslq	%ecx, %rcx
	addq	%rdx, %rcx
	movl	(%r12,%rcx,4), %ecx
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	addl	$2, %esi
	cmpl	%r14d, %esi
	jge	.L28
	movslq	%esi, %rsi
	addq	%rsi, %rdx
	movl	(%r12,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovl	%edx, %eax
.L28:
	leal	(%rax,%rax), %edx
	leaq	.LC13(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L73
	addq	$120, %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
.L39:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L5
.L71:
	leaq	dp(%rip), %r12
	orl	$-1, %esi
	movl	$524288, %edx
	movq	%r12, %rdi
	call	memset@PLT
	cmpl	$0, 72(%rsp)
	movl	$0, dp(%rip)
	jg	.L32
	testl	%r14d, %r14d
	movl	$1, %edi
	cmovg	%r14d, %edi
	xorl	%r15d, %r15d
	jmp	.L34
.L8:
	leaq	dp(%rip), %r12
	orl	$-1, %esi
	movl	$524288, %edx
	movq	%r12, %rdi
	call	memset@PLT
	cmpl	$0, 72(%rsp)
	movl	$0, dp(%rip)
	jg	.L32
.L33:
	xorl	%eax, %eax
	jmp	.L28
.L4:
	movl	88(%rsp), %r13d
	movl	$1, %eax
	movl	%r13d, %ecx
	sall	%cl, %eax
	movl	%eax, %r14d
	testl	%eax, %eax
	jg	.L36
	movl	$524288, %edx
	orl	$-1, %esi
	leaq	dp(%rip), %rdi
	call	memset@PLT
	xorl	%eax, %eax
	movl	$0, dp(%rip)
	jmp	.L28
.L40:
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	leaq	bc(%rip), %rsi
	jmp	.L9
.L43:
	xorl	%eax, %eax
	xorl	%esi, %esi
	movslq	%r15d, %rcx
	jmp	.L29
.L73:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	bc
	.bss
	.align 32
	.type	bc, @object
	.size	bc, 262144
bc:
	.zero	262144
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 524288
dp:
	.zero	524288
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 516
w:
	.zero	516
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 2580
s:
	.zero	2580
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC3:
	.long	5592405
	.long	5592405
	.long	5592405
	.long	5592405
	.align 16
.LC4:
	.long	3355443
	.long	3355443
	.long	3355443
	.long	3355443
	.align 16
.LC5:
	.long	986895
	.long	986895
	.long	986895
	.long	986895
	.align 16
.LC6:
	.long	255
	.long	255
	.long	255
	.long	255
	.align 16
.LC7:
	.long	16711935
	.long	16711935
	.long	16711935
	.long	16711935
	.set	.LC8,.LC3
	.set	.LC9,.LC4
	.set	.LC10,.LC5
	.set	.LC11,.LC6
	.set	.LC12,.LC7
	.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:

// AOJ 2449: Connect
// 2018.2.2 bal4u

#include <stdio.h>
#include <string.h>

char s[129][20]; int w[129];
int dp[2][65536], bc[65536];

int bitcount16(int x)
{
	x = ((x & 0xAAAAAA) >>  1) + (x & 0x555555);
	x = ((x & 0xCCCCCC) >>  2) + (x & 0x333333);
	x = ((x & 0xF0F0F0) >>  4) + (x & 0x0F0F0F);
	x = ((x & 0x00FF00) >>  8) + (x & 0xFF00FF);
	return x;
}

int main()
{
	int R, C, r, c, i, k, k1, k2, lim, p, q, x, ans;
	char buf[10], *t;

	fgets(buf, 10, stdin), sscanf(buf, "%d%d", &R, &C);
	for (r = 0; r < R; r++) {
		fgets(t=s[r], 20, stdin);
		while (*t > ' ') t++;
		w[r] = t - s[r];
	}
	lim = 1 << C;
	for (i = 0; i < lim; i++) bc[i] = bitcount16(i);
	
	memset(dp, -1, sizeof(dp));
	dp[0][0] = 0;
	
	k1 = 0, k2 = 1;
	for (r = 0; r < R; r++) for (c = 0; c < C; c++) {
		memset(dp[k2], -1, sizeof(dp[k2]));
		for (k = 0; k < lim; k++) if (dp[k1][k] >= 0) {
			p = bc[k & (1 << c) - 1];
			if (p < w[r]) {
				q = dp[k1][k];
				if (c && (k & (1 << (c-1))) && s[r][p-1] == s[r][p]) q++;
				if (r && (k & (1 << c))     && s[r][p  ] == s[r-1][w[r-1] - bc[k>>c]]) q++;
				x = k | (1 << c);
				if (q > dp[k2][x]) dp[k2][x] = q;
			}
			if (p + C - c > w[r]) {
				x = k & ~(1 << c);
				if (dp[k1][k] > dp[k2][x]) dp[k2][x] = dp[k1][k];
			}
		}
		k1 = k2, k2 = !k2;
	}

	ans = 0;
	for (c = 0; c < lim; c++) if (dp[k1][c] > ans) ans = dp[k1][c];
	printf("%d\n", ans << 1);
	return 0;
}

4 16
INTERNATIONAL
COLLEGIATE
PROGRAMMJNG
CONTEST
 4 16
LANOITANRETNI
COLLEGIATE
PROGRAMMJNG
CONTEST
 7 16
LANOIUANRETNI
COLLAGIFTE
PRNGRAMMJNG
TSETNOC
 7 16
LANOIUANRETNI
COGLALIFTE
PRNGRAMMJNG
TSETNOC
 8 16
LANOIUANRETNI
COGLALIFTE
PRNGRAMNJNG
TSETNOC
 2 15
LANOIUANRETNI
COGLALIFTE
PRNGRAMNJNG
TSETNOC
 1 15
LANOIUTNREANI
COGLALIFTE
PRNGRAMNJNG
TSETNOC
 2 15
INAERNTUIONAL
COGLALIFTE
PRNGRAMNJNG
TSETNOC
 4 15
LANOIVTNREBNI
COGLALFITE
PNRGRAMNJNG
TSETNOC
 2 4
ACM
ICPD

18
 20
 16
 14
 12
 6
 0
 4
 10
 2

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

```c
// AOJ 2449: Connect
// 2018.2.2 bal4u

#include <stdio.h>
#include <string.h>

char s[129][20]; int w[129];
int dp[2][65536], bc[65536];

int bitcount16(int x)
{
	x = ((x & 0xAAAAAA) >>  1) + (x & 0x555555);
	x = ((x & 0xCCCCCC) >>  2) + (x & 0x333333);
	x = ((x & 0xF0F0F0) >>  4) + (x & 0x0F0F0F);
	x = ((x & 0x00FF00) >>  8) + (x & 0xFF00FF);
	return x;
}

int main()
{
	int R, C, r, c, i, k, k1, k2, lim, p, q, x, ans;
	char buf[10], *t;

	fgets(buf, 10, stdin), sscanf(buf, "%d%d", &R, &C);
	for (r = 0; r < R; r++) {
		fgets(t=s[r], 20, stdin);
		while (*t > ' ') t++;
		w[r] = t - s[r];
	}
	lim = 1 << C;
	for (i = 0; i < lim; i++) bc[i] = bitcount16(i);
	
	memset(dp, -1, sizeof(dp));
	dp[0][0] = 0;
	
	k1 = 0, k2 = 1;
	for (r = 0; r < R; r++) for (c = 0; c < C; c++) {
		memset(dp[k2], -1, sizeof(dp[k2]));
		for (k = 0; k < lim; k++) if (dp[k1][k] >= 0) {
			p = bc[k & (1 << c) - 1];
			if (p < w[r]) {
				q = dp[k1][k];
				if (c && (k & (1 << (c-1))) && s[r][p-1] == s[r][p]) q++;
				if (r && (k & (1 << c))     && s[r][p  ] == s[r-1][w[r-1] - bc[k>>c]]) q++;
				x = k | (1 << c);
				if (q > dp[k2][x]) dp[k2][x] = q;
			}
			if (p + C - c > w[r]) {
				x = k & ~(1 << c);
				if (dp[k1][k] > dp[k2][x]) dp[k2][x] = dp[k1][k];
			}
		}
		k1 = k2, k2 = !k2;
	}

	ans = 0;
	for (c = 0; c < lim; c++) if (dp[k1][c] > ans) ans = dp[k1][c];
	printf("%d\n", ans << 1);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 2580
s:
	.zero	2580
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 516
w:
	.zero	516
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 524288
dp:
	.zero	524288
	.globl	bc
	.align 32
	.type	bc, @object
	.size	bc, 262144
bc:
	.zero	262144
	.text
	.globl	bitcount16
	.type	bitcount16, @function
bitcount16:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	sarl	%eax
	andl	$5592405, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$5592405, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	sarl	$2, %eax
	andl	$3355443, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$3355443, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	sarl	$4, %eax
	andl	$986895, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$986895, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	sarl	$8, %eax
	movzbl	%al, %edx
	movl	-4(%rbp), %eax
	andl	$16711935, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	bitcount16, .-bitcount16
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rdx
	leaq	-18(%rbp), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-80(%rbp), %rcx
	leaq	-84(%rbp), %rdx
	leaq	-18(%rbp), %rax
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$0, -76(%rbp)
	jmp	.L4
.L7:
	movq	stdin(%rip), %rdx
	movl	-76(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	leaq	s(%rip), %rcx
	addq	%rcx, %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	movl	$20, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	jmp	.L5
.L6:
	addq	$1, -32(%rbp)
.L5:
	movq	-32(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$32, %al
	jg	.L6
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	s(%rip), %rdx
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	subq	%rdx, %rax
	movl	%eax, %ecx
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -76(%rbp)
.L4:
	movl	-84(%rbp), %eax
	cmpl	%eax, -76(%rbp)
	jl	.L7
	movl	-80(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -44(%rbp)
	movl	$0, -68(%rbp)
	jmp	.L8
.L9:
	movl	-68(%rbp), %eax
	movl	%eax, %edi
	call	bitcount16
	movl	-68(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	bc(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -68(%rbp)
.L8:
	movl	-68(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L9
	movl	$524288, %edx
	movl	$-1, %esi
	leaq	dp(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, dp(%rip)
	movl	$0, -60(%rbp)
	movl	$1, -56(%rbp)
	movl	$0, -76(%rbp)
	jmp	.L10
.L19:
	movl	$0, -72(%rbp)
	jmp	.L11
.L18:
	movl	-56(%rbp), %eax
	cltq
	salq	$18, %rax
	movq	%rax, %rdx
	leaq	dp(%rip), %rax
	addq	%rdx, %rax
	movl	$262144, %edx
	movl	$-1, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -64(%rbp)
	jmp	.L12
.L17:
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L13
	movl	-72(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	subl	$1, %eax
	andl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bc(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -40(%rbp)
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -40(%rbp)
	jge	.L14
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -52(%rbp)
	cmpl	$0, -72(%rbp)
	je	.L15
	movl	-72(%rbp), %eax
	subl	$1, %eax
	movl	-64(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L15
	movl	-40(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %ecx
	movl	-40(%rbp), %eax
	movslq	%eax, %rsi
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rsi), %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %cl
	jne	.L15
	addl	$1, -52(%rbp)
.L15:
	cmpl	$0, -76(%rbp)
	je	.L16
	movl	-72(%rbp), %eax
	movl	-64(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L16
	movl	-40(%rbp), %eax
	movslq	%eax, %rcx
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %esi
	movl	-76(%rbp), %eax
	leal	-1(%rax), %r8d
	movl	-76(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-72(%rbp), %eax
	movl	-64(%rbp), %edi
	movl	%eax, %ecx
	sarl	%cl, %edi
	movl	%edi, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	bc(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movslq	%eax, %rcx
	movslq	%r8d, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %sil
	jne	.L16
	addl	$1, -52(%rbp)
.L16:
	movl	-72(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	orl	-64(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -52(%rbp)
	jle	.L14
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rdx
	movl	-52(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L14:
	movl	-80(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	subl	-72(%rbp), %eax
	movl	%eax, %edx
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	w(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L13
	movl	-72(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	notl	%eax
	andl	-64(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movl	-56(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L13
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	movl	-56(%rbp), %edx
	movslq	%edx, %rdx
	salq	$16, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L13:
	addl	$1, -64(%rbp)
.L12:
	movl	-64(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L17
	movl	-56(%rbp), %eax
	movl	%eax, -60(%rbp)
	cmpl	$0, -56(%rbp)
	sete	%al
	movzbl	%al, %eax
	movl	%eax, -56(%rbp)
	addl	$1, -72(%rbp)
.L11:
	movl	-80(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L18
	addl	$1, -76(%rbp)
.L10:
	movl	-84(%rbp), %eax
	cmpl	%eax, -76(%rbp)
	jl	.L19
	movl	$0, -48(%rbp)
	movl	$0, -72(%rbp)
	jmp	.L20
.L22:
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -48(%rbp)
	jge	.L21
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -48(%rbp)
.L21:
	addl	$1, -72(%rbp)
.L20:
	movl	-72(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L22
	movl	-48(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 2580
s:
	.zero	2580
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 516
w:
	.zero	516
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 524288
dp:
	.zero	524288
	.globl	bc
	.align 32
	.type	bc, @object
	.size	bc, 262144
bc:
	.zero	262144
	.text
	.globl	bitcount16
	.type	bitcount16, @function
bitcount16:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	sarl	%eax
	andl	$5592405, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$5592405, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	sarl	$2, %eax
	andl	$3355443, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$3355443, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	sarl	$4, %eax
	andl	$986895, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$986895, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	sarl	$8, %eax
	movzbl	%al, %edx
	movl	-4(%rbp), %eax
	andl	$16711935, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	bitcount16, .-bitcount16
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rdx
	leaq	-18(%rbp), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-80(%rbp), %rcx
	leaq	-84(%rbp), %rdx
	leaq	-18(%rbp), %rax
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$0, -76(%rbp)
	jmp	.L4
.L7:
	movq	stdin(%rip), %rdx
	movl	-76(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	leaq	s(%rip), %rcx
	addq	%rcx, %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	movl	$20, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	jmp	.L5
.L6:
	addq	$1, -32(%rbp)
.L5:
	movq	-32(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$32, %al
	jg	.L6
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	s(%rip), %rdx
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	subq	%rdx, %rax
	movl	%eax, %ecx
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -76(%rbp)
.L4:
	movl	-84(%rbp), %eax
	cmpl	%eax, -76(%rbp)
	jl	.L7
	movl	-80(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -44(%rbp)
	movl	$0, -68(%rbp)
	jmp	.L8
.L9:
	movl	-68(%rbp), %eax
	movl	%eax, %edi
	call	bitcount16
	movl	-68(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	bc(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -68(%rbp)
.L8:
	movl	-68(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L9
	movl	$524288, %edx
	movl	$-1, %esi
	leaq	dp(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, dp(%rip)
	movl	$0, -60(%rbp)
	movl	$1, -56(%rbp)
	movl	$0, -76(%rbp)
	jmp	.L10
.L19:
	movl	$0, -72(%rbp)
	jmp	.L11
.L18:
	movl	-56(%rbp), %eax
	cltq
	salq	$18, %rax
	movq	%rax, %rdx
	leaq	dp(%rip), %rax
	addq	%rdx, %rax
	movl	$262144, %edx
	movl	$-1, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -64(%rbp)
	jmp	.L12
.L17:
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L13
	movl	-72(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	subl	$1, %eax
	andl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bc(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -40(%rbp)
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -40(%rbp)
	jge	.L14
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -52(%rbp)
	cmpl	$0, -72(%rbp)
	je	.L15
	movl	-72(%rbp), %eax
	subl	$1, %eax
	movl	-64(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L15
	movl	-40(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %ecx
	movl	-40(%rbp), %eax
	movslq	%eax, %rsi
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rsi), %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %cl
	jne	.L15
	addl	$1, -52(%rbp)
.L15:
	cmpl	$0, -76(%rbp)
	je	.L16
	movl	-72(%rbp), %eax
	movl	-64(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L16
	movl	-40(%rbp), %eax
	movslq	%eax, %rcx
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %esi
	movl	-76(%rbp), %eax
	leal	-1(%rax), %r8d
	movl	-76(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-72(%rbp), %eax
	movl	-64(%rbp), %edi
	movl	%eax, %ecx
	sarl	%cl, %edi
	movl	%edi, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	bc(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movslq	%eax, %rcx
	movslq	%r8d, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %sil
	jne	.L16
	addl	$1, -52(%rbp)
.L16:
	movl	-72(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	orl	-64(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -52(%rbp)
	jle	.L14
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rdx
	movl	-52(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L14:
	movl	-80(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	subl	-72(%rbp), %eax
	movl	%eax, %edx
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	w(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L13
	movl	-72(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	notl	%eax
	andl	-64(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movl	-56(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L13
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	movl	-56(%rbp), %edx
	movslq	%edx, %rdx
	salq	$16, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L13:
	addl	$1, -64(%rbp)
.L12:
	movl	-64(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L17
	movl	-56(%rbp), %eax
	movl	%eax, -60(%rbp)
	cmpl	$0, -56(%rbp)
	sete	%al
	movzbl	%al, %eax
	movl	%eax, -56(%rbp)
	addl	$1, -72(%rbp)
.L11:
	movl	-80(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L18
	addl	$1, -76(%rbp)
.L10:
	movl	-84(%rbp), %eax
	cmpl	%eax, -76(%rbp)
	jl	.L19
	movl	$0, -48(%rbp)
	movl	$0, -72(%rbp)
	jmp	.L20
.L22:
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -48(%rbp)
	jge	.L21
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$16, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -48(%rbp)
.L21:
	addl	$1, -72(%rbp)
.L20:
	movl	-72(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L22
	movl	-48(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
