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

```c
// AOJ 1032 Course Planning for Lazy Students
// 2018.2.28 bal4u

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

//#define getchar_unlocked()  getchar()
int in()
{
	int n = 0;
	int c = getchar_unlocked();
	do n = 10*n + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}

#define QMAX 500000
typedef struct { int s, c; } Q;
Q q[QMAX+3]; int top, tail;
int c[22], r[22];
char mk[1<<20];

int bitcount(int bits)
{
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main()
{
	int n, U, i, k, s;
	
	while (n = in()) {
		U = in();
		for (i = 0; i < n; i++) {
			c[i] = in(), r[i] = 0;
			k = in(); while (k--) r[i] |= 1 << in();
		}

		memset(mk, 0, sizeof(mk));
		q[0].s = q[0].c = 0, top = 0, tail = 1;
		while (top != tail) {
			s = q[top].s, k = q[top].c; if (++top == QMAX) top = 0;
			if (mk[s]) continue;
			mk[s] = 1;
			if (k >= U) break;
			for (i = 0; i < n; i++) if (!(s & (1<<i)) && (r[i] & s) == r[i]) {
				q[tail].s = s | (1<<i), q[tail].c = k + c[i];
				if (++tail == QMAX) tail = 0;
			}
		}
		printf("%d\n", bitcount(s));
	}
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.LFB0:
	.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
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	in, .-in
	.globl	q
	.bss
	.align 32
	.type	q, @object
	.size	q, 4000024
q:
	.zero	4000024
	.globl	top
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.zero	4
	.globl	tail
	.align 4
	.type	tail, @object
	.size	tail, 4
tail:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 88
c:
	.zero	88
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 88
r:
	.zero	88
	.globl	mk
	.align 32
	.type	mk, @object
	.size	mk, 1048576
mk:
	.zero	1048576
	.text
	.globl	bitcount
	.type	bitcount, @function
bitcount:
.LFB1:
	.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
	andl	$1431655765, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	sarl	%eax
	andl	$1431655765, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	andl	$858993459, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	sarl	$2, %eax
	andl	$858993459, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	andl	$252645135, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	sarl	$4, %eax
	andl	$252645135, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	andl	$16711935, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	sarl	$8, %eax
	andl	$16711935, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movzwl	%ax, %edx
	movl	-4(%rbp), %eax
	shrl	$16, %eax
	addl	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	bitcount, .-bitcount
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	jmp	.L7
.L21:
	movl	$0, %eax
	call	in
	movl	%eax, -4(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L8
.L11:
	movl	$0, %eax
	call	in
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	c(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	jmp	.L9
.L10:
	movl	$0, %eax
	call	in
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	orl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L9:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.L10
	addl	$1, -20(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L11
	movl	$1048576, %edx
	movl	$0, %esi
	leaq	mk(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, 4+q(%rip)
	movl	4+q(%rip), %eax
	movl	%eax, q(%rip)
	movl	$0, top(%rip)
	movl	$1, tail(%rip)
	jmp	.L12
.L20:
	movl	top(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	top(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
	movl	top(%rip), %eax
	addl	$1, %eax
	movl	%eax, top(%rip)
	movl	top(%rip), %eax
	cmpl	$500000, %eax
	jne	.L13
	movl	$0, top(%rip)
.L13:
	movl	-12(%rbp), %eax
	cltq
	leaq	mk(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L14
	jmp	.L12
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	mk(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-16(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L23
	movl	$0, -20(%rbp)
	jmp	.L17
.L19:
	movl	-20(%rbp), %eax
	movl	-12(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L18
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	andl	-12(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	r(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L18
	movl	-20(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	tail(%rip), %edx
	orl	-12(%rbp), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	q(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	tail(%rip), %eax
	movl	-16(%rbp), %edx
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+q(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	tail(%rip), %eax
	addl	$1, %eax
	movl	%eax, tail(%rip)
	movl	tail(%rip), %eax
	cmpl	$500000, %eax
	jne	.L18
	movl	$0, tail(%rip)
.L18:
	addl	$1, -20(%rbp)
.L17:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L19
.L12:
	movl	top(%rip), %edx
	movl	tail(%rip), %eax
	cmpl	%eax, %edx
	jne	.L20
	jmp	.L16
.L23:
	nop
.L16:
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	bitcount
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	cmpl	$0, -8(%rbp)
	jne	.L21
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	in
	.type	in, @function
in:
.LFB35:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L11
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L3:
	xorl	%r12d, %r12d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L1
.L5:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L7:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L4
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L1
	movq	stdin(%rip), %rdi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L3
	.cfi_endproc
.LFE35:
	.size	in, .-in
	.p2align 4
	.globl	bitcount
	.type	bitcount, @function
bitcount:
.LFB36:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	sarl	%edi
	andl	$1431655765, %eax
	andl	$1431655765, %edi
	addl	%edi, %eax
	movl	%eax, %edx
	sarl	$2, %eax
	andl	$858993459, %eax
	andl	$858993459, %edx
	addl	%eax, %edx
	movl	%edx, %eax
	sarl	$4, %edx
	andl	$252645135, %edx
	andl	$252645135, %eax
	addl	%edx, %eax
	movl	%eax, %edx
	sarl	$8, %eax
	andl	$16711935, %eax
	andl	$16711935, %edx
	addl	%eax, %edx
	movzwl	%dx, %eax
	shrl	$16, %edx
	addl	%edx, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	bitcount, .-bitcount
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB37:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	r(%rip), %r15
	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	$24, %rsp
	.cfi_def_cfa_offset 80
.L14:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L84
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L57:
	xorl	%r12d, %r12d
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L58:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L60
.L59:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L61:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L58
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L60
	movq	stdin(%rip), %rdi
	jmp	.L59
.L60:
	testl	%r12d, %r12d
	je	.L85
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L86
	leaq	1(%rax), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rax), %edx
.L16:
	xorl	%ebp, %ebp
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L17:
	leaq	1(%rsi), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rsi), %edx
	cmpl	$47, %edx
	jle	.L19
.L18:
	movq	%rax, %rsi
.L20:
	leal	0(%rbp,%rbp,4), %eax
	andl	$15, %edx
	leal	(%rdx,%rax,2), %ebp
	cmpq	%rcx, %rsi
	jb	.L17
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movl	%eax, %edx
	movq	16(%rdi), %rcx
	movq	8(%rdi), %rax
	cmpl	$47, %edx
	jg	.L18
.L19:
	leaq	r(%rip), %rbx
	leal	-1(%r12), %edx
	movl	%ebp, 8(%rsp)
	leaq	4(%rbx), %rsi
	movl	%r12d, 12(%rsp)
	leaq	c(%rip), %r13
	leaq	(%rsi,%rdx,4), %r14
	cmpq	%rcx, %rax
	jnb	.L87
	.p2align 4,,10
	.p2align 3
.L21:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L22:
	xorl	%ebp, %ebp
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L23:
	leaq	1(%rdx), %r8
	movq	%r8, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L25
.L24:
	movq	%r8, %rdx
.L26:
	leal	0(%rbp,%rbp,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %ebp
	cmpq	%rcx, %rdx
	jb	.L23
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %r8
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jg	.L24
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%ebp, 0(%r13)
	movl	$0, (%rbx)
	cmpq	%r8, %rcx
	jbe	.L88
	leaq	1(%r8), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%r8), %eax
.L28:
	xorl	%ebp, %ebp
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L29:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L31
.L30:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L32:
	leal	0(%rbp,%rbp,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %ebp
	cmpq	%rcx, %rdx
	jb	.L29
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L31
	movq	stdin(%rip), %rdi
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L31:
	leal	-1(%rbp), %r12d
	testl	%ebp, %ebp
	je	.L42
	.p2align 4,,10
	.p2align 3
.L33:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %r8
	cmpq	%r8, %rax
	jnb	.L89
	leaq	1(%rax), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rax), %eax
.L37:
	xorl	%ebp, %ebp
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L38:
	leaq	1(%rsi), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rsi), %eax
	cmpl	$47, %eax
	jle	.L40
.L39:
	movq	8(%rdi), %rsi
	movq	16(%rdi), %r8
.L41:
	leal	0(%rbp,%rbp,4), %ecx
	andl	$15, %eax
	leal	(%rax,%rcx,2), %ebp
	cmpq	%r8, %rsi
	jb	.L38
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L40
	movq	stdin(%rip), %rdi
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L40:
	movl	$1, %eax
	movl	%ebp, %ecx
	sall	%cl, %eax
	orl	%eax, (%rbx)
	subl	$1, %r12d
	jnb	.L33
.L42:
	addq	$4, %rbx
	addq	$4, %r13
	cmpq	%rbx, %r14
	je	.L90
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jb	.L21
.L87:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L89:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rsi
	movq	16(%rdi), %r8
	jmp	.L37
.L90:
	leaq	mk(%rip), %r10
	movl	$1048576, %edx
	xorl	%esi, %esi
	xorl	%ebx, %ebx
	movq	%r10, %rdi
	movl	8(%rsp), %ebp
	movl	12(%rsp), %r12d
	xorl	%r13d, %r13d
	call	memset@PLT
	xorl	%r14d, %r14d
	movl	$1, %ecx
	xorl	%r11d, %r11d
	movq	%rax, %r10
	xorl	%edx, %edx
	xorl	%eax, %eax
	movq	$0, q(%rip)
	movl	$1, tail(%rip)
	movl	$1, %esi
	movl	$1, top(%rip)
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L46:
	cmpl	%esi, %ecx
	je	.L91
.L53:
	movslq	%ecx, %rax
	leaq	q(%rip), %rbx
	addl	$1, %ecx
	movl	(%rbx,%rax,8), %edx
	movl	4(%rbx,%rax,8), %r11d
	cmpl	$500000, %ecx
	movl	$1, %ebx
	cmove	%r14d, %ecx
	movslq	%edx, %rax
	movzbl	(%r10,%rax), %eax
.L44:
	testb	%al, %al
	jne	.L46
	movslq	%edx, %rax
	movb	$1, (%r10,%rax)
	cmpl	%r11d, %ebp
	jle	.L92
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L52:
	btl	%eax, %edx
	jc	.L51
	movl	(%r15,%rax,4), %edi
	movl	%edi, %r9d
	andl	%edx, %r9d
	cmpl	%r9d, %edi
	jne	.L51
	movl	%edx, %r9d
	movslq	%esi, %rdi
	addl	$1, %esi
	movl	$1, %r13d
	btsl	%eax, %r9d
	movd	%r9d, %xmm0
	leaq	c(%rip), %r9
	movl	(%r9,%rax,4), %r8d
	leaq	q(%rip), %r9
	addl	%r11d, %r8d
	movd	%r8d, %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%r9,%rdi,8)
	xorl	%edi, %edi
	cmpl	$500000, %esi
	cmove	%edi, %esi
	.p2align 4,,10
	.p2align 3
.L51:
	addq	$1, %rax
	cmpq	%r12, %rax
	jne	.L52
	cmpl	%esi, %ecx
	jne	.L53
.L91:
	testb	%bl, %bl
	je	.L54
	movl	%esi, top(%rip)
.L54:
	testb	%r13b, %r13b
	je	.L50
	movl	%esi, tail(%rip)
.L50:
	movl	%edx, %eax
	andl	$1431655765, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	sarl	%eax
	andl	$1431655765, %eax
	addl	%edx, %eax
	movl	%eax, %edx
	sarl	$2, %eax
	andl	$858993459, %eax
	andl	$858993459, %edx
	addl	%eax, %edx
	movl	%edx, %eax
	sarl	$4, %edx
	andl	$252645135, %edx
	andl	$252645135, %eax
	addl	%edx, %eax
	movl	%eax, %edx
	sarl	$8, %eax
	andl	$16711935, %edx
	andl	$16711935, %eax
	addl	%edx, %eax
	movzwl	%ax, %edx
	shrl	$16, %eax
	addl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L14
.L88:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L28
.L92:
	testb	%bl, %bl
	je	.L54
	movl	%ecx, top(%rip)
	jmp	.L54
.L86:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movl	%eax, %edx
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rcx
	jmp	.L16
.L85:
	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
.L84:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L57
	.cfi_endproc
.LFE37:
	.size	main, .-main
	.globl	mk
	.bss
	.align 32
	.type	mk, @object
	.size	mk, 1048576
mk:
	.zero	1048576
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 88
r:
	.zero	88
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 88
c:
	.zero	88
	.globl	tail
	.align 4
	.type	tail, @object
	.size	tail, 4
tail:
	.zero	4
	.globl	top
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.zero	4
	.globl	q
	.align 32
	.type	q, @object
	.size	q, 4000024
q:
	.zero	4000024
	.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	in
	.type	in, @function
in:
.LFB35:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L11
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L3:
	xorl	%r12d, %r12d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L1
.L5:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L7:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L4
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L1
	movq	stdin(%rip), %rdi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L3
	.cfi_endproc
.LFE35:
	.size	in, .-in
	.p2align 4
	.globl	bitcount
	.type	bitcount, @function
bitcount:
.LFB36:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	sarl	%edi
	andl	$1431655765, %eax
	andl	$1431655765, %edi
	addl	%edi, %eax
	movl	%eax, %edx
	sarl	$2, %eax
	andl	$858993459, %eax
	andl	$858993459, %edx
	addl	%eax, %edx
	movl	%edx, %eax
	sarl	$4, %edx
	andl	$252645135, %edx
	andl	$252645135, %eax
	addl	%edx, %eax
	movl	%eax, %edx
	sarl	$8, %eax
	andl	$16711935, %eax
	andl	$16711935, %edx
	addl	%eax, %edx
	movzwl	%dx, %eax
	shrl	$16, %edx
	addl	%edx, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	bitcount, .-bitcount
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB37:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	r(%rip), %r15
	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	$24, %rsp
	.cfi_def_cfa_offset 80
.L14:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L84
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L57:
	xorl	%r12d, %r12d
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L58:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L60
.L59:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L61:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L58
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L60
	movq	stdin(%rip), %rdi
	jmp	.L59
.L60:
	testl	%r12d, %r12d
	je	.L85
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L86
	leaq	1(%rax), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rax), %edx
.L16:
	xorl	%ebp, %ebp
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L17:
	leaq	1(%rsi), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rsi), %edx
	cmpl	$47, %edx
	jle	.L19
.L18:
	movq	%rax, %rsi
.L20:
	leal	0(%rbp,%rbp,4), %eax
	andl	$15, %edx
	leal	(%rdx,%rax,2), %ebp
	cmpq	%rcx, %rsi
	jb	.L17
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movl	%eax, %edx
	movq	16(%rdi), %rcx
	movq	8(%rdi), %rax
	cmpl	$47, %edx
	jg	.L18
.L19:
	leaq	r(%rip), %rbx
	leal	-1(%r12), %edx
	movl	%ebp, 8(%rsp)
	leaq	4(%rbx), %rsi
	movl	%r12d, 12(%rsp)
	leaq	c(%rip), %r13
	leaq	(%rsi,%rdx,4), %r14
	cmpq	%rcx, %rax
	jnb	.L87
	.p2align 4,,10
	.p2align 3
.L21:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L22:
	xorl	%ebp, %ebp
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L23:
	leaq	1(%rdx), %r8
	movq	%r8, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L25
.L24:
	movq	%r8, %rdx
.L26:
	leal	0(%rbp,%rbp,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %ebp
	cmpq	%rcx, %rdx
	jb	.L23
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %r8
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jg	.L24
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%ebp, 0(%r13)
	movl	$0, (%rbx)
	cmpq	%r8, %rcx
	jbe	.L88
	leaq	1(%r8), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%r8), %eax
.L28:
	xorl	%ebp, %ebp
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L29:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L31
.L30:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L32:
	leal	0(%rbp,%rbp,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %ebp
	cmpq	%rcx, %rdx
	jb	.L29
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L31
	movq	stdin(%rip), %rdi
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L31:
	leal	-1(%rbp), %r12d
	testl	%ebp, %ebp
	je	.L42
	.p2align 4,,10
	.p2align 3
.L33:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %r8
	cmpq	%r8, %rax
	jnb	.L89
	leaq	1(%rax), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rax), %eax
.L37:
	xorl	%ebp, %ebp
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L38:
	leaq	1(%rsi), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rsi), %eax
	cmpl	$47, %eax
	jle	.L40
.L39:
	movq	8(%rdi), %rsi
	movq	16(%rdi), %r8
.L41:
	leal	0(%rbp,%rbp,4), %ecx
	andl	$15, %eax
	leal	(%rax,%rcx,2), %ebp
	cmpq	%r8, %rsi
	jb	.L38
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L40
	movq	stdin(%rip), %rdi
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L40:
	movl	$1, %eax
	movl	%ebp, %ecx
	sall	%cl, %eax
	orl	%eax, (%rbx)
	subl	$1, %r12d
	jnb	.L33
.L42:
	addq	$4, %rbx
	addq	$4, %r13
	cmpq	%rbx, %r14
	je	.L90
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jb	.L21
.L87:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L89:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rsi
	movq	16(%rdi), %r8
	jmp	.L37
.L90:
	leaq	mk(%rip), %r10
	movl	$1048576, %edx
	xorl	%esi, %esi
	xorl	%ebx, %ebx
	movq	%r10, %rdi
	movl	8(%rsp), %ebp
	movl	12(%rsp), %r12d
	xorl	%r13d, %r13d
	call	memset@PLT
	xorl	%r14d, %r14d
	movl	$1, %ecx
	xorl	%r11d, %r11d
	movq	%rax, %r10
	xorl	%edx, %edx
	xorl	%eax, %eax
	movq	$0, q(%rip)
	movl	$1, tail(%rip)
	movl	$1, %esi
	movl	$1, top(%rip)
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L46:
	cmpl	%esi, %ecx
	je	.L91
.L53:
	movslq	%ecx, %rax
	leaq	q(%rip), %rbx
	addl	$1, %ecx
	movl	(%rbx,%rax,8), %edx
	movl	4(%rbx,%rax,8), %r11d
	cmpl	$500000, %ecx
	movl	$1, %ebx
	cmove	%r14d, %ecx
	movslq	%edx, %rax
	movzbl	(%r10,%rax), %eax
.L44:
	testb	%al, %al
	jne	.L46
	movslq	%edx, %rax
	movb	$1, (%r10,%rax)
	cmpl	%r11d, %ebp
	jle	.L92
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L52:
	btl	%eax, %edx
	jc	.L51
	movl	(%r15,%rax,4), %edi
	movl	%edi, %r9d
	andl	%edx, %r9d
	cmpl	%r9d, %edi
	jne	.L51
	movl	%edx, %r9d
	movslq	%esi, %rdi
	addl	$1, %esi
	movl	$1, %r13d
	btsl	%eax, %r9d
	movd	%r9d, %xmm0
	leaq	c(%rip), %r9
	movl	(%r9,%rax,4), %r8d
	leaq	q(%rip), %r9
	addl	%r11d, %r8d
	movd	%r8d, %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%r9,%rdi,8)
	xorl	%edi, %edi
	cmpl	$500000, %esi
	cmove	%edi, %esi
	.p2align 4,,10
	.p2align 3
.L51:
	addq	$1, %rax
	cmpq	%r12, %rax
	jne	.L52
	cmpl	%esi, %ecx
	jne	.L53
.L91:
	testb	%bl, %bl
	je	.L54
	movl	%esi, top(%rip)
.L54:
	testb	%r13b, %r13b
	je	.L50
	movl	%esi, tail(%rip)
.L50:
	movl	%edx, %eax
	andl	$1431655765, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	sarl	%eax
	andl	$1431655765, %eax
	addl	%edx, %eax
	movl	%eax, %edx
	sarl	$2, %eax
	andl	$858993459, %eax
	andl	$858993459, %edx
	addl	%eax, %edx
	movl	%edx, %eax
	sarl	$4, %edx
	andl	$252645135, %edx
	andl	$252645135, %eax
	addl	%edx, %eax
	movl	%eax, %edx
	sarl	$8, %eax
	andl	$16711935, %edx
	andl	$16711935, %eax
	addl	%edx, %eax
	movzwl	%ax, %edx
	shrl	$16, %eax
	addl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L14
.L88:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L28
.L92:
	testb	%bl, %bl
	je	.L54
	movl	%ecx, top(%rip)
	jmp	.L54
.L86:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movl	%eax, %edx
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rcx
	jmp	.L16
.L85:
	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
.L84:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L57
	.cfi_endproc
.LFE37:
	.size	main, .-main
	.globl	mk
	.bss
	.align 32
	.type	mk, @object
	.size	mk, 1048576
mk:
	.zero	1048576
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 88
r:
	.zero	88
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 88
c:
	.zero	88
	.globl	tail
	.align 4
	.type	tail, @object
	.size	tail, 4
tail:
	.zero	4
	.globl	top
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.zero	4
	.globl	q
	.align 32
	.type	q, @object
	.size	q, 4000024
q:
	.zero	4000024
	.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 1032 Course Planning for Lazy Students
// 2018.2.28 bal4u

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

//#define getchar_unlocked()  getchar()
int in()
{
	int n = 0;
	int c = getchar_unlocked();
	do n = 10*n + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}

#define QMAX 500000
typedef struct { int s, c; } Q;
Q q[QMAX+3]; int top, tail;
int c[22], r[22];
char mk[1<<20];

int bitcount(int bits)
{
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main()
{
	int n, U, i, k, s;
	
	while (n = in()) {
		U = in();
		for (i = 0; i < n; i++) {
			c[i] = in(), r[i] = 0;
			k = in(); while (k--) r[i] |= 1 << in();
		}

		memset(mk, 0, sizeof(mk));
		q[0].s = q[0].c = 0, top = 0, tail = 1;
		while (top != tail) {
			s = q[top].s, k = q[top].c; if (++top == QMAX) top = 0;
			if (mk[s]) continue;
			mk[s] = 1;
			if (k >= U) break;
			for (i = 0; i < n; i++) if (!(s & (1<<i)) && (r[i] & s) == r[i]) {
				q[tail].s = s | (1<<i), q[tail].c = k + c[i];
				if (++tail == QMAX) tail = 0;
			}
		}
		printf("%d\n", bitcount(s));
	}
	return 0;
}

4 4
1 0
3 2 0 2
2 0
2 0
3 1
1 0
3 2 0 2
2 0
0 0
 4 4
1 0
3 2 0 2
2 0
0 0
3 1
1 0
3 2 0 2
2 0
0 0
 4 4
1 0
3 2 0 2
2 0
2 0
3 6
1 0
3 2 0 2
4 0
0 0
 4 4
1 0
3 2 0 2
4 0
0 0
3 1
1 0
3 2 0 2
2 0
0 0
 4 4
2 0
3 0 -1 2
2 1
0 0
3 2
1 0
3 2 0 2
1 0
0 0
 4 4
1 0
3 0 1 0
2 0
0 0
3 1
1 0
3 2 0 2
2 0
0 0
 4 4
1 0
3 2 0 2
2 0
2 0
3 1
1 0
3 2 1 2
2 0
0 0
 4 4
1 0
3 0 0 2
2 0
0 0
3 1
1 0
3 2 0 2
2 0
0 0
 4 4
1 0
3 0 1 2
2 0
0 0
3 1
1 0
3 2 0 2
2 0
0 0
 4 4
1 0
3 0 1 2
2 0
-1 0
3 1
1 0
3 2 0 2
2 0
0 0

2
1
 3
1
 2
3
 1
1
 2
2
 2
 2
1
 2
1
 2
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
// AOJ 1032 Course Planning for Lazy Students
// 2018.2.28 bal4u

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

//#define getchar_unlocked()  getchar()
int in()
{
	int n = 0;
	int c = getchar_unlocked();
	do n = 10*n + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}

#define QMAX 500000
typedef struct { int s, c; } Q;
Q q[QMAX+3]; int top, tail;
int c[22], r[22];
char mk[1<<20];

int bitcount(int bits)
{
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main()
{
	int n, U, i, k, s;
	
	while (n = in()) {
		U = in();
		for (i = 0; i < n; i++) {
			c[i] = in(), r[i] = 0;
			k = in(); while (k--) r[i] |= 1 << in();
		}

		memset(mk, 0, sizeof(mk));
		q[0].s = q[0].c = 0, top = 0, tail = 1;
		while (top != tail) {
			s = q[top].s, k = q[top].c; if (++top == QMAX) top = 0;
			if (mk[s]) continue;
			mk[s] = 1;
			if (k >= U) break;
			for (i = 0; i < n; i++) if (!(s & (1<<i)) && (r[i] & s) == r[i]) {
				q[tail].s = s | (1<<i), q[tail].c = k + c[i];
				if (++tail == QMAX) tail = 0;
			}
		}
		printf("%d\n", bitcount(s));
	}
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.LFB0:
	.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
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	in, .-in
	.globl	q
	.bss
	.align 32
	.type	q, @object
	.size	q, 4000024
q:
	.zero	4000024
	.globl	top
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.zero	4
	.globl	tail
	.align 4
	.type	tail, @object
	.size	tail, 4
tail:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 88
c:
	.zero	88
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 88
r:
	.zero	88
	.globl	mk
	.align 32
	.type	mk, @object
	.size	mk, 1048576
mk:
	.zero	1048576
	.text
	.globl	bitcount
	.type	bitcount, @function
bitcount:
.LFB1:
	.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
	andl	$1431655765, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	sarl	%eax
	andl	$1431655765, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	andl	$858993459, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	sarl	$2, %eax
	andl	$858993459, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	andl	$252645135, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	sarl	$4, %eax
	andl	$252645135, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	andl	$16711935, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	sarl	$8, %eax
	andl	$16711935, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movzwl	%ax, %edx
	movl	-4(%rbp), %eax
	shrl	$16, %eax
	addl	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	bitcount, .-bitcount
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	jmp	.L7
.L21:
	movl	$0, %eax
	call	in
	movl	%eax, -4(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L8
.L11:
	movl	$0, %eax
	call	in
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	c(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	jmp	.L9
.L10:
	movl	$0, %eax
	call	in
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	orl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L9:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.L10
	addl	$1, -20(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L11
	movl	$1048576, %edx
	movl	$0, %esi
	leaq	mk(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, 4+q(%rip)
	movl	4+q(%rip), %eax
	movl	%eax, q(%rip)
	movl	$0, top(%rip)
	movl	$1, tail(%rip)
	jmp	.L12
.L20:
	movl	top(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	top(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
	movl	top(%rip), %eax
	addl	$1, %eax
	movl	%eax, top(%rip)
	movl	top(%rip), %eax
	cmpl	$500000, %eax
	jne	.L13
	movl	$0, top(%rip)
.L13:
	movl	-12(%rbp), %eax
	cltq
	leaq	mk(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L14
	jmp	.L12
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	mk(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-16(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L23
	movl	$0, -20(%rbp)
	jmp	.L17
.L19:
	movl	-20(%rbp), %eax
	movl	-12(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L18
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	andl	-12(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	r(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L18
	movl	-20(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	tail(%rip), %edx
	orl	-12(%rbp), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	q(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	tail(%rip), %eax
	movl	-16(%rbp), %edx
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+q(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	tail(%rip), %eax
	addl	$1, %eax
	movl	%eax, tail(%rip)
	movl	tail(%rip), %eax
	cmpl	$500000, %eax
	jne	.L18
	movl	$0, tail(%rip)
.L18:
	addl	$1, -20(%rbp)
.L17:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L19
.L12:
	movl	top(%rip), %edx
	movl	tail(%rip), %eax
	cmpl	%eax, %edx
	jne	.L20
	jmp	.L16
.L23:
	nop
.L16:
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	bitcount
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	cmpl	$0, -8(%rbp)
	jne	.L21
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	in
	.type	in, @function
in:
.LFB0:
	.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
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	in, .-in
	.globl	q
	.bss
	.align 32
	.type	q, @object
	.size	q, 4000024
q:
	.zero	4000024
	.globl	top
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.zero	4
	.globl	tail
	.align 4
	.type	tail, @object
	.size	tail, 4
tail:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 88
c:
	.zero	88
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 88
r:
	.zero	88
	.globl	mk
	.align 32
	.type	mk, @object
	.size	mk, 1048576
mk:
	.zero	1048576
	.text
	.globl	bitcount
	.type	bitcount, @function
bitcount:
.LFB1:
	.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
	andl	$1431655765, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	sarl	%eax
	andl	$1431655765, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	andl	$858993459, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	sarl	$2, %eax
	andl	$858993459, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	andl	$252645135, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	sarl	$4, %eax
	andl	$252645135, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	andl	$16711935, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	sarl	$8, %eax
	andl	$16711935, %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movzwl	%ax, %edx
	movl	-4(%rbp), %eax
	shrl	$16, %eax
	addl	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	bitcount, .-bitcount
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	jmp	.L7
.L21:
	movl	$0, %eax
	call	in
	movl	%eax, -4(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L8
.L11:
	movl	$0, %eax
	call	in
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	c(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	jmp	.L9
.L10:
	movl	$0, %eax
	call	in
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	orl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L9:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.L10
	addl	$1, -20(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L11
	movl	$1048576, %edx
	movl	$0, %esi
	leaq	mk(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, 4+q(%rip)
	movl	4+q(%rip), %eax
	movl	%eax, q(%rip)
	movl	$0, top(%rip)
	movl	$1, tail(%rip)
	jmp	.L12
.L20:
	movl	top(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	top(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
	movl	top(%rip), %eax
	addl	$1, %eax
	movl	%eax, top(%rip)
	movl	top(%rip), %eax
	cmpl	$500000, %eax
	jne	.L13
	movl	$0, top(%rip)
.L13:
	movl	-12(%rbp), %eax
	cltq
	leaq	mk(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L14
	jmp	.L12
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	mk(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-16(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L23
	movl	$0, -20(%rbp)
	jmp	.L17
.L19:
	movl	-20(%rbp), %eax
	movl	-12(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L18
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	andl	-12(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	r(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L18
	movl	-20(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	tail(%rip), %edx
	orl	-12(%rbp), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	q(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	tail(%rip), %eax
	movl	-16(%rbp), %edx
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+q(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	tail(%rip), %eax
	addl	$1, %eax
	movl	%eax, tail(%rip)
	movl	tail(%rip), %eax
	cmpl	$500000, %eax
	jne	.L18
	movl	$0, tail(%rip)
.L18:
	addl	$1, -20(%rbp)
.L17:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L19
.L12:
	movl	top(%rip), %edx
	movl	tail(%rip), %eax
	cmpl	%eax, %edx
	jne	.L20
	jmp	.L16
.L23:
	nop
.L16:
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	bitcount
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	cmpl	$0, -8(%rbp)
	jne	.L21
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
