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>

int main()
{
  int nn, aa[15], xx[15][14], yy[15][14], flag, count, ans = 0;
  scanf("%d", &nn);
  for(int ii = 0;ii < nn;ii++)
  {
    scanf("%d", &aa[ii]);
    {
      for(int jj = 0;jj < aa[ii];jj++)
      {
        scanf("%d %d", &xx[ii][jj], &yy[ii][jj]);
      }
    }
  }
  
  for(int bit = 1;bit < (1 << nn);bit++)	//正直者の組み合わせ	2進数各桁について1で正直、0で不親切
  {
    flag = 1;
    count = 0;
    for(int ii = 0;ii < nn && flag;ii++)
    {
      if(bit & (1 << ii))
      {
        count++;
        for(int jj = 0;jj < aa[ii] && flag;jj++)
        {
          if((bit & (1 << (xx[ii][jj] - 1))) != (yy[ii][jj] << (xx[ii][jj] - 1)))
          {
            flag = 0;
          }
        }
      }
    }
    
    if(flag && ans < count)
    {
      ans = count;
    }
  }
  
  printf("%d\n", ans);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.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	$1808, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -1784(%rbp)
	leaq	-1796(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1780(%rbp)
	jmp	.L2
.L5:
	leaq	-1760(%rbp), %rdx
	movl	-1780(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1776(%rbp)
	jmp	.L3
.L4:
	leaq	-848(%rbp), %rcx
	movl	-1776(%rbp), %eax
	movslq	%eax, %rsi
	movl	-1780(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	leaq	(%rcx,%rax), %rdx
	leaq	-1696(%rbp), %rsi
	movl	-1776(%rbp), %eax
	movslq	%eax, %rdi
	movl	-1780(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	subq	%rcx, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1776(%rbp)
.L3:
	movl	-1780(%rbp), %eax
	cltq
	movl	-1760(%rbp,%rax,4), %eax
	cmpl	%eax, -1776(%rbp)
	jl	.L4
	addl	$1, -1780(%rbp)
.L2:
	movl	-1796(%rbp), %eax
	cmpl	%eax, -1780(%rbp)
	jl	.L5
	movl	$1, -1772(%rbp)
	jmp	.L6
.L15:
	movl	$1, -1792(%rbp)
	movl	$0, -1788(%rbp)
	movl	$0, -1768(%rbp)
	jmp	.L7
.L13:
	movl	-1768(%rbp), %eax
	movl	-1772(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L8
	addl	$1, -1788(%rbp)
	movl	$0, -1764(%rbp)
	jmp	.L9
.L11:
	movl	-1764(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1768(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-1696(%rbp,%rax,4), %eax
	subl	$1, %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	andl	-1772(%rbp), %eax
	movl	%eax, %esi
	movl	-1764(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1768(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-848(%rbp,%rax,4), %edi
	movl	-1764(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1768(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-1696(%rbp,%rax,4), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	sall	%cl, %edi
	movl	%edi, %eax
	cmpl	%eax, %esi
	je	.L10
	movl	$0, -1792(%rbp)
.L10:
	addl	$1, -1764(%rbp)
.L9:
	movl	-1768(%rbp), %eax
	cltq
	movl	-1760(%rbp,%rax,4), %eax
	cmpl	%eax, -1764(%rbp)
	jge	.L8
	cmpl	$0, -1792(%rbp)
	jne	.L11
.L8:
	addl	$1, -1768(%rbp)
.L7:
	movl	-1796(%rbp), %eax
	cmpl	%eax, -1768(%rbp)
	jge	.L12
	cmpl	$0, -1792(%rbp)
	jne	.L13
.L12:
	cmpl	$0, -1792(%rbp)
	je	.L14
	movl	-1784(%rbp), %eax
	cmpl	-1788(%rbp), %eax
	jge	.L14
	movl	-1788(%rbp), %eax
	movl	%eax, -1784(%rbp)
.L14:
	addl	$1, -1772(%rbp)
.L6:
	movl	-1796(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -1772(%rbp)
	jl	.L15
	movl	-1784(%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	.L17
	call	__stack_chk_fail@PLT
.L17:
	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"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$1800, %rsp
	.cfi_def_cfa_offset 1856
	movq	%fs:40, %rax
	movq	%rax, 1784(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L2
	movl	$0, 12(%rsp)
	leaq	32(%rsp), %rbp
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	0(%rbp), %eax
	testl	%eax, %eax
	jle	.L6
	leaq	0(,%r14,4), %rax
	xorl	%ebx, %ebx
	leaq	96(%rsp,%rax), %r13
	leaq	944(%rsp,%rax), %r15
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r15, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	addl	$1, %ebx
	addq	$4, %r13
	addq	$4, %r15
	cmpl	%ebx, 0(%rbp)
	jg	.L5
.L6:
	addl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	addq	$4, %rbp
	addq	$14, %r14
	movl	28(%rsp), %r9d
	cmpl	%eax, %r9d
	jg	.L4
.L2:
	movl	$1, %ebp
	movl	%r9d, %ecx
	xorl	%r12d, %r12d
	movl	$1, %ebx
	sall	%cl, %ebp
	movl	$1, %r8d
	testl	%r9d, %r9d
	je	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	testl	%r9d, %r9d
	jle	.L11
	leaq	32(%rsp), %rdi
	leaq	96(%rsp), %rsi
	xorl	%eax, %eax
	xorl	%r11d, %r11d
	leaq	944(%rsp), %rdx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L12:
	cmpl	%eax, %r9d
	jle	.L69
	addq	$4, %rdi
	addq	$56, %rsi
	addq	$56, %rdx
.L15:
	movl	%eax, %ecx
	movl	%r8d, %r14d
	addl	$1, %eax
	sarl	%cl, %r14d
	movl	%r14d, %ecx
	andl	$1, %ecx
	je	.L12
	movl	(%rdi), %r13d
	addl	$1, %r11d
	testl	%r13d, %r13d
	jle	.L12
	movl	(%rsi), %ecx
	movl	(%rdx), %r10d
	movl	%ebx, %r15d
	subl	$1, %ecx
	sall	%cl, %r15d
	sall	%cl, %r10d
	movl	%r15d, %ecx
	andl	%r8d, %ecx
	cmpl	%ecx, %r10d
	je	.L70
.L11:
	addl	$1, %r8d
	cmpl	%r8d, %ebp
	jne	.L7
.L8:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	1784(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L71
	addq	$1800, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L70:
	.cfi_restore_state
	cmpl	$1, %r13d
	je	.L12
	movl	4(%rsi), %ecx
	movl	4(%rdx), %r10d
	movl	%ebx, %r15d
	subl	$1, %ecx
	sall	%cl, %r15d
	sall	%cl, %r10d
	movl	%r15d, %ecx
	andl	%r8d, %ecx
	cmpl	%ecx, %r10d
	jne	.L11
	cmpl	$2, %r13d
	je	.L12
	movl	8(%rsi), %ecx
	movl	8(%rdx), %r10d
	movl	%ebx, %r15d
	subl	$1, %ecx
	sall	%cl, %r15d
	sall	%cl, %r10d
	movl	%r15d, %ecx
	andl	%r8d, %ecx
	cmpl	%ecx, %r10d
	jne	.L11
	cmpl	$3, %r13d
	je	.L12
	movl	12(%rsi), %ecx
	movl	12(%rdx), %r10d
	movl	%ebx, %r15d
	subl	$1, %ecx
	sall	%cl, %r15d
	sall	%cl, %r10d
	movl	%r15d, %ecx
	andl	%r8d, %ecx
	cmpl	%ecx, %r10d
	jne	.L11
	cmpl	$4, %r13d
	je	.L12
	movl	16(%rsi), %ecx
	movl	16(%rdx), %r10d
	movl	%ebx, %r15d
	subl	$1, %ecx
	sall	%cl, %r15d
	sall	%cl, %r10d
	movl	%r15d, %ecx
	andl	%r8d, %ecx
	cmpl	%ecx, %r10d
	jne	.L11
	cmpl	$5, %r13d
	je	.L12
	movl	20(%rsi), %ecx
	movl	20(%rdx), %r10d
	movl	%ebx, %r15d
	subl	$1, %ecx
	sall	%cl, %r15d
	sall	%cl, %r10d
	movl	%r15d, %ecx
	andl	%r8d, %ecx
	cmpl	%ecx, %r10d
	jne	.L11
	cmpl	$6, %r13d
	je	.L12
	movl	24(%rsi), %ecx
	movl	24(%rdx), %r10d
	movl	%ebx, %r15d
	subl	$1, %ecx
	sall	%cl, %r15d
	sall	%cl, %r10d
	movl	%r15d, %ecx
	andl	%r8d, %ecx
	cmpl	%ecx, %r10d
	jne	.L11
	cmpl	$7, %r13d
	je	.L12
	movl	28(%rsi), %ecx
	movl	28(%rdx), %r15d
	movl	%ebx, %r10d
	subl	$1, %ecx
	sall	%cl, %r10d
	sall	%cl, %r15d
	andl	%r8d, %r10d
	cmpl	%r15d, %r10d
	jne	.L11
	cmpl	$8, %r13d
	je	.L12
	movl	32(%rsi), %ecx
	movl	32(%rdx), %r15d
	movl	%ebx, %r10d
	subl	$1, %ecx
	sall	%cl, %r10d
	sall	%cl, %r15d
	andl	%r8d, %r10d
	cmpl	%r15d, %r10d
	jne	.L11
	cmpl	$9, %r13d
	je	.L12
	movl	36(%rsi), %ecx
	movl	36(%rdx), %r15d
	movl	%ebx, %r10d
	subl	$1, %ecx
	sall	%cl, %r10d
	sall	%cl, %r15d
	andl	%r8d, %r10d
	cmpl	%r15d, %r10d
	jne	.L11
	cmpl	$10, %r13d
	je	.L12
	movl	40(%rsi), %ecx
	movl	40(%rdx), %r15d
	movl	%ebx, %r10d
	subl	$1, %ecx
	sall	%cl, %r10d
	sall	%cl, %r15d
	andl	%r8d, %r10d
	cmpl	%r15d, %r10d
	jne	.L11
	cmpl	$11, %r13d
	je	.L12
	movl	44(%rsi), %ecx
	movl	44(%rdx), %r15d
	movl	%ebx, %r10d
	subl	$1, %ecx
	sall	%cl, %r10d
	sall	%cl, %r15d
	andl	%r8d, %r10d
	cmpl	%r15d, %r10d
	jne	.L11
	cmpl	$12, %r13d
	je	.L12
	movl	48(%rsi), %ecx
	movl	48(%rdx), %r15d
	movl	%ebx, %r10d
	subl	$1, %ecx
	sall	%cl, %r10d
	sall	%cl, %r15d
	andl	%r8d, %r10d
	cmpl	%r15d, %r10d
	jne	.L11
	cmpl	$13, %r13d
	je	.L12
	movl	52(%rsi), %ecx
	movl	52(%rdx), %r15d
	movl	%ebx, %r10d
	subl	$1, %ecx
	sall	%cl, %r10d
	sall	%cl, %r15d
	andl	%r8d, %r10d
	cmpl	%r15d, %r10d
	jne	.L11
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L69:
	cmpl	%r11d, %r12d
	cmovl	%r11d, %r12d
	jmp	.L11
.L71:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$1800, %rsp
	.cfi_def_cfa_offset 1856
	movq	%fs:40, %rax
	movq	%rax, 1784(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L2
	movl	$0, 12(%rsp)
	leaq	32(%rsp), %rbp
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	0(%rbp), %eax
	testl	%eax, %eax
	jle	.L6
	leaq	0(,%r14,4), %rax
	xorl	%ebx, %ebx
	leaq	96(%rsp,%rax), %r13
	leaq	944(%rsp,%rax), %r15
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r15, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	addl	$1, %ebx
	addq	$4, %r13
	addq	$4, %r15
	cmpl	%ebx, 0(%rbp)
	jg	.L5
.L6:
	addl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	addq	$4, %rbp
	addq	$14, %r14
	movl	28(%rsp), %r9d
	cmpl	%eax, %r9d
	jg	.L4
.L2:
	movl	$1, %ebp
	movl	%r9d, %ecx
	xorl	%r12d, %r12d
	movl	$1, %ebx
	sall	%cl, %ebp
	movl	$1, %r8d
	testl	%r9d, %r9d
	je	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	testl	%r9d, %r9d
	jle	.L11
	leaq	32(%rsp), %rdi
	leaq	96(%rsp), %rsi
	xorl	%eax, %eax
	xorl	%r11d, %r11d
	leaq	944(%rsp), %rdx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L12:
	cmpl	%eax, %r9d
	jle	.L69
	addq	$4, %rdi
	addq	$56, %rsi
	addq	$56, %rdx
.L15:
	movl	%eax, %ecx
	movl	%r8d, %r14d
	addl	$1, %eax
	sarl	%cl, %r14d
	movl	%r14d, %ecx
	andl	$1, %ecx
	je	.L12
	movl	(%rdi), %r13d
	addl	$1, %r11d
	testl	%r13d, %r13d
	jle	.L12
	movl	(%rsi), %ecx
	movl	(%rdx), %r10d
	movl	%ebx, %r15d
	subl	$1, %ecx
	sall	%cl, %r15d
	sall	%cl, %r10d
	movl	%r15d, %ecx
	andl	%r8d, %ecx
	cmpl	%ecx, %r10d
	je	.L70
.L11:
	addl	$1, %r8d
	cmpl	%r8d, %ebp
	jne	.L7
.L8:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	1784(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L71
	addq	$1800, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L70:
	.cfi_restore_state
	cmpl	$1, %r13d
	je	.L12
	movl	4(%rsi), %ecx
	movl	4(%rdx), %r10d
	movl	%ebx, %r15d
	subl	$1, %ecx
	sall	%cl, %r15d
	sall	%cl, %r10d
	movl	%r15d, %ecx
	andl	%r8d, %ecx
	cmpl	%ecx, %r10d
	jne	.L11
	cmpl	$2, %r13d
	je	.L12
	movl	8(%rsi), %ecx
	movl	8(%rdx), %r10d
	movl	%ebx, %r15d
	subl	$1, %ecx
	sall	%cl, %r15d
	sall	%cl, %r10d
	movl	%r15d, %ecx
	andl	%r8d, %ecx
	cmpl	%ecx, %r10d
	jne	.L11
	cmpl	$3, %r13d
	je	.L12
	movl	12(%rsi), %ecx
	movl	12(%rdx), %r10d
	movl	%ebx, %r15d
	subl	$1, %ecx
	sall	%cl, %r15d
	sall	%cl, %r10d
	movl	%r15d, %ecx
	andl	%r8d, %ecx
	cmpl	%ecx, %r10d
	jne	.L11
	cmpl	$4, %r13d
	je	.L12
	movl	16(%rsi), %ecx
	movl	16(%rdx), %r10d
	movl	%ebx, %r15d
	subl	$1, %ecx
	sall	%cl, %r15d
	sall	%cl, %r10d
	movl	%r15d, %ecx
	andl	%r8d, %ecx
	cmpl	%ecx, %r10d
	jne	.L11
	cmpl	$5, %r13d
	je	.L12
	movl	20(%rsi), %ecx
	movl	20(%rdx), %r10d
	movl	%ebx, %r15d
	subl	$1, %ecx
	sall	%cl, %r15d
	sall	%cl, %r10d
	movl	%r15d, %ecx
	andl	%r8d, %ecx
	cmpl	%ecx, %r10d
	jne	.L11
	cmpl	$6, %r13d
	je	.L12
	movl	24(%rsi), %ecx
	movl	24(%rdx), %r10d
	movl	%ebx, %r15d
	subl	$1, %ecx
	sall	%cl, %r15d
	sall	%cl, %r10d
	movl	%r15d, %ecx
	andl	%r8d, %ecx
	cmpl	%ecx, %r10d
	jne	.L11
	cmpl	$7, %r13d
	je	.L12
	movl	28(%rsi), %ecx
	movl	28(%rdx), %r15d
	movl	%ebx, %r10d
	subl	$1, %ecx
	sall	%cl, %r10d
	sall	%cl, %r15d
	andl	%r8d, %r10d
	cmpl	%r15d, %r10d
	jne	.L11
	cmpl	$8, %r13d
	je	.L12
	movl	32(%rsi), %ecx
	movl	32(%rdx), %r15d
	movl	%ebx, %r10d
	subl	$1, %ecx
	sall	%cl, %r10d
	sall	%cl, %r15d
	andl	%r8d, %r10d
	cmpl	%r15d, %r10d
	jne	.L11
	cmpl	$9, %r13d
	je	.L12
	movl	36(%rsi), %ecx
	movl	36(%rdx), %r15d
	movl	%ebx, %r10d
	subl	$1, %ecx
	sall	%cl, %r10d
	sall	%cl, %r15d
	andl	%r8d, %r10d
	cmpl	%r15d, %r10d
	jne	.L11
	cmpl	$10, %r13d
	je	.L12
	movl	40(%rsi), %ecx
	movl	40(%rdx), %r15d
	movl	%ebx, %r10d
	subl	$1, %ecx
	sall	%cl, %r10d
	sall	%cl, %r15d
	andl	%r8d, %r10d
	cmpl	%r15d, %r10d
	jne	.L11
	cmpl	$11, %r13d
	je	.L12
	movl	44(%rsi), %ecx
	movl	44(%rdx), %r15d
	movl	%ebx, %r10d
	subl	$1, %ecx
	sall	%cl, %r10d
	sall	%cl, %r15d
	andl	%r8d, %r10d
	cmpl	%r15d, %r10d
	jne	.L11
	cmpl	$12, %r13d
	je	.L12
	movl	48(%rsi), %ecx
	movl	48(%rdx), %r15d
	movl	%ebx, %r10d
	subl	$1, %ecx
	sall	%cl, %r10d
	sall	%cl, %r15d
	andl	%r8d, %r10d
	cmpl	%r15d, %r10d
	jne	.L11
	cmpl	$13, %r13d
	je	.L12
	movl	52(%rsi), %ecx
	movl	52(%rdx), %r15d
	movl	%ebx, %r10d
	subl	$1, %ecx
	sall	%cl, %r10d
	sall	%cl, %r15d
	andl	%r8d, %r10d
	cmpl	%r15d, %r10d
	jne	.L11
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L69:
	cmpl	%r11d, %r12d
	cmovl	%r11d, %r12d
	jmp	.L11
.L71:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>

int main()
{
  int nn, aa[15], xx[15][14], yy[15][14], flag, count, ans = 0;
  scanf("%d", &nn);
  for(int ii = 0;ii < nn;ii++)
  {
    scanf("%d", &aa[ii]);
    {
      for(int jj = 0;jj < aa[ii];jj++)
      {
        scanf("%d %d", &xx[ii][jj], &yy[ii][jj]);
      }
    }
  }
  
  for(int bit = 1;bit < (1 << nn);bit++)	//正直者の組み合わせ	2進数各桁について1で正直、0で不親切
  {
    flag = 1;
    count = 0;
    for(int ii = 0;ii < nn && flag;ii++)
    {
      if(bit & (1 << ii))
      {
        count++;
        for(int jj = 0;jj < aa[ii] && flag;jj++)
        {
          if((bit & (1 << (xx[ii][jj] - 1))) != (yy[ii][jj] << (xx[ii][jj] - 1)))
          {
            flag = 0;
          }
        }
      }
    }
    
    if(flag && ans < count)
    {
      ans = count;
    }
  }
  
  printf("%d\n", ans);
  return 0;
}
3
2
2 1
3 0
2
3 1
1 0
2
1 1
2 -1
 2
1
2 0
1
1 1
 3
1
3 1
1
1 1
1
2 0
 3
1
3 1
1
1 1
0
2 0
 3
2
2 1
3 0
2
3 1
1 0
2
1 0
2 0
 3
1
1 1
1
1 1
0
2 0
 3
2
2 0
3 0
2
3 1
1 0
2
1 1
2 0
 3
1
2 1
1
2 1
1
2 0
 3
2
2 0
3 0
2
3 1
1 0
2
1 1
2 -1
 3
1
3 0
1
1 1
1
2 0

0
 1
 2
 3
 1
 3
 1
 2
 1
 2

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>

int main()
{
  int nn, aa[15], xx[15][14], yy[15][14], flag, count, ans = 0;
  scanf("%d", &nn);
  for(int ii = 0;ii < nn;ii++)
  {
    scanf("%d", &aa[ii]);
    {
      for(int jj = 0;jj < aa[ii];jj++)
      {
        scanf("%d %d", &xx[ii][jj], &yy[ii][jj]);
      }
    }
  }
  
  for(int bit = 1;bit < (1 << nn);bit++)	//正直者の組み合わせ	2進数各桁について1で正直、0で不親切
  {
    flag = 1;
    count = 0;
    for(int ii = 0;ii < nn && flag;ii++)
    {
      if(bit & (1 << ii))
      {
        count++;
        for(int jj = 0;jj < aa[ii] && flag;jj++)
        {
          if((bit & (1 << (xx[ii][jj] - 1))) != (yy[ii][jj] << (xx[ii][jj] - 1)))
          {
            flag = 0;
          }
        }
      }
    }
    
    if(flag && ans < count)
    {
      ans = count;
    }
  }
  
  printf("%d\n", ans);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.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	$1808, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -1784(%rbp)
	leaq	-1796(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1780(%rbp)
	jmp	.L2
.L5:
	leaq	-1760(%rbp), %rdx
	movl	-1780(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1776(%rbp)
	jmp	.L3
.L4:
	leaq	-848(%rbp), %rcx
	movl	-1776(%rbp), %eax
	movslq	%eax, %rsi
	movl	-1780(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	leaq	(%rcx,%rax), %rdx
	leaq	-1696(%rbp), %rsi
	movl	-1776(%rbp), %eax
	movslq	%eax, %rdi
	movl	-1780(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	subq	%rcx, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1776(%rbp)
.L3:
	movl	-1780(%rbp), %eax
	cltq
	movl	-1760(%rbp,%rax,4), %eax
	cmpl	%eax, -1776(%rbp)
	jl	.L4
	addl	$1, -1780(%rbp)
.L2:
	movl	-1796(%rbp), %eax
	cmpl	%eax, -1780(%rbp)
	jl	.L5
	movl	$1, -1772(%rbp)
	jmp	.L6
.L15:
	movl	$1, -1792(%rbp)
	movl	$0, -1788(%rbp)
	movl	$0, -1768(%rbp)
	jmp	.L7
.L13:
	movl	-1768(%rbp), %eax
	movl	-1772(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L8
	addl	$1, -1788(%rbp)
	movl	$0, -1764(%rbp)
	jmp	.L9
.L11:
	movl	-1764(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1768(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-1696(%rbp,%rax,4), %eax
	subl	$1, %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	andl	-1772(%rbp), %eax
	movl	%eax, %esi
	movl	-1764(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1768(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-848(%rbp,%rax,4), %edi
	movl	-1764(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1768(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-1696(%rbp,%rax,4), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	sall	%cl, %edi
	movl	%edi, %eax
	cmpl	%eax, %esi
	je	.L10
	movl	$0, -1792(%rbp)
.L10:
	addl	$1, -1764(%rbp)
.L9:
	movl	-1768(%rbp), %eax
	cltq
	movl	-1760(%rbp,%rax,4), %eax
	cmpl	%eax, -1764(%rbp)
	jge	.L8
	cmpl	$0, -1792(%rbp)
	jne	.L11
.L8:
	addl	$1, -1768(%rbp)
.L7:
	movl	-1796(%rbp), %eax
	cmpl	%eax, -1768(%rbp)
	jge	.L12
	cmpl	$0, -1792(%rbp)
	jne	.L13
.L12:
	cmpl	$0, -1792(%rbp)
	je	.L14
	movl	-1784(%rbp), %eax
	cmpl	-1788(%rbp), %eax
	jge	.L14
	movl	-1788(%rbp), %eax
	movl	%eax, -1784(%rbp)
.L14:
	addl	$1, -1772(%rbp)
.L6:
	movl	-1796(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -1772(%rbp)
	jl	.L15
	movl	-1784(%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	.L17
	call	__stack_chk_fail@PLT
.L17:
	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"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.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	$1808, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -1784(%rbp)
	leaq	-1796(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1780(%rbp)
	jmp	.L2
.L5:
	leaq	-1760(%rbp), %rdx
	movl	-1780(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1776(%rbp)
	jmp	.L3
.L4:
	leaq	-848(%rbp), %rcx
	movl	-1776(%rbp), %eax
	movslq	%eax, %rsi
	movl	-1780(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	leaq	(%rcx,%rax), %rdx
	leaq	-1696(%rbp), %rsi
	movl	-1776(%rbp), %eax
	movslq	%eax, %rdi
	movl	-1780(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	subq	%rcx, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1776(%rbp)
.L3:
	movl	-1780(%rbp), %eax
	cltq
	movl	-1760(%rbp,%rax,4), %eax
	cmpl	%eax, -1776(%rbp)
	jl	.L4
	addl	$1, -1780(%rbp)
.L2:
	movl	-1796(%rbp), %eax
	cmpl	%eax, -1780(%rbp)
	jl	.L5
	movl	$1, -1772(%rbp)
	jmp	.L6
.L15:
	movl	$1, -1792(%rbp)
	movl	$0, -1788(%rbp)
	movl	$0, -1768(%rbp)
	jmp	.L7
.L13:
	movl	-1768(%rbp), %eax
	movl	-1772(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L8
	addl	$1, -1788(%rbp)
	movl	$0, -1764(%rbp)
	jmp	.L9
.L11:
	movl	-1764(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1768(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-1696(%rbp,%rax,4), %eax
	subl	$1, %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	andl	-1772(%rbp), %eax
	movl	%eax, %esi
	movl	-1764(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1768(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-848(%rbp,%rax,4), %edi
	movl	-1764(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1768(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-1696(%rbp,%rax,4), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	sall	%cl, %edi
	movl	%edi, %eax
	cmpl	%eax, %esi
	je	.L10
	movl	$0, -1792(%rbp)
.L10:
	addl	$1, -1764(%rbp)
.L9:
	movl	-1768(%rbp), %eax
	cltq
	movl	-1760(%rbp,%rax,4), %eax
	cmpl	%eax, -1764(%rbp)
	jge	.L8
	cmpl	$0, -1792(%rbp)
	jne	.L11
.L8:
	addl	$1, -1768(%rbp)
.L7:
	movl	-1796(%rbp), %eax
	cmpl	%eax, -1768(%rbp)
	jge	.L12
	cmpl	$0, -1792(%rbp)
	jne	.L13
.L12:
	cmpl	$0, -1792(%rbp)
	je	.L14
	movl	-1784(%rbp), %eax
	cmpl	-1788(%rbp), %eax
	jge	.L14
	movl	-1788(%rbp), %eax
	movl	%eax, -1784(%rbp)
.L14:
	addl	$1, -1772(%rbp)
.L6:
	movl	-1796(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -1772(%rbp)
	jl	.L15
	movl	-1784(%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	.L17
	call	__stack_chk_fail@PLT
.L17:
	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:
