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

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

int main()
{
  int n,m,i,j,cnt,ans=0,bit;
  int k[11],s[11][11],p[11];

  scanf("%d%d",&n,&m );

  for(i=0; i<m; i++){
    scanf("%d",&k[i]);
    for(j=0; j<k[i]; j++){
      scanf("%d", &s[i][j]);
    }
  }
  for(i=0; i<m; i++)
    scanf("%d", &p[i]);


    for(bit=0; bit<(1<<n); bit++)
    {
      for(i=0; i<m; i++){
        cnt = 0;
          for(j=0; j<k[i]; j++)
            {
              if(bit & (1<<(s[i][j] - 1)) )
              cnt++;
            }
        if(cnt%2 != p[i])
          break;
        if(i == (m-1))
          ans++;
      }

    }

  printf("%d",ans );
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$624, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -600(%rbp)
	leaq	-616(%rbp), %rdx
	leaq	-620(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -612(%rbp)
	jmp	.L2
.L5:
	leaq	-592(%rbp), %rdx
	movl	-612(%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
	movl	$0, -608(%rbp)
	jmp	.L3
.L4:
	leaq	-496(%rbp), %rcx
	movl	-608(%rbp), %eax
	movslq	%eax, %rsi
	movl	-612(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -608(%rbp)
.L3:
	movl	-612(%rbp), %eax
	cltq
	movl	-592(%rbp,%rax,4), %eax
	cmpl	%eax, -608(%rbp)
	jl	.L4
	addl	$1, -612(%rbp)
.L2:
	movl	-616(%rbp), %eax
	cmpl	%eax, -612(%rbp)
	jl	.L5
	movl	$0, -612(%rbp)
	jmp	.L6
.L7:
	leaq	-544(%rbp), %rdx
	movl	-612(%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, -612(%rbp)
.L6:
	movl	-616(%rbp), %eax
	cmpl	%eax, -612(%rbp)
	jl	.L7
	movl	$0, -596(%rbp)
	jmp	.L8
.L17:
	movl	$0, -612(%rbp)
	jmp	.L9
.L16:
	movl	$0, -604(%rbp)
	movl	$0, -608(%rbp)
	jmp	.L10
.L12:
	movl	-608(%rbp), %eax
	movslq	%eax, %rcx
	movl	-612(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-496(%rbp,%rax,4), %eax
	subl	$1, %eax
	movl	-596(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L11
	addl	$1, -604(%rbp)
.L11:
	addl	$1, -608(%rbp)
.L10:
	movl	-612(%rbp), %eax
	cltq
	movl	-592(%rbp,%rax,4), %eax
	cmpl	%eax, -608(%rbp)
	jl	.L12
	movl	-604(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-612(%rbp), %eax
	cltq
	movl	-544(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L20
	movl	-616(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -612(%rbp)
	jne	.L15
	addl	$1, -600(%rbp)
.L15:
	addl	$1, -612(%rbp)
.L9:
	movl	-616(%rbp), %eax
	cmpl	%eax, -612(%rbp)
	jl	.L16
	jmp	.L14
.L20:
	nop
.L14:
	addl	$1, -596(%rbp)
.L8:
	movl	-620(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -596(%rbp)
	jl	.L17
	movl	-600(%rbp), %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	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$616, %rsp
	.cfi_def_cfa_offset 672
	movq	%fs:40, %rax
	movq	%rax, 600(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r13d
	testl	%r13d, %r13d
	jle	.L2
	leaq	16(%rsp), %r12
	leaq	112(%rsp), %r15
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	movq	%r15, %r13
	call	__isoc99_scanf@PLT
	movl	(%r12), %eax
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %r13
	cmpl	%ebx, (%r12)
	jg	.L3
.L6:
	movl	12(%rsp), %r13d
	addl	$1, %r14d
	addq	$4, %r12
	addq	$44, %r15
	cmpl	%r14d, %r13d
	jg	.L4
	testl	%r13d, %r13d
	jle	.L2
	leaq	64(%rsp), %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r13d
	addq	$4, %r12
	cmpl	%ebx, %r13d
	jg	.L7
.L2:
	movl	8(%rsp), %ecx
	movl	$1, %r14d
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	movslq	%r13d, %r12
	leaq	64(%rsp), %r11
	leal	-1(%r13), %ebx
	sall	%cl, %r14d
	testl	%r14d, %r14d
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	testl	%r13d, %r13d
	jle	.L21
	leaq	112(%rsp), %rdx
	xorl	%r8d, %r8d
	leaq	16(%rsp), %r10
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L88:
	xorl	%eax, %eax
	cmpl	%r8d, %ebx
	sete	%al
	addq	$1, %r8
	addq	$44, %rdx
	addl	%eax, %r9d
	cmpq	%r8, %r12
	je	.L21
.L25:
	movl	(%r10,%r8,4), %esi
	xorl	%eax, %eax
	testl	%esi, %esi
	jle	.L24
	movl	(%rdx), %eax
	leal	-1(%rax), %ecx
	movl	%edi, %eax
	sarl	%cl, %eax
	andl	$1, %eax
	cmpl	$1, %esi
	je	.L10
	movl	4(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$2, %esi
	je	.L10
	movl	8(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$3, %esi
	je	.L10
	movl	12(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$4, %esi
	je	.L10
	movl	16(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$5, %esi
	je	.L10
	movl	20(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$6, %esi
	je	.L10
	movl	24(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$7, %esi
	je	.L10
	movl	28(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$8, %esi
	je	.L10
	movl	32(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$9, %esi
	je	.L10
	movl	36(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$10, %esi
	je	.L10
	movl	40(%rdx), %esi
	leal	-1(%rsi), %ecx
	movl	%edi, %esi
	sarl	%cl, %esi
	movl	%esi, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
.L10:
	andl	$1, %eax
.L24:
	cmpl	%eax, (%r11,%r8,4)
	je	.L88
.L21:
	addl	$1, %edi
	cmpl	%edi, %r14d
	jne	.L8
.L9:
	xorl	%eax, %eax
	movl	%r9d, %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	600(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L89
	addq	$616, %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
.L89:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$616, %rsp
	.cfi_def_cfa_offset 672
	movq	%fs:40, %rax
	movq	%rax, 600(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r13d
	testl	%r13d, %r13d
	jle	.L2
	leaq	16(%rsp), %r12
	leaq	112(%rsp), %r15
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	movq	%r15, %r13
	call	__isoc99_scanf@PLT
	movl	(%r12), %eax
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %r13
	cmpl	%ebx, (%r12)
	jg	.L3
.L6:
	movl	12(%rsp), %r13d
	addl	$1, %r14d
	addq	$4, %r12
	addq	$44, %r15
	cmpl	%r14d, %r13d
	jg	.L4
	testl	%r13d, %r13d
	jle	.L2
	leaq	64(%rsp), %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r13d
	addq	$4, %r12
	cmpl	%ebx, %r13d
	jg	.L7
.L2:
	movl	8(%rsp), %ecx
	movl	$1, %r14d
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	movslq	%r13d, %r12
	leaq	64(%rsp), %r11
	leal	-1(%r13), %ebx
	sall	%cl, %r14d
	testl	%r14d, %r14d
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	testl	%r13d, %r13d
	jle	.L21
	leaq	112(%rsp), %rdx
	xorl	%r8d, %r8d
	leaq	16(%rsp), %r10
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L88:
	xorl	%eax, %eax
	cmpl	%r8d, %ebx
	sete	%al
	addq	$1, %r8
	addq	$44, %rdx
	addl	%eax, %r9d
	cmpq	%r8, %r12
	je	.L21
.L25:
	movl	(%r10,%r8,4), %esi
	xorl	%eax, %eax
	testl	%esi, %esi
	jle	.L24
	movl	(%rdx), %eax
	leal	-1(%rax), %ecx
	movl	%edi, %eax
	sarl	%cl, %eax
	andl	$1, %eax
	cmpl	$1, %esi
	je	.L10
	movl	4(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$2, %esi
	je	.L10
	movl	8(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$3, %esi
	je	.L10
	movl	12(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$4, %esi
	je	.L10
	movl	16(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$5, %esi
	je	.L10
	movl	20(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$6, %esi
	je	.L10
	movl	24(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$7, %esi
	je	.L10
	movl	28(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$8, %esi
	je	.L10
	movl	32(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$9, %esi
	je	.L10
	movl	36(%rdx), %ecx
	movl	%edi, %r15d
	subl	$1, %ecx
	sarl	%cl, %r15d
	movl	%r15d, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
	cmpl	$10, %esi
	je	.L10
	movl	40(%rdx), %esi
	leal	-1(%rsi), %ecx
	movl	%edi, %esi
	sarl	%cl, %esi
	movl	%esi, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %eax
.L10:
	andl	$1, %eax
.L24:
	cmpl	%eax, (%r11,%r8,4)
	je	.L88
.L21:
	addl	$1, %edi
	cmpl	%edi, %r14d
	jne	.L8
.L9:
	xorl	%eax, %eax
	movl	%r9d, %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	600(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L89
	addq	$616, %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
.L89:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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:

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

int main()
{
  int n,m,i,j,cnt,ans=0,bit;
  int k[11],s[11][11],p[11];

  scanf("%d%d",&n,&m );

  for(i=0; i<m; i++){
    scanf("%d",&k[i]);
    for(j=0; j<k[i]; j++){
      scanf("%d", &s[i][j]);
    }
  }
  for(i=0; i<m; i++)
    scanf("%d", &p[i]);


    for(bit=0; bit<(1<<n); bit++)
    {
      for(i=0; i<m; i++){
        cnt = 0;
          for(j=0; j<k[i]; j++)
            {
              if(bit & (1<<(s[i][j] - 1)) )
              cnt++;
            }
        if(cnt%2 != p[i])
          break;
        if(i == (m-1))
          ans++;
      }

    }

  printf("%d",ans );
}

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 0 0 128 32 0 0
Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

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

int main()
{
  int n,m,i,j,cnt,ans=0,bit;
  int k[11],s[11][11],p[11];

  scanf("%d%d",&n,&m );

  for(i=0; i<m; i++){
    scanf("%d",&k[i]);
    for(j=0; j<k[i]; j++){
      scanf("%d", &s[i][j]);
    }
  }
  for(i=0; i<m; i++)
    scanf("%d", &p[i]);


    for(bit=0; bit<(1<<n); bit++)
    {
      for(i=0; i<m; i++){
        cnt = 0;
          for(j=0; j<k[i]; j++)
            {
              if(bit & (1<<(s[i][j] - 1)) )
              cnt++;
            }
        if(cnt%2 != p[i])
          break;
        if(i == (m-1))
          ans++;
      }

    }

  printf("%d",ans );
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$624, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -600(%rbp)
	leaq	-616(%rbp), %rdx
	leaq	-620(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -612(%rbp)
	jmp	.L2
.L5:
	leaq	-592(%rbp), %rdx
	movl	-612(%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
	movl	$0, -608(%rbp)
	jmp	.L3
.L4:
	leaq	-496(%rbp), %rcx
	movl	-608(%rbp), %eax
	movslq	%eax, %rsi
	movl	-612(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -608(%rbp)
.L3:
	movl	-612(%rbp), %eax
	cltq
	movl	-592(%rbp,%rax,4), %eax
	cmpl	%eax, -608(%rbp)
	jl	.L4
	addl	$1, -612(%rbp)
.L2:
	movl	-616(%rbp), %eax
	cmpl	%eax, -612(%rbp)
	jl	.L5
	movl	$0, -612(%rbp)
	jmp	.L6
.L7:
	leaq	-544(%rbp), %rdx
	movl	-612(%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, -612(%rbp)
.L6:
	movl	-616(%rbp), %eax
	cmpl	%eax, -612(%rbp)
	jl	.L7
	movl	$0, -596(%rbp)
	jmp	.L8
.L17:
	movl	$0, -612(%rbp)
	jmp	.L9
.L16:
	movl	$0, -604(%rbp)
	movl	$0, -608(%rbp)
	jmp	.L10
.L12:
	movl	-608(%rbp), %eax
	movslq	%eax, %rcx
	movl	-612(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-496(%rbp,%rax,4), %eax
	subl	$1, %eax
	movl	-596(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L11
	addl	$1, -604(%rbp)
.L11:
	addl	$1, -608(%rbp)
.L10:
	movl	-612(%rbp), %eax
	cltq
	movl	-592(%rbp,%rax,4), %eax
	cmpl	%eax, -608(%rbp)
	jl	.L12
	movl	-604(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-612(%rbp), %eax
	cltq
	movl	-544(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L20
	movl	-616(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -612(%rbp)
	jne	.L15
	addl	$1, -600(%rbp)
.L15:
	addl	$1, -612(%rbp)
.L9:
	movl	-616(%rbp), %eax
	cmpl	%eax, -612(%rbp)
	jl	.L16
	jmp	.L14
.L20:
	nop
.L14:
	addl	$1, -596(%rbp)
.L8:
	movl	-620(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -596(%rbp)
	jl	.L17
	movl	-600(%rbp), %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	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$624, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -600(%rbp)
	leaq	-616(%rbp), %rdx
	leaq	-620(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -612(%rbp)
	jmp	.L2
.L5:
	leaq	-592(%rbp), %rdx
	movl	-612(%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
	movl	$0, -608(%rbp)
	jmp	.L3
.L4:
	leaq	-496(%rbp), %rcx
	movl	-608(%rbp), %eax
	movslq	%eax, %rsi
	movl	-612(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -608(%rbp)
.L3:
	movl	-612(%rbp), %eax
	cltq
	movl	-592(%rbp,%rax,4), %eax
	cmpl	%eax, -608(%rbp)
	jl	.L4
	addl	$1, -612(%rbp)
.L2:
	movl	-616(%rbp), %eax
	cmpl	%eax, -612(%rbp)
	jl	.L5
	movl	$0, -612(%rbp)
	jmp	.L6
.L7:
	leaq	-544(%rbp), %rdx
	movl	-612(%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, -612(%rbp)
.L6:
	movl	-616(%rbp), %eax
	cmpl	%eax, -612(%rbp)
	jl	.L7
	movl	$0, -596(%rbp)
	jmp	.L8
.L17:
	movl	$0, -612(%rbp)
	jmp	.L9
.L16:
	movl	$0, -604(%rbp)
	movl	$0, -608(%rbp)
	jmp	.L10
.L12:
	movl	-608(%rbp), %eax
	movslq	%eax, %rcx
	movl	-612(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-496(%rbp,%rax,4), %eax
	subl	$1, %eax
	movl	-596(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L11
	addl	$1, -604(%rbp)
.L11:
	addl	$1, -608(%rbp)
.L10:
	movl	-612(%rbp), %eax
	cltq
	movl	-592(%rbp,%rax,4), %eax
	cmpl	%eax, -608(%rbp)
	jl	.L12
	movl	-604(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-612(%rbp), %eax
	cltq
	movl	-544(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L20
	movl	-616(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -612(%rbp)
	jne	.L15
	addl	$1, -600(%rbp)
.L15:
	addl	$1, -612(%rbp)
.L9:
	movl	-616(%rbp), %eax
	cmpl	%eax, -612(%rbp)
	jl	.L16
	jmp	.L14
.L20:
	nop
.L14:
	addl	$1, -596(%rbp)
.L8:
	movl	-620(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -596(%rbp)
	jl	.L17
	movl	-600(%rbp), %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	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
