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

```c
/*
	submission # - User: herp_sy
	https://atcoder.jp/contests/

	coding: utf-8
	lang: C (GCC 5.4.1)
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdbool.h>

#define _CRT_SECURE_NO_WARNINGS
#define TLong long long
#define TBMod 1000000007

int main(int argc, char const *argv[])
{
	int n, m;
	int num[12][12] = { 0 };
	int k;
	int p[12] = { 0 };
	int col;
	int bitcnt, ans = 0;
	bool chkflag;
	
	// input & setup
	scanf("%d %d", &n, &m);
	for (int i = 0; i < 12; ++i){
		for (int j = 0; j < 12; ++j){
			num[i][j] = 0;
		}
	}
	for (int i = 0; i < m; ++i){
		scanf("%d", &k);
		for (int j = 0; j < k; ++j){
			scanf("%d", &col);
			num[i][col - 1] = 1;
		}
	}
	for (int i = 0; i < m; ++i) scanf("%d", &p[i]);
	
	// countup
	for (int i = 0; i < (1 << n); ++i){
		chkflag = true;
		for (int j = 0; j < m; ++j){
			bitcnt = 0;
			for (int l = 0; l < n; ++l){
				if(num[j][l] & i >> l) ++bitcnt;
			}
			if(bitcnt % 2 != p[j]) chkflag = false;
		}
		if(chkflag) ans += 1;
	}
	printf("%d\n", ans);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$720, %rsp
	movl	%edi, -708(%rbp)
	movq	%rsi, -720(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-592(%rbp), %rdx
	movl	$0, %eax
	movl	$72, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	$0, -640(%rbp)
	movq	$0, -632(%rbp)
	movq	$0, -624(%rbp)
	movq	$0, -616(%rbp)
	movq	$0, -608(%rbp)
	movq	$0, -600(%rbp)
	movl	$0, -676(%rbp)
	leaq	-692(%rbp), %rdx
	leaq	-696(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -672(%rbp)
	jmp	.L2
.L5:
	movl	$0, -668(%rbp)
	jmp	.L3
.L4:
	movl	-668(%rbp), %eax
	movslq	%eax, %rcx
	movl	-672(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$0, -592(%rbp,%rax,4)
	addl	$1, -668(%rbp)
.L3:
	cmpl	$11, -668(%rbp)
	jle	.L4
	addl	$1, -672(%rbp)
.L2:
	cmpl	$11, -672(%rbp)
	jle	.L5
	movl	$0, -664(%rbp)
	jmp	.L6
.L9:
	leaq	-688(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -660(%rbp)
	jmp	.L7
.L8:
	leaq	-684(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-684(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-664(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$1, -592(%rbp,%rax,4)
	addl	$1, -660(%rbp)
.L7:
	movl	-688(%rbp), %eax
	cmpl	%eax, -660(%rbp)
	jl	.L8
	addl	$1, -664(%rbp)
.L6:
	movl	-692(%rbp), %eax
	cmpl	%eax, -664(%rbp)
	jl	.L9
	movl	$0, -656(%rbp)
	jmp	.L10
.L11:
	leaq	-640(%rbp), %rdx
	movl	-656(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -656(%rbp)
.L10:
	movl	-692(%rbp), %eax
	cmpl	%eax, -656(%rbp)
	jl	.L11
	movl	$0, -652(%rbp)
	jmp	.L12
.L20:
	movb	$1, -697(%rbp)
	movl	$0, -648(%rbp)
	jmp	.L13
.L18:
	movl	$0, -680(%rbp)
	movl	$0, -644(%rbp)
	jmp	.L14
.L16:
	movl	-644(%rbp), %eax
	movslq	%eax, %rcx
	movl	-648(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-592(%rbp,%rax,4), %esi
	movl	-644(%rbp), %eax
	movl	-652(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	%esi, %eax
	testl	%eax, %eax
	je	.L15
	addl	$1, -680(%rbp)
.L15:
	addl	$1, -644(%rbp)
.L14:
	movl	-696(%rbp), %eax
	cmpl	%eax, -644(%rbp)
	jl	.L16
	movl	-680(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-648(%rbp), %eax
	cltq
	movl	-640(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	je	.L17
	movb	$0, -697(%rbp)
.L17:
	addl	$1, -648(%rbp)
.L13:
	movl	-692(%rbp), %eax
	cmpl	%eax, -648(%rbp)
	jl	.L18
	cmpb	$0, -697(%rbp)
	je	.L19
	addl	$1, -676(%rbp)
.L19:
	addl	$1, -652(%rbp)
.L12:
	movl	-696(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -652(%rbp)
	jl	.L20
	movl	-676(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$72, %ecx
	pxor	%xmm0, %xmm0
	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	$712, %rsp
	.cfi_def_cfa_offset 768
	movq	%fs:40, %rax
	movq	%rax, 696(%rsp)
	xorl	%eax, %eax
	leaq	112(%rsp), %rdi
	leaq	52(%rsp), %rdx
	movaps	%xmm0, 64(%rsp)
	movq	%rdi, 32(%rsp)
	leaq	48(%rsp), %rsi
	movaps	%xmm0, 80(%rsp)
	movaps	%xmm0, 96(%rsp)
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	movl	%eax, 20(%rsp)
	testl	%eax, %eax
	jle	.L2
	xorl	%r12d, %r12d
	leaq	56(%rsp), %r13
	leaq	60(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	call	__isoc99_scanf@PLT
	movslq	%r12d, %rax
	movl	56(%rsp), %edx
	leaq	(%rax,%rax,2), %r14
	salq	$2, %r14
	testl	%edx, %edx
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	60(%rsp), %eax
	subl	$1, %eax
	cltq
	addq	%r14, %rax
	movl	$1, 112(%rsp,%rax,4)
	cmpl	%r15d, 56(%rsp)
	jg	.L3
.L6:
	movl	52(%rsp), %eax
	addl	$1, %r12d
	cmpl	%r12d, %eax
	jg	.L4
	movl	%eax, 20(%rsp)
	testl	%eax, %eax
	jle	.L2
	leaq	64(%rsp), %r12
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	addq	$4, %r12
	cmpl	%ebp, %eax
	jg	.L7
	movl	%eax, 20(%rsp)
.L2:
	movl	48(%rsp), %r12d
	movl	$1, %eax
	movl	%r12d, %ecx
	sall	%cl, %eax
	movl	%eax, 40(%rsp)
	testl	%eax, %eax
	jle	.L31
	leaq	64(%rsp), %rax
	movl	$0, 44(%rsp)
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	movq	%rax, 24(%rsp)
	movl	20(%rsp), %eax
	subl	$1, %eax
	leaq	68(%rsp,%rax,4), %r13
	.p2align 4,,10
	.p2align 3
.L9:
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L27
	movl	%r14d, %eax
	movl	%r14d, %r8d
	movl	%r14d, %r9d
	movl	%r14d, %r10d
	sarl	$7, %eax
	movl	%r14d, %r11d
	movl	%r14d, %ebx
	movl	%r14d, %ebp
	movl	%eax, (%rsp)
	movl	%r14d, %eax
	movq	32(%rsp), %rdx
	sarl	%r8d
	sarl	$8, %eax
	movq	24(%rsp), %rcx
	sarl	$5, %ebx
	movl	$1, %esi
	movl	%eax, 4(%rsp)
	sarl	$2, %r9d
	movl	%r14d, %eax
	sarl	$3, %r10d
	sarl	$9, %eax
	sarl	$4, %r11d
	movl	%eax, 8(%rsp)
	movl	%r14d, %eax
	sarl	$6, %ebp
	sarl	$10, %eax
	movl	%eax, 12(%rsp)
	movl	%r14d, %eax
	sarl	$11, %eax
	movl	%eax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L28:
	xorl	%eax, %eax
	testl	%r12d, %r12d
	jle	.L25
	movl	%r14d, %eax
	andl	(%rdx), %eax
	setne	%al
	movzbl	%al, %eax
	cmpl	$1, %r12d
	je	.L10
	movl	4(%rdx), %edi
	andl	%r8d, %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$2, %r12d
	je	.L10
	movl	8(%rdx), %edi
	andl	%r9d, %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$3, %r12d
	je	.L10
	movl	12(%rdx), %edi
	andl	%r10d, %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$4, %r12d
	je	.L10
	movl	16(%rdx), %edi
	andl	%r11d, %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$5, %r12d
	je	.L10
	movl	20(%rdx), %edi
	andl	%ebx, %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$6, %r12d
	je	.L10
	movl	24(%rdx), %edi
	andl	%ebp, %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$7, %r12d
	je	.L10
	movl	(%rsp), %edi
	andl	28(%rdx), %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$8, %r12d
	je	.L10
	movl	4(%rsp), %edi
	andl	32(%rdx), %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$9, %r12d
	je	.L10
	movl	8(%rsp), %edi
	andl	36(%rdx), %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$10, %r12d
	je	.L10
	movl	12(%rsp), %edi
	andl	40(%rdx), %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$11, %r12d
	je	.L10
	movl	16(%rsp), %edi
	andl	44(%rdx), %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
.L10:
	andl	$1, %eax
.L25:
	cmpl	%eax, (%rcx)
	cmovne	%r15d, %esi
	addq	$4, %rcx
	addq	$48, %rdx
	cmpq	%r13, %rcx
	jne	.L28
	testb	%sil, %sil
	jne	.L27
.L26:
	addl	$1, %r14d
	cmpl	%r14d, 40(%rsp)
	jne	.L9
.L8:
	movl	44(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	696(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L98
	addq	$712, %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
.L27:
	.cfi_restore_state
	addl	$1, 44(%rsp)
	jmp	.L26
.L31:
	movl	$0, 44(%rsp)
	jmp	.L8
.L98:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$72, %ecx
	pxor	%xmm0, %xmm0
	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	$712, %rsp
	.cfi_def_cfa_offset 768
	movq	%fs:40, %rax
	movq	%rax, 696(%rsp)
	xorl	%eax, %eax
	leaq	112(%rsp), %rdi
	leaq	52(%rsp), %rdx
	movaps	%xmm0, 64(%rsp)
	movq	%rdi, 32(%rsp)
	leaq	48(%rsp), %rsi
	movaps	%xmm0, 80(%rsp)
	movaps	%xmm0, 96(%rsp)
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	movl	%eax, 20(%rsp)
	testl	%eax, %eax
	jle	.L2
	xorl	%r12d, %r12d
	leaq	56(%rsp), %r13
	leaq	60(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	call	__isoc99_scanf@PLT
	movslq	%r12d, %rax
	movl	56(%rsp), %edx
	leaq	(%rax,%rax,2), %r14
	salq	$2, %r14
	testl	%edx, %edx
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	60(%rsp), %eax
	subl	$1, %eax
	cltq
	addq	%r14, %rax
	movl	$1, 112(%rsp,%rax,4)
	cmpl	%r15d, 56(%rsp)
	jg	.L3
.L6:
	movl	52(%rsp), %eax
	addl	$1, %r12d
	cmpl	%r12d, %eax
	jg	.L4
	movl	%eax, 20(%rsp)
	testl	%eax, %eax
	jle	.L2
	leaq	64(%rsp), %r12
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	addq	$4, %r12
	cmpl	%ebp, %eax
	jg	.L7
	movl	%eax, 20(%rsp)
.L2:
	movl	48(%rsp), %r12d
	movl	$1, %eax
	movl	%r12d, %ecx
	sall	%cl, %eax
	movl	%eax, 40(%rsp)
	testl	%eax, %eax
	jle	.L31
	leaq	64(%rsp), %rax
	movl	$0, 44(%rsp)
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	movq	%rax, 24(%rsp)
	movl	20(%rsp), %eax
	subl	$1, %eax
	leaq	68(%rsp,%rax,4), %r13
	.p2align 4,,10
	.p2align 3
.L9:
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L27
	movl	%r14d, %eax
	movl	%r14d, %r8d
	movl	%r14d, %r9d
	movl	%r14d, %r10d
	sarl	$7, %eax
	movl	%r14d, %r11d
	movl	%r14d, %ebx
	movl	%r14d, %ebp
	movl	%eax, (%rsp)
	movl	%r14d, %eax
	movq	32(%rsp), %rdx
	sarl	%r8d
	sarl	$8, %eax
	movq	24(%rsp), %rcx
	sarl	$5, %ebx
	movl	$1, %esi
	movl	%eax, 4(%rsp)
	sarl	$2, %r9d
	movl	%r14d, %eax
	sarl	$3, %r10d
	sarl	$9, %eax
	sarl	$4, %r11d
	movl	%eax, 8(%rsp)
	movl	%r14d, %eax
	sarl	$6, %ebp
	sarl	$10, %eax
	movl	%eax, 12(%rsp)
	movl	%r14d, %eax
	sarl	$11, %eax
	movl	%eax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L28:
	xorl	%eax, %eax
	testl	%r12d, %r12d
	jle	.L25
	movl	%r14d, %eax
	andl	(%rdx), %eax
	setne	%al
	movzbl	%al, %eax
	cmpl	$1, %r12d
	je	.L10
	movl	4(%rdx), %edi
	andl	%r8d, %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$2, %r12d
	je	.L10
	movl	8(%rdx), %edi
	andl	%r9d, %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$3, %r12d
	je	.L10
	movl	12(%rdx), %edi
	andl	%r10d, %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$4, %r12d
	je	.L10
	movl	16(%rdx), %edi
	andl	%r11d, %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$5, %r12d
	je	.L10
	movl	20(%rdx), %edi
	andl	%ebx, %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$6, %r12d
	je	.L10
	movl	24(%rdx), %edi
	andl	%ebp, %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$7, %r12d
	je	.L10
	movl	(%rsp), %edi
	andl	28(%rdx), %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$8, %r12d
	je	.L10
	movl	4(%rsp), %edi
	andl	32(%rdx), %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$9, %r12d
	je	.L10
	movl	8(%rsp), %edi
	andl	36(%rdx), %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$10, %r12d
	je	.L10
	movl	12(%rsp), %edi
	andl	40(%rdx), %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
	cmpl	$11, %r12d
	je	.L10
	movl	16(%rsp), %edi
	andl	44(%rdx), %edi
	cmpl	$1, %edi
	sbbl	$-1, %eax
.L10:
	andl	$1, %eax
.L25:
	cmpl	%eax, (%rcx)
	cmovne	%r15d, %esi
	addq	$4, %rcx
	addq	$48, %rdx
	cmpq	%r13, %rcx
	jne	.L28
	testb	%sil, %sil
	jne	.L27
.L26:
	addl	$1, %r14d
	cmpl	%r14d, 40(%rsp)
	jne	.L9
.L8:
	movl	44(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	696(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L98
	addq	$712, %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
.L27:
	.cfi_restore_state
	addl	$1, 44(%rsp)
	jmp	.L26
.L31:
	movl	$0, 44(%rsp)
	jmp	.L8
.L98:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:

/*
	submission # - User: herp_sy
	https://atcoder.jp/contests/

	coding: utf-8
	lang: C (GCC 5.4.1)
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdbool.h>

#define _CRT_SECURE_NO_WARNINGS
#define TLong long long
#define TBMod 1000000007

int main(int argc, char const *argv[])
{
	int n, m;
	int num[12][12] = { 0 };
	int k;
	int p[12] = { 0 };
	int col;
	int bitcnt, ans = 0;
	bool chkflag;
	
	// input & setup
	scanf("%d %d", &n, &m);
	for (int i = 0; i < 12; ++i){
		for (int j = 0; j < 12; ++j){
			num[i][j] = 0;
		}
	}
	for (int i = 0; i < m; ++i){
		scanf("%d", &k);
		for (int j = 0; j < k; ++j){
			scanf("%d", &col);
			num[i][col - 1] = 1;
		}
	}
	for (int i = 0; i < m; ++i) scanf("%d", &p[i]);
	
	// countup
	for (int i = 0; i < (1 << n); ++i){
		chkflag = true;
		for (int j = 0; j < m; ++j){
			bitcnt = 0;
			for (int l = 0; l < n; ++l){
				if(num[j][l] & i >> l) ++bitcnt;
			}
			if(bitcnt % 2 != p[j]) chkflag = false;
		}
		if(chkflag) ans += 1;
	}
	printf("%d\n", ans);
	return 0;
}

2 2
2 1 2
1 2
0 0
 4 2
2 1 2
1 2
0 1
 5 2
1 1 2 5
2 2 3
1 0
 2 3
2 1 2
1 1
1 2
0 0 -1
 4 0
1 1 2
1 2
0 1
 1 0
0 1 4
1 1
0 1
0 0 -1
 9 2
3 1 2 5
2 2 3
1 0
 7 2
2 1 2
1 1
0 1
 8 0
2 1 2
1 1
1 2
0 0 -1
 6 0
-4 0 2
-1 4
1 0
0 0 -2

1
 4
 0
 0
 16
 2
 128
 32
 256
 64

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

```c
/*
	submission # - User: herp_sy
	https://atcoder.jp/contests/

	coding: utf-8
	lang: C (GCC 5.4.1)
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdbool.h>

#define _CRT_SECURE_NO_WARNINGS
#define TLong long long
#define TBMod 1000000007

int main(int argc, char const *argv[])
{
	int n, m;
	int num[12][12] = { 0 };
	int k;
	int p[12] = { 0 };
	int col;
	int bitcnt, ans = 0;
	bool chkflag;
	
	// input & setup
	scanf("%d %d", &n, &m);
	for (int i = 0; i < 12; ++i){
		for (int j = 0; j < 12; ++j){
			num[i][j] = 0;
		}
	}
	for (int i = 0; i < m; ++i){
		scanf("%d", &k);
		for (int j = 0; j < k; ++j){
			scanf("%d", &col);
			num[i][col - 1] = 1;
		}
	}
	for (int i = 0; i < m; ++i) scanf("%d", &p[i]);
	
	// countup
	for (int i = 0; i < (1 << n); ++i){
		chkflag = true;
		for (int j = 0; j < m; ++j){
			bitcnt = 0;
			for (int l = 0; l < n; ++l){
				if(num[j][l] & i >> l) ++bitcnt;
			}
			if(bitcnt % 2 != p[j]) chkflag = false;
		}
		if(chkflag) ans += 1;
	}
	printf("%d\n", ans);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$720, %rsp
	movl	%edi, -708(%rbp)
	movq	%rsi, -720(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-592(%rbp), %rdx
	movl	$0, %eax
	movl	$72, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	$0, -640(%rbp)
	movq	$0, -632(%rbp)
	movq	$0, -624(%rbp)
	movq	$0, -616(%rbp)
	movq	$0, -608(%rbp)
	movq	$0, -600(%rbp)
	movl	$0, -676(%rbp)
	leaq	-692(%rbp), %rdx
	leaq	-696(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -672(%rbp)
	jmp	.L2
.L5:
	movl	$0, -668(%rbp)
	jmp	.L3
.L4:
	movl	-668(%rbp), %eax
	movslq	%eax, %rcx
	movl	-672(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$0, -592(%rbp,%rax,4)
	addl	$1, -668(%rbp)
.L3:
	cmpl	$11, -668(%rbp)
	jle	.L4
	addl	$1, -672(%rbp)
.L2:
	cmpl	$11, -672(%rbp)
	jle	.L5
	movl	$0, -664(%rbp)
	jmp	.L6
.L9:
	leaq	-688(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -660(%rbp)
	jmp	.L7
.L8:
	leaq	-684(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-684(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-664(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$1, -592(%rbp,%rax,4)
	addl	$1, -660(%rbp)
.L7:
	movl	-688(%rbp), %eax
	cmpl	%eax, -660(%rbp)
	jl	.L8
	addl	$1, -664(%rbp)
.L6:
	movl	-692(%rbp), %eax
	cmpl	%eax, -664(%rbp)
	jl	.L9
	movl	$0, -656(%rbp)
	jmp	.L10
.L11:
	leaq	-640(%rbp), %rdx
	movl	-656(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -656(%rbp)
.L10:
	movl	-692(%rbp), %eax
	cmpl	%eax, -656(%rbp)
	jl	.L11
	movl	$0, -652(%rbp)
	jmp	.L12
.L20:
	movb	$1, -697(%rbp)
	movl	$0, -648(%rbp)
	jmp	.L13
.L18:
	movl	$0, -680(%rbp)
	movl	$0, -644(%rbp)
	jmp	.L14
.L16:
	movl	-644(%rbp), %eax
	movslq	%eax, %rcx
	movl	-648(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-592(%rbp,%rax,4), %esi
	movl	-644(%rbp), %eax
	movl	-652(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	%esi, %eax
	testl	%eax, %eax
	je	.L15
	addl	$1, -680(%rbp)
.L15:
	addl	$1, -644(%rbp)
.L14:
	movl	-696(%rbp), %eax
	cmpl	%eax, -644(%rbp)
	jl	.L16
	movl	-680(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-648(%rbp), %eax
	cltq
	movl	-640(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	je	.L17
	movb	$0, -697(%rbp)
.L17:
	addl	$1, -648(%rbp)
.L13:
	movl	-692(%rbp), %eax
	cmpl	%eax, -648(%rbp)
	jl	.L18
	cmpb	$0, -697(%rbp)
	je	.L19
	addl	$1, -676(%rbp)
.L19:
	addl	$1, -652(%rbp)
.L12:
	movl	-696(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -652(%rbp)
	jl	.L20
	movl	-676(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$720, %rsp
	movl	%edi, -708(%rbp)
	movq	%rsi, -720(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-592(%rbp), %rdx
	movl	$0, %eax
	movl	$72, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	$0, -640(%rbp)
	movq	$0, -632(%rbp)
	movq	$0, -624(%rbp)
	movq	$0, -616(%rbp)
	movq	$0, -608(%rbp)
	movq	$0, -600(%rbp)
	movl	$0, -676(%rbp)
	leaq	-692(%rbp), %rdx
	leaq	-696(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -672(%rbp)
	jmp	.L2
.L5:
	movl	$0, -668(%rbp)
	jmp	.L3
.L4:
	movl	-668(%rbp), %eax
	movslq	%eax, %rcx
	movl	-672(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$0, -592(%rbp,%rax,4)
	addl	$1, -668(%rbp)
.L3:
	cmpl	$11, -668(%rbp)
	jle	.L4
	addl	$1, -672(%rbp)
.L2:
	cmpl	$11, -672(%rbp)
	jle	.L5
	movl	$0, -664(%rbp)
	jmp	.L6
.L9:
	leaq	-688(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -660(%rbp)
	jmp	.L7
.L8:
	leaq	-684(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-684(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-664(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$1, -592(%rbp,%rax,4)
	addl	$1, -660(%rbp)
.L7:
	movl	-688(%rbp), %eax
	cmpl	%eax, -660(%rbp)
	jl	.L8
	addl	$1, -664(%rbp)
.L6:
	movl	-692(%rbp), %eax
	cmpl	%eax, -664(%rbp)
	jl	.L9
	movl	$0, -656(%rbp)
	jmp	.L10
.L11:
	leaq	-640(%rbp), %rdx
	movl	-656(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -656(%rbp)
.L10:
	movl	-692(%rbp), %eax
	cmpl	%eax, -656(%rbp)
	jl	.L11
	movl	$0, -652(%rbp)
	jmp	.L12
.L20:
	movb	$1, -697(%rbp)
	movl	$0, -648(%rbp)
	jmp	.L13
.L18:
	movl	$0, -680(%rbp)
	movl	$0, -644(%rbp)
	jmp	.L14
.L16:
	movl	-644(%rbp), %eax
	movslq	%eax, %rcx
	movl	-648(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-592(%rbp,%rax,4), %esi
	movl	-644(%rbp), %eax
	movl	-652(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	%esi, %eax
	testl	%eax, %eax
	je	.L15
	addl	$1, -680(%rbp)
.L15:
	addl	$1, -644(%rbp)
.L14:
	movl	-696(%rbp), %eax
	cmpl	%eax, -644(%rbp)
	jl	.L16
	movl	-680(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-648(%rbp), %eax
	cltq
	movl	-640(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	je	.L17
	movb	$0, -697(%rbp)
.L17:
	addl	$1, -648(%rbp)
.L13:
	movl	-692(%rbp), %eax
	cmpl	%eax, -648(%rbp)
	jl	.L18
	cmpb	$0, -697(%rbp)
	je	.L19
	addl	$1, -676(%rbp)
.L19:
	addl	$1, -652(%rbp)
.L12:
	movl	-696(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -652(%rbp)
	jl	.L20
	movl	-676(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
